From 50149c28ec1ddbd4d38a57f2ac6c34f9618e320e Mon Sep 17 00:00:00 2001 From: theo-s68 <194042188+theo-s68@users.noreply.github.com> Date: Wed, 16 Jul 2025 16:09:59 +0700 Subject: [PATCH] handle data streams --- .github/workflows/java.yml | 40 +- clients/common/pom.xml | 2 +- .../connector/client/common/ApiClient.java | 51 +- .../configuration/ClientConfiguration.java | 1 - .../adapter/ConnectionInterface.java | 3 + .../websocket/adapter/ConnectionWrapper.java | 26 +- .../adapter/PoolConnectionWrapper.java | 7 + .../common/websocket/dtos/StreamResponse.java | 22 + .../service/StreamBlockingQueue.java | 4 + .../service/StreamBlockingQueueWrapper.java | 10 +- .../CHANGELOG.md | 10 + .../docs/AccountConfigUpdate.md | 15 + .../docs/AccountConfigUpdateAc.md | 14 + .../docs/AccountUpdate.md | 16 + .../docs/AccountUpdateA.md | 15 + .../docs/AccountUpdateABInner.md | 16 + .../docs/AccountUpdateAPInner.md | 21 + .../docs/GridUpdate.md | 15 + .../docs/GridUpdateGu.md | 22 + .../docs/Listenkeyexpired.md | 14 + .../docs/MarginCall.md | 16 + .../docs/MarginCallPInner.md | 20 + .../docs/MarketDataApi.md | 2 +- .../docs/OrderTradeUpdate.md | 16 + .../docs/OrderTradeUpdateO.md | 46 + .../docs/StrategyUpdate.md | 15 + .../docs/StrategyUpdateSu.md | 18 + .../docs/UserDataStreamEventsResponse.md | 23 + .../example_websocket_api.md | 20 +- .../derivatives-trading-coin-futures/pom.xml | 4 +- .../rest/api/AccountApi.java | 2 +- .../DerivativesTradingCoinFuturesRestApi.java | 2 +- .../rest/api/MarketDataApi.java | 4 +- .../rest/api/PortfolioMarginEndpointsApi.java | 2 +- .../rest/api/TradeApi.java | 2 +- .../rest/api/UserDataStreamsApi.java | 2 +- ...vativesTradingCoinFuturesWebSocketApi.java | 2 +- .../websocket/stream/JSON.java | 151 +- ...vesTradingCoinFuturesWebSocketStreams.java | 38 +- .../stream/model/AccountConfigUpdate.java | 312 +++ .../stream/model/AccountConfigUpdateAc.java | 277 ++ .../websocket/stream/model/AccountUpdate.java | 356 +++ .../stream/model/AccountUpdateA.java | 373 +++ .../stream/model/AccountUpdateABInner.java | 375 +++ .../stream/model/AccountUpdateAPInner.java | 600 +++++ .../websocket/stream/model/GridUpdate.java | 311 +++ .../websocket/stream/model/GridUpdateGu.java | 628 +++++ .../stream/model/Listenkeyexpired.java | 277 ++ .../websocket/stream/model/MarginCall.java | 392 +++ .../stream/model/MarginCallPInner.java | 555 ++++ .../stream/model/OrderTradeUpdate.java | 357 +++ .../stream/model/OrderTradeUpdateO.java | 1703 ++++++++++++ .../stream/model/StrategyUpdate.java | 311 +++ .../stream/model/StrategyUpdateSu.java | 441 +++ .../model/UserDataStreamEventsResponse.java | 703 +++++ .../derivatives-trading-options/CHANGELOG.md | 10 + .../docs/AccountUpdate.md | 17 + .../docs/AccountUpdateBInner.md | 19 + .../docs/AccountUpdateGInner.md | 17 + .../docs/AccountUpdatePInner.md | 17 + ...sactionHistoryDownloadLinkByIdResponse1.md | 18 - ...sactionHistoryDownloadLinkByIdResponse2.md | 18 - .../docs/NewOrderResponse1.md | 22 - .../docs/NewOrderResponse2.md | 33 - .../docs/OrderTradeUpdate.md | 14 + .../docs/OrderTradeUpdateOInner.md | 29 + .../docs/OrderTradeUpdateOInnerFiInner.md | 18 + .../docs/RiskLevelChange.md | 16 + .../docs/UserDataStreamEventsResponse.md | 21 + clients/derivatives-trading-options/pom.xml | 4 +- .../rest/api/AccountApi.java | 2 +- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/MarketMakerBlockTradeApi.java | 2 +- .../rest/api/MarketMakerEndpointsApi.java | 2 +- .../rest/api/TradeApi.java | 2 +- .../rest/api/UserDataStreamsApi.java | 2 +- .../websocket/stream/JSON.java | 90 +- ...vativesTradingOptionsWebSocketStreams.java | 38 +- .../websocket/stream/model/AccountUpdate.java | 467 ++++ .../stream/model/AccountUpdateBInner.java | 502 ++++ .../stream/model/AccountUpdateGInner.java | 398 +++ .../stream/model/AccountUpdatePInner.java | 420 +++ .../stream/model/OrderTradeUpdate.java | 303 +++ .../stream/model/OrderTradeUpdateOInner.java | 962 +++++++ .../model/OrderTradeUpdateOInnerFiInner.java | 468 ++++ .../stream/model/RiskLevelChange.java | 367 +++ .../model/UserDataStreamEventsResponse.java | 420 +++ .../CHANGELOG.md | 10 + .../docs/Risklevelchange.md | 18 + .../docs/UserDataStreamEventsResponse.md | 18 + .../example_websocket_stream.md | 0 .../pom.xml | 4 +- .../rest/api/AccountApi.java | 2 +- .../rest/api/MarketDataApi.java | 2 +- ...ortfolioMarginProWebSocketStreamsUtil.java | 18 + .../websocket/stream/JSON.java | 460 ++++ ...ingPortfolioMarginProWebSocketStreams.java | 68 + .../stream/model/AbstractOpenApiSchema.java | 145 + .../stream/model/Risklevelchange.java | 457 ++++ .../model/UserDataStreamEventsResponse.java | 277 ++ .../CHANGELOG.md | 10 + .../docs/AccountConfigUpdate.md | 16 + .../docs/AccountConfigUpdateAc.md | 14 + .../docs/AccountUpdate.md | 17 + .../docs/AccountUpdateA.md | 15 + .../docs/AccountUpdateABInner.md | 16 + .../docs/AccountUpdateAPInner.md | 19 + .../docs/Balanceupdate.md | 17 + .../docs/ConditionalOrderTradeUpdate.md | 16 + .../docs/ConditionalOrderTradeUpdateSo.md | 33 + .../docs/Executionreport.md | 54 + .../docs/Liabilitychange.md | 19 + .../docs/Listenkeyexpired.md | 13 + .../docs/Openorderloss.md | 14 + .../docs/OpenorderlossOInner.md | 14 + .../docs/OrderTradeUpdate.md | 17 + .../docs/OrderTradeUpdateO.md | 41 + .../docs/Outboundaccountposition.md | 16 + .../docs/OutboundaccountpositionBInner.md | 15 + .../docs/Risklevelchange.md | 18 + .../docs/TradeApi.md | 4 +- .../docs/UserDataStreamEventsResponse.md | 60 + .../example_rest.md | 2 +- .../example_websocket_stream.md | 0 .../pom.xml | 4 +- .../rest/api/AccountApi.java | 2 +- ...ivativesTradingPortfolioMarginRestApi.java | 12 +- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/TradeApi.java | 14 +- .../rest/api/UserDataStreamsApi.java | 2 +- ...ngPortfolioMarginWebSocketStreamsUtil.java | 18 + .../websocket/stream/JSON.java | 633 +++++ ...radingPortfolioMarginWebSocketStreams.java | 67 + .../stream/model/AbstractOpenApiSchema.java | 145 + .../stream/model/AccountConfigUpdate.java | 357 +++ .../stream/model/AccountConfigUpdateAc.java | 277 ++ .../websocket/stream/model/AccountUpdate.java | 401 +++ .../stream/model/AccountUpdateA.java | 373 +++ .../stream/model/AccountUpdateABInner.java | 375 +++ .../stream/model/AccountUpdateAPInner.java | 510 ++++ .../websocket/stream/model/Balanceupdate.java | 395 +++ .../model/ConditionalOrderTradeUpdate.java | 360 +++ .../model/ConditionalOrderTradeUpdateSo.java | 1116 ++++++++ .../stream/model/Executionreport.java | 1983 ++++++++++++++ .../stream/model/Liabilitychange.java | 494 ++++ .../stream/model/Listenkeyexpired.java | 232 ++ .../websocket/stream/model/Openorderloss.java | 299 ++ .../stream/model/OpenorderlossOInner.java | 285 ++ .../stream/model/OrderTradeUpdate.java | 402 +++ .../stream/model/OrderTradeUpdateO.java | 1473 ++++++++++ .../stream/model/Outboundaccountposition.java | 377 +++ .../model/OutboundaccountpositionBInner.java | 339 +++ .../stream/model/Risklevelchange.java | 457 ++++ .../model/UserDataStreamEventsResponse.java | 1014 +++++++ .../CHANGELOG.md | 10 + .../docs/AccountConfigUpdate.md | 16 + .../docs/AccountConfigUpdateAc.md | 14 + .../docs/AccountConfigUpdateAi.md | 13 + .../docs/AccountUpdate.md | 15 + .../docs/AccountUpdateA.md | 15 + .../docs/AccountUpdateABInner.md | 16 + .../docs/AccountUpdateAPInner.md | 21 + .../docs/BatchOrdersInner.md | 66 +- .../docs/BatchOrdersPlaceMultipleOrders.md | 12 + .../BatchOrdersPlaceMultipleOrdersInner.md | 105 + .../docs/ConditionalOrderTriggerReject.md | 15 + .../docs/ConditionalOrderTriggerRejectOr.md | 15 + .../docs/GridUpdate.md | 15 + .../docs/GridUpdateGu.md | 22 + .../docs/Listenkeyexpired.md | 14 + .../docs/MarginCall.md | 15 + .../docs/MarginCallPInner.md | 20 + .../OpenInterestStatisticsResponseInner.md | 1 + .../docs/OrderTradeUpdate.md | 15 + .../docs/OrderTradeUpdateO.md | 48 + .../docs/PlaceMultipleOrdersRequest.md | 2 +- .../docs/StrategyUpdate.md | 15 + .../docs/StrategyUpdateSu.md | 18 + .../docs/TradeLite.md | 24 + .../docs/UserDataStreamEventsResponse.md | 33 + .../example_rest.md | 2 +- .../example_websocket_api.md | 32 +- .../derivatives-trading-usds-futures/pom.xml | 4 +- .../rest/JSON.java | 6 + .../rest/api/AccountApi.java | 2 +- .../rest/api/ConvertApi.java | 6 +- .../DerivativesTradingUsdsFuturesRestApi.java | 2 +- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/PortfolioMarginEndpointsApi.java | 2 +- .../rest/api/TradeApi.java | 2 +- .../rest/api/UserDataStreamsApi.java | 2 +- .../rest/model/BatchOrdersInner.java | 883 +----- .../model/BatchOrdersPlaceMultipleOrders.java | 187 ++ .../BatchOrdersPlaceMultipleOrdersInner.java | 1321 +++++++++ .../OpenInterestStatisticsResponseInner.java | 51 +- .../model/PlaceMultipleOrdersRequest.java | 9 +- ...vativesTradingUsdsFuturesWebSocketApi.java | 2 +- .../websocket/stream/JSON.java | 185 +- ...vesTradingUsdsFuturesWebSocketStreams.java | 38 +- .../stream/model/AccountConfigUpdate.java | 354 +++ .../stream/model/AccountConfigUpdateAc.java | 277 ++ .../stream/model/AccountConfigUpdateAi.java | 232 ++ .../websocket/stream/model/AccountUpdate.java | 311 +++ .../stream/model/AccountUpdateA.java | 373 +++ .../stream/model/AccountUpdateABInner.java | 375 +++ .../stream/model/AccountUpdateAPInner.java | 600 +++++ .../model/ConditionalOrderTriggerReject.java | 319 +++ .../ConditionalOrderTriggerRejectOr.java | 331 +++ .../websocket/stream/model/GridUpdate.java | 311 +++ .../websocket/stream/model/GridUpdateGu.java | 628 +++++ .../stream/model/Listenkeyexpired.java | 285 ++ .../websocket/stream/model/MarginCall.java | 347 +++ .../stream/model/MarginCallPInner.java | 555 ++++ .../stream/model/OrderTradeUpdate.java | 312 +++ .../stream/model/OrderTradeUpdateO.java | 1771 ++++++++++++ .../stream/model/StrategyUpdate.java | 311 +++ .../stream/model/StrategyUpdateSu.java | 441 +++ .../websocket/stream/model/TradeLite.java | 706 +++++ .../model/UserDataStreamEventsResponse.java | 857 ++++++ .../rest/api/TradeApiTest.java | 3 +- clients/margin-trading/CHANGELOG.md | 10 + clients/margin-trading/docs/Balanceupdate.md | 16 + .../margin-trading/docs/Executionreport.md | 62 + .../margin-trading/docs/Listenkeyexpired.md | 14 + clients/margin-trading/docs/Liststatus.md | 22 + .../margin-trading/docs/ListstatusOInner.md | 15 + .../docs/MarginAccountNewOrderResponse1.md | 17 - ...arginAccountNewOrderResponse3FillsInner.md | 17 - .../docs/MarginLevelStatusChange.md | 15 + .../docs/Outboundaccountposition.md | 15 + .../docs/OutboundaccountpositionBInner.md | 15 + ...QueryIsolatedMarginAccountInfoResponse1.md | 16 - ...edMarginAccountInfoResponse1AssetsInner.md | 24 - ...ccountInfoResponse1AssetsInnerBaseAsset.md | 22 - ...countInfoResponse1AssetsInnerQuoteAsset.md | 22 - ...QueryIsolatedMarginAccountInfoResponse2.md | 13 - .../docs/RiskDataStreamEventsResponse.md | 19 + .../docs/TradeDataStreamEventsResponse.md | 63 + .../docs/UserLiabilityChange.md | 17 + .../example_websocket_stream.md | 0 clients/margin-trading/pom.xml | 4 +- .../margin_trading/rest/api/AccountApi.java | 2 +- .../rest/api/BorrowRepayApi.java | 2 +- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/RiskDataStreamApi.java | 2 +- .../margin_trading/rest/api/TradeApi.java | 2 +- .../rest/api/TradeDataStreamApi.java | 2 +- .../margin_trading/rest/api/TransferApi.java | 2 +- .../margin_trading/websocket/stream/JSON.java | 566 ++++ .../MarginTradingWebSocketStreamsUtil.java | 18 + .../api/MarginTradingWebSocketStreams.java | 88 + .../stream/model/AbstractOpenApiSchema.java | 145 + .../websocket/stream/model/Balanceupdate.java | 358 +++ .../stream/model/Executionreport.java | 2399 +++++++++++++++++ .../stream/model/Listenkeyexpired.java | 285 ++ .../websocket/stream/model/Liststatus.java | 645 +++++ .../stream/model/ListstatusOInner.java | 322 +++ .../stream/model/MarginLevelStatusChange.java | 323 +++ .../stream/model/Outboundaccountposition.java | 340 +++ .../model/OutboundaccountpositionBInner.java | 339 +++ .../model/RiskDataStreamEventsResponse.java | 359 +++ .../model/TradeDataStreamEventsResponse.java | 569 ++++ .../stream/model/UserLiabilityChange.java | 412 +++ clients/spot/CHANGELOG.md | 10 + clients/spot/docs/BalanceUpdate.md | 16 + clients/spot/docs/EventStreamTerminated.md | 13 + clients/spot/docs/ExecutionReport.md | 62 + clients/spot/docs/ExternalLockUpdate.md | 16 + clients/spot/docs/ListStatus.md | 22 + clients/spot/docs/ListStatusOInner.md | 15 + clients/spot/docs/ListenKeyExpired.md | 14 + ...derCancelReplaceResponseCancelResponse.md} | 6 +- ...CancelReplaceResponseDataCancelResponse.md | 2 + ...ncelReplaceResponseDataNewOrderResponse.md | 5 + ...rCancelReplaceResponseNewOrderResponse.md} | 10 +- clients/spot/docs/OutboundAccountPosition.md | 15 + .../docs/OutboundAccountPositionBInner.md | 15 + clients/spot/docs/Ticker24hrResponse2Inner.md | 11 +- clients/spot/docs/TickerResponse2Inner.md | 3 + .../spot/docs/TickerTradingDayResponse1.md | 3 + .../docs/TickerTradingDayResponse2Inner.md | 3 + .../spot/docs/UserDataStreamEventsResponse.md | 63 + clients/spot/example_websocket_api.md | 98 +- clients/spot/pom.xml | 4 +- .../connector/client/spot/rest/JSON.java | 6 + .../client/spot/rest/api/AccountApi.java | 2 +- .../client/spot/rest/api/GeneralApi.java | 2 +- .../client/spot/rest/api/MarketApi.java | 2 +- .../client/spot/rest/api/TradeApi.java | 2 +- .../spot/rest/api/UserDataStreamApi.java | 2 +- .../model/OrderCancelReplaceResponse.java | 171 +- ...erCancelReplaceResponseCancelResponse.java | 858 ++++++ ...ncelReplaceResponseDataCancelResponse.java | 78 +- ...elReplaceResponseDataNewOrderResponse.java | 193 +- ...CancelReplaceResponseNewOrderResponse.java | 909 +++++++ .../spot/rest/model/Ticker24hrResponse1.java | 459 +++- .../rest/model/Ticker24hrResponse2Inner.java | 461 +++- .../spot/rest/model/TickerResponse1.java | 130 + .../spot/rest/model/TickerResponse2Inner.java | 131 + .../rest/model/TickerTradingDayResponse1.java | 132 + .../model/TickerTradingDayResponse2Inner.java | 134 + .../client/spot/websocket/api/JSON.java | 87 +- .../websocket/api/api/SpotWebSocketApi.java | 8 +- .../websocket/api/api/UserDataStreamApi.java | 20 +- .../websocket/api/model/BalanceUpdate.java | 358 +++ .../api/model/EventStreamTerminated.java | 232 ++ .../websocket/api/model/ExecutionReport.java | 2335 ++++++++++++++++ .../api/model/ExternalLockUpdate.java | 359 +++ .../spot/websocket/api/model/ListStatus.java | 645 +++++ .../websocket/api/model/ListStatusOInner.java | 322 +++ .../websocket/api/model/ListenKeyExpired.java | 277 ++ .../api/model/OutboundAccountPosition.java | 340 +++ .../model/OutboundAccountPositionBInner.java | 339 +++ .../model/UserDataStreamEventsResponse.java | 670 +++++ .../stream/api/SpotWebSocketStreams.java | 10 +- .../api/api/UserDataStreamApiTest.java | 21 +- .../derivatives-trading-coin-futures/pom.xml | 2 +- .../QueryIndexPriceConstituentsExample.java | 2 +- .../account/AccountInformationExample.java | 4 +- .../account/FuturesAccountBalanceExample.java | 4 +- .../api/trade/CancelOrderExample.java | 4 +- .../api/trade/ModifyOrderExample.java | 4 +- .../websocket/api/trade/NewOrderExample.java | 4 +- .../api/trade/PositionInformationExample.java | 4 +- .../api/trade/QueryOrderExample.java | 4 +- .../CloseUserDataStreamExample.java | 4 +- .../KeepaliveUserDataStreamExample.java | 4 +- .../StartUserDataStreamExample.java | 4 +- examples/derivatives-trading-options/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../rest/trade/CmAccountTradeListExample.java | 6 +- .../rest/trade/UmAccountTradeListExample.java | 8 +- .../derivatives-trading-usds-futures/pom.xml | 2 +- .../trade/PlaceMultipleOrdersExample.java | 4 +- .../account/AccountInformationExample.java | 4 +- .../AccountInformationV2ExampleAsync.java | 4 +- .../AccountInformationV2ExampleSync.java | 4 +- .../account/FuturesAccountBalanceExample.java | 4 +- .../FuturesAccountBalanceV2ExampleAsync.java | 4 +- .../FuturesAccountBalanceV2ExampleSync.java | 4 +- .../api/marketdata/OrderBookExample.java | 4 +- .../SymbolOrderBookTickerExample.java | 4 +- .../marketdata/SymbolPriceTickerExample.java | 4 +- .../api/trade/CancelOrderExample.java | 4 +- .../api/trade/ModifyOrderExample.java | 4 +- .../websocket/api/trade/NewOrderExample.java | 4 +- .../api/trade/PositionInformationExample.java | 4 +- .../PositionInformationV2ExampleAsync.java | 4 +- .../PositionInformationV2ExampleSync.java | 4 +- .../api/trade/QueryOrderExample.java | 4 +- .../CloseUserDataStreamExample.java | 4 +- .../KeepaliveUserDataStreamExample.java | 4 +- .../StartUserDataStreamExample.java | 4 +- examples/margin-trading/pom.xml | 2 +- examples/spot/pom.xml | 2 +- .../api/account/AccountCommissionExample.java | 4 +- .../AccountRateLimitsOrdersExample.java | 4 +- .../api/account/AccountStatusExample.java | 4 +- .../api/account/AllOrderListsExample.java | 4 +- .../api/account/AllOrdersExample.java | 4 +- .../api/account/MyAllocationsExample.java | 4 +- .../account/MyPreventedMatchesExample.java | 4 +- .../api/account/MyTradesExample.java | 4 +- .../account/OpenOrderListsStatusExample.java | 4 +- .../api/account/OpenOrdersStatusExample.java | 4 +- .../api/account/OrderAmendmentsExample.java | 4 +- .../api/account/OrderListStatusExample.java | 4 +- .../api/account/OrderStatusExample.java | 4 +- .../api/auth/SessionLogonExample.java | 4 +- .../api/auth/SessionLogoutExample.java | 4 +- .../api/auth/SessionStatusExample.java | 4 +- .../api/general/ExchangeInfoExample.java | 4 +- .../websocket/api/general/PingExample.java | 4 +- .../websocket/api/general/TimeExample.java | 4 +- .../websocket/api/market/AvgPriceExample.java | 4 +- .../websocket/api/market/DepthExample.java | 4 +- .../spot/websocket/api/market/HrExample.java | 4 +- .../websocket/api/market/KlinesExample.java | 4 +- .../api/market/TickerBookExample.java | 4 +- .../websocket/api/market/TickerExample.java | 4 +- .../api/market/TickerPriceExample.java | 4 +- .../api/market/TickerTradingDayExample.java | 4 +- .../api/market/TradesAggregateExample.java | 4 +- .../api/market/TradesHistoricalExample.java | 4 +- .../api/market/TradesRecentExample.java | 4 +- .../websocket/api/market/UiKlinesExample.java | 4 +- .../api/trade/OpenOrdersCancelAllExample.java | 4 +- .../trade/OrderAmendKeepPriorityExample.java | 4 +- .../api/trade/OrderCancelExample.java | 4 +- .../api/trade/OrderCancelReplaceExample.java | 4 +- .../api/trade/OrderListCancelExample.java | 4 +- .../api/trade/OrderListPlaceExample.java | 4 +- .../api/trade/OrderListPlaceOcoExample.java | 4 +- .../api/trade/OrderListPlaceOtoExample.java | 4 +- .../api/trade/OrderListPlaceOtocoExample.java | 4 +- .../api/trade/OrderPlaceExample.java | 4 +- .../websocket/api/trade/OrderTestExample.java | 4 +- .../api/trade/SorOrderPlaceExample.java | 4 +- .../api/trade/SorOrderTestExample.java | 4 +- .../UserDataStreamPingExample.java | 4 +- .../UserDataStreamStartExample.java | 4 +- .../UserDataStreamStopExample.java | 4 +- .../UserDataStreamSubscribeExample.java | 41 +- .../UserDataStreamUnsubscribeExample.java | 4 +- 405 files changed, 57337 insertions(+), 1516 deletions(-) create mode 100644 clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/StreamResponse.java create mode 100644 clients/derivatives-trading-coin-futures/docs/AccountConfigUpdate.md create mode 100644 clients/derivatives-trading-coin-futures/docs/AccountConfigUpdateAc.md create mode 100644 clients/derivatives-trading-coin-futures/docs/AccountUpdate.md create mode 100644 clients/derivatives-trading-coin-futures/docs/AccountUpdateA.md create mode 100644 clients/derivatives-trading-coin-futures/docs/AccountUpdateABInner.md create mode 100644 clients/derivatives-trading-coin-futures/docs/AccountUpdateAPInner.md create mode 100644 clients/derivatives-trading-coin-futures/docs/GridUpdate.md create mode 100644 clients/derivatives-trading-coin-futures/docs/GridUpdateGu.md create mode 100644 clients/derivatives-trading-coin-futures/docs/Listenkeyexpired.md create mode 100644 clients/derivatives-trading-coin-futures/docs/MarginCall.md create mode 100644 clients/derivatives-trading-coin-futures/docs/MarginCallPInner.md create mode 100644 clients/derivatives-trading-coin-futures/docs/OrderTradeUpdate.md create mode 100644 clients/derivatives-trading-coin-futures/docs/OrderTradeUpdateO.md create mode 100644 clients/derivatives-trading-coin-futures/docs/StrategyUpdate.md create mode 100644 clients/derivatives-trading-coin-futures/docs/StrategyUpdateSu.md create mode 100644 clients/derivatives-trading-coin-futures/docs/UserDataStreamEventsResponse.md create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountConfigUpdate.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountConfigUpdateAc.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdate.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateA.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateABInner.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateAPInner.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/GridUpdate.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/GridUpdateGu.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/Listenkeyexpired.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/MarginCall.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/MarginCallPInner.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdate.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdateO.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/StrategyUpdate.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/StrategyUpdateSu.java create mode 100644 clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/UserDataStreamEventsResponse.java create mode 100644 clients/derivatives-trading-options/docs/AccountUpdate.md create mode 100644 clients/derivatives-trading-options/docs/AccountUpdateBInner.md create mode 100644 clients/derivatives-trading-options/docs/AccountUpdateGInner.md create mode 100644 clients/derivatives-trading-options/docs/AccountUpdatePInner.md delete mode 100644 clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse1.md delete mode 100644 clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse2.md delete mode 100644 clients/derivatives-trading-options/docs/NewOrderResponse1.md delete mode 100644 clients/derivatives-trading-options/docs/NewOrderResponse2.md create mode 100644 clients/derivatives-trading-options/docs/OrderTradeUpdate.md create mode 100644 clients/derivatives-trading-options/docs/OrderTradeUpdateOInner.md create mode 100644 clients/derivatives-trading-options/docs/OrderTradeUpdateOInnerFiInner.md create mode 100644 clients/derivatives-trading-options/docs/RiskLevelChange.md create mode 100644 clients/derivatives-trading-options/docs/UserDataStreamEventsResponse.md create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdate.java create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateBInner.java create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateGInner.java create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdatePInner.java create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdate.java create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInner.java create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInnerFiInner.java create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/RiskLevelChange.java create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/UserDataStreamEventsResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/docs/Risklevelchange.md create mode 100644 clients/derivatives-trading-portfolio-margin-pro/docs/UserDataStreamEventsResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin-pro/example_websocket_stream.md create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/DerivativesTradingPortfolioMarginProWebSocketStreamsUtil.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/JSON.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/AbstractOpenApiSchema.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/Risklevelchange.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/UserDataStreamEventsResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin/docs/AccountConfigUpdate.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/AccountConfigUpdateAc.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/AccountUpdate.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/AccountUpdateA.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/AccountUpdateABInner.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/AccountUpdateAPInner.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/Balanceupdate.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/ConditionalOrderTradeUpdate.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/ConditionalOrderTradeUpdateSo.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/Executionreport.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/Liabilitychange.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/Listenkeyexpired.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/Openorderloss.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/OpenorderlossOInner.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/OrderTradeUpdate.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/OrderTradeUpdateO.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/Outboundaccountposition.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/OutboundaccountpositionBInner.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/Risklevelchange.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin/example_websocket_stream.md create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/DerivativesTradingPortfolioMarginWebSocketStreamsUtil.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/JSON.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AbstractOpenApiSchema.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountConfigUpdate.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountConfigUpdateAc.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdate.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateA.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateABInner.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateAPInner.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Balanceupdate.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/ConditionalOrderTradeUpdate.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/ConditionalOrderTradeUpdateSo.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Liabilitychange.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Listenkeyexpired.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Openorderloss.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OpenorderlossOInner.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OrderTradeUpdate.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OrderTradeUpdateO.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Outboundaccountposition.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OutboundaccountpositionBInner.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Risklevelchange.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/UserDataStreamEventsResponse.java create mode 100644 clients/derivatives-trading-usds-futures/docs/AccountConfigUpdate.md create mode 100644 clients/derivatives-trading-usds-futures/docs/AccountConfigUpdateAc.md create mode 100644 clients/derivatives-trading-usds-futures/docs/AccountConfigUpdateAi.md create mode 100644 clients/derivatives-trading-usds-futures/docs/AccountUpdate.md create mode 100644 clients/derivatives-trading-usds-futures/docs/AccountUpdateA.md create mode 100644 clients/derivatives-trading-usds-futures/docs/AccountUpdateABInner.md create mode 100644 clients/derivatives-trading-usds-futures/docs/AccountUpdateAPInner.md create mode 100644 clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrders.md create mode 100644 clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md create mode 100644 clients/derivatives-trading-usds-futures/docs/ConditionalOrderTriggerReject.md create mode 100644 clients/derivatives-trading-usds-futures/docs/ConditionalOrderTriggerRejectOr.md create mode 100644 clients/derivatives-trading-usds-futures/docs/GridUpdate.md create mode 100644 clients/derivatives-trading-usds-futures/docs/GridUpdateGu.md create mode 100644 clients/derivatives-trading-usds-futures/docs/Listenkeyexpired.md create mode 100644 clients/derivatives-trading-usds-futures/docs/MarginCall.md create mode 100644 clients/derivatives-trading-usds-futures/docs/MarginCallPInner.md create mode 100644 clients/derivatives-trading-usds-futures/docs/OrderTradeUpdate.md create mode 100644 clients/derivatives-trading-usds-futures/docs/OrderTradeUpdateO.md create mode 100644 clients/derivatives-trading-usds-futures/docs/StrategyUpdate.md create mode 100644 clients/derivatives-trading-usds-futures/docs/StrategyUpdateSu.md create mode 100644 clients/derivatives-trading-usds-futures/docs/TradeLite.md create mode 100644 clients/derivatives-trading-usds-futures/docs/UserDataStreamEventsResponse.md create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrders.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdate.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdateAc.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdateAi.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdate.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateA.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateABInner.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateAPInner.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/ConditionalOrderTriggerReject.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/ConditionalOrderTriggerRejectOr.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/GridUpdate.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/GridUpdateGu.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/Listenkeyexpired.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/MarginCall.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/MarginCallPInner.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdate.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdateO.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/StrategyUpdate.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/StrategyUpdateSu.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradeLite.java create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/UserDataStreamEventsResponse.java create mode 100644 clients/margin-trading/docs/Balanceupdate.md create mode 100644 clients/margin-trading/docs/Executionreport.md create mode 100644 clients/margin-trading/docs/Listenkeyexpired.md create mode 100644 clients/margin-trading/docs/Liststatus.md create mode 100644 clients/margin-trading/docs/ListstatusOInner.md delete mode 100644 clients/margin-trading/docs/MarginAccountNewOrderResponse1.md delete mode 100644 clients/margin-trading/docs/MarginAccountNewOrderResponse3FillsInner.md create mode 100644 clients/margin-trading/docs/MarginLevelStatusChange.md create mode 100644 clients/margin-trading/docs/Outboundaccountposition.md create mode 100644 clients/margin-trading/docs/OutboundaccountpositionBInner.md delete mode 100644 clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1.md delete mode 100644 clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInner.md delete mode 100644 clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInnerBaseAsset.md delete mode 100644 clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInnerQuoteAsset.md delete mode 100644 clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse2.md create mode 100644 clients/margin-trading/docs/RiskDataStreamEventsResponse.md create mode 100644 clients/margin-trading/docs/TradeDataStreamEventsResponse.md create mode 100644 clients/margin-trading/docs/UserLiabilityChange.md create mode 100644 clients/margin-trading/example_websocket_stream.md create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/JSON.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/MarginTradingWebSocketStreamsUtil.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/AbstractOpenApiSchema.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Balanceupdate.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Executionreport.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Listenkeyexpired.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Liststatus.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/ListstatusOInner.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/MarginLevelStatusChange.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Outboundaccountposition.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/OutboundaccountpositionBInner.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/RiskDataStreamEventsResponse.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/TradeDataStreamEventsResponse.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/UserLiabilityChange.java create mode 100644 clients/spot/docs/BalanceUpdate.md create mode 100644 clients/spot/docs/EventStreamTerminated.md create mode 100644 clients/spot/docs/ExecutionReport.md create mode 100644 clients/spot/docs/ExternalLockUpdate.md create mode 100644 clients/spot/docs/ListStatus.md create mode 100644 clients/spot/docs/ListStatusOInner.md create mode 100644 clients/spot/docs/ListenKeyExpired.md rename clients/{margin-trading/docs/MarginAccountNewOrderResponse2.md => spot/docs/OrderCancelReplaceResponseCancelResponse.md} (78%) rename clients/{margin-trading/docs/MarginAccountNewOrderResponse3.md => spot/docs/OrderCancelReplaceResponseNewOrderResponse.md} (68%) create mode 100644 clients/spot/docs/OutboundAccountPosition.md create mode 100644 clients/spot/docs/OutboundAccountPositionBInner.md create mode 100644 clients/spot/docs/UserDataStreamEventsResponse.md create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseCancelResponse.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseNewOrderResponse.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BalanceUpdate.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/EventStreamTerminated.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExecutionReport.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExternalLockUpdate.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListStatus.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListStatusOInner.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListenKeyExpired.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OutboundAccountPosition.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OutboundAccountPositionBInner.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamEventsResponse.java diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index c28783f5..04e3706c 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -1,8 +1,10 @@ name: Java Main Workflow on: -# pull_request: -# branches: [ master, rc-** ] + push: + branches: [ master ] + pull_request: + branches: [ master, rc-* ] jobs: detect-targets: @@ -28,13 +30,13 @@ jobs: fi # Check each client dynamically - find clients/* -type d -maxdepth 0 | while read client; do + while read client; do CLIENT_NAME=$(basename "$client") if ! git diff --quiet "$BASE_COMMIT" HEAD -- "$client"; then echo "Changes detected in $CLIENT_NAME" MODIFIED_TARGETS+=("$CLIENT_NAME") fi - done + done < <(find clients/* -type d -maxdepth 0) # Convert to JSON array format MODIFIED_TARGETS_JSON=$(printf '%s\n' "${MODIFIED_TARGETS[@]}" | jq -R -s -c 'split("\n") | map(select(. != ""))') @@ -42,7 +44,7 @@ jobs: echo "Detected modified targets: $MODIFIED_TARGETS_JSON" echo "modified_targets=$MODIFIED_TARGETS_JSON" >> $GITHUB_ENV echo "::set-output name=modified_targets::$MODIFIED_TARGETS_JSON" - checkstyle: + verify: runs-on: ubuntu-latest needs: detect-targets if: ${{ needs.detect-targets.outputs.modified_targets != '[]' }} @@ -59,29 +61,5 @@ jobs: 'examples/pom.xml' - name: Validate modules run: | - mvn -f clients/pom.xml -N install - mvn -f clients/pom.xml -pl common install - mvn -f clients/pom.xml -pl `echo '${{ needs.detect-targets.outputs.modified_targets }}' | jq -r 'join(",")'` validate - build: - runs-on: ubuntu-latest - needs: detect-targets - if: ${{ needs.detect-targets.outputs.modified_targets != '[]' }} - strategy: - matrix: - target: ${{ fromJson(needs.detect-targets.outputs.modified_targets) }} - java-version: [ 11, 17 ] - steps: - - uses: actions/checkout@v3 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java-version }} - distribution: 'adopt' - cache: 'maven' - cache-dependency-path: | - 'clients/pom.xml' - 'examples/pom.xml' - - name: Build ${{ matrix.target }} module - run: | - mvn -f clients/pom.xml -N install - mvn -f clients/pom.xml -pl common,${{ matrix.target }} install -Dcheckstyle.skip=true \ No newline at end of file + mvn -f clients/pom.xml -pl common install -Dgpg.skip + mvn -f clients/pom.xml -pl `echo '${{ needs.detect-targets.outputs.modified_targets }}' | jq -r 'join(",")'` verify -Dgpg.skip \ No newline at end of file diff --git a/clients/common/pom.xml b/clients/common/pom.xml index 3f3cd9ae..f7f3bb55 100644 --- a/clients/common/pom.xml +++ b/clients/common/pom.xml @@ -10,6 +10,6 @@ binance-common common - 1.3.0 + 1.4.0 jar \ No newline at end of file diff --git a/clients/common/src/main/java/com/binance/connector/client/common/ApiClient.java b/clients/common/src/main/java/com/binance/connector/client/common/ApiClient.java index b92dbc7e..bb04290b 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/ApiClient.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/ApiClient.java @@ -134,7 +134,8 @@ public class ApiClient { private Gson json; - private Set forbiddenHeaders = new HashSet<>(Arrays.asList("host", "authorization", "cookie", ":method", ":path")); + private Set forbiddenHeaders = + new HashSet<>(Arrays.asList("host", "authorization", "cookie", ":method", ":path")); public ApiClient(ClientConfiguration configuration) { this(configuration, new BinanceAuthenticationFactory(), null); @@ -188,8 +189,10 @@ public ApiClient( } } - if (configuration.getCustomHeaders() != null && !configuration.getCustomHeaders().isEmpty()) { - Interceptor customHeadersInterceptor = getCustomHeadersInterceptor(configuration.getCustomHeaders()); + if (configuration.getCustomHeaders() != null + && !configuration.getCustomHeaders().isEmpty()) { + Interceptor customHeadersInterceptor = + getCustomHeadersInterceptor(configuration.getCustomHeaders()); builder.addInterceptor(customHeadersInterceptor); } @@ -217,13 +220,15 @@ public ApiClient( if (authentication != null) { authentications.put(BINANCE_SIGNATURE, authentication); } + } - Authentication binanceApiKeyOnly = - (queryParams, headerParams, cookieParams, payload, method, uri) -> { + Authentication binanceApiKeyOnly = + (queryParams, headerParams, cookieParams, payload, method, uri) -> { + if (signatureConfiguration != null && signatureConfiguration.getApiKey() != null) { headerParams.put(HEADER_API_KEY, signatureConfiguration.getApiKey()); - }; - authentications.put(BINANCE_API_KEY_ONLY, binanceApiKeyOnly); - } + } + }; + authentications.put(BINANCE_API_KEY_ONLY, binanceApiKeyOnly); } private void init() { @@ -250,13 +255,15 @@ public void setJson(Gson json) { public Interceptor getCustomHeadersInterceptor(Map customHeaders) { return chain -> { - Request request = chain.request(); Request.Builder newBuilder = request.newBuilder(); for (String headerName : customHeaders.keySet()) { String headerValue = customHeaders.get(headerName); if (!validateHeader(headerName, headerValue)) { - throw new ApiException("Invalid header " + headerName + ", it is forbidden or invalid (contains CR/LF)"); + throw new ApiException( + "Invalid header " + + headerName + + ", it is forbidden or invalid (contains CR/LF)"); } newBuilder.addHeader(headerName, headerValue); @@ -1413,9 +1420,22 @@ public Request buildRequest( List updatedQueryParams = new ArrayList<>(queryParams); + boolean hasAuth = + Arrays.stream(authNames) + .anyMatch( + s -> s.equals(BINANCE_SIGNATURE) || s.equals(BINANCE_API_KEY_ONLY)); + + // add api key to every request + String[] finalAuthNames; + if (!hasAuth) { + finalAuthNames = append(authNames, BINANCE_API_KEY_ONLY); + } else { + finalAuthNames = authNames; + } + // update parameters with authentication settings updateParamsForAuth( - authNames, + finalAuthNames, updatedQueryParams, headerParams, cookieParams, @@ -1862,4 +1882,13 @@ private Boolean validateHeader(String name, String value) { return !value.contains("\n") && !value.contains("\t"); } + + private String[] append(String[] array, String value) { + if (array == null) { + return new String[] {value}; + } + String[] newArray = Arrays.copyOf(array, array.length + 1); + newArray[newArray.length - 1] = value; + return newArray; + } } diff --git a/clients/common/src/main/java/com/binance/connector/client/common/configuration/ClientConfiguration.java b/clients/common/src/main/java/com/binance/connector/client/common/configuration/ClientConfiguration.java index 8d3ca283..56a111b7 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/configuration/ClientConfiguration.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/configuration/ClientConfiguration.java @@ -3,7 +3,6 @@ import com.binance.connector.client.common.dtos.TimeUnit; import java.net.Proxy; import java.util.Map; - import okhttp3.Authenticator; import okhttp3.CertificatePinner; diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionInterface.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionInterface.java index a987cdfc..1fd08a00 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionInterface.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionInterface.java @@ -2,12 +2,15 @@ import com.binance.connector.client.common.websocket.dtos.ApiRequestWrapperDTO; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; +import java.util.concurrent.BlockingQueue; public interface ConnectionInterface { void connect(); void send(ApiRequestWrapperDTO request) throws InterruptedException; + BlockingQueue sendForStream(ApiRequestWrapperDTO request) throws InterruptedException; + void send(RequestWrapperDTO request) throws InterruptedException; void setUserAgent(String userAgent); diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionWrapper.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionWrapper.java index 911b2b1f..4c745656 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionWrapper.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionWrapper.java @@ -28,6 +28,7 @@ import java.nio.channels.ClosedChannelException; import java.text.DecimalFormat; import java.time.Duration; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; @@ -36,8 +37,10 @@ import java.util.Timer; import java.util.TimerTask; import java.util.UUID; +import java.util.concurrent.BlockingQueue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.logging.Level; @@ -87,6 +90,8 @@ public class ConnectionWrapper implements WebSocketListener, ConnectionInterface private boolean pendingReconnect = false; + private List> streamQueues = new ArrayList<>(); + public ConnectionWrapper(WebSocketClientConfiguration configuration, Gson gson) { this(configuration, null, gson); } @@ -349,6 +354,15 @@ public void send(ApiRequestWrapperDTO request) { innerSend(request); } + @Override + public BlockingQueue sendForStream(ApiRequestWrapperDTO request) + throws InterruptedException { + LinkedBlockingDeque streamQueue = new LinkedBlockingDeque<>(); + streamQueues.add(streamQueue); + send(request); + return streamQueue; + } + public void innerSend(RequestWrapperDTO requestWrapperDTO) { send(requestWrapperDTO); } @@ -431,12 +445,18 @@ public void onWebSocketText(String message) { JsonObject obj = root.getAsJsonObject(); JsonElement idElem = obj.get("id"); String id = idElem == null ? null : idElem.getAsString(); + RequestWrapperDTO requestWrapperDTO = null; + if (id != null) { + requestWrapperDTO = pendingRequest.get(id); + } - if (id == null) { + if (requestWrapperDTO == null) { + for (BlockingQueue streamQueue : streamQueues) { + JsonElement eventElem = obj.get("event"); + streamQueue.offer(eventElem != null ? eventElem.toString() : message); + } return; } - - RequestWrapperDTO requestWrapperDTO = pendingRequest.get(id); Type responseType = requestWrapperDTO.getResponseType(); Object responseResult = gson.fromJson(root, responseType); diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/PoolConnectionWrapper.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/PoolConnectionWrapper.java index e81cdc66..250e7ece 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/PoolConnectionWrapper.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/PoolConnectionWrapper.java @@ -9,6 +9,7 @@ import java.util.ListIterator; import java.util.Timer; import java.util.TimerTask; +import java.util.concurrent.BlockingQueue; public class PoolConnectionWrapper implements ConnectionInterface { private final LinkedList connectionList = new LinkedList<>(); @@ -86,6 +87,12 @@ public void send(RequestWrapperDTO request) throws InterruptedException { getConnection().send(request); } + @Override + public BlockingQueue sendForStream(ApiRequestWrapperDTO request) + throws InterruptedException { + return getConnection().sendForStream(request); + } + /** * @return the next connection from the pool, using round-robin */ diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/StreamResponse.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/StreamResponse.java new file mode 100644 index 00000000..0458d323 --- /dev/null +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/StreamResponse.java @@ -0,0 +1,22 @@ +package com.binance.connector.client.common.websocket.dtos; + +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import java.util.concurrent.CompletableFuture; + +public class StreamResponse { + private final CompletableFuture response; + private final StreamBlockingQueueWrapper stream; + + public StreamResponse(CompletableFuture response, StreamBlockingQueueWrapper stream) { + this.response = response; + this.stream = stream; + } + + public CompletableFuture getResponse() { + return response; + } + + public StreamBlockingQueueWrapper getStream() { + return stream; + } +} diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/StreamBlockingQueue.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/StreamBlockingQueue.java index 5783c8b6..99ac1851 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/StreamBlockingQueue.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/StreamBlockingQueue.java @@ -11,6 +11,10 @@ public class StreamBlockingQueue implements BlockingQueue { private final BlockingQueue innerQueue; private final String operationId; + public StreamBlockingQueue(BlockingQueue innerQueue) { + this(innerQueue, ""); + } + public StreamBlockingQueue(BlockingQueue innerQueue, String operationId) { this.innerQueue = innerQueue; this.operationId = operationId; diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/StreamBlockingQueueWrapper.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/StreamBlockingQueueWrapper.java index bf8e763d..80ba3584 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/StreamBlockingQueueWrapper.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/StreamBlockingQueueWrapper.java @@ -1,15 +1,23 @@ package com.binance.connector.client.common.websocket.service; import com.binance.connector.client.common.JSON; +import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; public class StreamBlockingQueueWrapper { private final StreamBlockingQueue innerQueue; private final TypeToken convertType; + private final Gson gson; public StreamBlockingQueueWrapper(StreamBlockingQueue innerQueue, TypeToken type) { + this(innerQueue, type, JSON.getGson()); + } + + public StreamBlockingQueueWrapper( + StreamBlockingQueue innerQueue, TypeToken type, Gson gson) { this.innerQueue = innerQueue; this.convertType = type; + this.gson = gson; } public StreamBlockingQueue getInnerQueue() { @@ -18,6 +26,6 @@ public StreamBlockingQueue getInnerQueue() { public T take() throws InterruptedException { String take = innerQueue.take(); - return JSON.getGson().fromJson(take, convertType); + return gson.fromJson(take, convertType); } } diff --git a/clients/derivatives-trading-coin-futures/CHANGELOG.md b/clients/derivatives-trading-coin-futures/CHANGELOG.md index a46d22b6..214b4218 100644 --- a/clients/derivatives-trading-coin-futures/CHANGELOG.md +++ b/clients/derivatives-trading-coin-futures/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 2.0.0 - 2025-07-16 + +### Added (1) + +- Support User Data Streams. + +### Changed (1) + +- Update `binance/common` module to version `1.4.0`. + ## 1.3.0 - 2025-07-08 - Update `binance/common` module to version `1.3.0`. diff --git a/clients/derivatives-trading-coin-futures/docs/AccountConfigUpdate.md b/clients/derivatives-trading-coin-futures/docs/AccountConfigUpdate.md new file mode 100644 index 00000000..5de8d459 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/AccountConfigUpdate.md @@ -0,0 +1,15 @@ + + +# AccountConfigUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**ac** | [**AccountConfigUpdateAc**](AccountConfigUpdateAc.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/AccountConfigUpdateAc.md b/clients/derivatives-trading-coin-futures/docs/AccountConfigUpdateAc.md new file mode 100644 index 00000000..c1ad4a50 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/AccountConfigUpdateAc.md @@ -0,0 +1,14 @@ + + +# AccountConfigUpdateAc + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**lLowerCase** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/AccountUpdate.md b/clients/derivatives-trading-coin-futures/docs/AccountUpdate.md new file mode 100644 index 00000000..53b53487 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/AccountUpdate.md @@ -0,0 +1,16 @@ + + +# AccountUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**iLowerCase** | **String** | | [optional] | +|**aLowerCase** | [**AccountUpdateA**](AccountUpdateA.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/AccountUpdateA.md b/clients/derivatives-trading-coin-futures/docs/AccountUpdateA.md new file mode 100644 index 00000000..b3859d2e --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/AccountUpdateA.md @@ -0,0 +1,15 @@ + + +# AccountUpdateA + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mLowerCase** | **String** | | [optional] | +|**B** | [**List<AccountUpdateABInner>**](AccountUpdateABInner.md) | | [optional] | +|**P** | [**List<AccountUpdateAPInner>**](AccountUpdateAPInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/AccountUpdateABInner.md b/clients/derivatives-trading-coin-futures/docs/AccountUpdateABInner.md new file mode 100644 index 00000000..3380c37b --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/AccountUpdateABInner.md @@ -0,0 +1,16 @@ + + +# AccountUpdateABInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aLowerCase** | **String** | | [optional] | +|**wb** | **String** | | [optional] | +|**cw** | **String** | | [optional] | +|**bc** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/AccountUpdateAPInner.md b/clients/derivatives-trading-coin-futures/docs/AccountUpdateAPInner.md new file mode 100644 index 00000000..2621e1c3 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/AccountUpdateAPInner.md @@ -0,0 +1,21 @@ + + +# AccountUpdateAPInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**pa** | **String** | | [optional] | +|**ep** | **String** | | [optional] | +|**bep** | **String** | | [optional] | +|**cr** | **String** | | [optional] | +|**up** | **String** | | [optional] | +|**mt** | **String** | | [optional] | +|**iw** | **String** | | [optional] | +|**ps** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/GridUpdate.md b/clients/derivatives-trading-coin-futures/docs/GridUpdate.md new file mode 100644 index 00000000..6ef473ae --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/GridUpdate.md @@ -0,0 +1,15 @@ + + +# GridUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**T** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | +|**gu** | [**GridUpdateGu**](GridUpdateGu.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/GridUpdateGu.md b/clients/derivatives-trading-coin-futures/docs/GridUpdateGu.md new file mode 100644 index 00000000..350ff7bb --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/GridUpdateGu.md @@ -0,0 +1,22 @@ + + +# GridUpdateGu + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**si** | **Long** | | [optional] | +|**st** | **String** | | [optional] | +|**ss** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**up** | **String** | | [optional] | +|**uq** | **String** | | [optional] | +|**uf** | **String** | | [optional] | +|**mp** | **String** | | [optional] | +|**ut** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/Listenkeyexpired.md b/clients/derivatives-trading-coin-futures/docs/Listenkeyexpired.md new file mode 100644 index 00000000..26089b05 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/Listenkeyexpired.md @@ -0,0 +1,14 @@ + + +# Listenkeyexpired + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**listenKey** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/MarginCall.md b/clients/derivatives-trading-coin-futures/docs/MarginCall.md new file mode 100644 index 00000000..3028d1cd --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/MarginCall.md @@ -0,0 +1,16 @@ + + +# MarginCall + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**iLowerCase** | **String** | | [optional] | +|**cw** | **String** | | [optional] | +|**pLowerCase** | [**List<MarginCallPInner>**](MarginCallPInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/MarginCallPInner.md b/clients/derivatives-trading-coin-futures/docs/MarginCallPInner.md new file mode 100644 index 00000000..0cdf73fb --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/MarginCallPInner.md @@ -0,0 +1,20 @@ + + +# MarginCallPInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**ps** | **String** | | [optional] | +|**pa** | **String** | | [optional] | +|**mt** | **String** | | [optional] | +|**iw** | **String** | | [optional] | +|**mp** | **String** | | [optional] | +|**up** | **String** | | [optional] | +|**mm** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/MarketDataApi.md b/clients/derivatives-trading-coin-futures/docs/MarketDataApi.md index 7004b46c..147776d1 100644 --- a/clients/derivatives-trading-coin-futures/docs/MarketDataApi.md +++ b/clients/derivatives-trading-coin-futures/docs/MarketDataApi.md @@ -1172,7 +1172,7 @@ No authorization required Query Index Price Constituents -Query index price constituents Weight: 2 +Query index price constituents Weight: 1 ### Example ```java diff --git a/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdate.md b/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdate.md new file mode 100644 index 00000000..f1101383 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdate.md @@ -0,0 +1,16 @@ + + +# OrderTradeUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**iLowerCase** | **String** | | [optional] | +|**oLowerCase** | [**OrderTradeUpdateO**](OrderTradeUpdateO.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdateO.md b/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdateO.md new file mode 100644 index 00000000..b1bb5820 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdateO.md @@ -0,0 +1,46 @@ + + +# 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] | +|**sp** | **String** | | [optional] | +|**xLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**zLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**ma** | **String** | | [optional] | +|**N** | **String** | | [optional] | +|**nLowerCase** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**rp** | **String** | | [optional] | +|**bLowerCase** | **String** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | +|**R** | **Boolean** | | [optional] | +|**wt** | **String** | | [optional] | +|**ot** | **String** | | [optional] | +|**ps** | **String** | | [optional] | +|**cp** | **Boolean** | | [optional] | +|**AP** | **String** | | [optional] | +|**cr** | **String** | | [optional] | +|**pP** | **Boolean** | | [optional] | +|**V** | **String** | | [optional] | +|**pm** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/StrategyUpdate.md b/clients/derivatives-trading-coin-futures/docs/StrategyUpdate.md new file mode 100644 index 00000000..cf642fdf --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/StrategyUpdate.md @@ -0,0 +1,15 @@ + + +# StrategyUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**T** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | +|**su** | [**StrategyUpdateSu**](StrategyUpdateSu.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/StrategyUpdateSu.md b/clients/derivatives-trading-coin-futures/docs/StrategyUpdateSu.md new file mode 100644 index 00000000..e9329247 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/StrategyUpdateSu.md @@ -0,0 +1,18 @@ + + +# StrategyUpdateSu + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**si** | **Long** | | [optional] | +|**st** | **String** | | [optional] | +|**ss** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**ut** | **Long** | | [optional] | +|**cLowerCase** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-coin-futures/docs/UserDataStreamEventsResponse.md new file mode 100644 index 00000000..ec113358 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/UserDataStreamEventsResponse.md @@ -0,0 +1,23 @@ + + +# UserDataStreamEventsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**ac** | [**AccountConfigUpdateAc**](AccountConfigUpdateAc.md) | | [optional] | +|**iLowerCase** | **String** | | [optional] | +|**aLowerCase** | [**AccountUpdateA**](AccountUpdateA.md) | | [optional] | +|**gu** | [**GridUpdateGu**](GridUpdateGu.md) | | [optional] | +|**cw** | **String** | | [optional] | +|**pLowerCase** | [**List<MarginCallPInner>**](MarginCallPInner.md) | | [optional] | +|**oLowerCase** | [**OrderTradeUpdateO**](OrderTradeUpdateO.md) | | [optional] | +|**su** | [**StrategyUpdateSu**](StrategyUpdateSu.md) | | [optional] | +|**listenKey** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-coin-futures/example_websocket_api.md b/clients/derivatives-trading-coin-futures/example_websocket_api.md index 38965e7d..738333e1 100644 --- a/clients/derivatives-trading-coin-futures/example_websocket_api.md +++ b/clients/derivatives-trading-coin-futures/example_websocket_api.md @@ -1,26 +1,26 @@ ## Account -[account.status](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) - accountInformation - [AccountInformationExample.java:47](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/AccountInformationExample.java#L47) +[account.status](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) - accountInformation - [AccountInformationExample.java:49](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/AccountInformationExample.java#L49) -[account.balance](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Futures-Account-Balance) - futuresAccountBalance - [FuturesAccountBalanceExample.java:46](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/FuturesAccountBalanceExample.java#L46) +[account.balance](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Futures-Account-Balance) - futuresAccountBalance - [FuturesAccountBalanceExample.java:48](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/FuturesAccountBalanceExample.java#L48) ## Trade -[order.cancel](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) - cancelOrder - [CancelOrderExample.java:47](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/CancelOrderExample.java#L47) +[order.cancel](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) - cancelOrder - [CancelOrderExample.java:49](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/CancelOrderExample.java#L49) -[order.modify](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) - modifyOrder - [ModifyOrderExample.java:58](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java#L58) +[order.modify](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) - modifyOrder - [ModifyOrderExample.java:60](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java#L60) -[order.place](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/New-Order) - newOrder - [NewOrderExample.java:78](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/NewOrderExample.java#L78) +[order.place](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/New-Order) - newOrder - [NewOrderExample.java:80](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/NewOrderExample.java#L80) -[account.position](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) - positionInformation - [PositionInformationExample.java:47](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/PositionInformationExample.java#L47) +[account.position](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) - positionInformation - [PositionInformationExample.java:49](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/PositionInformationExample.java#L49) -[order.status](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) - queryOrder - [QueryOrderExample.java:50](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/QueryOrderExample.java#L50) +[order.status](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) - queryOrder - [QueryOrderExample.java:52](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/QueryOrderExample.java#L52) ## UserDataStreams -[userDataStream.stop](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) - closeUserDataStream - [CloseUserDataStreamExample.java:46](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java#L46) +[userDataStream.stop](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) - closeUserDataStream - [CloseUserDataStreamExample.java:48](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java#L48) -[userDataStream.ping](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) - keepaliveUserDataStream - [KeepaliveUserDataStreamExample.java:47](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java#L47) +[userDataStream.ping](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) - keepaliveUserDataStream - [KeepaliveUserDataStreamExample.java:49](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java#L49) -[userDataStream.start](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) - startUserDataStream - [StartUserDataStreamExample.java:48](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java#L48) +[userDataStream.start](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) - startUserDataStream - [StartUserDataStreamExample.java:50](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java#L50) diff --git a/clients/derivatives-trading-coin-futures/pom.xml b/clients/derivatives-trading-coin-futures/pom.xml index af41e096..a60bbb96 100644 --- a/clients/derivatives-trading-coin-futures/pom.xml +++ b/clients/derivatives-trading-coin-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-coin-futures derivatives-trading-coin-futures - 1.3.0 + 2.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.3.0 + 1.4.0 \ No newline at end of file diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java index c88a1cae..684062a7 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java @@ -54,7 +54,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java index 0e21723a..1f6c52e6 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java @@ -988,7 +988,7 @@ public ApiResponse premiumIndexKlineData( } /** - * Query Index Price Constituents Query index price constituents Weight: 2 + * Query Index Price Constituents Query index price constituents Weight: 1 * * @param symbol (required) * @return ApiResponse<QueryIndexPriceConstituentsResponse> diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java index 9961e2f2..8abb4359 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java @@ -69,7 +69,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -3013,7 +3013,7 @@ private okhttp3.Call queryIndexPriceConstituentsValidateBeforeCall(String symbol } /** - * Query Index Price Constituents Query index price constituents Weight: 2 + * Query Index Price Constituents Query index price constituents Weight: 1 * * @param symbol (required) * @return ApiResponse<QueryIndexPriceConstituentsResponse> diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java index 7bcc8619..1c6ebbd2 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java index aee58587..32a16742 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java @@ -76,7 +76,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java index 94f80c7f..d1ea6434 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java index c2aa370c..2097e5e3 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java @@ -32,7 +32,7 @@ public class DerivativesTradingCoinFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/JSON.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/JSON.java index 94938984..eb844433 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/JSON.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/JSON.java @@ -26,6 +26,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -37,6 +38,7 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.HashMap; import java.util.Map; import okio.ByteString; @@ -58,7 +60,106 @@ public class JSON { @SuppressWarnings("unchecked") public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client.derivatives_trading_coin_futures + .websocket.stream.model.UserDataStreamEventsResponse.class, + new TypeSelector< + com.binance.connector.client + .derivatives_trading_coin_futures.websocket.stream + .model.UserDataStreamEventsResponse>() { + @Override + public Class< + ? extends + com.binance.connector.client + .derivatives_trading_coin_futures + .websocket.stream.model + .UserDataStreamEventsResponse> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "ACCOUNT_CONFIG_UPDATE", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.AccountConfigUpdate.class); + classByDiscriminatorValue.put( + "ACCOUNT_UPDATE", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.AccountUpdate.class); + classByDiscriminatorValue.put( + "GRID_UPDATE", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.GridUpdate.class); + classByDiscriminatorValue.put( + "MARGIN_CALL", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.MarginCall.class); + classByDiscriminatorValue.put( + "ORDER_TRADE_UPDATE", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.OrderTradeUpdate.class); + classByDiscriminatorValue.put( + "STRATEGY_UPDATE", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.StrategyUpdate.class); + classByDiscriminatorValue.put( + "listenKeyExpired", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.Listenkeyexpired.class); + classByDiscriminatorValue.put( + "accountConfigUpdate", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.AccountConfigUpdate.class); + classByDiscriminatorValue.put( + "accountUpdate", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.AccountUpdate.class); + classByDiscriminatorValue.put( + "gridUpdate", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.GridUpdate.class); + classByDiscriminatorValue.put( + "listenkeyexpired", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.Listenkeyexpired.class); + classByDiscriminatorValue.put( + "marginCall", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.MarginCall.class); + classByDiscriminatorValue.put( + "orderTradeUpdate", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.OrderTradeUpdate.class); + classByDiscriminatorValue.put( + "strategyUpdate", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.StrategyUpdate.class); + classByDiscriminatorValue.put( + "UserDataStreamEventsResponse", + com.binance.connector.client + .derivatives_trading_coin_futures.websocket + .stream.model.UserDataStreamEventsResponse + .class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "e")); + } + }); GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; } @@ -108,6 +209,24 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.AccountConfigUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.AccountConfigUpdateAc.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.AccountUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.AccountUpdateA.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.AccountUpdateABInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.AccountUpdateAPInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream .model.AggregateTradeStreamsRequest.CustomTypeAdapterFactory()); @@ -181,6 +300,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream .model.DiffBookDepthStreamsResponseBItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.GridUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.GridUpdateGu.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream .model.IndexKlineCandlestickStreamsRequest.CustomTypeAdapterFactory()); @@ -230,6 +355,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream .model.LiquidationOrderStreamsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.Listenkeyexpired.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.MarginCall.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.MarginCallPInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream .model.MarkPriceKlineCandlestickStreamsRequest.CustomTypeAdapterFactory()); @@ -256,6 +390,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream .model.MarkPriceStreamResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.OrderTradeUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.OrderTradeUpdateO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream .model.PartialBookDepthStreamsRequest.CustomTypeAdapterFactory()); @@ -268,6 +408,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream .model.PartialBookDepthStreamsResponseBItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.StrategyUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.StrategyUpdateSu.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream + .model.UserDataStreamEventsResponse.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java index 1612a751..16b0de70 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java @@ -6,6 +6,8 @@ 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_coin_futures.websocket.stream.JSON; import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model.AggregateTradeStreamsRequest; @@ -46,13 +48,21 @@ import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model.MarkPriceStreamResponse; import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model.PartialBookDepthStreamsRequest; import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model.PartialBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model.UserDataStreamEventsResponse; +import com.google.gson.reflect.TypeToken; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.UUID; public class DerivativesTradingCoinFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private final StreamConnectionInterface connection; + private WebsocketMarketStreamsApi websocketMarketStreamsApi; public DerivativesTradingCoinFuturesWebSocketStreams( @@ -68,6 +78,7 @@ public DerivativesTradingCoinFuturesWebSocketStreams(StreamConnectionInterface c if (!connection.isConnected()) { connection.connect(); } + this.connection = connection; this.websocketMarketStreamsApi = new WebsocketMarketStreamsApi(connection); } @@ -195,4 +206,29 @@ public StreamBlockingQueueWrapper partialBookDe PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { return websocketMarketStreamsApi.partialBookDepthStreams(partialBookDepthStreamsRequest); } + + /** + * Subscribes to the user data WebSocket stream using the provided listen key. + * + * @param listenKey - The listen key for the user data WebSocket stream. + * @return A WebSocket stream handler for the user data stream. + */ + public StreamBlockingQueueWrapper userData(String listenKey) { + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(listenKey)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + + TypeToken typeToken = new TypeToken<>() {}; + StreamBlockingQueue queue = queuesMap.get(listenKey); + return new StreamBlockingQueueWrapper<>(queue, typeToken, JSON.getGson()); + } + + public String getRequestID() { + return UUID.randomUUID().toString(); + } } diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountConfigUpdate.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountConfigUpdate.java new file mode 100644 index 00000000..06f0e387 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountConfigUpdate.java @@ -0,0 +1,312 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountConfigUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountConfigUpdate 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_AC = "ac"; + + @SerializedName(SERIALIZED_NAME_AC) + @jakarta.annotation.Nullable + private AccountConfigUpdateAc ac; + + public AccountConfigUpdate() {} + + public AccountConfigUpdate 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 AccountConfigUpdate 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 AccountConfigUpdate ac(@jakarta.annotation.Nullable AccountConfigUpdateAc ac) { + this.ac = ac; + return this; + } + + /** + * Get ac + * + * @return ac + */ + @jakarta.annotation.Nullable + @Valid + public AccountConfigUpdateAc getAc() { + return ac; + } + + public void setAc(@jakarta.annotation.Nullable AccountConfigUpdateAc ac) { + this.ac = ac; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountConfigUpdate accountConfigUpdate = (AccountConfigUpdate) o; + return Objects.equals(this.E, accountConfigUpdate.E) + && Objects.equals(this.T, accountConfigUpdate.T) + && Objects.equals(this.ac, accountConfigUpdate.ac); + } + + @Override + public int hashCode() { + return Objects.hash(E, T, ac); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountConfigUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" ac: ").append(toIndentedString(ac)).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); + } + AccountConfigUpdateAc acValue = getAc(); + if (acValue != null) { + String acValueAsString = JSON.getGson().toJson(acValue); + valMap.put("ac", acValueAsString); + } + + 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 acValue = getAc(); + if (acValue != null) { + valMap.put("ac", acValue); + } + + 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("ac"); + + // 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 AccountConfigUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountConfigUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountConfigUpdate is not found in" + + " the empty JSON string", + AccountConfigUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountConfigUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountConfigUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `ac` + if (jsonObj.get("ac") != null && !jsonObj.get("ac").isJsonNull()) { + AccountConfigUpdateAc.validateJsonElement(jsonObj.get("ac")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountConfigUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountConfigUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountConfigUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountConfigUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountConfigUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountConfigUpdate + * @throws IOException if the JSON string is invalid with respect to AccountConfigUpdate + */ + public static AccountConfigUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountConfigUpdate.class); + } + + /** + * Convert an instance of AccountConfigUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountConfigUpdateAc.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountConfigUpdateAc.java new file mode 100644 index 00000000..874689da --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountConfigUpdateAc.java @@ -0,0 +1,277 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountConfigUpdateAc */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountConfigUpdateAc 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_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private Long lLowerCase; + + public AccountConfigUpdateAc() {} + + public AccountConfigUpdateAc 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 AccountConfigUpdateAc lLowerCase(@jakarta.annotation.Nullable Long lLowerCase) { + this.lLowerCase = lLowerCase; + return this; + } + + /** + * Get lLowerCase + * + * @return lLowerCase + */ + @jakarta.annotation.Nullable + public Long getlLowerCase() { + return lLowerCase; + } + + public void setlLowerCase(@jakarta.annotation.Nullable Long lLowerCase) { + this.lLowerCase = lLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountConfigUpdateAc accountConfigUpdateAc = (AccountConfigUpdateAc) o; + return Objects.equals(this.sLowerCase, accountConfigUpdateAc.sLowerCase) + && Objects.equals(this.lLowerCase, accountConfigUpdateAc.lLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, lLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountConfigUpdateAc {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).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); + } + Long lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + + 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 lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + + 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("l"); + + // 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 AccountConfigUpdateAc + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountConfigUpdateAc.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountConfigUpdateAc is not found in" + + " the empty JSON string", + AccountConfigUpdateAc.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountConfigUpdateAc.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountConfigUpdateAc` 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountConfigUpdateAc.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountConfigUpdateAc' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdateAc.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountConfigUpdateAc value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountConfigUpdateAc read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountConfigUpdateAc given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountConfigUpdateAc + * @throws IOException if the JSON string is invalid with respect to AccountConfigUpdateAc + */ + public static AccountConfigUpdateAc fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountConfigUpdateAc.class); + } + + /** + * Convert an instance of AccountConfigUpdateAc to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdate.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdate.java new file mode 100644 index 00000000..4ca186ad --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdate.java @@ -0,0 +1,356 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdate 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private String iLowerCase; + + public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private AccountUpdateA aLowerCase; + + public AccountUpdate() {} + + public AccountUpdate 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 AccountUpdate 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 AccountUpdate iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + return this; + } + + /** + * Get iLowerCase + * + * @return iLowerCase + */ + @jakarta.annotation.Nullable + public String getiLowerCase() { + return iLowerCase; + } + + public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + } + + public AccountUpdate aLowerCase(@jakarta.annotation.Nullable AccountUpdateA aLowerCase) { + this.aLowerCase = aLowerCase; + return this; + } + + /** + * Get aLowerCase + * + * @return aLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public AccountUpdateA getaLowerCase() { + return aLowerCase; + } + + public void setaLowerCase(@jakarta.annotation.Nullable AccountUpdateA aLowerCase) { + this.aLowerCase = aLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdate accountUpdate = (AccountUpdate) o; + return Objects.equals(this.E, accountUpdate.E) + && Objects.equals(this.T, accountUpdate.T) + && Objects.equals(this.iLowerCase, accountUpdate.iLowerCase) + && Objects.equals(this.aLowerCase, accountUpdate.aLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, T, iLowerCase, aLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).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()); + 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 iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + AccountUpdateA 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 EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + 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("T"); + openapiFields.add("i"); + 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 AccountUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdate.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())); + } + } + + 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())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + // validate the optional field `a` + if (jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) { + AccountUpdateA.validateJsonElement(jsonObj.get("a")); + } + } + + 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 + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdate 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 + */ + public static AccountUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdate.class); + } + + /** + * Convert an instance of AccountUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateA.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateA.java new file mode 100644 index 00000000..4dc09f3c --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateA.java @@ -0,0 +1,373 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.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.*; + +/** AccountUpdateA */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdateA extends BaseDTO { + 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_B = "B"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private List<@Valid AccountUpdateABInner> B; + + public static final String SERIALIZED_NAME_P = "P"; + + @SerializedName(SERIALIZED_NAME_P) + @jakarta.annotation.Nullable + private List<@Valid AccountUpdateAPInner> P; + + public AccountUpdateA() {} + + public AccountUpdateA 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 AccountUpdateA B(@jakarta.annotation.Nullable List<@Valid AccountUpdateABInner> B) { + this.B = B; + return this; + } + + public AccountUpdateA addBItem(AccountUpdateABInner BItem) { + if (this.B == null) { + this.B = new ArrayList<>(); + } + this.B.add(BItem); + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid AccountUpdateABInner> getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable List<@Valid AccountUpdateABInner> B) { + this.B = B; + } + + public AccountUpdateA P(@jakarta.annotation.Nullable List<@Valid AccountUpdateAPInner> P) { + this.P = P; + return this; + } + + public AccountUpdateA addPItem(AccountUpdateAPInner PItem) { + if (this.P == null) { + this.P = new ArrayList<>(); + } + this.P.add(PItem); + return this; + } + + /** + * Get P + * + * @return P + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid AccountUpdateAPInner> getP() { + return P; + } + + public void setP(@jakarta.annotation.Nullable List<@Valid AccountUpdateAPInner> P) { + this.P = P; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdateA accountUpdateA = (AccountUpdateA) o; + return Objects.equals(this.mLowerCase, accountUpdateA.mLowerCase) + && Objects.equals(this.B, accountUpdateA.B) + && Objects.equals(this.P, accountUpdateA.P); + } + + @Override + public int hashCode() { + return Objects.hash(mLowerCase, B, P); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateA {\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).append("\n"); + sb.append(" P: ").append(toIndentedString(P)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + List<@Valid AccountUpdateABInner> BValue = getB(); + if (BValue != null) { + String BValueAsString = JSON.getGson().toJson(BValue); + valMap.put("B", BValueAsString); + } + List<@Valid AccountUpdateAPInner> PValue = getP(); + if (PValue != null) { + String PValueAsString = JSON.getGson().toJson(PValue); + valMap.put("P", PValueAsString); + } + + 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 mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); + } + Object PValue = getP(); + if (PValue != null) { + valMap.put("P", PValue); + } + + 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("m"); + openapiFields.add("B"); + 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 AccountUpdateA + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateA.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountUpdateA is not found in the" + + " empty JSON string", + AccountUpdateA.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountUpdateA.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateA` 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) { + // ensure the json data is an array + if (!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())); + } + + // validate the optional field `B` (array) + for (int i = 0; i < jsonArrayB.size(); i++) { + AccountUpdateABInner.validateJsonElement(jsonArrayB.get(i)); + } + ; + } + } + if (jsonObj.get("P") != null && !jsonObj.get("P").isJsonNull()) { + JsonArray jsonArrayP = jsonObj.getAsJsonArray("P"); + if (jsonArrayP != null) { + // ensure the json data is an array + if (!jsonObj.get("P").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `P` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("P").toString())); + } + + // validate the optional field `P` (array) + for (int i = 0; i < jsonArrayP.size(); i++) { + AccountUpdateAPInner.validateJsonElement(jsonArrayP.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountUpdateA.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdateA' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateA.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateA value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateA read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateA given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountUpdateA + * @throws IOException if the JSON string is invalid with respect to AccountUpdateA + */ + public static AccountUpdateA fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateA.class); + } + + /** + * Convert an instance of AccountUpdateA to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateABInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateABInner.java new file mode 100644 index 00000000..acd6a889 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateABInner.java @@ -0,0 +1,375 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountUpdateABInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdateABInner 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_WB = "wb"; + + @SerializedName(SERIALIZED_NAME_WB) + @jakarta.annotation.Nullable + private String wb; + + public static final String SERIALIZED_NAME_CW = "cw"; + + @SerializedName(SERIALIZED_NAME_CW) + @jakarta.annotation.Nullable + private String cw; + + public static final String SERIALIZED_NAME_BC = "bc"; + + @SerializedName(SERIALIZED_NAME_BC) + @jakarta.annotation.Nullable + private String bc; + + public AccountUpdateABInner() {} + + public AccountUpdateABInner 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 AccountUpdateABInner wb(@jakarta.annotation.Nullable String wb) { + this.wb = wb; + return this; + } + + /** + * Get wb + * + * @return wb + */ + @jakarta.annotation.Nullable + public String getWb() { + return wb; + } + + public void setWb(@jakarta.annotation.Nullable String wb) { + this.wb = wb; + } + + public AccountUpdateABInner cw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + return this; + } + + /** + * Get cw + * + * @return cw + */ + @jakarta.annotation.Nullable + public String getCw() { + return cw; + } + + public void setCw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + } + + public AccountUpdateABInner 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; + } + AccountUpdateABInner accountUpdateABInner = (AccountUpdateABInner) o; + return Objects.equals(this.aLowerCase, accountUpdateABInner.aLowerCase) + && Objects.equals(this.wb, accountUpdateABInner.wb) + && Objects.equals(this.cw, accountUpdateABInner.cw) + && Objects.equals(this.bc, accountUpdateABInner.bc); + } + + @Override + public int hashCode() { + return Objects.hash(aLowerCase, wb, cw, bc); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateABInner {\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" wb: ").append(toIndentedString(wb)).append("\n"); + sb.append(" cw: ").append(toIndentedString(cw)).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 wbValue = getWb(); + if (wbValue != null) { + String wbValueAsString = wbValue.toString(); + valMap.put("wb", wbValueAsString); + } + String cwValue = getCw(); + if (cwValue != null) { + String cwValueAsString = cwValue.toString(); + valMap.put("cw", cwValueAsString); + } + 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 wbValue = getWb(); + if (wbValue != null) { + valMap.put("wb", wbValue); + } + Object cwValue = getCw(); + if (cwValue != null) { + valMap.put("cw", cwValue); + } + 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("wb"); + openapiFields.add("cw"); + 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 AccountUpdateABInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateABInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountUpdateABInner is not found in" + + " the empty JSON string", + AccountUpdateABInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountUpdateABInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateABInner` 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("wb") != null && !jsonObj.get("wb").isJsonNull()) + && !jsonObj.get("wb").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `wb` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("wb").toString())); + } + if ((jsonObj.get("cw") != null && !jsonObj.get("cw").isJsonNull()) + && !jsonObj.get("cw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cw").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 (!AccountUpdateABInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdateABInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateABInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateABInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateABInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateABInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountUpdateABInner + * @throws IOException if the JSON string is invalid with respect to AccountUpdateABInner + */ + public static AccountUpdateABInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateABInner.class); + } + + /** + * Convert an instance of AccountUpdateABInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateAPInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateAPInner.java new file mode 100644 index 00000000..e99ebd1d --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/AccountUpdateAPInner.java @@ -0,0 +1,600 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountUpdateAPInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdateAPInner 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_PA = "pa"; + + @SerializedName(SERIALIZED_NAME_PA) + @jakarta.annotation.Nullable + private String pa; + + public static final String SERIALIZED_NAME_EP = "ep"; + + @SerializedName(SERIALIZED_NAME_EP) + @jakarta.annotation.Nullable + private String ep; + + public static final String SERIALIZED_NAME_BEP = "bep"; + + @SerializedName(SERIALIZED_NAME_BEP) + @jakarta.annotation.Nullable + private String bep; + + public static final String SERIALIZED_NAME_CR = "cr"; + + @SerializedName(SERIALIZED_NAME_CR) + @jakarta.annotation.Nullable + private String cr; + + public static final String SERIALIZED_NAME_UP = "up"; + + @SerializedName(SERIALIZED_NAME_UP) + @jakarta.annotation.Nullable + private String up; + + public static final String SERIALIZED_NAME_MT = "mt"; + + @SerializedName(SERIALIZED_NAME_MT) + @jakarta.annotation.Nullable + private String mt; + + public static final String SERIALIZED_NAME_IW = "iw"; + + @SerializedName(SERIALIZED_NAME_IW) + @jakarta.annotation.Nullable + private String iw; + + public static final String SERIALIZED_NAME_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public AccountUpdateAPInner() {} + + public AccountUpdateAPInner 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 AccountUpdateAPInner pa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + return this; + } + + /** + * Get pa + * + * @return pa + */ + @jakarta.annotation.Nullable + public String getPa() { + return pa; + } + + public void setPa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + } + + public AccountUpdateAPInner ep(@jakarta.annotation.Nullable String ep) { + this.ep = ep; + return this; + } + + /** + * Get ep + * + * @return ep + */ + @jakarta.annotation.Nullable + public String getEp() { + return ep; + } + + public void setEp(@jakarta.annotation.Nullable String ep) { + this.ep = ep; + } + + public AccountUpdateAPInner bep(@jakarta.annotation.Nullable String bep) { + this.bep = bep; + return this; + } + + /** + * Get bep + * + * @return bep + */ + @jakarta.annotation.Nullable + public String getBep() { + return bep; + } + + public void setBep(@jakarta.annotation.Nullable String bep) { + this.bep = bep; + } + + public AccountUpdateAPInner cr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + return this; + } + + /** + * Get cr + * + * @return cr + */ + @jakarta.annotation.Nullable + public String getCr() { + return cr; + } + + public void setCr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + } + + public AccountUpdateAPInner up(@jakarta.annotation.Nullable String up) { + this.up = up; + return this; + } + + /** + * Get up + * + * @return up + */ + @jakarta.annotation.Nullable + public String getUp() { + return up; + } + + public void setUp(@jakarta.annotation.Nullable String up) { + this.up = up; + } + + public AccountUpdateAPInner mt(@jakarta.annotation.Nullable String mt) { + this.mt = mt; + return this; + } + + /** + * Get mt + * + * @return mt + */ + @jakarta.annotation.Nullable + public String getMt() { + return mt; + } + + public void setMt(@jakarta.annotation.Nullable String mt) { + this.mt = mt; + } + + public AccountUpdateAPInner iw(@jakarta.annotation.Nullable String iw) { + this.iw = iw; + return this; + } + + /** + * Get iw + * + * @return iw + */ + @jakarta.annotation.Nullable + public String getIw() { + return iw; + } + + public void setIw(@jakarta.annotation.Nullable String iw) { + this.iw = iw; + } + + public AccountUpdateAPInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdateAPInner accountUpdateAPInner = (AccountUpdateAPInner) o; + return Objects.equals(this.sLowerCase, accountUpdateAPInner.sLowerCase) + && Objects.equals(this.pa, accountUpdateAPInner.pa) + && Objects.equals(this.ep, accountUpdateAPInner.ep) + && Objects.equals(this.bep, accountUpdateAPInner.bep) + && Objects.equals(this.cr, accountUpdateAPInner.cr) + && Objects.equals(this.up, accountUpdateAPInner.up) + && Objects.equals(this.mt, accountUpdateAPInner.mt) + && Objects.equals(this.iw, accountUpdateAPInner.iw) + && Objects.equals(this.ps, accountUpdateAPInner.ps); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, pa, ep, bep, cr, up, mt, iw, ps); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateAPInner {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" pa: ").append(toIndentedString(pa)).append("\n"); + sb.append(" ep: ").append(toIndentedString(ep)).append("\n"); + sb.append(" bep: ").append(toIndentedString(bep)).append("\n"); + sb.append(" cr: ").append(toIndentedString(cr)).append("\n"); + sb.append(" up: ").append(toIndentedString(up)).append("\n"); + sb.append(" mt: ").append(toIndentedString(mt)).append("\n"); + sb.append(" iw: ").append(toIndentedString(iw)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).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 paValue = getPa(); + if (paValue != null) { + String paValueAsString = paValue.toString(); + valMap.put("pa", paValueAsString); + } + String epValue = getEp(); + if (epValue != null) { + String epValueAsString = epValue.toString(); + valMap.put("ep", epValueAsString); + } + String bepValue = getBep(); + if (bepValue != null) { + String bepValueAsString = bepValue.toString(); + valMap.put("bep", bepValueAsString); + } + String crValue = getCr(); + if (crValue != null) { + String crValueAsString = crValue.toString(); + valMap.put("cr", crValueAsString); + } + String upValue = getUp(); + if (upValue != null) { + String upValueAsString = upValue.toString(); + valMap.put("up", upValueAsString); + } + String mtValue = getMt(); + if (mtValue != null) { + String mtValueAsString = mtValue.toString(); + valMap.put("mt", mtValueAsString); + } + String iwValue = getIw(); + if (iwValue != null) { + String iwValueAsString = iwValue.toString(); + valMap.put("iw", iwValueAsString); + } + String psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + + 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 paValue = getPa(); + if (paValue != null) { + valMap.put("pa", paValue); + } + Object epValue = getEp(); + if (epValue != null) { + valMap.put("ep", epValue); + } + Object bepValue = getBep(); + if (bepValue != null) { + valMap.put("bep", bepValue); + } + Object crValue = getCr(); + if (crValue != null) { + valMap.put("cr", crValue); + } + Object upValue = getUp(); + if (upValue != null) { + valMap.put("up", upValue); + } + Object mtValue = getMt(); + if (mtValue != null) { + valMap.put("mt", mtValue); + } + Object iwValue = getIw(); + if (iwValue != null) { + valMap.put("iw", iwValue); + } + Object psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + + 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("pa"); + openapiFields.add("ep"); + openapiFields.add("bep"); + openapiFields.add("cr"); + openapiFields.add("up"); + openapiFields.add("mt"); + openapiFields.add("iw"); + openapiFields.add("ps"); + + // 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 AccountUpdateAPInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateAPInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountUpdateAPInner is not found in" + + " the empty JSON string", + AccountUpdateAPInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountUpdateAPInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateAPInner` 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("pa") != null && !jsonObj.get("pa").isJsonNull()) + && !jsonObj.get("pa").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pa` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pa").toString())); + } + if ((jsonObj.get("ep") != null && !jsonObj.get("ep").isJsonNull()) + && !jsonObj.get("ep").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ep` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ep").toString())); + } + if ((jsonObj.get("bep") != null && !jsonObj.get("bep").isJsonNull()) + && !jsonObj.get("bep").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bep` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("bep").toString())); + } + if ((jsonObj.get("cr") != null && !jsonObj.get("cr").isJsonNull()) + && !jsonObj.get("cr").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cr` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cr").toString())); + } + if ((jsonObj.get("up") != null && !jsonObj.get("up").isJsonNull()) + && !jsonObj.get("up").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `up` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("up").toString())); + } + if ((jsonObj.get("mt") != null && !jsonObj.get("mt").isJsonNull()) + && !jsonObj.get("mt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mt` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("mt").toString())); + } + if ((jsonObj.get("iw") != null && !jsonObj.get("iw").isJsonNull()) + && !jsonObj.get("iw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `iw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("iw").toString())); + } + if ((jsonObj.get("ps") != null && !jsonObj.get("ps").isJsonNull()) + && !jsonObj.get("ps").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ps` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ps").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountUpdateAPInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdateAPInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateAPInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateAPInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateAPInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateAPInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountUpdateAPInner + * @throws IOException if the JSON string is invalid with respect to AccountUpdateAPInner + */ + public static AccountUpdateAPInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateAPInner.class); + } + + /** + * Convert an instance of AccountUpdateAPInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/GridUpdate.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/GridUpdate.java new file mode 100644 index 00000000..dce9f6ab --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/GridUpdate.java @@ -0,0 +1,311 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GridUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GridUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_GU = "gu"; + + @SerializedName(SERIALIZED_NAME_GU) + @jakarta.annotation.Nullable + private GridUpdateGu gu; + + public GridUpdate() {} + + public GridUpdate 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 GridUpdate 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 GridUpdate gu(@jakarta.annotation.Nullable GridUpdateGu gu) { + this.gu = gu; + return this; + } + + /** + * Get gu + * + * @return gu + */ + @jakarta.annotation.Nullable + @Valid + public GridUpdateGu getGu() { + return gu; + } + + public void setGu(@jakarta.annotation.Nullable GridUpdateGu gu) { + this.gu = gu; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GridUpdate gridUpdate = (GridUpdate) o; + return Objects.equals(this.T, gridUpdate.T) + && Objects.equals(this.E, gridUpdate.E) + && Objects.equals(this.gu, gridUpdate.gu); + } + + @Override + public int hashCode() { + return Objects.hash(T, E, gu); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GridUpdate {\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" gu: ").append(toIndentedString(gu)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + GridUpdateGu guValue = getGu(); + if (guValue != null) { + String guValueAsString = JSON.getGson().toJson(guValue); + valMap.put("gu", guValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object guValue = getGu(); + if (guValue != null) { + valMap.put("gu", guValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("T"); + openapiFields.add("E"); + openapiFields.add("gu"); + + // 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 GridUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GridUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GridUpdate is not found in the empty" + + " JSON string", + GridUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GridUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GridUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `gu` + if (jsonObj.get("gu") != null && !jsonObj.get("gu").isJsonNull()) { + GridUpdateGu.validateJsonElement(jsonObj.get("gu")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GridUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GridUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GridUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GridUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GridUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GridUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of GridUpdate + * @throws IOException if the JSON string is invalid with respect to GridUpdate + */ + public static GridUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GridUpdate.class); + } + + /** + * Convert an instance of GridUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/GridUpdateGu.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/GridUpdateGu.java new file mode 100644 index 00000000..0b1f390c --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/GridUpdateGu.java @@ -0,0 +1,628 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GridUpdateGu */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GridUpdateGu extends BaseDTO { + public static final String SERIALIZED_NAME_SI = "si"; + + @SerializedName(SERIALIZED_NAME_SI) + @jakarta.annotation.Nullable + private Long si; + + public static final String SERIALIZED_NAME_ST = "st"; + + @SerializedName(SERIALIZED_NAME_ST) + @jakarta.annotation.Nullable + private String st; + + public static final String SERIALIZED_NAME_SS = "ss"; + + @SerializedName(SERIALIZED_NAME_SS) + @jakarta.annotation.Nullable + private String ss; + + 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_R_LOWER_CASE = "r"; + + @SerializedName(SERIALIZED_NAME_R_LOWER_CASE) + @jakarta.annotation.Nullable + private String rLowerCase; + + public static final String SERIALIZED_NAME_UP = "up"; + + @SerializedName(SERIALIZED_NAME_UP) + @jakarta.annotation.Nullable + private String up; + + public static final String SERIALIZED_NAME_UQ = "uq"; + + @SerializedName(SERIALIZED_NAME_UQ) + @jakarta.annotation.Nullable + private String uq; + + public static final String SERIALIZED_NAME_UF = "uf"; + + @SerializedName(SERIALIZED_NAME_UF) + @jakarta.annotation.Nullable + private String uf; + + public static final String SERIALIZED_NAME_MP = "mp"; + + @SerializedName(SERIALIZED_NAME_MP) + @jakarta.annotation.Nullable + private String mp; + + public static final String SERIALIZED_NAME_UT = "ut"; + + @SerializedName(SERIALIZED_NAME_UT) + @jakarta.annotation.Nullable + private Long ut; + + public GridUpdateGu() {} + + public GridUpdateGu si(@jakarta.annotation.Nullable Long si) { + this.si = si; + return this; + } + + /** + * Get si + * + * @return si + */ + @jakarta.annotation.Nullable + public Long getSi() { + return si; + } + + public void setSi(@jakarta.annotation.Nullable Long si) { + this.si = si; + } + + public GridUpdateGu st(@jakarta.annotation.Nullable String st) { + this.st = st; + return this; + } + + /** + * Get st + * + * @return st + */ + @jakarta.annotation.Nullable + public String getSt() { + return st; + } + + public void setSt(@jakarta.annotation.Nullable String st) { + this.st = st; + } + + public GridUpdateGu ss(@jakarta.annotation.Nullable String ss) { + this.ss = ss; + return this; + } + + /** + * Get ss + * + * @return ss + */ + @jakarta.annotation.Nullable + public String getSs() { + return ss; + } + + public void setSs(@jakarta.annotation.Nullable String ss) { + this.ss = ss; + } + + public GridUpdateGu 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 GridUpdateGu 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 GridUpdateGu up(@jakarta.annotation.Nullable String up) { + this.up = up; + return this; + } + + /** + * Get up + * + * @return up + */ + @jakarta.annotation.Nullable + public String getUp() { + return up; + } + + public void setUp(@jakarta.annotation.Nullable String up) { + this.up = up; + } + + public GridUpdateGu uq(@jakarta.annotation.Nullable String uq) { + this.uq = uq; + return this; + } + + /** + * Get uq + * + * @return uq + */ + @jakarta.annotation.Nullable + public String getUq() { + return uq; + } + + public void setUq(@jakarta.annotation.Nullable String uq) { + this.uq = uq; + } + + public GridUpdateGu uf(@jakarta.annotation.Nullable String uf) { + this.uf = uf; + return this; + } + + /** + * Get uf + * + * @return uf + */ + @jakarta.annotation.Nullable + public String getUf() { + return uf; + } + + public void setUf(@jakarta.annotation.Nullable String uf) { + this.uf = uf; + } + + public GridUpdateGu 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 GridUpdateGu ut(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + return this; + } + + /** + * Get ut + * + * @return ut + */ + @jakarta.annotation.Nullable + public Long getUt() { + return ut; + } + + public void setUt(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GridUpdateGu gridUpdateGu = (GridUpdateGu) o; + return Objects.equals(this.si, gridUpdateGu.si) + && Objects.equals(this.st, gridUpdateGu.st) + && Objects.equals(this.ss, gridUpdateGu.ss) + && Objects.equals(this.sLowerCase, gridUpdateGu.sLowerCase) + && Objects.equals(this.rLowerCase, gridUpdateGu.rLowerCase) + && Objects.equals(this.up, gridUpdateGu.up) + && Objects.equals(this.uq, gridUpdateGu.uq) + && Objects.equals(this.uf, gridUpdateGu.uf) + && Objects.equals(this.mp, gridUpdateGu.mp) + && Objects.equals(this.ut, gridUpdateGu.ut); + } + + @Override + public int hashCode() { + return Objects.hash(si, st, ss, sLowerCase, rLowerCase, up, uq, uf, mp, ut); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GridUpdateGu {\n"); + sb.append(" si: ").append(toIndentedString(si)).append("\n"); + sb.append(" st: ").append(toIndentedString(st)).append("\n"); + sb.append(" ss: ").append(toIndentedString(ss)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).append("\n"); + sb.append(" up: ").append(toIndentedString(up)).append("\n"); + sb.append(" uq: ").append(toIndentedString(uq)).append("\n"); + sb.append(" uf: ").append(toIndentedString(uf)).append("\n"); + sb.append(" mp: ").append(toIndentedString(mp)).append("\n"); + sb.append(" ut: ").append(toIndentedString(ut)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long siValue = getSi(); + if (siValue != null) { + String siValueAsString = siValue.toString(); + valMap.put("si", siValueAsString); + } + String stValue = getSt(); + if (stValue != null) { + String stValueAsString = stValue.toString(); + valMap.put("st", stValueAsString); + } + String ssValue = getSs(); + if (ssValue != null) { + String ssValueAsString = ssValue.toString(); + valMap.put("ss", ssValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + String rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + String rLowerCaseValueAsString = rLowerCaseValue.toString(); + valMap.put("rLowerCase", rLowerCaseValueAsString); + } + String upValue = getUp(); + if (upValue != null) { + String upValueAsString = upValue.toString(); + valMap.put("up", upValueAsString); + } + String uqValue = getUq(); + if (uqValue != null) { + String uqValueAsString = uqValue.toString(); + valMap.put("uq", uqValueAsString); + } + String ufValue = getUf(); + if (ufValue != null) { + String ufValueAsString = ufValue.toString(); + valMap.put("uf", ufValueAsString); + } + String mpValue = getMp(); + if (mpValue != null) { + String mpValueAsString = mpValue.toString(); + valMap.put("mp", mpValueAsString); + } + Long utValue = getUt(); + if (utValue != null) { + String utValueAsString = utValue.toString(); + valMap.put("ut", utValueAsString); + } + + 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 siValue = getSi(); + if (siValue != null) { + valMap.put("si", siValue); + } + Object stValue = getSt(); + if (stValue != null) { + valMap.put("st", stValue); + } + Object ssValue = getSs(); + if (ssValue != null) { + valMap.put("ss", ssValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + valMap.put("rLowerCase", rLowerCaseValue); + } + Object upValue = getUp(); + if (upValue != null) { + valMap.put("up", upValue); + } + Object uqValue = getUq(); + if (uqValue != null) { + valMap.put("uq", uqValue); + } + Object ufValue = getUf(); + if (ufValue != null) { + valMap.put("uf", ufValue); + } + Object mpValue = getMp(); + if (mpValue != null) { + valMap.put("mp", mpValue); + } + Object utValue = getUt(); + if (utValue != null) { + valMap.put("ut", utValue); + } + + 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("si"); + openapiFields.add("st"); + openapiFields.add("ss"); + openapiFields.add("s"); + openapiFields.add("r"); + openapiFields.add("up"); + openapiFields.add("uq"); + openapiFields.add("uf"); + openapiFields.add("mp"); + openapiFields.add("ut"); + + // 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 GridUpdateGu + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GridUpdateGu.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GridUpdateGu is not found in the empty" + + " JSON string", + GridUpdateGu.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GridUpdateGu.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GridUpdateGu` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("st") != null && !jsonObj.get("st").isJsonNull()) + && !jsonObj.get("st").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `st` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("st").toString())); + } + if ((jsonObj.get("ss") != null && !jsonObj.get("ss").isJsonNull()) + && !jsonObj.get("ss").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ss` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ss").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("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("up") != null && !jsonObj.get("up").isJsonNull()) + && !jsonObj.get("up").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `up` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("up").toString())); + } + if ((jsonObj.get("uq") != null && !jsonObj.get("uq").isJsonNull()) + && !jsonObj.get("uq").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `uq` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("uq").toString())); + } + if ((jsonObj.get("uf") != null && !jsonObj.get("uf").isJsonNull()) + && !jsonObj.get("uf").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `uf` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("uf").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GridUpdateGu.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GridUpdateGu' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GridUpdateGu.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GridUpdateGu value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GridUpdateGu read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GridUpdateGu given an JSON string + * + * @param jsonString JSON string + * @return An instance of GridUpdateGu + * @throws IOException if the JSON string is invalid with respect to GridUpdateGu + */ + public static GridUpdateGu fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GridUpdateGu.class); + } + + /** + * Convert an instance of GridUpdateGu to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/Listenkeyexpired.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/Listenkeyexpired.java new file mode 100644 index 00000000..83ee292f --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/Listenkeyexpired.java @@ -0,0 +1,277 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** 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 Long 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 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 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()); + Long 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("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-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/MarginCall.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/MarginCall.java new file mode 100644 index 00000000..06773496 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/MarginCall.java @@ -0,0 +1,392 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.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.*; + +/** MarginCall */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MarginCall 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private String iLowerCase; + + public static final String SERIALIZED_NAME_CW = "cw"; + + @SerializedName(SERIALIZED_NAME_CW) + @jakarta.annotation.Nullable + private String cw; + + public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; + + @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) + @jakarta.annotation.Nullable + private List<@Valid MarginCallPInner> pLowerCase; + + public MarginCall() {} + + public MarginCall 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 MarginCall iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + return this; + } + + /** + * Get iLowerCase + * + * @return iLowerCase + */ + @jakarta.annotation.Nullable + public String getiLowerCase() { + return iLowerCase; + } + + public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + } + + public MarginCall cw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + return this; + } + + /** + * Get cw + * + * @return cw + */ + @jakarta.annotation.Nullable + public String getCw() { + return cw; + } + + public void setCw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + } + + public MarginCall pLowerCase( + @jakarta.annotation.Nullable List<@Valid MarginCallPInner> pLowerCase) { + this.pLowerCase = pLowerCase; + return this; + } + + public MarginCall addPLowerCaseItem(MarginCallPInner pLowerCaseItem) { + if (this.pLowerCase == null) { + this.pLowerCase = new ArrayList<>(); + } + this.pLowerCase.add(pLowerCaseItem); + return this; + } + + /** + * Get pLowerCase + * + * @return pLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid MarginCallPInner> getpLowerCase() { + return pLowerCase; + } + + public void setpLowerCase( + @jakarta.annotation.Nullable List<@Valid MarginCallPInner> pLowerCase) { + this.pLowerCase = pLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarginCall marginCall = (MarginCall) o; + return Objects.equals(this.E, marginCall.E) + && Objects.equals(this.iLowerCase, marginCall.iLowerCase) + && Objects.equals(this.cw, marginCall.cw) + && Objects.equals(this.pLowerCase, marginCall.pLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, iLowerCase, cw, pLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarginCall {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" cw: ").append(toIndentedString(cw)).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()); + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + String iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + String cwValue = getCw(); + if (cwValue != null) { + String cwValueAsString = cwValue.toString(); + valMap.put("cw", cwValueAsString); + } + List<@Valid MarginCallPInner> pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + String pLowerCaseValueAsString = JSON.getGson().toJson(pLowerCaseValue); + 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 EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object cwValue = getCw(); + if (cwValue != null) { + valMap.put("cw", cwValue); + } + 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("i"); + openapiFields.add("cw"); + 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 MarginCall + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MarginCall.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MarginCall is not found in the empty" + + " JSON string", + MarginCall.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MarginCall.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MarginCall` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("cw") != null && !jsonObj.get("cw").isJsonNull()) + && !jsonObj.get("cw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cw").toString())); + } + if (jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) { + JsonArray jsonArraypLowerCase = jsonObj.getAsJsonArray("p"); + if (jsonArraypLowerCase != null) { + // ensure the json data is an array + if (!jsonObj.get("p").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `p` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("p").toString())); + } + + // validate the optional field `p` (array) + for (int i = 0; i < jsonArraypLowerCase.size(); i++) { + MarginCallPInner.validateJsonElement(jsonArraypLowerCase.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MarginCall.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MarginCall' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MarginCall.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MarginCall value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MarginCall read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MarginCall given an JSON string + * + * @param jsonString JSON string + * @return An instance of MarginCall + * @throws IOException if the JSON string is invalid with respect to MarginCall + */ + public static MarginCall fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MarginCall.class); + } + + /** + * Convert an instance of MarginCall to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/MarginCallPInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/MarginCallPInner.java new file mode 100644 index 00000000..5411dc34 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/MarginCallPInner.java @@ -0,0 +1,555 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MarginCallPInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MarginCallPInner 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_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public static final String SERIALIZED_NAME_PA = "pa"; + + @SerializedName(SERIALIZED_NAME_PA) + @jakarta.annotation.Nullable + private String pa; + + public static final String SERIALIZED_NAME_MT = "mt"; + + @SerializedName(SERIALIZED_NAME_MT) + @jakarta.annotation.Nullable + private String mt; + + public static final String SERIALIZED_NAME_IW = "iw"; + + @SerializedName(SERIALIZED_NAME_IW) + @jakarta.annotation.Nullable + private String iw; + + public static final String SERIALIZED_NAME_MP = "mp"; + + @SerializedName(SERIALIZED_NAME_MP) + @jakarta.annotation.Nullable + private String mp; + + public static final String SERIALIZED_NAME_UP = "up"; + + @SerializedName(SERIALIZED_NAME_UP) + @jakarta.annotation.Nullable + private String up; + + public static final String SERIALIZED_NAME_MM = "mm"; + + @SerializedName(SERIALIZED_NAME_MM) + @jakarta.annotation.Nullable + private String mm; + + public MarginCallPInner() {} + + public MarginCallPInner 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 MarginCallPInner 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 MarginCallPInner pa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + return this; + } + + /** + * Get pa + * + * @return pa + */ + @jakarta.annotation.Nullable + public String getPa() { + return pa; + } + + public void setPa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + } + + public MarginCallPInner mt(@jakarta.annotation.Nullable String mt) { + this.mt = mt; + return this; + } + + /** + * Get mt + * + * @return mt + */ + @jakarta.annotation.Nullable + public String getMt() { + return mt; + } + + public void setMt(@jakarta.annotation.Nullable String mt) { + this.mt = mt; + } + + public MarginCallPInner iw(@jakarta.annotation.Nullable String iw) { + this.iw = iw; + return this; + } + + /** + * Get iw + * + * @return iw + */ + @jakarta.annotation.Nullable + public String getIw() { + return iw; + } + + public void setIw(@jakarta.annotation.Nullable String iw) { + this.iw = iw; + } + + public MarginCallPInner 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 MarginCallPInner up(@jakarta.annotation.Nullable String up) { + this.up = up; + return this; + } + + /** + * Get up + * + * @return up + */ + @jakarta.annotation.Nullable + public String getUp() { + return up; + } + + public void setUp(@jakarta.annotation.Nullable String up) { + this.up = up; + } + + public MarginCallPInner mm(@jakarta.annotation.Nullable String mm) { + this.mm = mm; + return this; + } + + /** + * Get mm + * + * @return mm + */ + @jakarta.annotation.Nullable + public String getMm() { + return mm; + } + + public void setMm(@jakarta.annotation.Nullable String mm) { + this.mm = mm; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarginCallPInner marginCallPInner = (MarginCallPInner) o; + return Objects.equals(this.sLowerCase, marginCallPInner.sLowerCase) + && Objects.equals(this.ps, marginCallPInner.ps) + && Objects.equals(this.pa, marginCallPInner.pa) + && Objects.equals(this.mt, marginCallPInner.mt) + && Objects.equals(this.iw, marginCallPInner.iw) + && Objects.equals(this.mp, marginCallPInner.mp) + && Objects.equals(this.up, marginCallPInner.up) + && Objects.equals(this.mm, marginCallPInner.mm); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, ps, pa, mt, iw, mp, up, mm); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarginCallPInner {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" pa: ").append(toIndentedString(pa)).append("\n"); + sb.append(" mt: ").append(toIndentedString(mt)).append("\n"); + sb.append(" iw: ").append(toIndentedString(iw)).append("\n"); + sb.append(" mp: ").append(toIndentedString(mp)).append("\n"); + sb.append(" up: ").append(toIndentedString(up)).append("\n"); + sb.append(" mm: ").append(toIndentedString(mm)).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 psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + String paValue = getPa(); + if (paValue != null) { + String paValueAsString = paValue.toString(); + valMap.put("pa", paValueAsString); + } + String mtValue = getMt(); + if (mtValue != null) { + String mtValueAsString = mtValue.toString(); + valMap.put("mt", mtValueAsString); + } + String iwValue = getIw(); + if (iwValue != null) { + String iwValueAsString = iwValue.toString(); + valMap.put("iw", iwValueAsString); + } + String mpValue = getMp(); + if (mpValue != null) { + String mpValueAsString = mpValue.toString(); + valMap.put("mp", mpValueAsString); + } + String upValue = getUp(); + if (upValue != null) { + String upValueAsString = upValue.toString(); + valMap.put("up", upValueAsString); + } + String mmValue = getMm(); + if (mmValue != null) { + String mmValueAsString = mmValue.toString(); + valMap.put("mm", mmValueAsString); + } + + 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 psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + Object paValue = getPa(); + if (paValue != null) { + valMap.put("pa", paValue); + } + Object mtValue = getMt(); + if (mtValue != null) { + valMap.put("mt", mtValue); + } + Object iwValue = getIw(); + if (iwValue != null) { + valMap.put("iw", iwValue); + } + Object mpValue = getMp(); + if (mpValue != null) { + valMap.put("mp", mpValue); + } + Object upValue = getUp(); + if (upValue != null) { + valMap.put("up", upValue); + } + Object mmValue = getMm(); + if (mmValue != null) { + valMap.put("mm", mmValue); + } + + 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("ps"); + openapiFields.add("pa"); + openapiFields.add("mt"); + openapiFields.add("iw"); + openapiFields.add("mp"); + openapiFields.add("up"); + openapiFields.add("mm"); + + // 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 MarginCallPInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MarginCallPInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MarginCallPInner is not found in the" + + " empty JSON string", + MarginCallPInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MarginCallPInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MarginCallPInner` 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("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("pa") != null && !jsonObj.get("pa").isJsonNull()) + && !jsonObj.get("pa").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pa` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pa").toString())); + } + if ((jsonObj.get("mt") != null && !jsonObj.get("mt").isJsonNull()) + && !jsonObj.get("mt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mt` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("mt").toString())); + } + if ((jsonObj.get("iw") != null && !jsonObj.get("iw").isJsonNull()) + && !jsonObj.get("iw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `iw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("iw").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("up") != null && !jsonObj.get("up").isJsonNull()) + && !jsonObj.get("up").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `up` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("up").toString())); + } + if ((jsonObj.get("mm") != null && !jsonObj.get("mm").isJsonNull()) + && !jsonObj.get("mm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mm` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("mm").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MarginCallPInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MarginCallPInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MarginCallPInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MarginCallPInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MarginCallPInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MarginCallPInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of MarginCallPInner + * @throws IOException if the JSON string is invalid with respect to MarginCallPInner + */ + public static MarginCallPInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MarginCallPInner.class); + } + + /** + * Convert an instance of MarginCallPInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdate.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdate.java new file mode 100644 index 00000000..675563de --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdate.java @@ -0,0 +1,357 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderTradeUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderTradeUpdate 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private String iLowerCase; + + public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; + + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @jakarta.annotation.Nullable + private OrderTradeUpdateO oLowerCase; + + public OrderTradeUpdate() {} + + public OrderTradeUpdate 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 OrderTradeUpdate 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 OrderTradeUpdate iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + return this; + } + + /** + * Get iLowerCase + * + * @return iLowerCase + */ + @jakarta.annotation.Nullable + public String getiLowerCase() { + return iLowerCase; + } + + public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + } + + public OrderTradeUpdate oLowerCase(@jakarta.annotation.Nullable OrderTradeUpdateO oLowerCase) { + this.oLowerCase = oLowerCase; + return this; + } + + /** + * Get oLowerCase + * + * @return oLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public OrderTradeUpdateO getoLowerCase() { + return oLowerCase; + } + + public void setoLowerCase(@jakarta.annotation.Nullable OrderTradeUpdateO oLowerCase) { + this.oLowerCase = oLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderTradeUpdate orderTradeUpdate = (OrderTradeUpdate) o; + return Objects.equals(this.E, orderTradeUpdate.E) + && Objects.equals(this.T, orderTradeUpdate.T) + && Objects.equals(this.iLowerCase, orderTradeUpdate.iLowerCase) + && Objects.equals(this.oLowerCase, orderTradeUpdate.oLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, T, iLowerCase, oLowerCase); + } + + @Override + 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(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long 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 iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + OrderTradeUpdateO oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + String oLowerCaseValueAsString = JSON.getGson().toJson(oLowerCaseValue); + valMap.put("oLowerCase", oLowerCaseValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + valMap.put("oLowerCase", oLowerCaseValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("E"); + openapiFields.add("T"); + openapiFields.add("i"); + openapiFields.add("o"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrderTradeUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderTradeUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderTradeUpdate is not found in the" + + " empty JSON string", + OrderTradeUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderTradeUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderTradeUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + // validate the optional field `o` + if (jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) { + OrderTradeUpdateO.validateJsonElement(jsonObj.get("o")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderTradeUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderTradeUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderTradeUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderTradeUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderTradeUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderTradeUpdate + * @throws IOException if the JSON string is invalid with respect to OrderTradeUpdate + */ + public static OrderTradeUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderTradeUpdate.class); + } + + /** + * Convert an instance of OrderTradeUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdateO.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdateO.java new file mode 100644 index 00000000..c809d02c --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdateO.java @@ -0,0 +1,1703 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** 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_SP = "sp"; + + @SerializedName(SERIALIZED_NAME_SP) + @jakarta.annotation.Nullable + private String sp; + + 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_MA = "ma"; + + @SerializedName(SERIALIZED_NAME_MA) + @jakarta.annotation.Nullable + private String ma; + + 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_RP = "rp"; + + @SerializedName(SERIALIZED_NAME_RP) + @jakarta.annotation.Nullable + private String rp; + + 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_WT = "wt"; + + @SerializedName(SERIALIZED_NAME_WT) + @jakarta.annotation.Nullable + private String wt; + + public static final String SERIALIZED_NAME_OT = "ot"; + + @SerializedName(SERIALIZED_NAME_OT) + @jakarta.annotation.Nullable + private String ot; + + public static final String SERIALIZED_NAME_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public static final String SERIALIZED_NAME_CP = "cp"; + + @SerializedName(SERIALIZED_NAME_CP) + @jakarta.annotation.Nullable + private Boolean cp; + + public static final String SERIALIZED_NAME_A_P = "AP"; + + @SerializedName(SERIALIZED_NAME_A_P) + @jakarta.annotation.Nullable + private String AP; + + public static final String SERIALIZED_NAME_CR = "cr"; + + @SerializedName(SERIALIZED_NAME_CR) + @jakarta.annotation.Nullable + private String cr; + + public static final String SERIALIZED_NAME_P_P = "pP"; + + @SerializedName(SERIALIZED_NAME_P_P) + @jakarta.annotation.Nullable + private Boolean pP; + + public static final String SERIALIZED_NAME_V = "V"; + + @SerializedName(SERIALIZED_NAME_V) + @jakarta.annotation.Nullable + private String V; + + public static final String SERIALIZED_NAME_PM = "pm"; + + @SerializedName(SERIALIZED_NAME_PM) + @jakarta.annotation.Nullable + private String pm; + + 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 sp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; + return this; + } + + /** + * Get sp + * + * @return sp + */ + @jakarta.annotation.Nullable + public String getSp() { + return sp; + } + + public void setSp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; + } + + 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 ma(@jakarta.annotation.Nullable String ma) { + this.ma = ma; + return this; + } + + /** + * Get ma + * + * @return ma + */ + @jakarta.annotation.Nullable + public String getMa() { + return ma; + } + + public void setMa(@jakarta.annotation.Nullable String ma) { + this.ma = ma; + } + + 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 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; + } + + 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 wt(@jakarta.annotation.Nullable String wt) { + this.wt = wt; + return this; + } + + /** + * Get wt + * + * @return wt + */ + @jakarta.annotation.Nullable + public String getWt() { + return wt; + } + + public void setWt(@jakarta.annotation.Nullable String wt) { + this.wt = wt; + } + + public 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 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 OrderTradeUpdateO cp(@jakarta.annotation.Nullable Boolean cp) { + this.cp = cp; + return this; + } + + /** + * Get cp + * + * @return cp + */ + @jakarta.annotation.Nullable + public Boolean getCp() { + return cp; + } + + public void setCp(@jakarta.annotation.Nullable Boolean cp) { + this.cp = cp; + } + + public 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 cr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + return this; + } + + /** + * Get cr + * + * @return cr + */ + @jakarta.annotation.Nullable + public String getCr() { + return cr; + } + + public void setCr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + } + + public OrderTradeUpdateO pP(@jakarta.annotation.Nullable Boolean pP) { + this.pP = pP; + return this; + } + + /** + * Get pP + * + * @return pP + */ + @jakarta.annotation.Nullable + public Boolean getpP() { + return pP; + } + + public void setpP(@jakarta.annotation.Nullable Boolean pP) { + this.pP = pP; + } + + public OrderTradeUpdateO 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 OrderTradeUpdateO pm(@jakarta.annotation.Nullable String pm) { + this.pm = pm; + return this; + } + + /** + * Get pm + * + * @return pm + */ + @jakarta.annotation.Nullable + public String getPm() { + return pm; + } + + public void setPm(@jakarta.annotation.Nullable String pm) { + this.pm = pm; + } + + @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.sp, orderTradeUpdateO.sp) + && 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.ma, orderTradeUpdateO.ma) + && 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.rp, orderTradeUpdateO.rp) + && 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.wt, orderTradeUpdateO.wt) + && Objects.equals(this.ot, orderTradeUpdateO.ot) + && Objects.equals(this.ps, orderTradeUpdateO.ps) + && Objects.equals(this.cp, orderTradeUpdateO.cp) + && Objects.equals(this.AP, orderTradeUpdateO.AP) + && Objects.equals(this.cr, orderTradeUpdateO.cr) + && Objects.equals(this.pP, orderTradeUpdateO.pP) + && Objects.equals(this.V, orderTradeUpdateO.V) + && Objects.equals(this.pm, orderTradeUpdateO.pm); + } + + @Override + public int hashCode() { + return Objects.hash( + sLowerCase, + cLowerCase, + S, + oLowerCase, + fLowerCase, + qLowerCase, + pLowerCase, + ap, + sp, + xLowerCase, + X, + iLowerCase, + lLowerCase, + zLowerCase, + L, + ma, + N, + nLowerCase, + T, + tLowerCase, + rp, + bLowerCase, + aLowerCase, + mLowerCase, + R, + wt, + ot, + ps, + cp, + AP, + cr, + pP, + V, + pm); + } + + @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(" sp: ").append(toIndentedString(sp)).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(" ma: ").append(toIndentedString(ma)).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(" rp: ").append(toIndentedString(rp)).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(" wt: ").append(toIndentedString(wt)).append("\n"); + sb.append(" ot: ").append(toIndentedString(ot)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" cp: ").append(toIndentedString(cp)).append("\n"); + sb.append(" AP: ").append(toIndentedString(AP)).append("\n"); + sb.append(" cr: ").append(toIndentedString(cr)).append("\n"); + sb.append(" pP: ").append(toIndentedString(pP)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); + sb.append(" pm: ").append(toIndentedString(pm)).append("\n"); + sb.append("}"); + 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 spValue = getSp(); + if (spValue != null) { + String spValueAsString = spValue.toString(); + valMap.put("sp", spValueAsString); + } + 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 maValue = getMa(); + if (maValue != null) { + String maValueAsString = maValue.toString(); + valMap.put("ma", maValueAsString); + } + 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 rpValue = getRp(); + if (rpValue != null) { + String rpValueAsString = rpValue.toString(); + valMap.put("rp", rpValueAsString); + } + 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 wtValue = getWt(); + if (wtValue != null) { + String wtValueAsString = wtValue.toString(); + valMap.put("wt", wtValueAsString); + } + String otValue = getOt(); + if (otValue != null) { + String otValueAsString = otValue.toString(); + valMap.put("ot", otValueAsString); + } + String psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + Boolean cpValue = getCp(); + if (cpValue != null) { + String cpValueAsString = cpValue.toString(); + valMap.put("cp", cpValueAsString); + } + String APValue = getAP(); + if (APValue != null) { + String APValueAsString = APValue.toString(); + valMap.put("AP", APValueAsString); + } + String crValue = getCr(); + if (crValue != null) { + String crValueAsString = crValue.toString(); + valMap.put("cr", crValueAsString); + } + Boolean pPValue = getpP(); + if (pPValue != null) { + String pPValueAsString = pPValue.toString(); + valMap.put("pP", pPValueAsString); + } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } + String pmValue = getPm(); + if (pmValue != null) { + String pmValueAsString = pmValue.toString(); + valMap.put("pm", pmValueAsString); + } + + 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 spValue = getSp(); + if (spValue != null) { + valMap.put("sp", spValue); + } + 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 maValue = getMa(); + if (maValue != null) { + valMap.put("ma", maValue); + } + 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 rpValue = getRp(); + if (rpValue != null) { + valMap.put("rp", rpValue); + } + 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 wtValue = getWt(); + if (wtValue != null) { + valMap.put("wt", wtValue); + } + Object otValue = getOt(); + if (otValue != null) { + valMap.put("ot", otValue); + } + Object psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + Object cpValue = getCp(); + if (cpValue != null) { + valMap.put("cp", cpValue); + } + Object APValue = getAP(); + if (APValue != null) { + valMap.put("AP", APValue); + } + Object crValue = getCr(); + if (crValue != null) { + valMap.put("cr", crValue); + } + Object pPValue = getpP(); + if (pPValue != null) { + valMap.put("pP", pPValue); + } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } + Object pmValue = getPm(); + if (pmValue != null) { + valMap.put("pm", pmValue); + } + + 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("sp"); + openapiFields.add("x"); + openapiFields.add("X"); + openapiFields.add("i"); + openapiFields.add("l"); + openapiFields.add("z"); + openapiFields.add("L"); + openapiFields.add("ma"); + openapiFields.add("N"); + openapiFields.add("n"); + openapiFields.add("T"); + openapiFields.add("t"); + openapiFields.add("rp"); + openapiFields.add("b"); + openapiFields.add("a"); + openapiFields.add("m"); + openapiFields.add("R"); + openapiFields.add("wt"); + openapiFields.add("ot"); + openapiFields.add("ps"); + openapiFields.add("cp"); + openapiFields.add("AP"); + openapiFields.add("cr"); + openapiFields.add("pP"); + openapiFields.add("V"); + openapiFields.add("pm"); + + // 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("sp") != null && !jsonObj.get("sp").isJsonNull()) + && !jsonObj.get("sp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sp` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("sp").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("ma") != null && !jsonObj.get("ma").isJsonNull()) + && !jsonObj.get("ma").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ma` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ma").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("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())); + } + 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("wt") != null && !jsonObj.get("wt").isJsonNull()) + && !jsonObj.get("wt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `wt` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("wt").toString())); + } + if ((jsonObj.get("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("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("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("cr") != null && !jsonObj.get("cr").isJsonNull()) + && !jsonObj.get("cr").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cr` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cr").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("pm") != null && !jsonObj.get("pm").isJsonNull()) + && !jsonObj.get("pm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pm` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pm").toString())); + } + } + + 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-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/StrategyUpdate.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/StrategyUpdate.java new file mode 100644 index 00000000..98e653c7 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/StrategyUpdate.java @@ -0,0 +1,311 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** StrategyUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class StrategyUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_SU = "su"; + + @SerializedName(SERIALIZED_NAME_SU) + @jakarta.annotation.Nullable + private StrategyUpdateSu su; + + public StrategyUpdate() {} + + public StrategyUpdate 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 StrategyUpdate 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 StrategyUpdate su(@jakarta.annotation.Nullable StrategyUpdateSu su) { + this.su = su; + return this; + } + + /** + * Get su + * + * @return su + */ + @jakarta.annotation.Nullable + @Valid + public StrategyUpdateSu getSu() { + return su; + } + + public void setSu(@jakarta.annotation.Nullable StrategyUpdateSu su) { + this.su = su; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StrategyUpdate strategyUpdate = (StrategyUpdate) o; + return Objects.equals(this.T, strategyUpdate.T) + && Objects.equals(this.E, strategyUpdate.E) + && Objects.equals(this.su, strategyUpdate.su); + } + + @Override + public int hashCode() { + return Objects.hash(T, E, su); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StrategyUpdate {\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" su: ").append(toIndentedString(su)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + StrategyUpdateSu suValue = getSu(); + if (suValue != null) { + String suValueAsString = JSON.getGson().toJson(suValue); + valMap.put("su", suValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object suValue = getSu(); + if (suValue != null) { + valMap.put("su", suValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("T"); + openapiFields.add("E"); + openapiFields.add("su"); + + // 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 StrategyUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StrategyUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in StrategyUpdate is not found in the" + + " empty JSON string", + StrategyUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StrategyUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `StrategyUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `su` + if (jsonObj.get("su") != null && !jsonObj.get("su").isJsonNull()) { + StrategyUpdateSu.validateJsonElement(jsonObj.get("su")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StrategyUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StrategyUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(StrategyUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, StrategyUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StrategyUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of StrategyUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of StrategyUpdate + * @throws IOException if the JSON string is invalid with respect to StrategyUpdate + */ + public static StrategyUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StrategyUpdate.class); + } + + /** + * Convert an instance of StrategyUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/StrategyUpdateSu.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/StrategyUpdateSu.java new file mode 100644 index 00000000..3daf7f4a --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/StrategyUpdateSu.java @@ -0,0 +1,441 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** StrategyUpdateSu */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class StrategyUpdateSu extends BaseDTO { + public static final String SERIALIZED_NAME_SI = "si"; + + @SerializedName(SERIALIZED_NAME_SI) + @jakarta.annotation.Nullable + private Long si; + + public static final String SERIALIZED_NAME_ST = "st"; + + @SerializedName(SERIALIZED_NAME_ST) + @jakarta.annotation.Nullable + private String st; + + public static final String SERIALIZED_NAME_SS = "ss"; + + @SerializedName(SERIALIZED_NAME_SS) + @jakarta.annotation.Nullable + private String ss; + + 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_UT = "ut"; + + @SerializedName(SERIALIZED_NAME_UT) + @jakarta.annotation.Nullable + private Long ut; + + public static final String SERIALIZED_NAME_C_LOWER_CASE = "c"; + + @SerializedName(SERIALIZED_NAME_C_LOWER_CASE) + @jakarta.annotation.Nullable + private Long cLowerCase; + + public StrategyUpdateSu() {} + + public StrategyUpdateSu si(@jakarta.annotation.Nullable Long si) { + this.si = si; + return this; + } + + /** + * Get si + * + * @return si + */ + @jakarta.annotation.Nullable + public Long getSi() { + return si; + } + + public void setSi(@jakarta.annotation.Nullable Long si) { + this.si = si; + } + + public StrategyUpdateSu st(@jakarta.annotation.Nullable String st) { + this.st = st; + return this; + } + + /** + * Get st + * + * @return st + */ + @jakarta.annotation.Nullable + public String getSt() { + return st; + } + + public void setSt(@jakarta.annotation.Nullable String st) { + this.st = st; + } + + public StrategyUpdateSu ss(@jakarta.annotation.Nullable String ss) { + this.ss = ss; + return this; + } + + /** + * Get ss + * + * @return ss + */ + @jakarta.annotation.Nullable + public String getSs() { + return ss; + } + + public void setSs(@jakarta.annotation.Nullable String ss) { + this.ss = ss; + } + + public StrategyUpdateSu 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 StrategyUpdateSu ut(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + return this; + } + + /** + * Get ut + * + * @return ut + */ + @jakarta.annotation.Nullable + public Long getUt() { + return ut; + } + + public void setUt(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + } + + public StrategyUpdateSu cLowerCase(@jakarta.annotation.Nullable Long cLowerCase) { + this.cLowerCase = cLowerCase; + return this; + } + + /** + * Get cLowerCase + * + * @return cLowerCase + */ + @jakarta.annotation.Nullable + public Long getcLowerCase() { + return cLowerCase; + } + + public void setcLowerCase(@jakarta.annotation.Nullable Long cLowerCase) { + this.cLowerCase = cLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StrategyUpdateSu strategyUpdateSu = (StrategyUpdateSu) o; + return Objects.equals(this.si, strategyUpdateSu.si) + && Objects.equals(this.st, strategyUpdateSu.st) + && Objects.equals(this.ss, strategyUpdateSu.ss) + && Objects.equals(this.sLowerCase, strategyUpdateSu.sLowerCase) + && Objects.equals(this.ut, strategyUpdateSu.ut) + && Objects.equals(this.cLowerCase, strategyUpdateSu.cLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(si, st, ss, sLowerCase, ut, cLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StrategyUpdateSu {\n"); + sb.append(" si: ").append(toIndentedString(si)).append("\n"); + sb.append(" st: ").append(toIndentedString(st)).append("\n"); + sb.append(" ss: ").append(toIndentedString(ss)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" ut: ").append(toIndentedString(ut)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long siValue = getSi(); + if (siValue != null) { + String siValueAsString = siValue.toString(); + valMap.put("si", siValueAsString); + } + String stValue = getSt(); + if (stValue != null) { + String stValueAsString = stValue.toString(); + valMap.put("st", stValueAsString); + } + String ssValue = getSs(); + if (ssValue != null) { + String ssValueAsString = ssValue.toString(); + valMap.put("ss", ssValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + Long utValue = getUt(); + if (utValue != null) { + String utValueAsString = utValue.toString(); + valMap.put("ut", utValueAsString); + } + Long cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + String cLowerCaseValueAsString = cLowerCaseValue.toString(); + valMap.put("cLowerCase", cLowerCaseValueAsString); + } + + 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 siValue = getSi(); + if (siValue != null) { + valMap.put("si", siValue); + } + Object stValue = getSt(); + if (stValue != null) { + valMap.put("st", stValue); + } + Object ssValue = getSs(); + if (ssValue != null) { + valMap.put("ss", ssValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object utValue = getUt(); + if (utValue != null) { + valMap.put("ut", utValue); + } + Object cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + valMap.put("cLowerCase", cLowerCaseValue); + } + + 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("si"); + openapiFields.add("st"); + openapiFields.add("ss"); + openapiFields.add("s"); + openapiFields.add("ut"); + openapiFields.add("c"); + + // 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 StrategyUpdateSu + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StrategyUpdateSu.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in StrategyUpdateSu is not found in the" + + " empty JSON string", + StrategyUpdateSu.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StrategyUpdateSu.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `StrategyUpdateSu` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("st") != null && !jsonObj.get("st").isJsonNull()) + && !jsonObj.get("st").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `st` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("st").toString())); + } + if ((jsonObj.get("ss") != null && !jsonObj.get("ss").isJsonNull()) + && !jsonObj.get("ss").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ss` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ss").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StrategyUpdateSu.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StrategyUpdateSu' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(StrategyUpdateSu.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, StrategyUpdateSu value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StrategyUpdateSu read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of StrategyUpdateSu given an JSON string + * + * @param jsonString JSON string + * @return An instance of StrategyUpdateSu + * @throws IOException if the JSON string is invalid with respect to StrategyUpdateSu + */ + public static StrategyUpdateSu fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StrategyUpdateSu.class); + } + + /** + * Convert an instance of StrategyUpdateSu to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/UserDataStreamEventsResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/UserDataStreamEventsResponse.java new file mode 100644 index 00000000..585705f6 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/UserDataStreamEventsResponse.java @@ -0,0 +1,703 @@ +/* + * Binance Derivatives Trading COIN Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.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 UserDataStreamEventsResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(UserDataStreamEventsResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDataStreamEventsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDataStreamEventsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAccountConfigUpdate = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdate.class)); + final TypeAdapter adapterAccountUpdate = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + final TypeAdapter adapterGridUpdate = + gson.getDelegateAdapter(this, TypeToken.get(GridUpdate.class)); + final TypeAdapter adapterMarginCall = + gson.getDelegateAdapter(this, TypeToken.get(MarginCall.class)); + final TypeAdapter adapterOrderTradeUpdate = + gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdate.class)); + final TypeAdapter adapterStrategyUpdate = + gson.getDelegateAdapter(this, TypeToken.get(StrategyUpdate.class)); + final TypeAdapter adapterListenkeyexpired = + gson.getDelegateAdapter(this, TypeToken.get(Listenkeyexpired.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDataStreamEventsResponse value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AccountConfigUpdate` + if (value.getActualInstance() instanceof AccountConfigUpdate) { + JsonElement element = + adapterAccountConfigUpdate.toJsonTree( + (AccountConfigUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AccountUpdate` + if (value.getActualInstance() instanceof AccountUpdate) { + JsonElement element = + adapterAccountUpdate.toJsonTree( + (AccountUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `GridUpdate` + if (value.getActualInstance() instanceof GridUpdate) { + JsonElement element = + adapterGridUpdate.toJsonTree( + (GridUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MarginCall` + if (value.getActualInstance() instanceof MarginCall) { + JsonElement element = + adapterMarginCall.toJsonTree( + (MarginCall) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OrderTradeUpdate` + if (value.getActualInstance() instanceof OrderTradeUpdate) { + JsonElement element = + adapterOrderTradeUpdate.toJsonTree( + (OrderTradeUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `StrategyUpdate` + if (value.getActualInstance() instanceof StrategyUpdate) { + JsonElement element = + adapterStrategyUpdate.toJsonTree( + (StrategyUpdate) value.getActualInstance()); + 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:" + + " AccountConfigUpdate, AccountUpdate, GridUpdate," + + " Listenkeyexpired, MarginCall, OrderTradeUpdate," + + " StrategyUpdate"); + } + + @Override + public UserDataStreamEventsResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + UserDataStreamEventsResponse newUserDataStreamEventsResponse = + new UserDataStreamEventsResponse(); + if (jsonObject.get("e") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for" + + " UserDataStreamEventsResponse as `e` was not found" + + " in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `e` + switch (jsonObject.get("e").getAsString()) { + case "ACCOUNT_CONFIG_UPDATE": + deserialized = + adapterAccountConfigUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "ACCOUNT_UPDATE": + deserialized = + adapterAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "GRID_UPDATE": + deserialized = adapterGridUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "MARGIN_CALL": + deserialized = adapterMarginCall.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "ORDER_TRADE_UPDATE": + deserialized = + adapterOrderTradeUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "STRATEGY_UPDATE": + deserialized = + adapterStrategyUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "listenKeyExpired": + deserialized = + adapterListenkeyexpired.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "accountConfigUpdate": + deserialized = + adapterAccountConfigUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "accountUpdate": + deserialized = + adapterAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "gridUpdate": + deserialized = adapterGridUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "listenkeyexpired": + deserialized = + adapterListenkeyexpired.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "marginCall": + deserialized = adapterMarginCall.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "orderTradeUpdate": + deserialized = + adapterOrderTradeUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "strategyUpdate": + deserialized = + adapterStrategyUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + default: + newUserDataStreamEventsResponse.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for UserDataStreamEventsResponse." + + " Possible values:" + + " ACCOUNT_CONFIG_UPDATE" + + " ACCOUNT_UPDATE GRID_UPDATE" + + " MARGIN_CALL ORDER_TRADE_UPDATE" + + " STRATEGY_UPDATE listenKeyExpired" + + " accountConfigUpdate accountUpdate" + + " gridUpdate listenkeyexpired" + + " marginCall orderTradeUpdate" + + " strategyUpdate. Falling back to" + + " String.", + jsonObject.get("e").getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AccountConfigUpdate + try { + // validate the JSON object to see if any exception is thrown + AccountConfigUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterAccountConfigUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'AccountConfigUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AccountConfigUpdate failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AccountConfigUpdate'", + e); + } + // deserialize AccountUpdate + try { + // validate the JSON object to see if any exception is thrown + AccountUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterAccountUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'AccountUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AccountUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AccountUpdate'", + e); + } + // deserialize GridUpdate + try { + // validate the JSON object to see if any exception is thrown + GridUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterGridUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'GridUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for GridUpdate failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'GridUpdate'", + e); + } + // deserialize MarginCall + try { + // validate the JSON object to see if any exception is thrown + MarginCall.validateJsonElement(jsonElement); + actualAdapter = adapterMarginCall; + match++; + log.log(Level.FINER, "Input data matches schema 'MarginCall'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MarginCall failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MarginCall'", + e); + } + // deserialize OrderTradeUpdate + try { + // validate the JSON object to see if any exception is thrown + OrderTradeUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterOrderTradeUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'OrderTradeUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for OrderTradeUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'OrderTradeUpdate'", + e); + } + // deserialize StrategyUpdate + try { + // validate the JSON object to see if any exception is thrown + StrategyUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterStrategyUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'StrategyUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for StrategyUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'StrategyUpdate'", + 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 = + new UserDataStreamEventsResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for" + + " UserDataStreamEventsResponse: %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 UserDataStreamEventsResponse() { + super("oneOf", Boolean.FALSE); + } + + public UserDataStreamEventsResponse(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AccountConfigUpdate", AccountConfigUpdate.class); + schemas.put("AccountUpdate", AccountUpdate.class); + schemas.put("GridUpdate", GridUpdate.class); + schemas.put("MarginCall", MarginCall.class); + schemas.put("OrderTradeUpdate", OrderTradeUpdate.class); + schemas.put("StrategyUpdate", StrategyUpdate.class); + schemas.put("Listenkeyexpired", Listenkeyexpired.class); + } + + @Override + public Map> getSchemas() { + return UserDataStreamEventsResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AccountConfigUpdate, AccountUpdate, GridUpdate, + * Listenkeyexpired, MarginCall, OrderTradeUpdate, StrategyUpdate + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AccountConfigUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AccountUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GridUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MarginCall) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OrderTradeUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof StrategyUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Listenkeyexpired) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be AccountConfigUpdate, AccountUpdate, GridUpdate," + + " Listenkeyexpired, MarginCall, OrderTradeUpdate, StrategyUpdate"); + } + + /** + * Get the actual instance, which can be the following: AccountConfigUpdate, AccountUpdate, + * GridUpdate, Listenkeyexpired, MarginCall, OrderTradeUpdate, StrategyUpdate + * + * @return The actual instance (AccountConfigUpdate, AccountUpdate, GridUpdate, + * Listenkeyexpired, MarginCall, OrderTradeUpdate, StrategyUpdate) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AccountConfigUpdate`. If the actual instance is not + * `AccountConfigUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `AccountConfigUpdate` + * @throws ClassCastException if the instance is not `AccountConfigUpdate` + */ + public AccountConfigUpdate getAccountConfigUpdate() throws ClassCastException { + return (AccountConfigUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `AccountUpdate`. If the actual instance is not `AccountUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AccountUpdate` + * @throws ClassCastException if the instance is not `AccountUpdate` + */ + public AccountUpdate getAccountUpdate() throws ClassCastException { + return (AccountUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `GridUpdate`. If the actual instance is not `GridUpdate`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `GridUpdate` + * @throws ClassCastException if the instance is not `GridUpdate` + */ + public GridUpdate getGridUpdate() throws ClassCastException { + return (GridUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `MarginCall`. If the actual instance is not `MarginCall`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `MarginCall` + * @throws ClassCastException if the instance is not `MarginCall` + */ + public MarginCall getMarginCall() throws ClassCastException { + return (MarginCall) super.getActualInstance(); + } + + /** + * Get the actual instance of `OrderTradeUpdate`. If the actual instance is not + * `OrderTradeUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `OrderTradeUpdate` + * @throws ClassCastException if the instance is not `OrderTradeUpdate` + */ + public OrderTradeUpdate getOrderTradeUpdate() throws ClassCastException { + return (OrderTradeUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `StrategyUpdate`. If the actual instance is not `StrategyUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `StrategyUpdate` + * @throws ClassCastException if the instance is not `StrategyUpdate` + */ + public StrategyUpdate getStrategyUpdate() throws ClassCastException { + return (StrategyUpdate) 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 + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UserDataStreamEventsResponse + */ + 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 AccountConfigUpdate + try { + AccountConfigUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AccountConfigUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AccountUpdate + try { + AccountUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AccountUpdate failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GridUpdate + try { + GridUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for GridUpdate failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with MarginCall + try { + MarginCall.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MarginCall failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OrderTradeUpdate + try { + OrderTradeUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for OrderTradeUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with StrategyUpdate + try { + StrategyUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for StrategyUpdate failed with `%s`.", + 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: AccountConfigUpdate, AccountUpdate, GridUpdate," + + " Listenkeyexpired, MarginCall, OrderTradeUpdate, StrategyUpdate." + + " %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 UserDataStreamEventsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDataStreamEventsResponse + * @throws IOException if the JSON string is invalid with respect to + * UserDataStreamEventsResponse + */ + public static UserDataStreamEventsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDataStreamEventsResponse.class); + } + + /** + * Convert an instance of UserDataStreamEventsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/CHANGELOG.md b/clients/derivatives-trading-options/CHANGELOG.md index 7202f408..0f97555d 100644 --- a/clients/derivatives-trading-options/CHANGELOG.md +++ b/clients/derivatives-trading-options/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 2.0.0 - 2025-07-16 + +### Added (1) + +- Support User Data Streams. + +### Changed (1) + +- Update `binance/common` module to version `1.4.0`. + ## 1.3.0 - 2025-07-08 - Update `binance/common` module to version `1.3.0`. diff --git a/clients/derivatives-trading-options/docs/AccountUpdate.md b/clients/derivatives-trading-options/docs/AccountUpdate.md new file mode 100644 index 00000000..48a637e8 --- /dev/null +++ b/clients/derivatives-trading-options/docs/AccountUpdate.md @@ -0,0 +1,17 @@ + + +# 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 new file mode 100644 index 00000000..6b70d0e7 --- /dev/null +++ b/clients/derivatives-trading-options/docs/AccountUpdateBInner.md @@ -0,0 +1,19 @@ + + +# 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 new file mode 100644 index 00000000..124db137 --- /dev/null +++ b/clients/derivatives-trading-options/docs/AccountUpdateGInner.md @@ -0,0 +1,17 @@ + + +# 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/AccountUpdatePInner.md b/clients/derivatives-trading-options/docs/AccountUpdatePInner.md new file mode 100644 index 00000000..1e48fd42 --- /dev/null +++ b/clients/derivatives-trading-options/docs/AccountUpdatePInner.md @@ -0,0 +1,17 @@ + + +# AccountUpdatePInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**aLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse1.md b/clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse1.md deleted file mode 100644 index 77ed84d5..00000000 --- a/clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetOptionTransactionHistoryDownloadLinkByIdResponse1 - - -## 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/GetOptionTransactionHistoryDownloadLinkByIdResponse2.md b/clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse2.md deleted file mode 100644 index 2968db5a..00000000 --- a/clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetOptionTransactionHistoryDownloadLinkByIdResponse2 - - -## 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/NewOrderResponse1.md b/clients/derivatives-trading-options/docs/NewOrderResponse1.md deleted file mode 100644 index eba91c09..00000000 --- a/clients/derivatives-trading-options/docs/NewOrderResponse1.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# NewOrderResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**orderId** | **Long** | | [optional] | -|**symbol** | **String** | | [optional] | -|**price** | **String** | | [optional] | -|**quantity** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**createDate** | **Long** | | [optional] | -|**reduceOnly** | **Boolean** | | [optional] | -|**postOnly** | **Boolean** | | [optional] | -|**mmp** | **Boolean** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/NewOrderResponse2.md b/clients/derivatives-trading-options/docs/NewOrderResponse2.md deleted file mode 100644 index 8ecb8997..00000000 --- a/clients/derivatives-trading-options/docs/NewOrderResponse2.md +++ /dev/null @@ -1,33 +0,0 @@ - - -# NewOrderResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**orderId** | **Long** | | [optional] | -|**symbol** | **String** | | [optional] | -|**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] | -|**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/OrderTradeUpdate.md b/clients/derivatives-trading-options/docs/OrderTradeUpdate.md new file mode 100644 index 00000000..ea80191d --- /dev/null +++ b/clients/derivatives-trading-options/docs/OrderTradeUpdate.md @@ -0,0 +1,14 @@ + + +# OrderTradeUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**oLowerCase** | [**List<OrderTradeUpdateOInner>**](OrderTradeUpdateOInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/OrderTradeUpdateOInner.md b/clients/derivatives-trading-options/docs/OrderTradeUpdateOInner.md new file mode 100644 index 00000000..48404e70 --- /dev/null +++ b/clients/derivatives-trading-options/docs/OrderTradeUpdateOInner.md @@ -0,0 +1,29 @@ + + +# 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 new file mode 100644 index 00000000..ee60c44d --- /dev/null +++ b/clients/derivatives-trading-options/docs/OrderTradeUpdateOInnerFiInner.md @@ -0,0 +1,18 @@ + + +# 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/RiskLevelChange.md b/clients/derivatives-trading-options/docs/RiskLevelChange.md new file mode 100644 index 00000000..3e54655e --- /dev/null +++ b/clients/derivatives-trading-options/docs/RiskLevelChange.md @@ -0,0 +1,16 @@ + + +# RiskLevelChange + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**mb** | **String** | | [optional] | +|**mm** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-options/docs/UserDataStreamEventsResponse.md new file mode 100644 index 00000000..721a7e73 --- /dev/null +++ b/clients/derivatives-trading-options/docs/UserDataStreamEventsResponse.md @@ -0,0 +1,21 @@ + + +# UserDataStreamEventsResponse + + +## 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] | +|**oLowerCase** | [**List<OrderTradeUpdateOInner>**](OrderTradeUpdateOInner.md) | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**mb** | **String** | | [optional] | +|**mm** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/pom.xml b/clients/derivatives-trading-options/pom.xml index 89484bb5..939c4a4c 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 - 1.3.0 + 2.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.3.0 + 1.4.0 \ No newline at end of file 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 81b57c15..314f9e67 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 @@ -45,7 +45,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java index 7cd64563..8182a228 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 @@ -53,7 +53,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java index 44e84198..1142f91e 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 @@ -53,7 +53,7 @@ public class MarketMakerBlockTradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java index e974a9af..36e90d41 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 @@ -54,7 +54,7 @@ public class MarketMakerEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java index 5eccc42b..4845a5c5 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java @@ -60,7 +60,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java index ff396d21..816809d0 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/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/JSON.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/JSON.java index 9e8ee022..0cc03a10 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 @@ -26,6 +26,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -37,6 +38,7 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.HashMap; import java.util.Map; import okio.ByteString; @@ -58,7 +60,66 @@ public class JSON { @SuppressWarnings("unchecked") public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client.derivatives_trading_options.websocket + .stream.model.UserDataStreamEventsResponse.class, + new TypeSelector< + com.binance.connector.client.derivatives_trading_options + .websocket.stream.model + .UserDataStreamEventsResponse>() { + @Override + public Class< + ? extends + com.binance.connector.client + .derivatives_trading_options + .websocket.stream.model + .UserDataStreamEventsResponse> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "ACCOUNT_UPDATE", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.AccountUpdate.class); + classByDiscriminatorValue.put( + "ORDER_TRADE_UPDATE", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.OrderTradeUpdate.class); + classByDiscriminatorValue.put( + "RISK_LEVEL_CHANGE", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.RiskLevelChange.class); + classByDiscriminatorValue.put( + "accountUpdate", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.AccountUpdate.class); + classByDiscriminatorValue.put( + "orderTradeUpdate", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.OrderTradeUpdate.class); + classByDiscriminatorValue.put( + "riskLevelChange", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.RiskLevelChange.class); + classByDiscriminatorValue.put( + "UserDataStreamEventsResponse", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.UserDataStreamEventsResponse + .class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "e")); + } + }); GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; } @@ -108,6 +169,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .AccountUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .AccountUpdateBInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .AccountUpdateGInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .AccountUpdatePInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .IndexPriceStreamsRequest.CustomTypeAdapterFactory()); @@ -147,6 +220,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .OpenInterestResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .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()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .PartialBookDepthStreamsRequest.CustomTypeAdapterFactory()); @@ -159,6 +241,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .PartialBookDepthStreamsResponseBItem.CustomTypeAdapterFactory()); + 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 @@ -183,6 +268,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .TradeStreamsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .UserDataStreamEventsResponse.CustomTypeAdapterFactory()); 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 0f9a8086..f46c60f1 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 @@ -6,6 +6,8 @@ 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; @@ -26,13 +28,21 @@ 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.binance.connector.client.derivatives_trading_options.websocket.stream.model.UserDataStreamEventsResponse; +import com.google.gson.reflect.TypeToken; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.UUID; public class DerivativesTradingOptionsWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private final StreamConnectionInterface connection; + private WebsocketMarketStreamsApi websocketMarketStreamsApi; public DerivativesTradingOptionsWebSocketStreams(WebSocketClientConfiguration configuration) { @@ -47,6 +57,7 @@ public DerivativesTradingOptionsWebSocketStreams(StreamConnectionInterface conne if (!connection.isConnected()) { connection.connect(); } + this.connection = connection; this.websocketMarketStreamsApi = new WebsocketMarketStreamsApi(connection); } @@ -99,4 +110,29 @@ public StreamBlockingQueueWrapper tradeStreams( TradeStreamsRequest tradeStreamsRequest) throws ApiException { return websocketMarketStreamsApi.tradeStreams(tradeStreamsRequest); } + + /** + * Subscribes to the user data WebSocket stream using the provided listen key. + * + * @param listenKey - The listen key for the user data WebSocket stream. + * @return A WebSocket stream handler for the user data stream. + */ + public StreamBlockingQueueWrapper userData(String listenKey) { + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(listenKey)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + + TypeToken typeToken = new TypeToken<>() {}; + StreamBlockingQueue queue = queuesMap.get(listenKey); + return new StreamBlockingQueueWrapper<>(queue, typeToken, JSON.getGson()); + } + + 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/AccountUpdate.java new file mode 100644 index 00000000..792f01f6 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdate.java @@ -0,0 +1,467 @@ +/* + * 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.*; + +/** AccountUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdate 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"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private List<@Valid AccountUpdateBInner> B; + + public static final String SERIALIZED_NAME_G = "G"; + + @SerializedName(SERIALIZED_NAME_G) + @jakarta.annotation.Nullable + private List<@Valid AccountUpdateGInner> G; + + public static final String SERIALIZED_NAME_P = "P"; + + @SerializedName(SERIALIZED_NAME_P) + @jakarta.annotation.Nullable + private List<@Valid AccountUpdatePInner> P; + + public static final String SERIALIZED_NAME_UID = "uid"; + + @SerializedName(SERIALIZED_NAME_UID) + @jakarta.annotation.Nullable + private Long uid; + + public AccountUpdate() {} + + public AccountUpdate 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 AccountUpdate B(@jakarta.annotation.Nullable List<@Valid AccountUpdateBInner> B) { + this.B = B; + return this; + } + + public AccountUpdate addBItem(AccountUpdateBInner BItem) { + if (this.B == null) { + this.B = new ArrayList<>(); + } + this.B.add(BItem); + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid AccountUpdateBInner> getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable List<@Valid AccountUpdateBInner> B) { + this.B = B; + } + + public AccountUpdate G(@jakarta.annotation.Nullable List<@Valid AccountUpdateGInner> G) { + this.G = G; + return this; + } + + public AccountUpdate addGItem(AccountUpdateGInner 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 AccountUpdateGInner> getG() { + return G; + } + + public void setG(@jakarta.annotation.Nullable List<@Valid AccountUpdateGInner> G) { + this.G = G; + } + + public AccountUpdate P(@jakarta.annotation.Nullable List<@Valid AccountUpdatePInner> P) { + this.P = P; + return this; + } + + public AccountUpdate addPItem(AccountUpdatePInner PItem) { + if (this.P == null) { + this.P = new ArrayList<>(); + } + this.P.add(PItem); + return this; + } + + /** + * Get P + * + * @return P + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid AccountUpdatePInner> getP() { + return P; + } + + public void setP(@jakarta.annotation.Nullable List<@Valid AccountUpdatePInner> 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) { + return true; + } + 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); + } + + @Override + public int hashCode() { + return Objects.hash(E, B, G, P, uid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).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(); + } + + 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); + } + List<@Valid AccountUpdateBInner> 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(); + 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( + 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 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; + } + + 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("B"); + openapiFields.add("G"); + openapiFields.add("P"); + openapiFields.add("uid"); + + // 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 AccountUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdate.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())); + } + } + + 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())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("B") != null && !jsonObj.get("B").isJsonNull()) { + JsonArray jsonArrayB = jsonObj.getAsJsonArray("B"); + if (jsonArrayB != null) { + // ensure the json data is an array + if (!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())); + } + + // 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)); + } + ; + } + } + if (jsonObj.get("P") != null && !jsonObj.get("P").isJsonNull()) { + JsonArray jsonArrayP = jsonObj.getAsJsonArray("P"); + if (jsonArrayP != null) { + // ensure the json data is an array + if (!jsonObj.get("P").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `P` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("P").toString())); + } + + // validate the optional field `P` (array) + for (int i = 0; i < jsonArrayP.size(); i++) { + AccountUpdatePInner.validateJsonElement(jsonArrayP.get(i)); + } + ; + } + } + } + + 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 + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdate 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 + */ + public static AccountUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdate.class); + } + + /** + * Convert an instance of AccountUpdate 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/AccountUpdateBInner.java new file mode 100644 index 00000000..e861b75b --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateBInner.java @@ -0,0 +1,502 @@ +/* + * 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.*; + +/** AccountUpdateBInner */ +@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"; + + @SerializedName(SERIALIZED_NAME_B_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; + + 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_U = "U"; + + @SerializedName(SERIALIZED_NAME_U) + @jakarta.annotation.Nullable + private Long U; + + public static final String SERIALIZED_NAME_M = "M"; + + @SerializedName(SERIALIZED_NAME_M) + @jakarta.annotation.Nullable + private String M; + + public static final String SERIALIZED_NAME_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private String iLowerCase; + + public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private String aLowerCase; + + public AccountUpdateBInner() {} + + public AccountUpdateBInner 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 AccountUpdateBInner 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 AccountUpdateBInner uLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; + return this; + } + + /** + * Get uLowerCase + * + * @return uLowerCase + */ + @jakarta.annotation.Nullable + public String getuLowerCase() { + return uLowerCase; + } + + public void setuLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; + } + + public AccountUpdateBInner 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 AccountUpdateBInner M(@jakarta.annotation.Nullable String M) { + this.M = M; + return this; + } + + /** + * Get M + * + * @return M + */ + @jakarta.annotation.Nullable + public String getM() { + return M; + } + + public void setM(@jakarta.annotation.Nullable String M) { + this.M = M; + } + + public AccountUpdateBInner iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + return this; + } + + /** + * Get iLowerCase + * + * @return iLowerCase + */ + @jakarta.annotation.Nullable + public String getiLowerCase() { + return iLowerCase; + } + + public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + } + + public AccountUpdateBInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + 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); + } + + @Override + public int hashCode() { + return Objects.hash(bLowerCase, mLowerCase, uLowerCase, U, M, iLowerCase, aLowerCase); + } + + @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(" 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(" 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 bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + String bLowerCaseValueAsString = bLowerCaseValue.toString(); + valMap.put("bLowerCase", bLowerCaseValueAsString); + } + String mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + String 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 MValue = getM(); + if (MValue != null) { + String MValueAsString = MValue.toString(); + valMap.put("M", MValueAsString); + } + String iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + String aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = aLowerCaseValue.toString(); + 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 bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + valMap.put("bLowerCase", bLowerCaseValue); + } + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + Object uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object UValue = getU(); + if (UValue != null) { + valMap.put("U", UValue); + } + Object MValue = getM(); + if (MValue != null) { + valMap.put("M", MValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + 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("b"); + openapiFields.add("m"); + openapiFields.add("u"); + openapiFields.add("U"); + openapiFields.add("M"); + openapiFields.add("i"); + 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 AccountUpdateBInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateBInner.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())); + } + } + + 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())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateBInner` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("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("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()) { + 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("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("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 + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateBInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateBInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateBInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateBInner 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 + */ + public static AccountUpdateBInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateBInner.class); + } + + /** + * Convert an instance of AccountUpdateBInner 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/AccountUpdateGInner.java new file mode 100644 index 00000000..70b1741a --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateGInner.java @@ -0,0 +1,398 @@ +/* + * 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.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; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountUpdateGInner */ +@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"; + + @SerializedName(SERIALIZED_NAME_UI) + @jakarta.annotation.Nullable + private String ui; + + public static final String SERIALIZED_NAME_D_LOWER_CASE = "d"; + + @SerializedName(SERIALIZED_NAME_D_LOWER_CASE) + @jakarta.annotation.Nullable + private Double dLowerCase; + + public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; + + @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) + @jakarta.annotation.Nullable + private Double tLowerCase; + + public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; + + @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) + @jakarta.annotation.Nullable + private Double gLowerCase; + + public static final String SERIALIZED_NAME_V_LOWER_CASE = "v"; + + @SerializedName(SERIALIZED_NAME_V_LOWER_CASE) + @jakarta.annotation.Nullable + private Double vLowerCase; + + public AccountUpdateGInner() {} + + public AccountUpdateGInner ui(@jakarta.annotation.Nullable String ui) { + this.ui = ui; + return this; + } + + /** + * Get ui + * + * @return ui + */ + @jakarta.annotation.Nullable + public String getUi() { + return ui; + } + + public void setUi(@jakarta.annotation.Nullable String ui) { + this.ui = ui; + } + + public AccountUpdateGInner dLowerCase(@jakarta.annotation.Nullable Double dLowerCase) { + this.dLowerCase = dLowerCase; + return this; + } + + /** + * Get dLowerCase + * + * @return dLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public Double getdLowerCase() { + return dLowerCase; + } + + public void setdLowerCase(@jakarta.annotation.Nullable Double dLowerCase) { + this.dLowerCase = dLowerCase; + } + + public AccountUpdateGInner tLowerCase(@jakarta.annotation.Nullable Double tLowerCase) { + this.tLowerCase = tLowerCase; + return this; + } + + /** + * Get tLowerCase + * + * @return tLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public Double gettLowerCase() { + return tLowerCase; + } + + public void settLowerCase(@jakarta.annotation.Nullable Double tLowerCase) { + this.tLowerCase = tLowerCase; + } + + public AccountUpdateGInner gLowerCase(@jakarta.annotation.Nullable Double gLowerCase) { + this.gLowerCase = gLowerCase; + return this; + } + + /** + * Get gLowerCase + * + * @return gLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public Double getgLowerCase() { + return gLowerCase; + } + + public void setgLowerCase(@jakarta.annotation.Nullable Double gLowerCase) { + this.gLowerCase = gLowerCase; + } + + public AccountUpdateGInner vLowerCase(@jakarta.annotation.Nullable Double vLowerCase) { + this.vLowerCase = vLowerCase; + return this; + } + + /** + * Get vLowerCase + * + * @return vLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public Double getvLowerCase() { + return vLowerCase; + } + + public void setvLowerCase(@jakarta.annotation.Nullable Double vLowerCase) { + this.vLowerCase = vLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + 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); + } + + @Override + public int hashCode() { + return Objects.hash(ui, dLowerCase, tLowerCase, gLowerCase, vLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateGInner {\n"); + sb.append(" ui: ").append(toIndentedString(ui)).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(); + } + + 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); + } + Double dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + String dLowerCaseValueAsString = + DecimalFormatter.getFormatter().format(dLowerCaseValue); + valMap.put("dLowerCase", dLowerCaseValueAsString); + } + Double tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + String tLowerCaseValueAsString = + DecimalFormatter.getFormatter().format(tLowerCaseValue); + valMap.put("tLowerCase", tLowerCaseValueAsString); + } + Double gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + String gLowerCaseValueAsString = + DecimalFormatter.getFormatter().format(gLowerCaseValue); + valMap.put("gLowerCase", gLowerCaseValueAsString); + } + Double vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + String vLowerCaseValueAsString = + DecimalFormatter.getFormatter().format(vLowerCaseValue); + valMap.put("vLowerCase", vLowerCaseValueAsString); + } + + 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 uiValue = getUi(); + if (uiValue != null) { + valMap.put("ui", uiValue); + } + 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; + } + + 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("ui"); + openapiFields.add("d"); + openapiFields.add("t"); + openapiFields.add("g"); + openapiFields.add("v"); + + // 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 AccountUpdateGInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateGInner.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())); + } + } + + 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())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateGInner` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ui") != null && !jsonObj.get("ui").isJsonNull()) + && !jsonObj.get("ui").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ui` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ui").toString())); + } + } + + 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 + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateGInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateGInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateGInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateGInner 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 + */ + public static AccountUpdateGInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateGInner.class); + } + + /** + * Convert an instance of AccountUpdateGInner 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/AccountUpdatePInner.java new file mode 100644 index 00000000..e5cb3672 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdatePInner.java @@ -0,0 +1,420 @@ +/* + * 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.*; + +/** AccountUpdatePInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdatePInner 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_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) + @jakarta.annotation.Nullable + private String pLowerCase; + + public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private String aLowerCase; + + public AccountUpdatePInner() {} + + public AccountUpdatePInner 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 AccountUpdatePInner 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 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) { + 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 AccountUpdatePInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + 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); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, cLowerCase, rLowerCase, pLowerCase, aLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdatePInner {\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("}"); + 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 rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + String rLowerCaseValueAsString = rLowerCaseValue.toString(); + valMap.put("rLowerCase", rLowerCaseValueAsString); + } + String pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + String pLowerCaseValueAsString = pLowerCaseValue.toString(); + valMap.put("pLowerCase", pLowerCaseValueAsString); + } + String aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = aLowerCaseValue.toString(); + 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 sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object cLowerCaseValue = getcLowerCase(); + 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); + } + 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("s"); + openapiFields.add("c"); + openapiFields.add("r"); + openapiFields.add("p"); + 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 AccountUpdatePInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdatePInner.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())); + } + } + + 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())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdatePInner` 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("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( + 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("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 (!AccountUpdatePInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdatePInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdatePInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdatePInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdatePInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdatePInner 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 + */ + public static AccountUpdatePInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdatePInner.class); + } + + /** + * Convert an instance of AccountUpdatePInner 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/OrderTradeUpdate.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdate.java new file mode 100644 index 00000000..e4ff9d81 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdate.java @@ -0,0 +1,303 @@ +/* + * 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.*; + +/** OrderTradeUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderTradeUpdate 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_O_LOWER_CASE = "o"; + + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @jakarta.annotation.Nullable + private List<@Valid OrderTradeUpdateOInner> oLowerCase; + + public OrderTradeUpdate() {} + + public OrderTradeUpdate 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 OrderTradeUpdate oLowerCase( + @jakarta.annotation.Nullable List<@Valid OrderTradeUpdateOInner> oLowerCase) { + this.oLowerCase = oLowerCase; + return this; + } + + public OrderTradeUpdate addOLowerCaseItem(OrderTradeUpdateOInner oLowerCaseItem) { + if (this.oLowerCase == null) { + this.oLowerCase = new ArrayList<>(); + } + this.oLowerCase.add(oLowerCaseItem); + return this; + } + + /** + * Get oLowerCase + * + * @return oLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OrderTradeUpdateOInner> getoLowerCase() { + return oLowerCase; + } + + public void setoLowerCase( + @jakarta.annotation.Nullable List<@Valid OrderTradeUpdateOInner> oLowerCase) { + this.oLowerCase = oLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderTradeUpdate orderTradeUpdate = (OrderTradeUpdate) o; + return Objects.equals(this.E, orderTradeUpdate.E) + && Objects.equals(this.oLowerCase, orderTradeUpdate.oLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, oLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderTradeUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + List<@Valid OrderTradeUpdateOInner> oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + String oLowerCaseValueAsString = JSON.getGson().toJson(oLowerCaseValue); + valMap.put("oLowerCase", oLowerCaseValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + valMap.put("oLowerCase", oLowerCaseValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("E"); + openapiFields.add("o"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrderTradeUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderTradeUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderTradeUpdate is not found in the" + + " empty JSON string", + OrderTradeUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderTradeUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderTradeUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderTradeUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderTradeUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderTradeUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderTradeUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderTradeUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderTradeUpdate + * @throws IOException if the JSON string is invalid with respect to OrderTradeUpdate + */ + public static OrderTradeUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderTradeUpdate.class); + } + + /** + * Convert an instance of OrderTradeUpdate 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 new file mode 100644 index 00000000..c97943ec --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInner.java @@ -0,0 +1,962 @@ +/* + * 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 new file mode 100644 index 00000000..d2b676ea --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInnerFiInner.java @@ -0,0 +1,468 @@ +/* + * 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/RiskLevelChange.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/RiskLevelChange.java new file mode 100644 index 00000000..e01476de --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/RiskLevelChange.java @@ -0,0 +1,367 @@ +/* + * 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.*; + +/** RiskLevelChange */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RiskLevelChange 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_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public static final String SERIALIZED_NAME_MB = "mb"; + + @SerializedName(SERIALIZED_NAME_MB) + @jakarta.annotation.Nullable + private String mb; + + public static final String SERIALIZED_NAME_MM = "mm"; + + @SerializedName(SERIALIZED_NAME_MM) + @jakarta.annotation.Nullable + private String mm; + + public RiskLevelChange() {} + + public RiskLevelChange 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 RiskLevelChange 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 RiskLevelChange mb(@jakarta.annotation.Nullable String mb) { + this.mb = mb; + return this; + } + + /** + * Get mb + * + * @return mb + */ + @jakarta.annotation.Nullable + public String getMb() { + return mb; + } + + public void setMb(@jakarta.annotation.Nullable String mb) { + this.mb = mb; + } + + public RiskLevelChange mm(@jakarta.annotation.Nullable String mm) { + this.mm = mm; + return this; + } + + /** + * Get mm + * + * @return mm + */ + @jakarta.annotation.Nullable + public String getMm() { + return mm; + } + + public void setMm(@jakarta.annotation.Nullable String mm) { + this.mm = mm; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RiskLevelChange riskLevelChange = (RiskLevelChange) o; + return Objects.equals(this.E, riskLevelChange.E) + && Objects.equals(this.sLowerCase, riskLevelChange.sLowerCase) + && Objects.equals(this.mb, riskLevelChange.mb) + && Objects.equals(this.mm, riskLevelChange.mm); + } + + @Override + public int hashCode() { + return Objects.hash(E, sLowerCase, mb, mm); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RiskLevelChange {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" mb: ").append(toIndentedString(mb)).append("\n"); + sb.append(" mm: ").append(toIndentedString(mm)).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); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + String mbValue = getMb(); + if (mbValue != null) { + String mbValueAsString = mbValue.toString(); + valMap.put("mb", mbValueAsString); + } + String mmValue = getMm(); + if (mmValue != null) { + String mmValueAsString = mmValue.toString(); + valMap.put("mm", mmValueAsString); + } + + 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 sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object mbValue = getMb(); + if (mbValue != null) { + valMap.put("mb", mbValue); + } + Object mmValue = getMm(); + if (mmValue != null) { + valMap.put("mm", mmValue); + } + + 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("s"); + openapiFields.add("mb"); + openapiFields.add("mm"); + + // 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 RiskLevelChange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RiskLevelChange.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RiskLevelChange is not found in the" + + " empty JSON string", + RiskLevelChange.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RiskLevelChange.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RiskLevelChange` 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("mb") != null && !jsonObj.get("mb").isJsonNull()) + && !jsonObj.get("mb").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mb` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("mb").toString())); + } + if ((jsonObj.get("mm") != null && !jsonObj.get("mm").isJsonNull()) + && !jsonObj.get("mm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mm` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("mm").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RiskLevelChange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RiskLevelChange' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RiskLevelChange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RiskLevelChange value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RiskLevelChange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RiskLevelChange given an JSON string + * + * @param jsonString JSON string + * @return An instance of RiskLevelChange + * @throws IOException if the JSON string is invalid with respect to RiskLevelChange + */ + public static RiskLevelChange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RiskLevelChange.class); + } + + /** + * Convert an instance of RiskLevelChange 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/UserDataStreamEventsResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/UserDataStreamEventsResponse.java new file mode 100644 index 00000000..2ac1198e --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/UserDataStreamEventsResponse.java @@ -0,0 +1,420 @@ +/* + * 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.AbstractOpenApiSchema; +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.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 UserDataStreamEventsResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(UserDataStreamEventsResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDataStreamEventsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDataStreamEventsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAccountUpdate = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + final TypeAdapter adapterOrderTradeUpdate = + gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdate.class)); + final TypeAdapter adapterRiskLevelChange = + gson.getDelegateAdapter(this, TypeToken.get(RiskLevelChange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDataStreamEventsResponse value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AccountUpdate` + if (value.getActualInstance() instanceof AccountUpdate) { + JsonElement element = + adapterAccountUpdate.toJsonTree( + (AccountUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OrderTradeUpdate` + if (value.getActualInstance() instanceof OrderTradeUpdate) { + JsonElement element = + adapterOrderTradeUpdate.toJsonTree( + (OrderTradeUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `RiskLevelChange` + if (value.getActualInstance() instanceof RiskLevelChange) { + JsonElement element = + adapterRiskLevelChange.toJsonTree( + (RiskLevelChange) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " AccountUpdate, OrderTradeUpdate, RiskLevelChange"); + } + + @Override + public UserDataStreamEventsResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + UserDataStreamEventsResponse newUserDataStreamEventsResponse = + new UserDataStreamEventsResponse(); + if (jsonObject.get("e") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for" + + " UserDataStreamEventsResponse as `e` was not found" + + " in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `e` + switch (jsonObject.get("e").getAsString()) { + case "ACCOUNT_UPDATE": + deserialized = + adapterAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "ORDER_TRADE_UPDATE": + deserialized = + adapterOrderTradeUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "RISK_LEVEL_CHANGE": + deserialized = + adapterRiskLevelChange.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "accountUpdate": + deserialized = + adapterAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "orderTradeUpdate": + deserialized = + adapterOrderTradeUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "riskLevelChange": + deserialized = + adapterRiskLevelChange.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + default: + newUserDataStreamEventsResponse.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + 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.", + jsonObject.get("e").getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AccountUpdate + try { + // validate the JSON object to see if any exception is thrown + AccountUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterAccountUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'AccountUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AccountUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AccountUpdate'", + e); + } + // deserialize OrderTradeUpdate + try { + // validate the JSON object to see if any exception is thrown + OrderTradeUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterOrderTradeUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'OrderTradeUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for OrderTradeUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'OrderTradeUpdate'", + e); + } + // deserialize RiskLevelChange + try { + // validate the JSON object to see if any exception is thrown + RiskLevelChange.validateJsonElement(jsonElement); + actualAdapter = adapterRiskLevelChange; + match++; + log.log(Level.FINER, "Input data matches schema 'RiskLevelChange'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for RiskLevelChange failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'RiskLevelChange'", + e); + } + + if (match == 1) { + UserDataStreamEventsResponse ret = + new UserDataStreamEventsResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for" + + " UserDataStreamEventsResponse: %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 UserDataStreamEventsResponse() { + super("oneOf", Boolean.FALSE); + } + + public UserDataStreamEventsResponse(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AccountUpdate", AccountUpdate.class); + schemas.put("OrderTradeUpdate", OrderTradeUpdate.class); + schemas.put("RiskLevelChange", RiskLevelChange.class); + } + + @Override + public Map> getSchemas() { + return UserDataStreamEventsResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AccountUpdate, OrderTradeUpdate, RiskLevelChange + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AccountUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OrderTradeUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RiskLevelChange) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be AccountUpdate, OrderTradeUpdate, RiskLevelChange"); + } + + /** + * Get the actual instance, which can be the following: AccountUpdate, OrderTradeUpdate, + * RiskLevelChange + * + * @return The actual instance (AccountUpdate, OrderTradeUpdate, RiskLevelChange) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AccountUpdate`. If the actual instance is not `AccountUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AccountUpdate` + * @throws ClassCastException if the instance is not `AccountUpdate` + */ + public AccountUpdate getAccountUpdate() throws ClassCastException { + return (AccountUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `OrderTradeUpdate`. If the actual instance is not + * `OrderTradeUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `OrderTradeUpdate` + * @throws ClassCastException if the instance is not `OrderTradeUpdate` + */ + public OrderTradeUpdate getOrderTradeUpdate() throws ClassCastException { + return (OrderTradeUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `RiskLevelChange`. If the actual instance is not + * `RiskLevelChange`, the ClassCastException will be thrown. + * + * @return The actual instance of `RiskLevelChange` + * @throws ClassCastException if the instance is not `RiskLevelChange` + */ + public RiskLevelChange getRiskLevelChange() throws ClassCastException { + return (RiskLevelChange) 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 + * UserDataStreamEventsResponse + */ + 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 AccountUpdate + try { + AccountUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AccountUpdate failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OrderTradeUpdate + try { + OrderTradeUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for OrderTradeUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with RiskLevelChange + try { + RiskLevelChange.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for RiskLevelChange 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", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserDataStreamEventsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDataStreamEventsResponse + * @throws IOException if the JSON string is invalid with respect to + * UserDataStreamEventsResponse + */ + public static UserDataStreamEventsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDataStreamEventsResponse.class); + } + + /** + * Convert an instance of UserDataStreamEventsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md index abb9cc85..67d8f4d2 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 3.0.0 - 2025-07-16 + +### Added (1) + +- Support User Data Streams. + +### Changed (1) + +- Update `binance/common` module to version `1.4.0`. + ## 2.1.0 - 2025-07-08 - Update `binance/common` module to version `1.3.0`. diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/Risklevelchange.md b/clients/derivatives-trading-portfolio-margin-pro/docs/Risklevelchange.md new file mode 100644 index 00000000..7865b406 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/Risklevelchange.md @@ -0,0 +1,18 @@ + + +# Risklevelchange + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**uLowerCase** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**eq** | **String** | | [optional] | +|**ae** | **String** | | [optional] | +|**mLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/UserDataStreamEventsResponse.md new file mode 100644 index 00000000..fd03c661 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/UserDataStreamEventsResponse.md @@ -0,0 +1,18 @@ + + +# UserDataStreamEventsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**uLowerCase** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**eq** | **String** | | [optional] | +|**ae** | **String** | | [optional] | +|**mLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/example_websocket_stream.md b/clients/derivatives-trading-portfolio-margin-pro/example_websocket_stream.md new file mode 100644 index 00000000..e69de29b diff --git a/clients/derivatives-trading-portfolio-margin-pro/pom.xml b/clients/derivatives-trading-portfolio-margin-pro/pom.xml index 0836da9c..38b3cf96 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/pom.xml +++ b/clients/derivatives-trading-portfolio-margin-pro/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-portfolio-margin-pro derivatives-trading-portfolio-margin-pro - 2.1.0 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.3.0 + 1.4.0 \ No newline at end of file diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java index 9ff9b35e..5c5e566a 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java @@ -69,7 +69,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/2.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java index 9497b27d..eb703b45 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java @@ -45,7 +45,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/2.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/DerivativesTradingPortfolioMarginProWebSocketStreamsUtil.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/DerivativesTradingPortfolioMarginProWebSocketStreamsUtil.java new file mode 100644 index 00000000..806f5b39 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/DerivativesTradingPortfolioMarginProWebSocketStreamsUtil.java @@ -0,0 +1,18 @@ +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.websocket.stream; + +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; + +public class DerivativesTradingPortfolioMarginProWebSocketStreamsUtil { + private static final String BASE_URL = "wss://fstream.binance.com/pm-classic"; + private static final boolean HAS_TIME_UNIT = false; + + public static WebSocketClientConfiguration getClientConfiguration() { + WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); + if (!HAS_TIME_UNIT) { + clientConfiguration.setTimeUnit(null); + } + clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setAutoLogon(false); + return clientConfiguration; + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/JSON.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/JSON.java new file mode 100644 index 00000000..924cafbc --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/JSON.java @@ -0,0 +1,460 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro 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_portfolio_margin_pro.websocket.stream; + +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.websocket.service.DeserializeExclusionStrategy; +import com.binance.connector.client.common.websocket.service.SerializeExclusionStrategy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializer; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import okio.ByteString; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = + new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client + .derivatives_trading_portfolio_margin_pro.websocket.stream + .model.UserDataStreamEventsResponse.class, + new TypeSelector< + com.binance.connector.client + .derivatives_trading_portfolio_margin_pro.websocket + .stream.model.UserDataStreamEventsResponse>() { + @Override + public Class< + ? extends + com.binance.connector.client + .derivatives_trading_portfolio_margin_pro + .websocket.stream.model + .UserDataStreamEventsResponse> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "riskLevelChange", + com.binance.connector.client + .derivatives_trading_portfolio_margin_pro + .websocket.stream.model.Risklevelchange + .class); + classByDiscriminatorValue.put( + "risklevelchange", + com.binance.connector.client + .derivatives_trading_portfolio_margin_pro + .websocket.stream.model.Risklevelchange + .class); + classByDiscriminatorValue.put( + "UserDataStreamEventsResponse", + com.binance.connector.client + .derivatives_trading_portfolio_margin_pro + .websocket.stream.model + .UserDataStreamEventsResponse.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "e")); + } + }); + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue( + JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException( + "missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator + * value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator( + Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException( + "cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder + .registerTypeAdapter( + Double.class, + (JsonSerializer) + (src, typeOfSrc, context) -> { + DecimalFormat df = DecimalFormatter.getFormatter(); + return new JsonPrimitive(df.format(src)); + }) + .addSerializationExclusionStrategy(new SerializeExclusionStrategy()) + .addDeserializationExclusionStrategy(new DeserializeExclusionStrategy()); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.websocket + .stream.model.Risklevelchange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.websocket + .stream.model.UserDataStreamEventsResponse.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see + // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** Gson TypeAdapter for Byte Array type */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** Gson TypeAdapter for JSR310 OffsetDateTime type */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length() - 5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** Gson TypeAdapter for JSR310 LocalDate type */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" + * format will be used (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date( + ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be + * used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java new file mode 100644 index 00000000..c82277e6 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java @@ -0,0 +1,68 @@ +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.websocket.stream.api; + +import com.binance.connector.client.common.SystemUtil; +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_portfolio_margin_pro.websocket.stream.JSON; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.websocket.stream.model.UserDataStreamEventsResponse; +import com.google.gson.reflect.TypeToken; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +public class DerivativesTradingPortfolioMarginProWebSocketStreams { + private static final String USER_AGENT = + String.format( + "binance-derivatives-trading-portfolio-margin-pro/3.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + + private final StreamConnectionInterface connection; + + public DerivativesTradingPortfolioMarginProWebSocketStreams( + WebSocketClientConfiguration configuration) { + this( + configuration.getUsePool() + ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) + : new StreamConnectionWrapper(configuration, JSON.getGson())); + } + + public DerivativesTradingPortfolioMarginProWebSocketStreams( + StreamConnectionInterface connection) { + connection.setUserAgent(USER_AGENT); + if (!connection.isConnected()) { + connection.connect(); + } + this.connection = connection; + } + + /** + * Subscribes to the user data WebSocket stream using the provided listen key. + * + * @param listenKey - The listen key for the user data WebSocket stream. + * @return A WebSocket stream handler for the user data stream. + */ + public StreamBlockingQueueWrapper userData(String listenKey) { + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(listenKey)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + + TypeToken typeToken = new TypeToken<>() {}; + StreamBlockingQueue queue = queuesMap.get(listenKey); + return new StreamBlockingQueueWrapper<>(queue, typeToken, JSON.getGson()); + } + + public String getRequestID() { + return UUID.randomUUID().toString(); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/AbstractOpenApiSchema.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000..4bd1f09a --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/AbstractOpenApiSchema.java @@ -0,0 +1,145 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro 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_portfolio_margin_pro.websocket.stream.model; + +import java.util.Map; +import java.util.Objects; + +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + // @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/Risklevelchange.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/Risklevelchange.java new file mode 100644 index 00000000..1999011b --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/Risklevelchange.java @@ -0,0 +1,457 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro 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_portfolio_margin_pro.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.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.*; + +/** Risklevelchange */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Risklevelchange 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_U_LOWER_CASE = "u"; + + @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) + @jakarta.annotation.Nullable + private String uLowerCase; + + 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_EQ = "eq"; + + @SerializedName(SERIALIZED_NAME_EQ) + @jakarta.annotation.Nullable + private String eq; + + public static final String SERIALIZED_NAME_AE = "ae"; + + @SerializedName(SERIALIZED_NAME_AE) + @jakarta.annotation.Nullable + private String ae; + + public static final String SERIALIZED_NAME_M_LOWER_CASE = "m"; + + @SerializedName(SERIALIZED_NAME_M_LOWER_CASE) + @jakarta.annotation.Nullable + private String mLowerCase; + + public Risklevelchange() {} + + public Risklevelchange 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 Risklevelchange uLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; + return this; + } + + /** + * Get uLowerCase + * + * @return uLowerCase + */ + @jakarta.annotation.Nullable + public String getuLowerCase() { + return uLowerCase; + } + + public void setuLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; + } + + public Risklevelchange 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 Risklevelchange eq(@jakarta.annotation.Nullable String eq) { + this.eq = eq; + return this; + } + + /** + * Get eq + * + * @return eq + */ + @jakarta.annotation.Nullable + public String getEq() { + return eq; + } + + public void setEq(@jakarta.annotation.Nullable String eq) { + this.eq = eq; + } + + public Risklevelchange ae(@jakarta.annotation.Nullable String ae) { + this.ae = ae; + return this; + } + + /** + * Get ae + * + * @return ae + */ + @jakarta.annotation.Nullable + public String getAe() { + return ae; + } + + public void setAe(@jakarta.annotation.Nullable String ae) { + this.ae = ae; + } + + public Risklevelchange 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Risklevelchange risklevelchange = (Risklevelchange) o; + return Objects.equals(this.E, risklevelchange.E) + && Objects.equals(this.uLowerCase, risklevelchange.uLowerCase) + && Objects.equals(this.sLowerCase, risklevelchange.sLowerCase) + && Objects.equals(this.eq, risklevelchange.eq) + && Objects.equals(this.ae, risklevelchange.ae) + && Objects.equals(this.mLowerCase, risklevelchange.mLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, uLowerCase, sLowerCase, eq, ae, mLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Risklevelchange {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" eq: ").append(toIndentedString(eq)).append("\n"); + sb.append(" ae: ").append(toIndentedString(ae)).append("\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).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); + } + String uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + String uLowerCaseValueAsString = uLowerCaseValue.toString(); + valMap.put("uLowerCase", uLowerCaseValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + String eqValue = getEq(); + if (eqValue != null) { + String eqValueAsString = eqValue.toString(); + valMap.put("eq", eqValueAsString); + } + String aeValue = getAe(); + if (aeValue != null) { + String aeValueAsString = aeValue.toString(); + valMap.put("ae", aeValueAsString); + } + String mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + + 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 uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object eqValue = getEq(); + if (eqValue != null) { + valMap.put("eq", eqValue); + } + Object aeValue = getAe(); + if (aeValue != null) { + valMap.put("ae", aeValue); + } + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + + 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("u"); + openapiFields.add("s"); + openapiFields.add("eq"); + openapiFields.add("ae"); + openapiFields.add("m"); + + // 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 Risklevelchange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Risklevelchange.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Risklevelchange is not found in the" + + " empty JSON string", + Risklevelchange.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Risklevelchange.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Risklevelchange` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("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("eq") != null && !jsonObj.get("eq").isJsonNull()) + && !jsonObj.get("eq").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eq` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("eq").toString())); + } + if ((jsonObj.get("ae") != null && !jsonObj.get("ae").isJsonNull()) + && !jsonObj.get("ae").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ae` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ae").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Risklevelchange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Risklevelchange' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Risklevelchange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Risklevelchange value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Risklevelchange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Risklevelchange given an JSON string + * + * @param jsonString JSON string + * @return An instance of Risklevelchange + * @throws IOException if the JSON string is invalid with respect to Risklevelchange + */ + public static Risklevelchange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Risklevelchange.class); + } + + /** + * Convert an instance of Risklevelchange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/UserDataStreamEventsResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/UserDataStreamEventsResponse.java new file mode 100644 index 00000000..2ec0cb50 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/UserDataStreamEventsResponse.java @@ -0,0 +1,277 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro 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_portfolio_margin_pro.websocket.stream.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.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 UserDataStreamEventsResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(UserDataStreamEventsResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDataStreamEventsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDataStreamEventsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterRisklevelchange = + gson.getDelegateAdapter(this, TypeToken.get(Risklevelchange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDataStreamEventsResponse value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Risklevelchange` + if (value.getActualInstance() instanceof Risklevelchange) { + JsonElement element = + adapterRisklevelchange.toJsonTree( + (Risklevelchange) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " Risklevelchange"); + } + + @Override + public UserDataStreamEventsResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + UserDataStreamEventsResponse newUserDataStreamEventsResponse = + new UserDataStreamEventsResponse(); + if (jsonObject.get("e") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for" + + " UserDataStreamEventsResponse as `e` was not found" + + " in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `e` + switch (jsonObject.get("e").getAsString()) { + case "riskLevelChange": + deserialized = + adapterRisklevelchange.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "risklevelchange": + deserialized = + adapterRisklevelchange.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + default: + newUserDataStreamEventsResponse.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for UserDataStreamEventsResponse." + + " Possible values: riskLevelChange" + + " risklevelchange. Falling back to" + + " String.", + jsonObject.get("e").getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Risklevelchange + try { + // validate the JSON object to see if any exception is thrown + Risklevelchange.validateJsonElement(jsonElement); + actualAdapter = adapterRisklevelchange; + match++; + log.log(Level.FINER, "Input data matches schema 'Risklevelchange'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Risklevelchange failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Risklevelchange'", + e); + } + + if (match == 1) { + UserDataStreamEventsResponse ret = + new UserDataStreamEventsResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for" + + " UserDataStreamEventsResponse: %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 UserDataStreamEventsResponse() { + super("oneOf", Boolean.FALSE); + } + + public UserDataStreamEventsResponse(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Risklevelchange", Risklevelchange.class); + } + + @Override + public Map> getSchemas() { + return UserDataStreamEventsResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Risklevelchange + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Risklevelchange) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Risklevelchange"); + } + + /** + * Get the actual instance, which can be the following: Risklevelchange + * + * @return The actual instance (Risklevelchange) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Risklevelchange`. If the actual instance is not + * `Risklevelchange`, the ClassCastException will be thrown. + * + * @return The actual instance of `Risklevelchange` + * @throws ClassCastException if the instance is not `Risklevelchange` + */ + public Risklevelchange getRisklevelchange() throws ClassCastException { + return (Risklevelchange) 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 + * UserDataStreamEventsResponse + */ + 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 Risklevelchange + try { + Risklevelchange.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Risklevelchange 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: Risklevelchange. %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 UserDataStreamEventsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDataStreamEventsResponse + * @throws IOException if the JSON string is invalid with respect to + * UserDataStreamEventsResponse + */ + public static UserDataStreamEventsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDataStreamEventsResponse.class); + } + + /** + * Convert an instance of UserDataStreamEventsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md index 4fca29ad..b8d60c51 100644 --- a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 3.0.0 - 2025-07-16 + +### Added (1) + +- Support User Data Streams. + +### Changed (1) + +- Update `binance/common` module to version `1.4.0`. + ## 1.3.0 - 2025-07-08 - Update `binance/common` module to version `1.3.0`. diff --git a/clients/derivatives-trading-portfolio-margin/docs/AccountConfigUpdate.md b/clients/derivatives-trading-portfolio-margin/docs/AccountConfigUpdate.md new file mode 100644 index 00000000..a5d4fcbf --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/AccountConfigUpdate.md @@ -0,0 +1,16 @@ + + +# AccountConfigUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fs** | **String** | | [optional] | +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**ac** | [**AccountConfigUpdateAc**](AccountConfigUpdateAc.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/AccountConfigUpdateAc.md b/clients/derivatives-trading-portfolio-margin/docs/AccountConfigUpdateAc.md new file mode 100644 index 00000000..c1ad4a50 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/AccountConfigUpdateAc.md @@ -0,0 +1,14 @@ + + +# AccountConfigUpdateAc + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**lLowerCase** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/AccountUpdate.md b/clients/derivatives-trading-portfolio-margin/docs/AccountUpdate.md new file mode 100644 index 00000000..a45e10f1 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/AccountUpdate.md @@ -0,0 +1,17 @@ + + +# AccountUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fs** | **String** | | [optional] | +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**iLowerCase** | **String** | | [optional] | +|**aLowerCase** | [**AccountUpdateA**](AccountUpdateA.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/AccountUpdateA.md b/clients/derivatives-trading-portfolio-margin/docs/AccountUpdateA.md new file mode 100644 index 00000000..b3859d2e --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/AccountUpdateA.md @@ -0,0 +1,15 @@ + + +# AccountUpdateA + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mLowerCase** | **String** | | [optional] | +|**B** | [**List<AccountUpdateABInner>**](AccountUpdateABInner.md) | | [optional] | +|**P** | [**List<AccountUpdateAPInner>**](AccountUpdateAPInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/AccountUpdateABInner.md b/clients/derivatives-trading-portfolio-margin/docs/AccountUpdateABInner.md new file mode 100644 index 00000000..3380c37b --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/AccountUpdateABInner.md @@ -0,0 +1,16 @@ + + +# AccountUpdateABInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aLowerCase** | **String** | | [optional] | +|**wb** | **String** | | [optional] | +|**cw** | **String** | | [optional] | +|**bc** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/AccountUpdateAPInner.md b/clients/derivatives-trading-portfolio-margin/docs/AccountUpdateAPInner.md new file mode 100644 index 00000000..1d935553 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/AccountUpdateAPInner.md @@ -0,0 +1,19 @@ + + +# AccountUpdateAPInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**pa** | **String** | | [optional] | +|**ep** | **String** | | [optional] | +|**cr** | **String** | | [optional] | +|**up** | **String** | | [optional] | +|**ps** | **String** | | [optional] | +|**bep** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/Balanceupdate.md b/clients/derivatives-trading-portfolio-margin/docs/Balanceupdate.md new file mode 100644 index 00000000..f289de4a --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/Balanceupdate.md @@ -0,0 +1,17 @@ + + +# Balanceupdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**dLowerCase** | **String** | | [optional] | +|**U** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/ConditionalOrderTradeUpdate.md b/clients/derivatives-trading-portfolio-margin/docs/ConditionalOrderTradeUpdate.md new file mode 100644 index 00000000..008e2fbd --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/ConditionalOrderTradeUpdate.md @@ -0,0 +1,16 @@ + + +# ConditionalOrderTradeUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**T** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | +|**fs** | **String** | | [optional] | +|**so** | [**ConditionalOrderTradeUpdateSo**](ConditionalOrderTradeUpdateSo.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/ConditionalOrderTradeUpdateSo.md b/clients/derivatives-trading-portfolio-margin/docs/ConditionalOrderTradeUpdateSo.md new file mode 100644 index 00000000..4d06ef7d --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/ConditionalOrderTradeUpdateSo.md @@ -0,0 +1,33 @@ + + +# ConditionalOrderTradeUpdateSo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**si** | **Long** | | [optional] | +|**S** | **String** | | [optional] | +|**st** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**sp** | **String** | | [optional] | +|**os** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**ut** | **Long** | | [optional] | +|**R** | **Boolean** | | [optional] | +|**wt** | **String** | | [optional] | +|**ps** | **String** | | [optional] | +|**cp** | **Boolean** | | [optional] | +|**AP** | **String** | | [optional] | +|**cr** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**V** | **String** | | [optional] | +|**gtd** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md b/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md new file mode 100644 index 00000000..fbbdce5b --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md @@ -0,0 +1,54 @@ + + +# Executionreport + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**P** | **String** | | [optional] | +|**dLowerCase** | **Long** | | [optional] | +|**F** | **String** | | [optional] | +|**gLowerCase** | **Long** | | [optional] | +|**C** | **String** | | [optional] | +|**xLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**zLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**nLowerCase** | **String** | | [optional] | +|**N** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**vLowerCase** | **Long** | | [optional] | +|**I** | **Long** | | [optional] | +|**wLowerCase** | **Boolean** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | +|**M** | **Boolean** | | [optional] | +|**O** | **Long** | | [optional] | +|**Z** | **String** | | [optional] | +|**Y** | **String** | | [optional] | +|**Q** | **String** | | [optional] | +|**D** | **Long** | | [optional] | +|**jLowerCase** | **Long** | | [optional] | +|**J** | **Long** | | [optional] | +|**W** | **Long** | | [optional] | +|**V** | **String** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**U** | **Long** | | [optional] | +|**A** | **String** | | [optional] | +|**B** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/Liabilitychange.md b/clients/derivatives-trading-portfolio-margin/docs/Liabilitychange.md new file mode 100644 index 00000000..bc4bae39 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/Liabilitychange.md @@ -0,0 +1,19 @@ + + +# Liabilitychange + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**tLowerCase** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**iLowerCase** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/Listenkeyexpired.md b/clients/derivatives-trading-portfolio-margin/docs/Listenkeyexpired.md new file mode 100644 index 00000000..062121b8 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/Listenkeyexpired.md @@ -0,0 +1,13 @@ + + +# Listenkeyexpired + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/Openorderloss.md b/clients/derivatives-trading-portfolio-margin/docs/Openorderloss.md new file mode 100644 index 00000000..91268a07 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/Openorderloss.md @@ -0,0 +1,14 @@ + + +# Openorderloss + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**O** | [**List<OpenorderlossOInner>**](OpenorderlossOInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/OpenorderlossOInner.md b/clients/derivatives-trading-portfolio-margin/docs/OpenorderlossOInner.md new file mode 100644 index 00000000..7830b333 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/OpenorderlossOInner.md @@ -0,0 +1,14 @@ + + +# OpenorderlossOInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aLowerCase** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/OrderTradeUpdate.md b/clients/derivatives-trading-portfolio-margin/docs/OrderTradeUpdate.md new file mode 100644 index 00000000..3a8e1277 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/OrderTradeUpdate.md @@ -0,0 +1,17 @@ + + +# OrderTradeUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fs** | **String** | | [optional] | +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**iLowerCase** | **String** | | [optional] | +|**oLowerCase** | [**OrderTradeUpdateO**](OrderTradeUpdateO.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/OrderTradeUpdateO.md b/clients/derivatives-trading-portfolio-margin/docs/OrderTradeUpdateO.md new file mode 100644 index 00000000..2bcbabea --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/OrderTradeUpdateO.md @@ -0,0 +1,41 @@ + + +# 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] | +|**sp** | **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] | +|**ps** | **String** | | [optional] | +|**rp** | **String** | | [optional] | +|**st** | **String** | | [optional] | +|**si** | **Long** | | [optional] | +|**V** | **String** | | [optional] | +|**gtd** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/Outboundaccountposition.md b/clients/derivatives-trading-portfolio-margin/docs/Outboundaccountposition.md new file mode 100644 index 00000000..7faca90f --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/Outboundaccountposition.md @@ -0,0 +1,16 @@ + + +# Outboundaccountposition + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**U** | **Long** | | [optional] | +|**B** | [**List<OutboundaccountpositionBInner>**](OutboundaccountpositionBInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/OutboundaccountpositionBInner.md b/clients/derivatives-trading-portfolio-margin/docs/OutboundaccountpositionBInner.md new file mode 100644 index 00000000..3b50c015 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/OutboundaccountpositionBInner.md @@ -0,0 +1,15 @@ + + +# OutboundaccountpositionBInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aLowerCase** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/Risklevelchange.md b/clients/derivatives-trading-portfolio-margin/docs/Risklevelchange.md new file mode 100644 index 00000000..7865b406 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/Risklevelchange.md @@ -0,0 +1,18 @@ + + +# Risklevelchange + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**uLowerCase** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**eq** | **String** | | [optional] | +|**ae** | **String** | | [optional] | +|**mLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md b/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md index 72e57bda..093cf243 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md +++ b/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md @@ -800,7 +800,7 @@ No authorization required CM Account Trade List(USER_DATA) -Get trades for a specific account and CM symbol. * Either `symbol` or `pair` must be sent * `symbol` and `pair` cannot be sent together * `pair` and `fromId` cannot be sent together * `OrderId` can only be sent together with symbol * If a `pair` is sent, tickers for all symbols of the `pair` will be returned * The parameter `fromId` cannot be sent with `startTime` or `endTime` Weight: 20 with symbol, 40 with pair +Get trades for a specific account and CM symbol. * Either `symbol` or `pair` must be sent * `symbol` and `pair` cannot be sent together * `pair` and `fromId` cannot be sent together * `OrderId` can only be sent together with symbol * If a `pair` is sent, tickers for all symbols of the `pair` will be returned * The parameter `fromId` cannot be sent with `startTime` or `endTime` * If `startTime` and `endTime` are both not sent, then the last '24 hours' data will be returned. * The time between `startTime` and `endTime` cannot be longer than 24 hours. Weight: 20 with symbol, 40 with pair ### Example ```java @@ -3674,7 +3674,7 @@ No authorization required UM Account Trade List(USER_DATA) -Get trades for a specific account and UM symbol. * If `startTime` and `endTime` are both not sent, then the last '24 hours' data will be returned. * The time between `startTime` and `endTime` cannot be longer than 24 hours. * The parameter `fromId` cannot be sent with `startTime` or `endTime`. Weight: 5 +Get trades for a specific account and UM symbol. * If `startTime` and `endTime` are both not sent, then the last '7 days' data will be returned. * The time between `startTime` and `endTime` cannot be longer than 7 days. * The parameter `fromId` cannot be sent with `startTime` or `endTime`. Weight: 5 ### Example ```java diff --git a/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md new file mode 100644 index 00000000..3365f94f --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md @@ -0,0 +1,60 @@ + + +# UserDataStreamEventsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**T** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | +|**fs** | **String** | | [optional] | +|**so** | [**ConditionalOrderTradeUpdateSo**](ConditionalOrderTradeUpdateSo.md) | | [optional] | +|**ac** | [**AccountConfigUpdateAc**](AccountConfigUpdateAc.md) | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**uLowerCase** | **String** | | [optional] | +|**U** | **Long** | | [optional] | +|**B** | **String** | | [optional] | +|**dLowerCase** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**P** | **String** | | [optional] | +|**F** | **String** | | [optional] | +|**gLowerCase** | **Long** | | [optional] | +|**C** | **String** | | [optional] | +|**xLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**zLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**nLowerCase** | **String** | | [optional] | +|**N** | **String** | | [optional] | +|**vLowerCase** | **Long** | | [optional] | +|**I** | **Long** | | [optional] | +|**wLowerCase** | **Boolean** | | [optional] | +|**mLowerCase** | **String** | | [optional] | +|**M** | **Boolean** | | [optional] | +|**O** | [**List<OpenorderlossOInner>**](OpenorderlossOInner.md) | | [optional] | +|**Z** | **String** | | [optional] | +|**Y** | **String** | | [optional] | +|**Q** | **String** | | [optional] | +|**D** | **Long** | | [optional] | +|**jLowerCase** | **Long** | | [optional] | +|**J** | **Long** | | [optional] | +|**W** | **Long** | | [optional] | +|**V** | **String** | | [optional] | +|**A** | **String** | | [optional] | +|**eq** | **String** | | [optional] | +|**ae** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/example_rest.md b/clients/derivatives-trading-portfolio-margin/example_rest.md index f37b22c1..7c7a2103 100644 --- a/clients/derivatives-trading-portfolio-margin/example_rest.md +++ b/clients/derivatives-trading-portfolio-margin/example_rest.md @@ -112,7 +112,7 @@ [DELETE /papi/v1/um/order](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) - cancelUmOrder - [CancelUmOrderExample.java:48](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmOrderExample.java#L48) -[GET /papi/v1/cm/userTrades](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) - cmAccountTradeList - [CmAccountTradeListExample.java:53](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CmAccountTradeListExample.java#L53) +[GET /papi/v1/cm/userTrades](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) - cmAccountTradeList - [CmAccountTradeListExample.java:55](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CmAccountTradeListExample.java#L55) [GET /papi/v1/cm/adlQuantile](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation) - cmPositionAdlQuantileEstimation - [CmPositionAdlQuantileEstimationExample.java:55](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CmPositionAdlQuantileEstimationExample.java#L55) diff --git a/clients/derivatives-trading-portfolio-margin/example_websocket_stream.md b/clients/derivatives-trading-portfolio-margin/example_websocket_stream.md new file mode 100644 index 00000000..e69de29b diff --git a/clients/derivatives-trading-portfolio-margin/pom.xml b/clients/derivatives-trading-portfolio-margin/pom.xml index 64053b1f..031f7bc6 100644 --- a/clients/derivatives-trading-portfolio-margin/pom.xml +++ b/clients/derivatives-trading-portfolio-margin/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-portfolio-margin derivatives-trading-portfolio-margin - 1.3.0 + 2.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.3.0 + 1.4.0 \ No newline at end of file diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java index 940b4910..165ca020 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java @@ -94,7 +94,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/DerivativesTradingPortfolioMarginRestApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/DerivativesTradingPortfolioMarginRestApi.java index 788d4a5f..820e2eda 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/DerivativesTradingPortfolioMarginRestApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/DerivativesTradingPortfolioMarginRestApi.java @@ -1649,8 +1649,10 @@ public ApiResponse cancelUmOrder( * cannot be sent together * `pair` and `fromId` cannot be sent together * * `OrderId` can only be sent together with symbol * If a `pair` is sent, * tickers for all symbols of the `pair` will be returned * The parameter - * `fromId` cannot be sent with `startTime` or `endTime` Weight: - * 20 with symbol, 40 with pair + * `fromId` cannot be sent with `startTime` or `endTime` * If + * `startTime` and `endTime` are both not sent, then the last '24 + * hours' data will be returned. * The time between `startTime` and + * `endTime` cannot be longer than 24 hours. Weight: 20 with symbol, 40 with pair * * @param symbol (optional) * @param pair (optional) @@ -3009,9 +3011,9 @@ public ApiResponse toggleBnbBurnOnUmFutur /** * UM Account Trade List(USER_DATA) Get trades for a specific account and UM symbol. * If - * `startTime` and `endTime` are both not sent, then the last '24 - * hours' data will be returned. * The time between `startTime` and - * `endTime` cannot be longer than 24 hours. * The parameter `fromId` cannot + * `startTime` and `endTime` are both not sent, then the last '7 + * days' data will be returned. * The time between `startTime` and + * `endTime` cannot be longer than 7 days. * The parameter `fromId` cannot * be sent with `startTime` or `endTime`. Weight: 5 * * @param symbol (required) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java index 9363fc95..2fd088e8 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java @@ -40,7 +40,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java index 3ae391f9..115fcf83 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java @@ -112,7 +112,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -2137,8 +2137,10 @@ private okhttp3.Call cmAccountTradeListValidateBeforeCall( * cannot be sent together * `pair` and `fromId` cannot be sent together * * `OrderId` can only be sent together with symbol * If a `pair` is sent, * tickers for all symbols of the `pair` will be returned * The parameter - * `fromId` cannot be sent with `startTime` or `endTime` Weight: - * 20 with symbol, 40 with pair + * `fromId` cannot be sent with `startTime` or `endTime` * If + * `startTime` and `endTime` are both not sent, then the last '24 + * hours' data will be returned. * The time between `startTime` and + * `endTime` cannot be longer than 24 hours. Weight: 20 with symbol, 40 with pair * * @param symbol (optional) * @param pair (optional) @@ -9939,9 +9941,9 @@ private okhttp3.Call umAccountTradeListValidateBeforeCall( /** * UM Account Trade List(USER_DATA) Get trades for a specific account and UM symbol. * If - * `startTime` and `endTime` are both not sent, then the last '24 - * hours' data will be returned. * The time between `startTime` and - * `endTime` cannot be longer than 24 hours. * The parameter `fromId` cannot + * `startTime` and `endTime` are both not sent, then the last '7 + * days' data will be returned. * The time between `startTime` and + * `endTime` cannot be longer than 7 days. * The parameter `fromId` cannot * be sent with `startTime` or `endTime`. Weight: 5 * * @param symbol (required) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java index 21614e36..9ab7be00 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/1.3.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/DerivativesTradingPortfolioMarginWebSocketStreamsUtil.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/DerivativesTradingPortfolioMarginWebSocketStreamsUtil.java new file mode 100644 index 00000000..651c3591 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/DerivativesTradingPortfolioMarginWebSocketStreamsUtil.java @@ -0,0 +1,18 @@ +package com.binance.connector.client.derivatives_trading_portfolio_margin.websocket.stream; + +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; + +public class DerivativesTradingPortfolioMarginWebSocketStreamsUtil { + private static final String BASE_URL = "wss://fstream.binance.com/pm"; + private static final boolean HAS_TIME_UNIT = false; + + public static WebSocketClientConfiguration getClientConfiguration() { + WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); + if (!HAS_TIME_UNIT) { + clientConfiguration.setTimeUnit(null); + } + clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setAutoLogon(false); + return clientConfiguration; + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/JSON.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/JSON.java new file mode 100644 index 00000000..4bba0022 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/JSON.java @@ -0,0 +1,633 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream; + +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.websocket.service.DeserializeExclusionStrategy; +import com.binance.connector.client.common.websocket.service.SerializeExclusionStrategy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializer; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import okio.ByteString; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = + new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client.derivatives_trading_portfolio_margin + .websocket.stream.model.UserDataStreamEventsResponse.class, + new TypeSelector< + com.binance.connector.client + .derivatives_trading_portfolio_margin.websocket + .stream.model.UserDataStreamEventsResponse>() { + @Override + public Class< + ? extends + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model + .UserDataStreamEventsResponse> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "ACCOUNT_CONFIG_UPDATE", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.AccountConfigUpdate + .class); + classByDiscriminatorValue.put( + "ACCOUNT_UPDATE", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.AccountUpdate + .class); + classByDiscriminatorValue.put( + "CONDITIONAL_ORDER_TRADE_UPDATE", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model + .ConditionalOrderTradeUpdate.class); + classByDiscriminatorValue.put( + "ORDER_TRADE_UPDATE", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.OrderTradeUpdate + .class); + classByDiscriminatorValue.put( + "balanceUpdate", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Balanceupdate + .class); + classByDiscriminatorValue.put( + "executionReport", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Executionreport + .class); + classByDiscriminatorValue.put( + "liabilityChange", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Liabilitychange + .class); + classByDiscriminatorValue.put( + "listenKeyExpired", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Listenkeyexpired + .class); + classByDiscriminatorValue.put( + "openOrderLoss", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Openorderloss + .class); + classByDiscriminatorValue.put( + "outboundAccountPosition", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model + .Outboundaccountposition.class); + classByDiscriminatorValue.put( + "riskLevelChange", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Risklevelchange + .class); + classByDiscriminatorValue.put( + "accountConfigUpdate", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.AccountConfigUpdate + .class); + classByDiscriminatorValue.put( + "accountUpdate", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.AccountUpdate + .class); + classByDiscriminatorValue.put( + "balanceupdate", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Balanceupdate + .class); + classByDiscriminatorValue.put( + "conditionalOrderTradeUpdate", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model + .ConditionalOrderTradeUpdate.class); + classByDiscriminatorValue.put( + "executionreport", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Executionreport + .class); + classByDiscriminatorValue.put( + "liabilitychange", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Liabilitychange + .class); + classByDiscriminatorValue.put( + "listenkeyexpired", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Listenkeyexpired + .class); + classByDiscriminatorValue.put( + "openorderloss", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Openorderloss + .class); + classByDiscriminatorValue.put( + "orderTradeUpdate", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.OrderTradeUpdate + .class); + classByDiscriminatorValue.put( + "outboundaccountposition", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model + .Outboundaccountposition.class); + classByDiscriminatorValue.put( + "risklevelchange", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.Risklevelchange + .class); + classByDiscriminatorValue.put( + "UserDataStreamEventsResponse", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model + .UserDataStreamEventsResponse.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "e")); + } + }); + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue( + JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException( + "missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator + * value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator( + Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException( + "cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder + .registerTypeAdapter( + Double.class, + (JsonSerializer) + (src, typeOfSrc, context) -> { + DecimalFormat df = DecimalFormatter.getFormatter(); + return new JsonPrimitive(df.format(src)); + }) + .addSerializationExclusionStrategy(new SerializeExclusionStrategy()) + .addDeserializationExclusionStrategy(new DeserializeExclusionStrategy()); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.AccountConfigUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.AccountConfigUpdateAc.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.AccountUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.AccountUpdateA.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.AccountUpdateABInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.AccountUpdateAPInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.Balanceupdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.ConditionalOrderTradeUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.ConditionalOrderTradeUpdateSo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.Executionreport.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.Liabilitychange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.Listenkeyexpired.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.Openorderloss.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.OpenorderlossOInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.OrderTradeUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.OrderTradeUpdateO.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.Outboundaccountposition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.OutboundaccountpositionBInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.Risklevelchange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.UserDataStreamEventsResponse.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see + // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** Gson TypeAdapter for Byte Array type */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** Gson TypeAdapter for JSR310 OffsetDateTime type */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length() - 5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** Gson TypeAdapter for JSR310 LocalDate type */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" + * format will be used (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date( + ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be + * used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java new file mode 100644 index 00000000..5496ac51 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java @@ -0,0 +1,67 @@ +package com.binance.connector.client.derivatives_trading_portfolio_margin.websocket.stream.api; + +import com.binance.connector.client.common.SystemUtil; +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_portfolio_margin.websocket.stream.JSON; +import com.binance.connector.client.derivatives_trading_portfolio_margin.websocket.stream.model.UserDataStreamEventsResponse; +import com.google.gson.reflect.TypeToken; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +public class DerivativesTradingPortfolioMarginWebSocketStreams { + private static final String USER_AGENT = + String.format( + "binance-derivatives-trading-portfolio-margin/2.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + + private final StreamConnectionInterface connection; + + public DerivativesTradingPortfolioMarginWebSocketStreams( + WebSocketClientConfiguration configuration) { + this( + configuration.getUsePool() + ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) + : new StreamConnectionWrapper(configuration, JSON.getGson())); + } + + public DerivativesTradingPortfolioMarginWebSocketStreams(StreamConnectionInterface connection) { + connection.setUserAgent(USER_AGENT); + if (!connection.isConnected()) { + connection.connect(); + } + this.connection = connection; + } + + /** + * Subscribes to the user data WebSocket stream using the provided listen key. + * + * @param listenKey - The listen key for the user data WebSocket stream. + * @return A WebSocket stream handler for the user data stream. + */ + public StreamBlockingQueueWrapper userData(String listenKey) { + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(listenKey)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + + TypeToken typeToken = new TypeToken<>() {}; + StreamBlockingQueue queue = queuesMap.get(listenKey); + return new StreamBlockingQueueWrapper<>(queue, typeToken, JSON.getGson()); + } + + public String getRequestID() { + return UUID.randomUUID().toString(); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AbstractOpenApiSchema.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000..06e21565 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AbstractOpenApiSchema.java @@ -0,0 +1,145 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import java.util.Map; +import java.util.Objects; + +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + // @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountConfigUpdate.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountConfigUpdate.java new file mode 100644 index 00000000..73b8d3ad --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountConfigUpdate.java @@ -0,0 +1,357 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountConfigUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountConfigUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_FS = "fs"; + + @SerializedName(SERIALIZED_NAME_FS) + @jakarta.annotation.Nullable + private String fs; + + 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_AC = "ac"; + + @SerializedName(SERIALIZED_NAME_AC) + @jakarta.annotation.Nullable + private AccountConfigUpdateAc ac; + + public AccountConfigUpdate() {} + + public AccountConfigUpdate fs(@jakarta.annotation.Nullable String fs) { + this.fs = fs; + return this; + } + + /** + * Get fs + * + * @return fs + */ + @jakarta.annotation.Nullable + public String getFs() { + return fs; + } + + public void setFs(@jakarta.annotation.Nullable String fs) { + this.fs = fs; + } + + public AccountConfigUpdate 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 AccountConfigUpdate 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 AccountConfigUpdate ac(@jakarta.annotation.Nullable AccountConfigUpdateAc ac) { + this.ac = ac; + return this; + } + + /** + * Get ac + * + * @return ac + */ + @jakarta.annotation.Nullable + @Valid + public AccountConfigUpdateAc getAc() { + return ac; + } + + public void setAc(@jakarta.annotation.Nullable AccountConfigUpdateAc ac) { + this.ac = ac; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountConfigUpdate accountConfigUpdate = (AccountConfigUpdate) o; + return Objects.equals(this.fs, accountConfigUpdate.fs) + && Objects.equals(this.E, accountConfigUpdate.E) + && Objects.equals(this.T, accountConfigUpdate.T) + && Objects.equals(this.ac, accountConfigUpdate.ac); + } + + @Override + public int hashCode() { + return Objects.hash(fs, E, T, ac); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountConfigUpdate {\n"); + sb.append(" fs: ").append(toIndentedString(fs)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" ac: ").append(toIndentedString(ac)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String fsValue = getFs(); + if (fsValue != null) { + String fsValueAsString = fsValue.toString(); + valMap.put("fs", fsValueAsString); + } + 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); + } + AccountConfigUpdateAc acValue = getAc(); + if (acValue != null) { + String acValueAsString = JSON.getGson().toJson(acValue); + valMap.put("ac", acValueAsString); + } + + 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 fsValue = getFs(); + if (fsValue != null) { + valMap.put("fs", fsValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object acValue = getAc(); + if (acValue != null) { + valMap.put("ac", acValue); + } + + 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("fs"); + openapiFields.add("E"); + openapiFields.add("T"); + openapiFields.add("ac"); + + // 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 AccountConfigUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountConfigUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountConfigUpdate is not found in" + + " the empty JSON string", + AccountConfigUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountConfigUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountConfigUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("fs") != null && !jsonObj.get("fs").isJsonNull()) + && !jsonObj.get("fs").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fs` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fs").toString())); + } + // validate the optional field `ac` + if (jsonObj.get("ac") != null && !jsonObj.get("ac").isJsonNull()) { + AccountConfigUpdateAc.validateJsonElement(jsonObj.get("ac")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountConfigUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountConfigUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountConfigUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountConfigUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountConfigUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountConfigUpdate + * @throws IOException if the JSON string is invalid with respect to AccountConfigUpdate + */ + public static AccountConfigUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountConfigUpdate.class); + } + + /** + * Convert an instance of AccountConfigUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountConfigUpdateAc.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountConfigUpdateAc.java new file mode 100644 index 00000000..9df0dc22 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountConfigUpdateAc.java @@ -0,0 +1,277 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** AccountConfigUpdateAc */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountConfigUpdateAc 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_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private Long lLowerCase; + + public AccountConfigUpdateAc() {} + + public AccountConfigUpdateAc 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 AccountConfigUpdateAc lLowerCase(@jakarta.annotation.Nullable Long lLowerCase) { + this.lLowerCase = lLowerCase; + return this; + } + + /** + * Get lLowerCase + * + * @return lLowerCase + */ + @jakarta.annotation.Nullable + public Long getlLowerCase() { + return lLowerCase; + } + + public void setlLowerCase(@jakarta.annotation.Nullable Long lLowerCase) { + this.lLowerCase = lLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountConfigUpdateAc accountConfigUpdateAc = (AccountConfigUpdateAc) o; + return Objects.equals(this.sLowerCase, accountConfigUpdateAc.sLowerCase) + && Objects.equals(this.lLowerCase, accountConfigUpdateAc.lLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, lLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountConfigUpdateAc {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).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); + } + Long lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + + 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 lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + + 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("l"); + + // 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 AccountConfigUpdateAc + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountConfigUpdateAc.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountConfigUpdateAc is not found in" + + " the empty JSON string", + AccountConfigUpdateAc.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountConfigUpdateAc.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountConfigUpdateAc` 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountConfigUpdateAc.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountConfigUpdateAc' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdateAc.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountConfigUpdateAc value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountConfigUpdateAc read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountConfigUpdateAc given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountConfigUpdateAc + * @throws IOException if the JSON string is invalid with respect to AccountConfigUpdateAc + */ + public static AccountConfigUpdateAc fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountConfigUpdateAc.class); + } + + /** + * Convert an instance of AccountConfigUpdateAc to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdate.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdate.java new file mode 100644 index 00000000..6d14a2a4 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdate.java @@ -0,0 +1,401 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_FS = "fs"; + + @SerializedName(SERIALIZED_NAME_FS) + @jakarta.annotation.Nullable + private String fs; + + 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private String iLowerCase; + + public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private AccountUpdateA aLowerCase; + + public AccountUpdate() {} + + public AccountUpdate fs(@jakarta.annotation.Nullable String fs) { + this.fs = fs; + return this; + } + + /** + * Get fs + * + * @return fs + */ + @jakarta.annotation.Nullable + public String getFs() { + return fs; + } + + public void setFs(@jakarta.annotation.Nullable String fs) { + this.fs = fs; + } + + public AccountUpdate 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 AccountUpdate 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 AccountUpdate iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + return this; + } + + /** + * Get iLowerCase + * + * @return iLowerCase + */ + @jakarta.annotation.Nullable + public String getiLowerCase() { + return iLowerCase; + } + + public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + } + + public AccountUpdate aLowerCase(@jakarta.annotation.Nullable AccountUpdateA aLowerCase) { + this.aLowerCase = aLowerCase; + return this; + } + + /** + * Get aLowerCase + * + * @return aLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public AccountUpdateA getaLowerCase() { + return aLowerCase; + } + + public void setaLowerCase(@jakarta.annotation.Nullable AccountUpdateA aLowerCase) { + this.aLowerCase = aLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdate accountUpdate = (AccountUpdate) o; + return Objects.equals(this.fs, accountUpdate.fs) + && Objects.equals(this.E, accountUpdate.E) + && Objects.equals(this.T, accountUpdate.T) + && Objects.equals(this.iLowerCase, accountUpdate.iLowerCase) + && Objects.equals(this.aLowerCase, accountUpdate.aLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(fs, E, T, iLowerCase, aLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdate {\n"); + sb.append(" fs: ").append(toIndentedString(fs)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).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 fsValue = getFs(); + if (fsValue != null) { + String fsValueAsString = fsValue.toString(); + valMap.put("fs", fsValueAsString); + } + 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 iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + AccountUpdateA 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 fsValue = getFs(); + if (fsValue != null) { + valMap.put("fs", fsValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + 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("fs"); + openapiFields.add("E"); + openapiFields.add("T"); + openapiFields.add("i"); + 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 AccountUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdate.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())); + } + } + + 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())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("fs") != null && !jsonObj.get("fs").isJsonNull()) + && !jsonObj.get("fs").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fs` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fs").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())); + } + // validate the optional field `a` + if (jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) { + AccountUpdateA.validateJsonElement(jsonObj.get("a")); + } + } + + 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 + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdate 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 + */ + public static AccountUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdate.class); + } + + /** + * Convert an instance of AccountUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateA.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateA.java new file mode 100644 index 00000000..203b6a4a --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateA.java @@ -0,0 +1,373 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** AccountUpdateA */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdateA extends BaseDTO { + 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_B = "B"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private List<@Valid AccountUpdateABInner> B; + + public static final String SERIALIZED_NAME_P = "P"; + + @SerializedName(SERIALIZED_NAME_P) + @jakarta.annotation.Nullable + private List<@Valid AccountUpdateAPInner> P; + + public AccountUpdateA() {} + + public AccountUpdateA 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 AccountUpdateA B(@jakarta.annotation.Nullable List<@Valid AccountUpdateABInner> B) { + this.B = B; + return this; + } + + public AccountUpdateA addBItem(AccountUpdateABInner BItem) { + if (this.B == null) { + this.B = new ArrayList<>(); + } + this.B.add(BItem); + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid AccountUpdateABInner> getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable List<@Valid AccountUpdateABInner> B) { + this.B = B; + } + + public AccountUpdateA P(@jakarta.annotation.Nullable List<@Valid AccountUpdateAPInner> P) { + this.P = P; + return this; + } + + public AccountUpdateA addPItem(AccountUpdateAPInner PItem) { + if (this.P == null) { + this.P = new ArrayList<>(); + } + this.P.add(PItem); + return this; + } + + /** + * Get P + * + * @return P + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid AccountUpdateAPInner> getP() { + return P; + } + + public void setP(@jakarta.annotation.Nullable List<@Valid AccountUpdateAPInner> P) { + this.P = P; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdateA accountUpdateA = (AccountUpdateA) o; + return Objects.equals(this.mLowerCase, accountUpdateA.mLowerCase) + && Objects.equals(this.B, accountUpdateA.B) + && Objects.equals(this.P, accountUpdateA.P); + } + + @Override + public int hashCode() { + return Objects.hash(mLowerCase, B, P); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateA {\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).append("\n"); + sb.append(" P: ").append(toIndentedString(P)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + List<@Valid AccountUpdateABInner> BValue = getB(); + if (BValue != null) { + String BValueAsString = JSON.getGson().toJson(BValue); + valMap.put("B", BValueAsString); + } + List<@Valid AccountUpdateAPInner> PValue = getP(); + if (PValue != null) { + String PValueAsString = JSON.getGson().toJson(PValue); + valMap.put("P", PValueAsString); + } + + 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 mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); + } + Object PValue = getP(); + if (PValue != null) { + valMap.put("P", PValue); + } + + 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("m"); + openapiFields.add("B"); + 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 AccountUpdateA + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateA.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountUpdateA is not found in the" + + " empty JSON string", + AccountUpdateA.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountUpdateA.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateA` 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) { + // ensure the json data is an array + if (!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())); + } + + // validate the optional field `B` (array) + for (int i = 0; i < jsonArrayB.size(); i++) { + AccountUpdateABInner.validateJsonElement(jsonArrayB.get(i)); + } + ; + } + } + if (jsonObj.get("P") != null && !jsonObj.get("P").isJsonNull()) { + JsonArray jsonArrayP = jsonObj.getAsJsonArray("P"); + if (jsonArrayP != null) { + // ensure the json data is an array + if (!jsonObj.get("P").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `P` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("P").toString())); + } + + // validate the optional field `P` (array) + for (int i = 0; i < jsonArrayP.size(); i++) { + AccountUpdateAPInner.validateJsonElement(jsonArrayP.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountUpdateA.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdateA' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateA.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateA value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateA read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateA given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountUpdateA + * @throws IOException if the JSON string is invalid with respect to AccountUpdateA + */ + public static AccountUpdateA fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateA.class); + } + + /** + * Convert an instance of AccountUpdateA to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateABInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateABInner.java new file mode 100644 index 00000000..5cc33460 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateABInner.java @@ -0,0 +1,375 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** AccountUpdateABInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdateABInner 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_WB = "wb"; + + @SerializedName(SERIALIZED_NAME_WB) + @jakarta.annotation.Nullable + private String wb; + + public static final String SERIALIZED_NAME_CW = "cw"; + + @SerializedName(SERIALIZED_NAME_CW) + @jakarta.annotation.Nullable + private String cw; + + public static final String SERIALIZED_NAME_BC = "bc"; + + @SerializedName(SERIALIZED_NAME_BC) + @jakarta.annotation.Nullable + private String bc; + + public AccountUpdateABInner() {} + + public AccountUpdateABInner 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 AccountUpdateABInner wb(@jakarta.annotation.Nullable String wb) { + this.wb = wb; + return this; + } + + /** + * Get wb + * + * @return wb + */ + @jakarta.annotation.Nullable + public String getWb() { + return wb; + } + + public void setWb(@jakarta.annotation.Nullable String wb) { + this.wb = wb; + } + + public AccountUpdateABInner cw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + return this; + } + + /** + * Get cw + * + * @return cw + */ + @jakarta.annotation.Nullable + public String getCw() { + return cw; + } + + public void setCw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + } + + public AccountUpdateABInner 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; + } + AccountUpdateABInner accountUpdateABInner = (AccountUpdateABInner) o; + return Objects.equals(this.aLowerCase, accountUpdateABInner.aLowerCase) + && Objects.equals(this.wb, accountUpdateABInner.wb) + && Objects.equals(this.cw, accountUpdateABInner.cw) + && Objects.equals(this.bc, accountUpdateABInner.bc); + } + + @Override + public int hashCode() { + return Objects.hash(aLowerCase, wb, cw, bc); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateABInner {\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" wb: ").append(toIndentedString(wb)).append("\n"); + sb.append(" cw: ").append(toIndentedString(cw)).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 wbValue = getWb(); + if (wbValue != null) { + String wbValueAsString = wbValue.toString(); + valMap.put("wb", wbValueAsString); + } + String cwValue = getCw(); + if (cwValue != null) { + String cwValueAsString = cwValue.toString(); + valMap.put("cw", cwValueAsString); + } + 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 wbValue = getWb(); + if (wbValue != null) { + valMap.put("wb", wbValue); + } + Object cwValue = getCw(); + if (cwValue != null) { + valMap.put("cw", cwValue); + } + 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("wb"); + openapiFields.add("cw"); + 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 AccountUpdateABInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateABInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountUpdateABInner is not found in" + + " the empty JSON string", + AccountUpdateABInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountUpdateABInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateABInner` 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("wb") != null && !jsonObj.get("wb").isJsonNull()) + && !jsonObj.get("wb").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `wb` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("wb").toString())); + } + if ((jsonObj.get("cw") != null && !jsonObj.get("cw").isJsonNull()) + && !jsonObj.get("cw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cw").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 (!AccountUpdateABInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdateABInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateABInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateABInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateABInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateABInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountUpdateABInner + * @throws IOException if the JSON string is invalid with respect to AccountUpdateABInner + */ + public static AccountUpdateABInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateABInner.class); + } + + /** + * Convert an instance of AccountUpdateABInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateAPInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateAPInner.java new file mode 100644 index 00000000..fe229ca1 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AccountUpdateAPInner.java @@ -0,0 +1,510 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** AccountUpdateAPInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdateAPInner 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_PA = "pa"; + + @SerializedName(SERIALIZED_NAME_PA) + @jakarta.annotation.Nullable + private String pa; + + public static final String SERIALIZED_NAME_EP = "ep"; + + @SerializedName(SERIALIZED_NAME_EP) + @jakarta.annotation.Nullable + private String ep; + + public static final String SERIALIZED_NAME_CR = "cr"; + + @SerializedName(SERIALIZED_NAME_CR) + @jakarta.annotation.Nullable + private String cr; + + public static final String SERIALIZED_NAME_UP = "up"; + + @SerializedName(SERIALIZED_NAME_UP) + @jakarta.annotation.Nullable + private String up; + + public static final String SERIALIZED_NAME_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public static final String SERIALIZED_NAME_BEP = "bep"; + + @SerializedName(SERIALIZED_NAME_BEP) + @jakarta.annotation.Nullable + private String bep; + + public AccountUpdateAPInner() {} + + public AccountUpdateAPInner 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 AccountUpdateAPInner pa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + return this; + } + + /** + * Get pa + * + * @return pa + */ + @jakarta.annotation.Nullable + public String getPa() { + return pa; + } + + public void setPa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + } + + public AccountUpdateAPInner ep(@jakarta.annotation.Nullable String ep) { + this.ep = ep; + return this; + } + + /** + * Get ep + * + * @return ep + */ + @jakarta.annotation.Nullable + public String getEp() { + return ep; + } + + public void setEp(@jakarta.annotation.Nullable String ep) { + this.ep = ep; + } + + public AccountUpdateAPInner cr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + return this; + } + + /** + * Get cr + * + * @return cr + */ + @jakarta.annotation.Nullable + public String getCr() { + return cr; + } + + public void setCr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + } + + public AccountUpdateAPInner up(@jakarta.annotation.Nullable String up) { + this.up = up; + return this; + } + + /** + * Get up + * + * @return up + */ + @jakarta.annotation.Nullable + public String getUp() { + return up; + } + + public void setUp(@jakarta.annotation.Nullable String up) { + this.up = up; + } + + public AccountUpdateAPInner 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 AccountUpdateAPInner bep(@jakarta.annotation.Nullable String bep) { + this.bep = bep; + return this; + } + + /** + * Get bep + * + * @return bep + */ + @jakarta.annotation.Nullable + public String getBep() { + return bep; + } + + public void setBep(@jakarta.annotation.Nullable String bep) { + this.bep = bep; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdateAPInner accountUpdateAPInner = (AccountUpdateAPInner) o; + return Objects.equals(this.sLowerCase, accountUpdateAPInner.sLowerCase) + && Objects.equals(this.pa, accountUpdateAPInner.pa) + && Objects.equals(this.ep, accountUpdateAPInner.ep) + && Objects.equals(this.cr, accountUpdateAPInner.cr) + && Objects.equals(this.up, accountUpdateAPInner.up) + && Objects.equals(this.ps, accountUpdateAPInner.ps) + && Objects.equals(this.bep, accountUpdateAPInner.bep); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, pa, ep, cr, up, ps, bep); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateAPInner {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" pa: ").append(toIndentedString(pa)).append("\n"); + sb.append(" ep: ").append(toIndentedString(ep)).append("\n"); + sb.append(" cr: ").append(toIndentedString(cr)).append("\n"); + sb.append(" up: ").append(toIndentedString(up)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" bep: ").append(toIndentedString(bep)).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 paValue = getPa(); + if (paValue != null) { + String paValueAsString = paValue.toString(); + valMap.put("pa", paValueAsString); + } + String epValue = getEp(); + if (epValue != null) { + String epValueAsString = epValue.toString(); + valMap.put("ep", epValueAsString); + } + String crValue = getCr(); + if (crValue != null) { + String crValueAsString = crValue.toString(); + valMap.put("cr", crValueAsString); + } + String upValue = getUp(); + if (upValue != null) { + String upValueAsString = upValue.toString(); + valMap.put("up", upValueAsString); + } + String psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + String bepValue = getBep(); + if (bepValue != null) { + String bepValueAsString = bepValue.toString(); + valMap.put("bep", bepValueAsString); + } + + 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 paValue = getPa(); + if (paValue != null) { + valMap.put("pa", paValue); + } + Object epValue = getEp(); + if (epValue != null) { + valMap.put("ep", epValue); + } + Object crValue = getCr(); + if (crValue != null) { + valMap.put("cr", crValue); + } + Object upValue = getUp(); + if (upValue != null) { + valMap.put("up", upValue); + } + Object psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + Object bepValue = getBep(); + if (bepValue != null) { + valMap.put("bep", bepValue); + } + + 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("pa"); + openapiFields.add("ep"); + openapiFields.add("cr"); + openapiFields.add("up"); + openapiFields.add("ps"); + openapiFields.add("bep"); + + // 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 AccountUpdateAPInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateAPInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountUpdateAPInner is not found in" + + " the empty JSON string", + AccountUpdateAPInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountUpdateAPInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateAPInner` 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("pa") != null && !jsonObj.get("pa").isJsonNull()) + && !jsonObj.get("pa").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pa` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pa").toString())); + } + if ((jsonObj.get("ep") != null && !jsonObj.get("ep").isJsonNull()) + && !jsonObj.get("ep").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ep` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ep").toString())); + } + if ((jsonObj.get("cr") != null && !jsonObj.get("cr").isJsonNull()) + && !jsonObj.get("cr").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cr` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cr").toString())); + } + if ((jsonObj.get("up") != null && !jsonObj.get("up").isJsonNull()) + && !jsonObj.get("up").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `up` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("up").toString())); + } + if ((jsonObj.get("ps") != null && !jsonObj.get("ps").isJsonNull()) + && !jsonObj.get("ps").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ps` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ps").toString())); + } + if ((jsonObj.get("bep") != null && !jsonObj.get("bep").isJsonNull()) + && !jsonObj.get("bep").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bep` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("bep").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountUpdateAPInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdateAPInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateAPInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateAPInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateAPInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateAPInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountUpdateAPInner + * @throws IOException if the JSON string is invalid with respect to AccountUpdateAPInner + */ + public static AccountUpdateAPInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateAPInner.class); + } + + /** + * Convert an instance of AccountUpdateAPInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Balanceupdate.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Balanceupdate.java new file mode 100644 index 00000000..0bc984db --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Balanceupdate.java @@ -0,0 +1,395 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** Balanceupdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Balanceupdate 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_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_U = "U"; + + @SerializedName(SERIALIZED_NAME_U) + @jakarta.annotation.Nullable + private Long U; + + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public Balanceupdate() {} + + public Balanceupdate 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 Balanceupdate 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 Balanceupdate 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 Balanceupdate 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 Balanceupdate 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Balanceupdate balanceupdate = (Balanceupdate) o; + return Objects.equals(this.E, balanceupdate.E) + && Objects.equals(this.aLowerCase, balanceupdate.aLowerCase) + && Objects.equals(this.dLowerCase, balanceupdate.dLowerCase) + && Objects.equals(this.U, balanceupdate.U) + && Objects.equals(this.T, balanceupdate.T); + } + + @Override + public int hashCode() { + return Objects.hash(E, aLowerCase, dLowerCase, U, T); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Balanceupdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); + sb.append(" U: ").append(toIndentedString(U)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).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); + } + 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); + } + Long UValue = getU(); + if (UValue != null) { + String UValueAsString = UValue.toString(); + valMap.put("U", UValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + + 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 aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + valMap.put("dLowerCase", dLowerCaseValue); + } + Object UValue = getU(); + if (UValue != null) { + valMap.put("U", UValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + + 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("a"); + openapiFields.add("d"); + openapiFields.add("U"); + openapiFields.add("T"); + + // 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 Balanceupdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Balanceupdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Balanceupdate is not found in the" + + " empty JSON string", + Balanceupdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Balanceupdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Balanceupdate` 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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Balanceupdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Balanceupdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Balanceupdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Balanceupdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Balanceupdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Balanceupdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of Balanceupdate + * @throws IOException if the JSON string is invalid with respect to Balanceupdate + */ + public static Balanceupdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Balanceupdate.class); + } + + /** + * Convert an instance of Balanceupdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/ConditionalOrderTradeUpdate.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/ConditionalOrderTradeUpdate.java new file mode 100644 index 00000000..97b52588 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/ConditionalOrderTradeUpdate.java @@ -0,0 +1,360 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ConditionalOrderTradeUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ConditionalOrderTradeUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_FS = "fs"; + + @SerializedName(SERIALIZED_NAME_FS) + @jakarta.annotation.Nullable + private String fs; + + public static final String SERIALIZED_NAME_SO = "so"; + + @SerializedName(SERIALIZED_NAME_SO) + @jakarta.annotation.Nullable + private ConditionalOrderTradeUpdateSo so; + + public ConditionalOrderTradeUpdate() {} + + public ConditionalOrderTradeUpdate 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 ConditionalOrderTradeUpdate 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 ConditionalOrderTradeUpdate fs(@jakarta.annotation.Nullable String fs) { + this.fs = fs; + return this; + } + + /** + * Get fs + * + * @return fs + */ + @jakarta.annotation.Nullable + public String getFs() { + return fs; + } + + public void setFs(@jakarta.annotation.Nullable String fs) { + this.fs = fs; + } + + public ConditionalOrderTradeUpdate so( + @jakarta.annotation.Nullable ConditionalOrderTradeUpdateSo so) { + this.so = so; + return this; + } + + /** + * Get so + * + * @return so + */ + @jakarta.annotation.Nullable + @Valid + public ConditionalOrderTradeUpdateSo getSo() { + return so; + } + + public void setSo(@jakarta.annotation.Nullable ConditionalOrderTradeUpdateSo so) { + this.so = so; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConditionalOrderTradeUpdate conditionalOrderTradeUpdate = (ConditionalOrderTradeUpdate) o; + return Objects.equals(this.T, conditionalOrderTradeUpdate.T) + && Objects.equals(this.E, conditionalOrderTradeUpdate.E) + && Objects.equals(this.fs, conditionalOrderTradeUpdate.fs) + && Objects.equals(this.so, conditionalOrderTradeUpdate.so); + } + + @Override + public int hashCode() { + return Objects.hash(T, E, fs, so); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConditionalOrderTradeUpdate {\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" fs: ").append(toIndentedString(fs)).append("\n"); + sb.append(" so: ").append(toIndentedString(so)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + String fsValue = getFs(); + if (fsValue != null) { + String fsValueAsString = fsValue.toString(); + valMap.put("fs", fsValueAsString); + } + ConditionalOrderTradeUpdateSo soValue = getSo(); + if (soValue != null) { + String soValueAsString = JSON.getGson().toJson(soValue); + valMap.put("so", soValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object fsValue = getFs(); + if (fsValue != null) { + valMap.put("fs", fsValue); + } + Object soValue = getSo(); + if (soValue != null) { + valMap.put("so", soValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("T"); + openapiFields.add("E"); + openapiFields.add("fs"); + openapiFields.add("so"); + + // 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 + * ConditionalOrderTradeUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConditionalOrderTradeUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ConditionalOrderTradeUpdate is not" + + " found in the empty JSON string", + ConditionalOrderTradeUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConditionalOrderTradeUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConditionalOrderTradeUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("fs") != null && !jsonObj.get("fs").isJsonNull()) + && !jsonObj.get("fs").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fs` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fs").toString())); + } + // validate the optional field `so` + if (jsonObj.get("so") != null && !jsonObj.get("so").isJsonNull()) { + ConditionalOrderTradeUpdateSo.validateJsonElement(jsonObj.get("so")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConditionalOrderTradeUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConditionalOrderTradeUpdate' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ConditionalOrderTradeUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ConditionalOrderTradeUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConditionalOrderTradeUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ConditionalOrderTradeUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConditionalOrderTradeUpdate + * @throws IOException if the JSON string is invalid with respect to ConditionalOrderTradeUpdate + */ + public static ConditionalOrderTradeUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConditionalOrderTradeUpdate.class); + } + + /** + * Convert an instance of ConditionalOrderTradeUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/ConditionalOrderTradeUpdateSo.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/ConditionalOrderTradeUpdateSo.java new file mode 100644 index 00000000..69aae000 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/ConditionalOrderTradeUpdateSo.java @@ -0,0 +1,1116 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** ConditionalOrderTradeUpdateSo */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ConditionalOrderTradeUpdateSo 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_SI = "si"; + + @SerializedName(SERIALIZED_NAME_SI) + @jakarta.annotation.Nullable + private Long si; + + public static final String SERIALIZED_NAME_S = "S"; + + @SerializedName(SERIALIZED_NAME_S) + @jakarta.annotation.Nullable + private String S; + + public static final String SERIALIZED_NAME_ST = "st"; + + @SerializedName(SERIALIZED_NAME_ST) + @jakarta.annotation.Nullable + private String st; + + 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_SP = "sp"; + + @SerializedName(SERIALIZED_NAME_SP) + @jakarta.annotation.Nullable + private String sp; + + public static final String SERIALIZED_NAME_OS = "os"; + + @SerializedName(SERIALIZED_NAME_OS) + @jakarta.annotation.Nullable + private String os; + + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_UT = "ut"; + + @SerializedName(SERIALIZED_NAME_UT) + @jakarta.annotation.Nullable + private Long ut; + + public static final String SERIALIZED_NAME_R = "R"; + + @SerializedName(SERIALIZED_NAME_R) + @jakarta.annotation.Nullable + private Boolean R; + + public static final String SERIALIZED_NAME_WT = "wt"; + + @SerializedName(SERIALIZED_NAME_WT) + @jakarta.annotation.Nullable + private String wt; + + public static final String SERIALIZED_NAME_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public static final String SERIALIZED_NAME_CP = "cp"; + + @SerializedName(SERIALIZED_NAME_CP) + @jakarta.annotation.Nullable + private Boolean cp; + + public static final String SERIALIZED_NAME_A_P = "AP"; + + @SerializedName(SERIALIZED_NAME_A_P) + @jakarta.annotation.Nullable + private String AP; + + public static final String SERIALIZED_NAME_CR = "cr"; + + @SerializedName(SERIALIZED_NAME_CR) + @jakarta.annotation.Nullable + private String cr; + + 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_V = "V"; + + @SerializedName(SERIALIZED_NAME_V) + @jakarta.annotation.Nullable + private String V; + + public static final String SERIALIZED_NAME_GTD = "gtd"; + + @SerializedName(SERIALIZED_NAME_GTD) + @jakarta.annotation.Nullable + private Long gtd; + + public ConditionalOrderTradeUpdateSo() {} + + public ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo si(@jakarta.annotation.Nullable Long si) { + this.si = si; + return this; + } + + /** + * Get si + * + * @return si + */ + @jakarta.annotation.Nullable + public Long getSi() { + return si; + } + + public void setSi(@jakarta.annotation.Nullable Long si) { + this.si = si; + } + + public ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo st(@jakarta.annotation.Nullable String st) { + this.st = st; + return this; + } + + /** + * Get st + * + * @return st + */ + @jakarta.annotation.Nullable + public String getSt() { + return st; + } + + public void setSt(@jakarta.annotation.Nullable String st) { + this.st = st; + } + + public ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo sp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; + return this; + } + + /** + * Get sp + * + * @return sp + */ + @jakarta.annotation.Nullable + public String getSp() { + return sp; + } + + public void setSp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; + } + + public ConditionalOrderTradeUpdateSo os(@jakarta.annotation.Nullable String os) { + this.os = os; + return this; + } + + /** + * Get os + * + * @return os + */ + @jakarta.annotation.Nullable + public String getOs() { + return os; + } + + public void setOs(@jakarta.annotation.Nullable String os) { + this.os = os; + } + + public ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo ut(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + return this; + } + + /** + * Get ut + * + * @return ut + */ + @jakarta.annotation.Nullable + public Long getUt() { + return ut; + } + + public void setUt(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + } + + public ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo wt(@jakarta.annotation.Nullable String wt) { + this.wt = wt; + return this; + } + + /** + * Get wt + * + * @return wt + */ + @jakarta.annotation.Nullable + public String getWt() { + return wt; + } + + public void setWt(@jakarta.annotation.Nullable String wt) { + this.wt = wt; + } + + public ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo cp(@jakarta.annotation.Nullable Boolean cp) { + this.cp = cp; + return this; + } + + /** + * Get cp + * + * @return cp + */ + @jakarta.annotation.Nullable + public Boolean getCp() { + return cp; + } + + public void setCp(@jakarta.annotation.Nullable Boolean cp) { + this.cp = cp; + } + + public ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo cr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + return this; + } + + /** + * Get cr + * + * @return cr + */ + @jakarta.annotation.Nullable + public String getCr() { + return cr; + } + + public void setCr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + } + + public ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo 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 ConditionalOrderTradeUpdateSo gtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + return this; + } + + /** + * Get gtd + * + * @return gtd + */ + @jakarta.annotation.Nullable + public Long getGtd() { + return gtd; + } + + public void setGtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConditionalOrderTradeUpdateSo conditionalOrderTradeUpdateSo = + (ConditionalOrderTradeUpdateSo) o; + return Objects.equals(this.sLowerCase, conditionalOrderTradeUpdateSo.sLowerCase) + && Objects.equals(this.cLowerCase, conditionalOrderTradeUpdateSo.cLowerCase) + && Objects.equals(this.si, conditionalOrderTradeUpdateSo.si) + && Objects.equals(this.S, conditionalOrderTradeUpdateSo.S) + && Objects.equals(this.st, conditionalOrderTradeUpdateSo.st) + && Objects.equals(this.fLowerCase, conditionalOrderTradeUpdateSo.fLowerCase) + && Objects.equals(this.qLowerCase, conditionalOrderTradeUpdateSo.qLowerCase) + && Objects.equals(this.pLowerCase, conditionalOrderTradeUpdateSo.pLowerCase) + && Objects.equals(this.sp, conditionalOrderTradeUpdateSo.sp) + && Objects.equals(this.os, conditionalOrderTradeUpdateSo.os) + && Objects.equals(this.T, conditionalOrderTradeUpdateSo.T) + && Objects.equals(this.ut, conditionalOrderTradeUpdateSo.ut) + && Objects.equals(this.R, conditionalOrderTradeUpdateSo.R) + && Objects.equals(this.wt, conditionalOrderTradeUpdateSo.wt) + && Objects.equals(this.ps, conditionalOrderTradeUpdateSo.ps) + && Objects.equals(this.cp, conditionalOrderTradeUpdateSo.cp) + && Objects.equals(this.AP, conditionalOrderTradeUpdateSo.AP) + && Objects.equals(this.cr, conditionalOrderTradeUpdateSo.cr) + && Objects.equals(this.iLowerCase, conditionalOrderTradeUpdateSo.iLowerCase) + && Objects.equals(this.V, conditionalOrderTradeUpdateSo.V) + && Objects.equals(this.gtd, conditionalOrderTradeUpdateSo.gtd); + } + + @Override + public int hashCode() { + return Objects.hash( + sLowerCase, + cLowerCase, + si, + S, + st, + fLowerCase, + qLowerCase, + pLowerCase, + sp, + os, + T, + ut, + R, + wt, + ps, + cp, + AP, + cr, + iLowerCase, + V, + gtd); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConditionalOrderTradeUpdateSo {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); + sb.append(" si: ").append(toIndentedString(si)).append("\n"); + sb.append(" S: ").append(toIndentedString(S)).append("\n"); + sb.append(" st: ").append(toIndentedString(st)).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(" sp: ").append(toIndentedString(sp)).append("\n"); + sb.append(" os: ").append(toIndentedString(os)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" ut: ").append(toIndentedString(ut)).append("\n"); + sb.append(" R: ").append(toIndentedString(R)).append("\n"); + sb.append(" wt: ").append(toIndentedString(wt)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" cp: ").append(toIndentedString(cp)).append("\n"); + sb.append(" AP: ").append(toIndentedString(AP)).append("\n"); + sb.append(" cr: ").append(toIndentedString(cr)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); + sb.append(" gtd: ").append(toIndentedString(gtd)).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); + } + Long siValue = getSi(); + if (siValue != null) { + String siValueAsString = siValue.toString(); + valMap.put("si", siValueAsString); + } + String SValue = getS(); + if (SValue != null) { + String SValueAsString = SValue.toString(); + valMap.put("S", SValueAsString); + } + String stValue = getSt(); + if (stValue != null) { + String stValueAsString = stValue.toString(); + valMap.put("st", stValueAsString); + } + 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 spValue = getSp(); + if (spValue != null) { + String spValueAsString = spValue.toString(); + valMap.put("sp", spValueAsString); + } + String osValue = getOs(); + if (osValue != null) { + String osValueAsString = osValue.toString(); + valMap.put("os", osValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + Long utValue = getUt(); + if (utValue != null) { + String utValueAsString = utValue.toString(); + valMap.put("ut", utValueAsString); + } + Boolean RValue = getR(); + if (RValue != null) { + String RValueAsString = RValue.toString(); + valMap.put("R", RValueAsString); + } + String wtValue = getWt(); + if (wtValue != null) { + String wtValueAsString = wtValue.toString(); + valMap.put("wt", wtValueAsString); + } + String psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + Boolean cpValue = getCp(); + if (cpValue != null) { + String cpValueAsString = cpValue.toString(); + valMap.put("cp", cpValueAsString); + } + String APValue = getAP(); + if (APValue != null) { + String APValueAsString = APValue.toString(); + valMap.put("AP", APValueAsString); + } + String crValue = getCr(); + if (crValue != null) { + String crValueAsString = crValue.toString(); + valMap.put("cr", crValueAsString); + } + Long iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } + Long gtdValue = getGtd(); + if (gtdValue != null) { + String gtdValueAsString = gtdValue.toString(); + valMap.put("gtd", gtdValueAsString); + } + + 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 siValue = getSi(); + if (siValue != null) { + valMap.put("si", siValue); + } + Object SValue = getS(); + if (SValue != null) { + valMap.put("S", SValue); + } + Object stValue = getSt(); + if (stValue != null) { + valMap.put("st", stValue); + } + 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 spValue = getSp(); + if (spValue != null) { + valMap.put("sp", spValue); + } + Object osValue = getOs(); + if (osValue != null) { + valMap.put("os", osValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object utValue = getUt(); + if (utValue != null) { + valMap.put("ut", utValue); + } + Object RValue = getR(); + if (RValue != null) { + valMap.put("R", RValue); + } + Object wtValue = getWt(); + if (wtValue != null) { + valMap.put("wt", wtValue); + } + Object psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + Object cpValue = getCp(); + if (cpValue != null) { + valMap.put("cp", cpValue); + } + Object APValue = getAP(); + if (APValue != null) { + valMap.put("AP", APValue); + } + Object crValue = getCr(); + if (crValue != null) { + valMap.put("cr", crValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } + Object gtdValue = getGtd(); + if (gtdValue != null) { + valMap.put("gtd", gtdValue); + } + + 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("si"); + openapiFields.add("S"); + openapiFields.add("st"); + openapiFields.add("f"); + openapiFields.add("q"); + openapiFields.add("p"); + openapiFields.add("sp"); + openapiFields.add("os"); + openapiFields.add("T"); + openapiFields.add("ut"); + openapiFields.add("R"); + openapiFields.add("wt"); + openapiFields.add("ps"); + openapiFields.add("cp"); + openapiFields.add("AP"); + openapiFields.add("cr"); + openapiFields.add("i"); + openapiFields.add("V"); + openapiFields.add("gtd"); + + // 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 + * ConditionalOrderTradeUpdateSo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConditionalOrderTradeUpdateSo.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ConditionalOrderTradeUpdateSo is not" + + " found in the empty JSON string", + ConditionalOrderTradeUpdateSo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConditionalOrderTradeUpdateSo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConditionalOrderTradeUpdateSo` 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("st") != null && !jsonObj.get("st").isJsonNull()) + && !jsonObj.get("st").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `st` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("st").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("sp") != null && !jsonObj.get("sp").isJsonNull()) + && !jsonObj.get("sp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sp` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("sp").toString())); + } + if ((jsonObj.get("os") != null && !jsonObj.get("os").isJsonNull()) + && !jsonObj.get("os").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `os` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("os").toString())); + } + if ((jsonObj.get("wt") != null && !jsonObj.get("wt").isJsonNull()) + && !jsonObj.get("wt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `wt` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("wt").toString())); + } + if ((jsonObj.get("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("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("cr") != null && !jsonObj.get("cr").isJsonNull()) + && !jsonObj.get("cr").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cr` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cr").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 { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConditionalOrderTradeUpdateSo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConditionalOrderTradeUpdateSo' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ConditionalOrderTradeUpdateSo.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ConditionalOrderTradeUpdateSo value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConditionalOrderTradeUpdateSo read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ConditionalOrderTradeUpdateSo given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConditionalOrderTradeUpdateSo + * @throws IOException if the JSON string is invalid with respect to + * ConditionalOrderTradeUpdateSo + */ + public static ConditionalOrderTradeUpdateSo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConditionalOrderTradeUpdateSo.class); + } + + /** + * Convert an instance of ConditionalOrderTradeUpdateSo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java new file mode 100644 index 00000000..7491de85 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java @@ -0,0 +1,1983 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** Executionreport */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Executionreport 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_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_P = "P"; + + @SerializedName(SERIALIZED_NAME_P) + @jakarta.annotation.Nullable + private String P; + + public static final String SERIALIZED_NAME_D_LOWER_CASE = "d"; + + @SerializedName(SERIALIZED_NAME_D_LOWER_CASE) + @jakarta.annotation.Nullable + private Long dLowerCase; + + public static final String SERIALIZED_NAME_F = "F"; + + @SerializedName(SERIALIZED_NAME_F) + @jakarta.annotation.Nullable + private String F; + + public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; + + @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) + @jakarta.annotation.Nullable + private Long gLowerCase; + + public static final String SERIALIZED_NAME_C = "C"; + + @SerializedName(SERIALIZED_NAME_C) + @jakarta.annotation.Nullable + private String C; + + 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_R_LOWER_CASE = "r"; + + @SerializedName(SERIALIZED_NAME_R_LOWER_CASE) + @jakarta.annotation.Nullable + private String rLowerCase; + + 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_LOWER_CASE = "n"; + + @SerializedName(SERIALIZED_NAME_N_LOWER_CASE) + @jakarta.annotation.Nullable + private String nLowerCase; + + public static final String SERIALIZED_NAME_N = "N"; + + @SerializedName(SERIALIZED_NAME_N) + @jakarta.annotation.Nullable + private String N; + + 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_V_LOWER_CASE = "v"; + + @SerializedName(SERIALIZED_NAME_V_LOWER_CASE) + @jakarta.annotation.Nullable + private Long vLowerCase; + + public static final String SERIALIZED_NAME_I = "I"; + + @SerializedName(SERIALIZED_NAME_I) + @jakarta.annotation.Nullable + private Long I; + + public static final String SERIALIZED_NAME_W_LOWER_CASE = "w"; + + @SerializedName(SERIALIZED_NAME_W_LOWER_CASE) + @jakarta.annotation.Nullable + private Boolean wLowerCase; + + 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_M = "M"; + + @SerializedName(SERIALIZED_NAME_M) + @jakarta.annotation.Nullable + private Boolean M; + + public static final String SERIALIZED_NAME_O = "O"; + + @SerializedName(SERIALIZED_NAME_O) + @jakarta.annotation.Nullable + private Long O; + + public static final String SERIALIZED_NAME_Z = "Z"; + + @SerializedName(SERIALIZED_NAME_Z) + @jakarta.annotation.Nullable + private String Z; + + public static final String SERIALIZED_NAME_Y = "Y"; + + @SerializedName(SERIALIZED_NAME_Y) + @jakarta.annotation.Nullable + private String Y; + + public static final String SERIALIZED_NAME_Q = "Q"; + + @SerializedName(SERIALIZED_NAME_Q) + @jakarta.annotation.Nullable + private String Q; + + public static final String SERIALIZED_NAME_D = "D"; + + @SerializedName(SERIALIZED_NAME_D) + @jakarta.annotation.Nullable + private Long D; + + public static final String SERIALIZED_NAME_J_LOWER_CASE = "j"; + + @SerializedName(SERIALIZED_NAME_J_LOWER_CASE) + @jakarta.annotation.Nullable + private Long jLowerCase; + + public static final String SERIALIZED_NAME_J = "J"; + + @SerializedName(SERIALIZED_NAME_J) + @jakarta.annotation.Nullable + private Long J; + + public static final String SERIALIZED_NAME_W = "W"; + + @SerializedName(SERIALIZED_NAME_W) + @jakarta.annotation.Nullable + private Long W; + + public static final String SERIALIZED_NAME_V = "V"; + + @SerializedName(SERIALIZED_NAME_V) + @jakarta.annotation.Nullable + private String V; + + 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_U = "U"; + + @SerializedName(SERIALIZED_NAME_U) + @jakarta.annotation.Nullable + private Long U; + + public static final String SERIALIZED_NAME_A = "A"; + + @SerializedName(SERIALIZED_NAME_A) + @jakarta.annotation.Nullable + private String A; + + public static final String SERIALIZED_NAME_B = "B"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private String B; + + public Executionreport() {} + + public Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport dLowerCase(@jakarta.annotation.Nullable Long dLowerCase) { + this.dLowerCase = dLowerCase; + return this; + } + + /** + * Get dLowerCase + * + * @return dLowerCase + */ + @jakarta.annotation.Nullable + public Long getdLowerCase() { + return dLowerCase; + } + + public void setdLowerCase(@jakarta.annotation.Nullable Long dLowerCase) { + this.dLowerCase = dLowerCase; + } + + public Executionreport 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 Executionreport gLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + return this; + } + + /** + * Get gLowerCase + * + * @return gLowerCase + */ + @jakarta.annotation.Nullable + public Long getgLowerCase() { + return gLowerCase; + } + + public void setgLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + } + + public Executionreport C(@jakarta.annotation.Nullable String C) { + this.C = C; + return this; + } + + /** + * Get C + * + * @return C + */ + @jakarta.annotation.Nullable + public String getC() { + return C; + } + + public void setC(@jakarta.annotation.Nullable String C) { + this.C = C; + } + + public Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport vLowerCase(@jakarta.annotation.Nullable Long vLowerCase) { + this.vLowerCase = vLowerCase; + return this; + } + + /** + * Get vLowerCase + * + * @return vLowerCase + */ + @jakarta.annotation.Nullable + public Long getvLowerCase() { + return vLowerCase; + } + + public void setvLowerCase(@jakarta.annotation.Nullable Long vLowerCase) { + this.vLowerCase = vLowerCase; + } + + public Executionreport I(@jakarta.annotation.Nullable Long I) { + this.I = I; + return this; + } + + /** + * Get I + * + * @return I + */ + @jakarta.annotation.Nullable + public Long getI() { + return I; + } + + public void setI(@jakarta.annotation.Nullable Long I) { + this.I = I; + } + + public Executionreport wLowerCase(@jakarta.annotation.Nullable Boolean wLowerCase) { + this.wLowerCase = wLowerCase; + return this; + } + + /** + * Get wLowerCase + * + * @return wLowerCase + */ + @jakarta.annotation.Nullable + public Boolean getwLowerCase() { + return wLowerCase; + } + + public void setwLowerCase(@jakarta.annotation.Nullable Boolean wLowerCase) { + this.wLowerCase = wLowerCase; + } + + public Executionreport 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 Executionreport M(@jakarta.annotation.Nullable Boolean M) { + this.M = M; + return this; + } + + /** + * Get M + * + * @return M + */ + @jakarta.annotation.Nullable + public Boolean getM() { + return M; + } + + public void setM(@jakarta.annotation.Nullable Boolean M) { + this.M = M; + } + + public Executionreport O(@jakarta.annotation.Nullable Long O) { + this.O = O; + return this; + } + + /** + * Get O + * + * @return O + */ + @jakarta.annotation.Nullable + public Long getO() { + return O; + } + + public void setO(@jakarta.annotation.Nullable Long O) { + this.O = O; + } + + public Executionreport Z(@jakarta.annotation.Nullable String Z) { + this.Z = Z; + return this; + } + + /** + * Get Z + * + * @return Z + */ + @jakarta.annotation.Nullable + public String getZ() { + return Z; + } + + public void setZ(@jakarta.annotation.Nullable String Z) { + this.Z = Z; + } + + public Executionreport Y(@jakarta.annotation.Nullable String Y) { + this.Y = Y; + return this; + } + + /** + * Get Y + * + * @return Y + */ + @jakarta.annotation.Nullable + public String getY() { + return Y; + } + + public void setY(@jakarta.annotation.Nullable String Y) { + this.Y = Y; + } + + public Executionreport 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 Executionreport D(@jakarta.annotation.Nullable Long D) { + this.D = D; + return this; + } + + /** + * Get D + * + * @return D + */ + @jakarta.annotation.Nullable + public Long getD() { + return D; + } + + public void setD(@jakarta.annotation.Nullable Long D) { + this.D = D; + } + + public Executionreport jLowerCase(@jakarta.annotation.Nullable Long jLowerCase) { + this.jLowerCase = jLowerCase; + return this; + } + + /** + * Get jLowerCase + * + * @return jLowerCase + */ + @jakarta.annotation.Nullable + public Long getjLowerCase() { + return jLowerCase; + } + + public void setjLowerCase(@jakarta.annotation.Nullable Long jLowerCase) { + this.jLowerCase = jLowerCase; + } + + public Executionreport J(@jakarta.annotation.Nullable Long J) { + this.J = J; + return this; + } + + /** + * Get J + * + * @return J + */ + @jakarta.annotation.Nullable + public Long getJ() { + return J; + } + + public void setJ(@jakarta.annotation.Nullable Long J) { + this.J = J; + } + + public Executionreport W(@jakarta.annotation.Nullable Long W) { + this.W = W; + return this; + } + + /** + * Get W + * + * @return W + */ + @jakarta.annotation.Nullable + public Long getW() { + return W; + } + + public void setW(@jakarta.annotation.Nullable Long W) { + this.W = W; + } + + public Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport B(@jakarta.annotation.Nullable String B) { + this.B = B; + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + public String getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable String B) { + this.B = B; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Executionreport executionreport = (Executionreport) o; + return Objects.equals(this.E, executionreport.E) + && Objects.equals(this.sLowerCase, executionreport.sLowerCase) + && Objects.equals(this.cLowerCase, executionreport.cLowerCase) + && Objects.equals(this.S, executionreport.S) + && Objects.equals(this.oLowerCase, executionreport.oLowerCase) + && Objects.equals(this.fLowerCase, executionreport.fLowerCase) + && Objects.equals(this.qLowerCase, executionreport.qLowerCase) + && Objects.equals(this.pLowerCase, executionreport.pLowerCase) + && Objects.equals(this.P, executionreport.P) + && Objects.equals(this.dLowerCase, executionreport.dLowerCase) + && Objects.equals(this.F, executionreport.F) + && Objects.equals(this.gLowerCase, executionreport.gLowerCase) + && Objects.equals(this.C, executionreport.C) + && Objects.equals(this.xLowerCase, executionreport.xLowerCase) + && Objects.equals(this.X, executionreport.X) + && Objects.equals(this.rLowerCase, executionreport.rLowerCase) + && Objects.equals(this.iLowerCase, executionreport.iLowerCase) + && Objects.equals(this.lLowerCase, executionreport.lLowerCase) + && Objects.equals(this.zLowerCase, executionreport.zLowerCase) + && Objects.equals(this.L, executionreport.L) + && Objects.equals(this.nLowerCase, executionreport.nLowerCase) + && Objects.equals(this.N, executionreport.N) + && Objects.equals(this.T, executionreport.T) + && Objects.equals(this.tLowerCase, executionreport.tLowerCase) + && Objects.equals(this.vLowerCase, executionreport.vLowerCase) + && Objects.equals(this.I, executionreport.I) + && Objects.equals(this.wLowerCase, executionreport.wLowerCase) + && Objects.equals(this.mLowerCase, executionreport.mLowerCase) + && Objects.equals(this.M, executionreport.M) + && Objects.equals(this.O, executionreport.O) + && Objects.equals(this.Z, executionreport.Z) + && Objects.equals(this.Y, executionreport.Y) + && Objects.equals(this.Q, executionreport.Q) + && Objects.equals(this.D, executionreport.D) + && Objects.equals(this.jLowerCase, executionreport.jLowerCase) + && Objects.equals(this.J, executionreport.J) + && Objects.equals(this.W, executionreport.W) + && Objects.equals(this.V, executionreport.V) + && Objects.equals(this.uLowerCase, executionreport.uLowerCase) + && Objects.equals(this.U, executionreport.U) + && Objects.equals(this.A, executionreport.A) + && Objects.equals(this.B, executionreport.B); + } + + @Override + public int hashCode() { + return Objects.hash( + E, + sLowerCase, + cLowerCase, + S, + oLowerCase, + fLowerCase, + qLowerCase, + pLowerCase, + P, + dLowerCase, + F, + gLowerCase, + C, + xLowerCase, + X, + rLowerCase, + iLowerCase, + lLowerCase, + zLowerCase, + L, + nLowerCase, + N, + T, + tLowerCase, + vLowerCase, + I, + wLowerCase, + mLowerCase, + M, + O, + Z, + Y, + Q, + D, + jLowerCase, + J, + W, + V, + uLowerCase, + U, + A, + B); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Executionreport {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\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(" P: ").append(toIndentedString(P)).append("\n"); + sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); + sb.append(" F: ").append(toIndentedString(F)).append("\n"); + sb.append(" gLowerCase: ").append(toIndentedString(gLowerCase)).append("\n"); + sb.append(" C: ").append(toIndentedString(C)).append("\n"); + sb.append(" xLowerCase: ").append(toIndentedString(xLowerCase)).append("\n"); + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).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(" nLowerCase: ").append(toIndentedString(nLowerCase)).append("\n"); + sb.append(" N: ").append(toIndentedString(N)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); + sb.append(" vLowerCase: ").append(toIndentedString(vLowerCase)).append("\n"); + sb.append(" I: ").append(toIndentedString(I)).append("\n"); + sb.append(" wLowerCase: ").append(toIndentedString(wLowerCase)).append("\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); + sb.append(" M: ").append(toIndentedString(M)).append("\n"); + sb.append(" O: ").append(toIndentedString(O)).append("\n"); + sb.append(" Z: ").append(toIndentedString(Z)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append(" Q: ").append(toIndentedString(Q)).append("\n"); + sb.append(" D: ").append(toIndentedString(D)).append("\n"); + sb.append(" jLowerCase: ").append(toIndentedString(jLowerCase)).append("\n"); + sb.append(" J: ").append(toIndentedString(J)).append("\n"); + sb.append(" W: ").append(toIndentedString(W)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" U: ").append(toIndentedString(U)).append("\n"); + sb.append(" A: ").append(toIndentedString(A)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).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); + } + 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 PValue = getP(); + if (PValue != null) { + String PValueAsString = PValue.toString(); + valMap.put("P", PValueAsString); + } + Long dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + String dLowerCaseValueAsString = dLowerCaseValue.toString(); + valMap.put("dLowerCase", dLowerCaseValueAsString); + } + String FValue = getF(); + if (FValue != null) { + String FValueAsString = FValue.toString(); + valMap.put("F", FValueAsString); + } + Long gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + String gLowerCaseValueAsString = gLowerCaseValue.toString(); + valMap.put("gLowerCase", gLowerCaseValueAsString); + } + String CValue = getC(); + if (CValue != null) { + String CValueAsString = CValue.toString(); + valMap.put("C", CValueAsString); + } + 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); + } + String rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + String rLowerCaseValueAsString = rLowerCaseValue.toString(); + valMap.put("rLowerCase", rLowerCaseValueAsString); + } + 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 nLowerCaseValue = getnLowerCase(); + if (nLowerCaseValue != null) { + String nLowerCaseValueAsString = nLowerCaseValue.toString(); + valMap.put("nLowerCase", nLowerCaseValueAsString); + } + String NValue = getN(); + if (NValue != null) { + String NValueAsString = NValue.toString(); + valMap.put("N", NValueAsString); + } + 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); + } + Long vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + String vLowerCaseValueAsString = vLowerCaseValue.toString(); + valMap.put("vLowerCase", vLowerCaseValueAsString); + } + Long IValue = getI(); + if (IValue != null) { + String IValueAsString = IValue.toString(); + valMap.put("I", IValueAsString); + } + Boolean wLowerCaseValue = getwLowerCase(); + if (wLowerCaseValue != null) { + String wLowerCaseValueAsString = wLowerCaseValue.toString(); + valMap.put("wLowerCase", wLowerCaseValueAsString); + } + Boolean mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + Boolean MValue = getM(); + if (MValue != null) { + String MValueAsString = MValue.toString(); + valMap.put("M", MValueAsString); + } + Long OValue = getO(); + if (OValue != null) { + String OValueAsString = OValue.toString(); + valMap.put("O", OValueAsString); + } + String ZValue = getZ(); + if (ZValue != null) { + String ZValueAsString = ZValue.toString(); + valMap.put("Z", ZValueAsString); + } + String YValue = getY(); + if (YValue != null) { + String YValueAsString = YValue.toString(); + valMap.put("Y", YValueAsString); + } + String QValue = getQ(); + if (QValue != null) { + String QValueAsString = QValue.toString(); + valMap.put("Q", QValueAsString); + } + Long DValue = getD(); + if (DValue != null) { + String DValueAsString = DValue.toString(); + valMap.put("D", DValueAsString); + } + Long jLowerCaseValue = getjLowerCase(); + if (jLowerCaseValue != null) { + String jLowerCaseValueAsString = jLowerCaseValue.toString(); + valMap.put("jLowerCase", jLowerCaseValueAsString); + } + Long JValue = getJ(); + if (JValue != null) { + String JValueAsString = JValue.toString(); + valMap.put("J", JValueAsString); + } + Long WValue = getW(); + if (WValue != null) { + String WValueAsString = WValue.toString(); + valMap.put("W", WValueAsString); + } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } + 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 AValue = getA(); + if (AValue != null) { + String AValueAsString = AValue.toString(); + valMap.put("A", AValueAsString); + } + String BValue = getB(); + if (BValue != null) { + String BValueAsString = BValue.toString(); + valMap.put("B", BValueAsString); + } + + 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 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 PValue = getP(); + if (PValue != null) { + valMap.put("P", PValue); + } + Object dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + valMap.put("dLowerCase", dLowerCaseValue); + } + Object FValue = getF(); + if (FValue != null) { + valMap.put("F", FValue); + } + Object gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + valMap.put("gLowerCase", gLowerCaseValue); + } + Object CValue = getC(); + if (CValue != null) { + valMap.put("C", CValue); + } + Object xLowerCaseValue = getxLowerCase(); + if (xLowerCaseValue != null) { + valMap.put("xLowerCase", xLowerCaseValue); + } + Object XValue = getX(); + if (XValue != null) { + valMap.put("X", XValue); + } + Object rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + valMap.put("rLowerCase", rLowerCaseValue); + } + 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 nLowerCaseValue = getnLowerCase(); + if (nLowerCaseValue != null) { + valMap.put("nLowerCase", nLowerCaseValue); + } + Object NValue = getN(); + if (NValue != null) { + valMap.put("N", NValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } + Object vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + valMap.put("vLowerCase", vLowerCaseValue); + } + Object IValue = getI(); + if (IValue != null) { + valMap.put("I", IValue); + } + Object wLowerCaseValue = getwLowerCase(); + if (wLowerCaseValue != null) { + valMap.put("wLowerCase", wLowerCaseValue); + } + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + Object MValue = getM(); + if (MValue != null) { + valMap.put("M", MValue); + } + Object OValue = getO(); + if (OValue != null) { + valMap.put("O", OValue); + } + Object ZValue = getZ(); + if (ZValue != null) { + valMap.put("Z", ZValue); + } + Object YValue = getY(); + if (YValue != null) { + valMap.put("Y", YValue); + } + Object QValue = getQ(); + if (QValue != null) { + valMap.put("Q", QValue); + } + Object DValue = getD(); + if (DValue != null) { + valMap.put("D", DValue); + } + Object jLowerCaseValue = getjLowerCase(); + if (jLowerCaseValue != null) { + valMap.put("jLowerCase", jLowerCaseValue); + } + Object JValue = getJ(); + if (JValue != null) { + valMap.put("J", JValue); + } + Object WValue = getW(); + if (WValue != null) { + valMap.put("W", WValue); + } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } + Object uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object UValue = getU(); + if (UValue != null) { + valMap.put("U", UValue); + } + Object AValue = getA(); + if (AValue != null) { + valMap.put("A", AValue); + } + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); + } + + 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("s"); + openapiFields.add("c"); + openapiFields.add("S"); + openapiFields.add("o"); + openapiFields.add("f"); + openapiFields.add("q"); + openapiFields.add("p"); + openapiFields.add("P"); + openapiFields.add("d"); + openapiFields.add("F"); + openapiFields.add("g"); + openapiFields.add("C"); + openapiFields.add("x"); + openapiFields.add("X"); + openapiFields.add("r"); + 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("v"); + openapiFields.add("I"); + openapiFields.add("w"); + openapiFields.add("m"); + openapiFields.add("M"); + openapiFields.add("O"); + openapiFields.add("Z"); + openapiFields.add("Y"); + openapiFields.add("Q"); + openapiFields.add("D"); + openapiFields.add("j"); + openapiFields.add("J"); + openapiFields.add("W"); + openapiFields.add("V"); + openapiFields.add("u"); + openapiFields.add("U"); + openapiFields.add("A"); + openapiFields.add("B"); + + // 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 Executionreport + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Executionreport.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Executionreport is not found in the" + + " empty JSON string", + Executionreport.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Executionreport.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Executionreport` 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("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("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("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("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("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("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("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("Y") != null && !jsonObj.get("Y").isJsonNull()) + && !jsonObj.get("Y").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `Y` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("Y").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("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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Executionreport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Executionreport' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Executionreport.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Executionreport value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Executionreport read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Executionreport given an JSON string + * + * @param jsonString JSON string + * @return An instance of Executionreport + * @throws IOException if the JSON string is invalid with respect to Executionreport + */ + public static Executionreport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Executionreport.class); + } + + /** + * Convert an instance of Executionreport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Liabilitychange.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Liabilitychange.java new file mode 100644 index 00000000..2be716bc --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Liabilitychange.java @@ -0,0 +1,494 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** Liabilitychange */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Liabilitychange 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_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private String aLowerCase; + + 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_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private String iLowerCase; + + public static final String SERIALIZED_NAME_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private String lLowerCase; + + public Liabilitychange() {} + + public Liabilitychange 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 Liabilitychange 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 Liabilitychange 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 Liabilitychange 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 Liabilitychange 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 Liabilitychange iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + return this; + } + + /** + * Get iLowerCase + * + * @return iLowerCase + */ + @jakarta.annotation.Nullable + public String getiLowerCase() { + return iLowerCase; + } + + public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + } + + public Liabilitychange 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Liabilitychange liabilitychange = (Liabilitychange) o; + return Objects.equals(this.E, liabilitychange.E) + && Objects.equals(this.aLowerCase, liabilitychange.aLowerCase) + && Objects.equals(this.tLowerCase, liabilitychange.tLowerCase) + && Objects.equals(this.T, liabilitychange.T) + && Objects.equals(this.pLowerCase, liabilitychange.pLowerCase) + && Objects.equals(this.iLowerCase, liabilitychange.iLowerCase) + && Objects.equals(this.lLowerCase, liabilitychange.lLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, aLowerCase, tLowerCase, T, pLowerCase, iLowerCase, lLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Liabilitychange {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).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); + } + String aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = aLowerCaseValue.toString(); + valMap.put("aLowerCase", aLowerCaseValueAsString); + } + String tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + String tLowerCaseValueAsString = tLowerCaseValue.toString(); + valMap.put("tLowerCase", tLowerCaseValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + String pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + String pLowerCaseValueAsString = pLowerCaseValue.toString(); + valMap.put("pLowerCase", pLowerCaseValueAsString); + } + String 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); + } + + 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 aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + valMap.put("pLowerCase", pLowerCaseValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + + 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("a"); + openapiFields.add("t"); + openapiFields.add("T"); + openapiFields.add("p"); + openapiFields.add("i"); + openapiFields.add("l"); + + // 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 Liabilitychange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Liabilitychange.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Liabilitychange is not found in the" + + " empty JSON string", + Liabilitychange.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Liabilitychange.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Liabilitychange` 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("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("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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Liabilitychange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Liabilitychange' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Liabilitychange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Liabilitychange value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Liabilitychange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Liabilitychange given an JSON string + * + * @param jsonString JSON string + * @return An instance of Liabilitychange + * @throws IOException if the JSON string is invalid with respect to Liabilitychange + */ + public static Liabilitychange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Liabilitychange.class); + } + + /** + * Convert an instance of Liabilitychange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Listenkeyexpired.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Listenkeyexpired.java new file mode 100644 index 00000000..43c392a2 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Listenkeyexpired.java @@ -0,0 +1,232 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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 Long E; + + public Listenkeyexpired() {} + + public Listenkeyexpired 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Listenkeyexpired listenkeyexpired = (Listenkeyexpired) o; + return Objects.equals(this.E, listenkeyexpired.E); + } + + @Override + public int hashCode() { + return Objects.hash(E); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Listenkeyexpired {\n"); + sb.append(" E: ").append(toIndentedString(E)).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); + } + + 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); + } + + 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"); + + // 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(); + } + + 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-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Openorderloss.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Openorderloss.java new file mode 100644 index 00000000..e29b69f6 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Openorderloss.java @@ -0,0 +1,299 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** Openorderloss */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Openorderloss 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_O = "O"; + + @SerializedName(SERIALIZED_NAME_O) + @jakarta.annotation.Nullable + private List<@Valid OpenorderlossOInner> O; + + public Openorderloss() {} + + public Openorderloss 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 Openorderloss O(@jakarta.annotation.Nullable List<@Valid OpenorderlossOInner> O) { + this.O = O; + return this; + } + + public Openorderloss addOItem(OpenorderlossOInner OItem) { + if (this.O == null) { + this.O = new ArrayList<>(); + } + this.O.add(OItem); + return this; + } + + /** + * Get O + * + * @return O + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OpenorderlossOInner> getO() { + return O; + } + + public void setO(@jakarta.annotation.Nullable List<@Valid OpenorderlossOInner> O) { + this.O = O; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Openorderloss openorderloss = (Openorderloss) o; + return Objects.equals(this.E, openorderloss.E) && Objects.equals(this.O, openorderloss.O); + } + + @Override + public int hashCode() { + return Objects.hash(E, O); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Openorderloss {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" O: ").append(toIndentedString(O)).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); + } + List<@Valid OpenorderlossOInner> OValue = getO(); + if (OValue != null) { + String OValueAsString = JSON.getGson().toJson(OValue); + valMap.put("O", OValueAsString); + } + + 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 OValue = getO(); + if (OValue != null) { + valMap.put("O", OValue); + } + + 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("O"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Openorderloss + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Openorderloss.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Openorderloss is not found in the" + + " empty JSON string", + Openorderloss.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Openorderloss.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Openorderloss` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("O") != null && !jsonObj.get("O").isJsonNull()) { + JsonArray jsonArrayO = jsonObj.getAsJsonArray("O"); + if (jsonArrayO != 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 < jsonArrayO.size(); i++) { + OpenorderlossOInner.validateJsonElement(jsonArrayO.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Openorderloss.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Openorderloss' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Openorderloss.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Openorderloss value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Openorderloss read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Openorderloss given an JSON string + * + * @param jsonString JSON string + * @return An instance of Openorderloss + * @throws IOException if the JSON string is invalid with respect to Openorderloss + */ + public static Openorderloss fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Openorderloss.class); + } + + /** + * Convert an instance of Openorderloss to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OpenorderlossOInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OpenorderlossOInner.java new file mode 100644 index 00000000..85f1c7cd --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OpenorderlossOInner.java @@ -0,0 +1,285 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** OpenorderlossOInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OpenorderlossOInner 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_O_LOWER_CASE = "o"; + + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @jakarta.annotation.Nullable + private String oLowerCase; + + public OpenorderlossOInner() {} + + public OpenorderlossOInner 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 OpenorderlossOInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenorderlossOInner openorderlossOInner = (OpenorderlossOInner) o; + return Objects.equals(this.aLowerCase, openorderlossOInner.aLowerCase) + && Objects.equals(this.oLowerCase, openorderlossOInner.oLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(aLowerCase, oLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenorderlossOInner {\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = aLowerCaseValue.toString(); + valMap.put("aLowerCase", aLowerCaseValueAsString); + } + String oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + String oLowerCaseValueAsString = oLowerCaseValue.toString(); + valMap.put("oLowerCase", oLowerCaseValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + valMap.put("oLowerCase", oLowerCaseValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("a"); + openapiFields.add("o"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OpenorderlossOInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OpenorderlossOInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OpenorderlossOInner is not found in" + + " the empty JSON string", + OpenorderlossOInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OpenorderlossOInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OpenorderlossOInner` 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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OpenorderlossOInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenorderlossOInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OpenorderlossOInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OpenorderlossOInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OpenorderlossOInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OpenorderlossOInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpenorderlossOInner + * @throws IOException if the JSON string is invalid with respect to OpenorderlossOInner + */ + public static OpenorderlossOInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenorderlossOInner.class); + } + + /** + * Convert an instance of OpenorderlossOInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OrderTradeUpdate.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OrderTradeUpdate.java new file mode 100644 index 00000000..ac1cf6c0 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OrderTradeUpdate.java @@ -0,0 +1,402 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderTradeUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderTradeUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_FS = "fs"; + + @SerializedName(SERIALIZED_NAME_FS) + @jakarta.annotation.Nullable + private String fs; + + 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private String iLowerCase; + + public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; + + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @jakarta.annotation.Nullable + private OrderTradeUpdateO oLowerCase; + + public OrderTradeUpdate() {} + + public OrderTradeUpdate fs(@jakarta.annotation.Nullable String fs) { + this.fs = fs; + return this; + } + + /** + * Get fs + * + * @return fs + */ + @jakarta.annotation.Nullable + public String getFs() { + return fs; + } + + public void setFs(@jakarta.annotation.Nullable String fs) { + this.fs = fs; + } + + public OrderTradeUpdate 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 OrderTradeUpdate 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 OrderTradeUpdate iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + return this; + } + + /** + * Get iLowerCase + * + * @return iLowerCase + */ + @jakarta.annotation.Nullable + public String getiLowerCase() { + return iLowerCase; + } + + public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + } + + public OrderTradeUpdate oLowerCase(@jakarta.annotation.Nullable OrderTradeUpdateO oLowerCase) { + this.oLowerCase = oLowerCase; + return this; + } + + /** + * Get oLowerCase + * + * @return oLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public OrderTradeUpdateO getoLowerCase() { + return oLowerCase; + } + + public void setoLowerCase(@jakarta.annotation.Nullable OrderTradeUpdateO oLowerCase) { + this.oLowerCase = oLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderTradeUpdate orderTradeUpdate = (OrderTradeUpdate) o; + return Objects.equals(this.fs, orderTradeUpdate.fs) + && Objects.equals(this.E, orderTradeUpdate.E) + && Objects.equals(this.T, orderTradeUpdate.T) + && Objects.equals(this.iLowerCase, orderTradeUpdate.iLowerCase) + && Objects.equals(this.oLowerCase, orderTradeUpdate.oLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(fs, E, T, iLowerCase, oLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderTradeUpdate {\n"); + sb.append(" fs: ").append(toIndentedString(fs)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String fsValue = getFs(); + if (fsValue != null) { + String fsValueAsString = fsValue.toString(); + valMap.put("fs", fsValueAsString); + } + 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 iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + OrderTradeUpdateO oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + String oLowerCaseValueAsString = JSON.getGson().toJson(oLowerCaseValue); + valMap.put("oLowerCase", oLowerCaseValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object fsValue = getFs(); + if (fsValue != null) { + valMap.put("fs", fsValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + valMap.put("oLowerCase", oLowerCaseValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fs"); + openapiFields.add("E"); + openapiFields.add("T"); + openapiFields.add("i"); + openapiFields.add("o"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrderTradeUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderTradeUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderTradeUpdate is not found in the" + + " empty JSON string", + OrderTradeUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderTradeUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderTradeUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("fs") != null && !jsonObj.get("fs").isJsonNull()) + && !jsonObj.get("fs").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fs` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fs").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())); + } + // validate the optional field `o` + if (jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) { + OrderTradeUpdateO.validateJsonElement(jsonObj.get("o")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderTradeUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderTradeUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderTradeUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderTradeUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderTradeUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderTradeUpdate + * @throws IOException if the JSON string is invalid with respect to OrderTradeUpdate + */ + public static OrderTradeUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderTradeUpdate.class); + } + + /** + * Convert an instance of OrderTradeUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OrderTradeUpdateO.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OrderTradeUpdateO.java new file mode 100644 index 00000000..8011dbc5 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OrderTradeUpdateO.java @@ -0,0 +1,1473 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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_SP = "sp"; + + @SerializedName(SERIALIZED_NAME_SP) + @jakarta.annotation.Nullable + private String sp; + + 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_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public static final String SERIALIZED_NAME_RP = "rp"; + + @SerializedName(SERIALIZED_NAME_RP) + @jakarta.annotation.Nullable + private String rp; + + public static final String SERIALIZED_NAME_ST = "st"; + + @SerializedName(SERIALIZED_NAME_ST) + @jakarta.annotation.Nullable + private String st; + + public static final String SERIALIZED_NAME_SI = "si"; + + @SerializedName(SERIALIZED_NAME_SI) + @jakarta.annotation.Nullable + private Long si; + + public static final String SERIALIZED_NAME_V = "V"; + + @SerializedName(SERIALIZED_NAME_V) + @jakarta.annotation.Nullable + private String V; + + public static final String SERIALIZED_NAME_GTD = "gtd"; + + @SerializedName(SERIALIZED_NAME_GTD) + @jakarta.annotation.Nullable + private Long gtd; + + 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 sp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; + return this; + } + + /** + * Get sp + * + * @return sp + */ + @jakarta.annotation.Nullable + public String getSp() { + return sp; + } + + public void setSp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; + } + + 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 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 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; + } + + public OrderTradeUpdateO st(@jakarta.annotation.Nullable String st) { + this.st = st; + return this; + } + + /** + * Get st + * + * @return st + */ + @jakarta.annotation.Nullable + public String getSt() { + return st; + } + + public void setSt(@jakarta.annotation.Nullable String st) { + this.st = st; + } + + public OrderTradeUpdateO si(@jakarta.annotation.Nullable Long si) { + this.si = si; + return this; + } + + /** + * Get si + * + * @return si + */ + @jakarta.annotation.Nullable + public Long getSi() { + return si; + } + + public void setSi(@jakarta.annotation.Nullable Long si) { + this.si = si; + } + + public OrderTradeUpdateO 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 OrderTradeUpdateO gtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + return this; + } + + /** + * Get gtd + * + * @return gtd + */ + @jakarta.annotation.Nullable + public Long getGtd() { + return gtd; + } + + public void setGtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + } + + @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.sp, orderTradeUpdateO.sp) + && 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.ps, orderTradeUpdateO.ps) + && Objects.equals(this.rp, orderTradeUpdateO.rp) + && Objects.equals(this.st, orderTradeUpdateO.st) + && Objects.equals(this.si, orderTradeUpdateO.si) + && Objects.equals(this.V, orderTradeUpdateO.V) + && Objects.equals(this.gtd, orderTradeUpdateO.gtd); + } + + @Override + public int hashCode() { + return Objects.hash( + sLowerCase, + cLowerCase, + S, + oLowerCase, + fLowerCase, + qLowerCase, + pLowerCase, + ap, + sp, + xLowerCase, + X, + iLowerCase, + lLowerCase, + zLowerCase, + L, + N, + nLowerCase, + T, + tLowerCase, + bLowerCase, + aLowerCase, + mLowerCase, + R, + ps, + rp, + st, + si, + V, + gtd); + } + + @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(" sp: ").append(toIndentedString(sp)).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(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" rp: ").append(toIndentedString(rp)).append("\n"); + sb.append(" st: ").append(toIndentedString(st)).append("\n"); + sb.append(" si: ").append(toIndentedString(si)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); + sb.append(" gtd: ").append(toIndentedString(gtd)).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 spValue = getSp(); + if (spValue != null) { + String spValueAsString = spValue.toString(); + valMap.put("sp", spValueAsString); + } + 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 psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + String rpValue = getRp(); + if (rpValue != null) { + String rpValueAsString = rpValue.toString(); + valMap.put("rp", rpValueAsString); + } + String stValue = getSt(); + if (stValue != null) { + String stValueAsString = stValue.toString(); + valMap.put("st", stValueAsString); + } + Long siValue = getSi(); + if (siValue != null) { + String siValueAsString = siValue.toString(); + valMap.put("si", siValueAsString); + } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } + Long gtdValue = getGtd(); + if (gtdValue != null) { + String gtdValueAsString = gtdValue.toString(); + valMap.put("gtd", gtdValueAsString); + } + + 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 spValue = getSp(); + if (spValue != null) { + valMap.put("sp", spValue); + } + 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 psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + Object rpValue = getRp(); + if (rpValue != null) { + valMap.put("rp", rpValue); + } + Object stValue = getSt(); + if (stValue != null) { + valMap.put("st", stValue); + } + Object siValue = getSi(); + if (siValue != null) { + valMap.put("si", siValue); + } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } + Object gtdValue = getGtd(); + if (gtdValue != null) { + valMap.put("gtd", gtdValue); + } + + 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("sp"); + 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("ps"); + openapiFields.add("rp"); + openapiFields.add("st"); + openapiFields.add("si"); + openapiFields.add("V"); + openapiFields.add("gtd"); + + // 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("sp") != null && !jsonObj.get("sp").isJsonNull()) + && !jsonObj.get("sp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sp` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("sp").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("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("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())); + } + if ((jsonObj.get("st") != null && !jsonObj.get("st").isJsonNull()) + && !jsonObj.get("st").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `st` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("st").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 { + @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-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Outboundaccountposition.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Outboundaccountposition.java new file mode 100644 index 00000000..70ab4720 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Outboundaccountposition.java @@ -0,0 +1,377 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** Outboundaccountposition */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Outboundaccountposition 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_U_LOWER_CASE = "u"; + + @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) + @jakarta.annotation.Nullable + private Long uLowerCase; + + public static final String SERIALIZED_NAME_U = "U"; + + @SerializedName(SERIALIZED_NAME_U) + @jakarta.annotation.Nullable + private Long U; + + public static final String SERIALIZED_NAME_B = "B"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private List<@Valid OutboundaccountpositionBInner> B; + + public Outboundaccountposition() {} + + public Outboundaccountposition 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 Outboundaccountposition 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 Outboundaccountposition 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 Outboundaccountposition B( + @jakarta.annotation.Nullable List<@Valid OutboundaccountpositionBInner> B) { + this.B = B; + return this; + } + + public Outboundaccountposition addBItem(OutboundaccountpositionBInner BItem) { + if (this.B == null) { + this.B = new ArrayList<>(); + } + this.B.add(BItem); + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OutboundaccountpositionBInner> getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable List<@Valid OutboundaccountpositionBInner> B) { + this.B = B; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Outboundaccountposition outboundaccountposition = (Outboundaccountposition) o; + return Objects.equals(this.E, outboundaccountposition.E) + && Objects.equals(this.uLowerCase, outboundaccountposition.uLowerCase) + && Objects.equals(this.U, outboundaccountposition.U) + && Objects.equals(this.B, outboundaccountposition.B); + } + + @Override + public int hashCode() { + return Objects.hash(E, uLowerCase, U, B); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Outboundaccountposition {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" U: ").append(toIndentedString(U)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).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 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); + } + List<@Valid OutboundaccountpositionBInner> BValue = getB(); + if (BValue != null) { + String BValueAsString = JSON.getGson().toJson(BValue); + valMap.put("B", BValueAsString); + } + + 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 uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object UValue = getU(); + if (UValue != null) { + valMap.put("U", UValue); + } + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); + } + + 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("u"); + openapiFields.add("U"); + openapiFields.add("B"); + + // 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 Outboundaccountposition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Outboundaccountposition.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Outboundaccountposition is not found" + + " in the empty JSON string", + Outboundaccountposition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Outboundaccountposition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Outboundaccountposition` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("B") != null && !jsonObj.get("B").isJsonNull()) { + JsonArray jsonArrayB = jsonObj.getAsJsonArray("B"); + if (jsonArrayB != null) { + // ensure the json data is an array + if (!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())); + } + + // validate the optional field `B` (array) + for (int i = 0; i < jsonArrayB.size(); i++) { + OutboundaccountpositionBInner.validateJsonElement(jsonArrayB.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Outboundaccountposition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Outboundaccountposition' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Outboundaccountposition.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Outboundaccountposition value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Outboundaccountposition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Outboundaccountposition given an JSON string + * + * @param jsonString JSON string + * @return An instance of Outboundaccountposition + * @throws IOException if the JSON string is invalid with respect to Outboundaccountposition + */ + public static Outboundaccountposition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Outboundaccountposition.class); + } + + /** + * Convert an instance of Outboundaccountposition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OutboundaccountpositionBInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OutboundaccountpositionBInner.java new file mode 100644 index 00000000..55c0850a --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/OutboundaccountpositionBInner.java @@ -0,0 +1,339 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** OutboundaccountpositionBInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OutboundaccountpositionBInner 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_F_LOWER_CASE = "f"; + + @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) + @jakarta.annotation.Nullable + private String fLowerCase; + + public static final String SERIALIZED_NAME_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private String lLowerCase; + + public OutboundaccountpositionBInner() {} + + public OutboundaccountpositionBInner 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 OutboundaccountpositionBInner 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 OutboundaccountpositionBInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutboundaccountpositionBInner outboundaccountpositionBInner = + (OutboundaccountpositionBInner) o; + return Objects.equals(this.aLowerCase, outboundaccountpositionBInner.aLowerCase) + && Objects.equals(this.fLowerCase, outboundaccountpositionBInner.fLowerCase) + && Objects.equals(this.lLowerCase, outboundaccountpositionBInner.lLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(aLowerCase, fLowerCase, lLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutboundaccountpositionBInner {\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).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 fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + String fLowerCaseValueAsString = fLowerCaseValue.toString(); + valMap.put("fLowerCase", fLowerCaseValueAsString); + } + String lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + + 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 fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + valMap.put("fLowerCase", fLowerCaseValue); + } + Object lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + + 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("f"); + openapiFields.add("l"); + + // 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 + * OutboundaccountpositionBInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OutboundaccountpositionBInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OutboundaccountpositionBInner is not" + + " found in the empty JSON string", + OutboundaccountpositionBInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OutboundaccountpositionBInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OutboundaccountpositionBInner` 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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OutboundaccountpositionBInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OutboundaccountpositionBInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OutboundaccountpositionBInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OutboundaccountpositionBInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OutboundaccountpositionBInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OutboundaccountpositionBInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OutboundaccountpositionBInner + * @throws IOException if the JSON string is invalid with respect to + * OutboundaccountpositionBInner + */ + public static OutboundaccountpositionBInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OutboundaccountpositionBInner.class); + } + + /** + * Convert an instance of OutboundaccountpositionBInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Risklevelchange.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Risklevelchange.java new file mode 100644 index 00000000..0bf2c83b --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Risklevelchange.java @@ -0,0 +1,457 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** Risklevelchange */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Risklevelchange 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_U_LOWER_CASE = "u"; + + @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) + @jakarta.annotation.Nullable + private String uLowerCase; + + 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_EQ = "eq"; + + @SerializedName(SERIALIZED_NAME_EQ) + @jakarta.annotation.Nullable + private String eq; + + public static final String SERIALIZED_NAME_AE = "ae"; + + @SerializedName(SERIALIZED_NAME_AE) + @jakarta.annotation.Nullable + private String ae; + + public static final String SERIALIZED_NAME_M_LOWER_CASE = "m"; + + @SerializedName(SERIALIZED_NAME_M_LOWER_CASE) + @jakarta.annotation.Nullable + private String mLowerCase; + + public Risklevelchange() {} + + public Risklevelchange 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 Risklevelchange uLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; + return this; + } + + /** + * Get uLowerCase + * + * @return uLowerCase + */ + @jakarta.annotation.Nullable + public String getuLowerCase() { + return uLowerCase; + } + + public void setuLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; + } + + public Risklevelchange 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 Risklevelchange eq(@jakarta.annotation.Nullable String eq) { + this.eq = eq; + return this; + } + + /** + * Get eq + * + * @return eq + */ + @jakarta.annotation.Nullable + public String getEq() { + return eq; + } + + public void setEq(@jakarta.annotation.Nullable String eq) { + this.eq = eq; + } + + public Risklevelchange ae(@jakarta.annotation.Nullable String ae) { + this.ae = ae; + return this; + } + + /** + * Get ae + * + * @return ae + */ + @jakarta.annotation.Nullable + public String getAe() { + return ae; + } + + public void setAe(@jakarta.annotation.Nullable String ae) { + this.ae = ae; + } + + public Risklevelchange 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Risklevelchange risklevelchange = (Risklevelchange) o; + return Objects.equals(this.E, risklevelchange.E) + && Objects.equals(this.uLowerCase, risklevelchange.uLowerCase) + && Objects.equals(this.sLowerCase, risklevelchange.sLowerCase) + && Objects.equals(this.eq, risklevelchange.eq) + && Objects.equals(this.ae, risklevelchange.ae) + && Objects.equals(this.mLowerCase, risklevelchange.mLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, uLowerCase, sLowerCase, eq, ae, mLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Risklevelchange {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" eq: ").append(toIndentedString(eq)).append("\n"); + sb.append(" ae: ").append(toIndentedString(ae)).append("\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).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); + } + String uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + String uLowerCaseValueAsString = uLowerCaseValue.toString(); + valMap.put("uLowerCase", uLowerCaseValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + String eqValue = getEq(); + if (eqValue != null) { + String eqValueAsString = eqValue.toString(); + valMap.put("eq", eqValueAsString); + } + String aeValue = getAe(); + if (aeValue != null) { + String aeValueAsString = aeValue.toString(); + valMap.put("ae", aeValueAsString); + } + String mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + + 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 uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object eqValue = getEq(); + if (eqValue != null) { + valMap.put("eq", eqValue); + } + Object aeValue = getAe(); + if (aeValue != null) { + valMap.put("ae", aeValue); + } + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + + 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("u"); + openapiFields.add("s"); + openapiFields.add("eq"); + openapiFields.add("ae"); + openapiFields.add("m"); + + // 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 Risklevelchange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Risklevelchange.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Risklevelchange is not found in the" + + " empty JSON string", + Risklevelchange.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Risklevelchange.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Risklevelchange` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("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("eq") != null && !jsonObj.get("eq").isJsonNull()) + && !jsonObj.get("eq").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eq` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("eq").toString())); + } + if ((jsonObj.get("ae") != null && !jsonObj.get("ae").isJsonNull()) + && !jsonObj.get("ae").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ae` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ae").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Risklevelchange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Risklevelchange' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Risklevelchange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Risklevelchange value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Risklevelchange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Risklevelchange given an JSON string + * + * @param jsonString JSON string + * @return An instance of Risklevelchange + * @throws IOException if the JSON string is invalid with respect to Risklevelchange + */ + public static Risklevelchange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Risklevelchange.class); + } + + /** + * Convert an instance of Risklevelchange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/UserDataStreamEventsResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/UserDataStreamEventsResponse.java new file mode 100644 index 00000000..d7eb3863 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/UserDataStreamEventsResponse.java @@ -0,0 +1,1014 @@ +/* + * Binance Derivatives Trading Portfolio Margin WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin 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_portfolio_margin.websocket.stream.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.derivatives_trading_portfolio_margin.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.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 UserDataStreamEventsResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(UserDataStreamEventsResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDataStreamEventsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDataStreamEventsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterConditionalOrderTradeUpdate = + gson.getDelegateAdapter(this, TypeToken.get(ConditionalOrderTradeUpdate.class)); + final TypeAdapter adapterAccountConfigUpdate = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdate.class)); + final TypeAdapter adapterAccountUpdate = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + final TypeAdapter adapterOrderTradeUpdate = + gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdate.class)); + final TypeAdapter adapterLiabilitychange = + gson.getDelegateAdapter(this, TypeToken.get(Liabilitychange.class)); + final TypeAdapter adapterOutboundaccountposition = + gson.getDelegateAdapter(this, TypeToken.get(Outboundaccountposition.class)); + final TypeAdapter adapterBalanceupdate = + gson.getDelegateAdapter(this, TypeToken.get(Balanceupdate.class)); + final TypeAdapter adapterExecutionreport = + gson.getDelegateAdapter(this, TypeToken.get(Executionreport.class)); + final TypeAdapter adapterOpenorderloss = + gson.getDelegateAdapter(this, TypeToken.get(Openorderloss.class)); + final TypeAdapter adapterListenkeyexpired = + gson.getDelegateAdapter(this, TypeToken.get(Listenkeyexpired.class)); + final TypeAdapter adapterRisklevelchange = + gson.getDelegateAdapter(this, TypeToken.get(Risklevelchange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDataStreamEventsResponse value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ConditionalOrderTradeUpdate` + if (value.getActualInstance() instanceof ConditionalOrderTradeUpdate) { + JsonElement element = + adapterConditionalOrderTradeUpdate.toJsonTree( + (ConditionalOrderTradeUpdate) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AccountConfigUpdate` + if (value.getActualInstance() instanceof AccountConfigUpdate) { + JsonElement element = + adapterAccountConfigUpdate.toJsonTree( + (AccountConfigUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AccountUpdate` + if (value.getActualInstance() instanceof AccountUpdate) { + JsonElement element = + adapterAccountUpdate.toJsonTree( + (AccountUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OrderTradeUpdate` + if (value.getActualInstance() instanceof OrderTradeUpdate) { + JsonElement element = + adapterOrderTradeUpdate.toJsonTree( + (OrderTradeUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Liabilitychange` + if (value.getActualInstance() instanceof Liabilitychange) { + JsonElement element = + adapterLiabilitychange.toJsonTree( + (Liabilitychange) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Outboundaccountposition` + if (value.getActualInstance() instanceof Outboundaccountposition) { + JsonElement element = + adapterOutboundaccountposition.toJsonTree( + (Outboundaccountposition) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Balanceupdate` + if (value.getActualInstance() instanceof Balanceupdate) { + JsonElement element = + adapterBalanceupdate.toJsonTree( + (Balanceupdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Executionreport` + if (value.getActualInstance() instanceof Executionreport) { + JsonElement element = + adapterExecutionreport.toJsonTree( + (Executionreport) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Openorderloss` + if (value.getActualInstance() instanceof Openorderloss) { + JsonElement element = + adapterOpenorderloss.toJsonTree( + (Openorderloss) value.getActualInstance()); + 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; + } + // check if the actual instance is of the type `Risklevelchange` + if (value.getActualInstance() instanceof Risklevelchange) { + JsonElement element = + adapterRisklevelchange.toJsonTree( + (Risklevelchange) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " AccountConfigUpdate, AccountUpdate, Balanceupdate," + + " ConditionalOrderTradeUpdate, Executionreport," + + " Liabilitychange, Listenkeyexpired, Openorderloss," + + " OrderTradeUpdate, Outboundaccountposition," + + " Risklevelchange"); + } + + @Override + public UserDataStreamEventsResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + UserDataStreamEventsResponse newUserDataStreamEventsResponse = + new UserDataStreamEventsResponse(); + if (jsonObject.get("e") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for" + + " UserDataStreamEventsResponse as `e` was not found" + + " in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `e` + switch (jsonObject.get("e").getAsString()) { + case "ACCOUNT_CONFIG_UPDATE": + deserialized = + adapterAccountConfigUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "ACCOUNT_UPDATE": + deserialized = + adapterAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "CONDITIONAL_ORDER_TRADE_UPDATE": + deserialized = + adapterConditionalOrderTradeUpdate.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "ORDER_TRADE_UPDATE": + deserialized = + adapterOrderTradeUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "balanceUpdate": + deserialized = + adapterBalanceupdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "executionReport": + deserialized = + adapterExecutionreport.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "liabilityChange": + deserialized = + adapterLiabilitychange.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "listenKeyExpired": + deserialized = + adapterListenkeyexpired.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "openOrderLoss": + deserialized = + adapterOpenorderloss.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "outboundAccountPosition": + deserialized = + adapterOutboundaccountposition.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "riskLevelChange": + deserialized = + adapterRisklevelchange.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "accountConfigUpdate": + deserialized = + adapterAccountConfigUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "accountUpdate": + deserialized = + adapterAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "balanceupdate": + deserialized = + adapterBalanceupdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "conditionalOrderTradeUpdate": + deserialized = + adapterConditionalOrderTradeUpdate.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "executionreport": + deserialized = + adapterExecutionreport.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "liabilitychange": + deserialized = + adapterLiabilitychange.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "listenkeyexpired": + deserialized = + adapterListenkeyexpired.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "openorderloss": + deserialized = + adapterOpenorderloss.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "orderTradeUpdate": + deserialized = + adapterOrderTradeUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "outboundaccountposition": + deserialized = + adapterOutboundaccountposition.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "risklevelchange": + deserialized = + adapterRisklevelchange.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + default: + newUserDataStreamEventsResponse.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for UserDataStreamEventsResponse." + + " Possible values:" + + " ACCOUNT_CONFIG_UPDATE" + + " ACCOUNT_UPDATE" + + " CONDITIONAL_ORDER_TRADE_UPDATE" + + " ORDER_TRADE_UPDATE balanceUpdate" + + " executionReport liabilityChange" + + " listenKeyExpired openOrderLoss" + + " outboundAccountPosition" + + " riskLevelChange accountConfigUpdate" + + " accountUpdate balanceupdate" + + " conditionalOrderTradeUpdate" + + " executionreport liabilitychange" + + " listenkeyexpired openorderloss" + + " orderTradeUpdate" + + " outboundaccountposition" + + " risklevelchange. Falling back to" + + " String.", + jsonObject.get("e").getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ConditionalOrderTradeUpdate + try { + // validate the JSON object to see if any exception is thrown + ConditionalOrderTradeUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterConditionalOrderTradeUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'ConditionalOrderTradeUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ConditionalOrderTradeUpdate" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ConditionalOrderTradeUpdate'", + e); + } + // deserialize AccountConfigUpdate + try { + // validate the JSON object to see if any exception is thrown + AccountConfigUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterAccountConfigUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'AccountConfigUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AccountConfigUpdate failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AccountConfigUpdate'", + e); + } + // deserialize AccountUpdate + try { + // validate the JSON object to see if any exception is thrown + AccountUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterAccountUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'AccountUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AccountUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AccountUpdate'", + e); + } + // deserialize OrderTradeUpdate + try { + // validate the JSON object to see if any exception is thrown + OrderTradeUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterOrderTradeUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'OrderTradeUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for OrderTradeUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'OrderTradeUpdate'", + e); + } + // deserialize Liabilitychange + try { + // validate the JSON object to see if any exception is thrown + Liabilitychange.validateJsonElement(jsonElement); + actualAdapter = adapterLiabilitychange; + match++; + log.log(Level.FINER, "Input data matches schema 'Liabilitychange'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Liabilitychange failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Liabilitychange'", + e); + } + // deserialize Outboundaccountposition + try { + // validate the JSON object to see if any exception is thrown + Outboundaccountposition.validateJsonElement(jsonElement); + actualAdapter = adapterOutboundaccountposition; + match++; + log.log( + Level.FINER, + "Input data matches schema 'Outboundaccountposition'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Outboundaccountposition failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'Outboundaccountposition'", + e); + } + // deserialize Balanceupdate + try { + // validate the JSON object to see if any exception is thrown + Balanceupdate.validateJsonElement(jsonElement); + actualAdapter = adapterBalanceupdate; + match++; + log.log(Level.FINER, "Input data matches schema 'Balanceupdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Balanceupdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Balanceupdate'", + e); + } + // deserialize Executionreport + try { + // validate the JSON object to see if any exception is thrown + Executionreport.validateJsonElement(jsonElement); + actualAdapter = adapterExecutionreport; + match++; + log.log(Level.FINER, "Input data matches schema 'Executionreport'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Executionreport failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Executionreport'", + e); + } + // deserialize Openorderloss + try { + // validate the JSON object to see if any exception is thrown + Openorderloss.validateJsonElement(jsonElement); + actualAdapter = adapterOpenorderloss; + match++; + log.log(Level.FINER, "Input data matches schema 'Openorderloss'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Openorderloss failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Openorderloss'", + 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); + } + // deserialize Risklevelchange + try { + // validate the JSON object to see if any exception is thrown + Risklevelchange.validateJsonElement(jsonElement); + actualAdapter = adapterRisklevelchange; + match++; + log.log(Level.FINER, "Input data matches schema 'Risklevelchange'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Risklevelchange failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Risklevelchange'", + e); + } + + if (match == 1) { + UserDataStreamEventsResponse ret = + new UserDataStreamEventsResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for" + + " UserDataStreamEventsResponse: %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 UserDataStreamEventsResponse() { + super("oneOf", Boolean.FALSE); + } + + public UserDataStreamEventsResponse(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ConditionalOrderTradeUpdate", ConditionalOrderTradeUpdate.class); + schemas.put("AccountConfigUpdate", AccountConfigUpdate.class); + schemas.put("AccountUpdate", AccountUpdate.class); + schemas.put("OrderTradeUpdate", OrderTradeUpdate.class); + schemas.put("Liabilitychange", Liabilitychange.class); + schemas.put("Outboundaccountposition", Outboundaccountposition.class); + schemas.put("Balanceupdate", Balanceupdate.class); + schemas.put("Executionreport", Executionreport.class); + schemas.put("Openorderloss", Openorderloss.class); + schemas.put("Listenkeyexpired", Listenkeyexpired.class); + schemas.put("Risklevelchange", Risklevelchange.class); + } + + @Override + public Map> getSchemas() { + return UserDataStreamEventsResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AccountConfigUpdate, AccountUpdate, Balanceupdate, + * ConditionalOrderTradeUpdate, Executionreport, Liabilitychange, Listenkeyexpired, + * Openorderloss, OrderTradeUpdate, Outboundaccountposition, Risklevelchange + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ConditionalOrderTradeUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AccountConfigUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AccountUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OrderTradeUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Liabilitychange) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Outboundaccountposition) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Balanceupdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Executionreport) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Openorderloss) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Listenkeyexpired) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Risklevelchange) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be AccountConfigUpdate, AccountUpdate, Balanceupdate," + + " ConditionalOrderTradeUpdate, Executionreport, Liabilitychange," + + " Listenkeyexpired, Openorderloss, OrderTradeUpdate, Outboundaccountposition," + + " Risklevelchange"); + } + + /** + * Get the actual instance, which can be the following: AccountConfigUpdate, AccountUpdate, + * Balanceupdate, ConditionalOrderTradeUpdate, Executionreport, Liabilitychange, + * Listenkeyexpired, Openorderloss, OrderTradeUpdate, Outboundaccountposition, Risklevelchange + * + * @return The actual instance (AccountConfigUpdate, AccountUpdate, Balanceupdate, + * ConditionalOrderTradeUpdate, Executionreport, Liabilitychange, Listenkeyexpired, + * Openorderloss, OrderTradeUpdate, Outboundaccountposition, Risklevelchange) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ConditionalOrderTradeUpdate`. If the actual instance is not + * `ConditionalOrderTradeUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `ConditionalOrderTradeUpdate` + * @throws ClassCastException if the instance is not `ConditionalOrderTradeUpdate` + */ + public ConditionalOrderTradeUpdate getConditionalOrderTradeUpdate() throws ClassCastException { + return (ConditionalOrderTradeUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `AccountConfigUpdate`. If the actual instance is not + * `AccountConfigUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `AccountConfigUpdate` + * @throws ClassCastException if the instance is not `AccountConfigUpdate` + */ + public AccountConfigUpdate getAccountConfigUpdate() throws ClassCastException { + return (AccountConfigUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `AccountUpdate`. If the actual instance is not `AccountUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AccountUpdate` + * @throws ClassCastException if the instance is not `AccountUpdate` + */ + public AccountUpdate getAccountUpdate() throws ClassCastException { + return (AccountUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `OrderTradeUpdate`. If the actual instance is not + * `OrderTradeUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `OrderTradeUpdate` + * @throws ClassCastException if the instance is not `OrderTradeUpdate` + */ + public OrderTradeUpdate getOrderTradeUpdate() throws ClassCastException { + return (OrderTradeUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `Liabilitychange`. If the actual instance is not + * `Liabilitychange`, the ClassCastException will be thrown. + * + * @return The actual instance of `Liabilitychange` + * @throws ClassCastException if the instance is not `Liabilitychange` + */ + public Liabilitychange getLiabilitychange() throws ClassCastException { + return (Liabilitychange) super.getActualInstance(); + } + + /** + * Get the actual instance of `Outboundaccountposition`. If the actual instance is not + * `Outboundaccountposition`, the ClassCastException will be thrown. + * + * @return The actual instance of `Outboundaccountposition` + * @throws ClassCastException if the instance is not `Outboundaccountposition` + */ + public Outboundaccountposition getOutboundaccountposition() throws ClassCastException { + return (Outboundaccountposition) super.getActualInstance(); + } + + /** + * Get the actual instance of `Balanceupdate`. If the actual instance is not `Balanceupdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Balanceupdate` + * @throws ClassCastException if the instance is not `Balanceupdate` + */ + public Balanceupdate getBalanceupdate() throws ClassCastException { + return (Balanceupdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `Executionreport`. If the actual instance is not + * `Executionreport`, the ClassCastException will be thrown. + * + * @return The actual instance of `Executionreport` + * @throws ClassCastException if the instance is not `Executionreport` + */ + public Executionreport getExecutionreport() throws ClassCastException { + return (Executionreport) super.getActualInstance(); + } + + /** + * Get the actual instance of `Openorderloss`. If the actual instance is not `Openorderloss`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Openorderloss` + * @throws ClassCastException if the instance is not `Openorderloss` + */ + public Openorderloss getOpenorderloss() throws ClassCastException { + return (Openorderloss) 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(); + } + + /** + * Get the actual instance of `Risklevelchange`. If the actual instance is not + * `Risklevelchange`, the ClassCastException will be thrown. + * + * @return The actual instance of `Risklevelchange` + * @throws ClassCastException if the instance is not `Risklevelchange` + */ + public Risklevelchange getRisklevelchange() throws ClassCastException { + return (Risklevelchange) 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 + * UserDataStreamEventsResponse + */ + 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 ConditionalOrderTradeUpdate + try { + ConditionalOrderTradeUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ConditionalOrderTradeUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AccountConfigUpdate + try { + AccountConfigUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AccountConfigUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AccountUpdate + try { + AccountUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AccountUpdate failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OrderTradeUpdate + try { + OrderTradeUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for OrderTradeUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with Liabilitychange + try { + Liabilitychange.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Liabilitychange failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with Outboundaccountposition + try { + Outboundaccountposition.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Outboundaccountposition failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with Balanceupdate + try { + Balanceupdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Balanceupdate failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Executionreport + try { + Executionreport.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Executionreport failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with Openorderloss + try { + Openorderloss.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Openorderloss failed with `%s`.", 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 + } + // validate the json string with Risklevelchange + try { + Risklevelchange.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Risklevelchange 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: AccountConfigUpdate, AccountUpdate, Balanceupdate," + + " ConditionalOrderTradeUpdate, Executionreport, Liabilitychange," + + " Listenkeyexpired, Openorderloss, OrderTradeUpdate," + + " Outboundaccountposition, Risklevelchange. %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 UserDataStreamEventsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDataStreamEventsResponse + * @throws IOException if the JSON string is invalid with respect to + * UserDataStreamEventsResponse + */ + public static UserDataStreamEventsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDataStreamEventsResponse.class); + } + + /** + * Convert an instance of UserDataStreamEventsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/CHANGELOG.md b/clients/derivatives-trading-usds-futures/CHANGELOG.md index cc146098..665d6fad 100644 --- a/clients/derivatives-trading-usds-futures/CHANGELOG.md +++ b/clients/derivatives-trading-usds-futures/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 4.0.0 - 2025-07-16 + +### Added (1) + +- Support User Data Streams. + +### Changed (1) + +- Update `binance/common` module to version `1.4.0`. + ## 3.1.0 - 2025-07-08 - Update `binance/common` module to version `1.3.0`. diff --git a/clients/derivatives-trading-usds-futures/docs/AccountConfigUpdate.md b/clients/derivatives-trading-usds-futures/docs/AccountConfigUpdate.md new file mode 100644 index 00000000..2684d5d5 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AccountConfigUpdate.md @@ -0,0 +1,16 @@ + + +# AccountConfigUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**ac** | [**AccountConfigUpdateAc**](AccountConfigUpdateAc.md) | | [optional] | +|**ai** | [**AccountConfigUpdateAi**](AccountConfigUpdateAi.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AccountConfigUpdateAc.md b/clients/derivatives-trading-usds-futures/docs/AccountConfigUpdateAc.md new file mode 100644 index 00000000..c1ad4a50 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AccountConfigUpdateAc.md @@ -0,0 +1,14 @@ + + +# AccountConfigUpdateAc + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**lLowerCase** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AccountConfigUpdateAi.md b/clients/derivatives-trading-usds-futures/docs/AccountConfigUpdateAi.md new file mode 100644 index 00000000..7905cd31 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AccountConfigUpdateAi.md @@ -0,0 +1,13 @@ + + +# AccountConfigUpdateAi + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**jLowerCase** | **Boolean** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AccountUpdate.md b/clients/derivatives-trading-usds-futures/docs/AccountUpdate.md new file mode 100644 index 00000000..87e31ecd --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AccountUpdate.md @@ -0,0 +1,15 @@ + + +# AccountUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**aLowerCase** | [**AccountUpdateA**](AccountUpdateA.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AccountUpdateA.md b/clients/derivatives-trading-usds-futures/docs/AccountUpdateA.md new file mode 100644 index 00000000..b3859d2e --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AccountUpdateA.md @@ -0,0 +1,15 @@ + + +# AccountUpdateA + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mLowerCase** | **String** | | [optional] | +|**B** | [**List<AccountUpdateABInner>**](AccountUpdateABInner.md) | | [optional] | +|**P** | [**List<AccountUpdateAPInner>**](AccountUpdateAPInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AccountUpdateABInner.md b/clients/derivatives-trading-usds-futures/docs/AccountUpdateABInner.md new file mode 100644 index 00000000..3380c37b --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AccountUpdateABInner.md @@ -0,0 +1,16 @@ + + +# AccountUpdateABInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aLowerCase** | **String** | | [optional] | +|**wb** | **String** | | [optional] | +|**cw** | **String** | | [optional] | +|**bc** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AccountUpdateAPInner.md b/clients/derivatives-trading-usds-futures/docs/AccountUpdateAPInner.md new file mode 100644 index 00000000..2621e1c3 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AccountUpdateAPInner.md @@ -0,0 +1,21 @@ + + +# AccountUpdateAPInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**pa** | **String** | | [optional] | +|**ep** | **String** | | [optional] | +|**bep** | **String** | | [optional] | +|**cr** | **String** | | [optional] | +|**up** | **String** | | [optional] | +|**mt** | **String** | | [optional] | +|**iw** | **String** | | [optional] | +|**ps** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md b/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md index 9ecc3318..d0469439 100644 --- a/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md +++ b/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md @@ -7,24 +7,14 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**orderId** | **Long** | | [optional] | +|**origClientOrderId** | **String** | | [optional] | |**symbol** | **String** | | [optional] | |**side** | [**SideEnum**](#SideEnum) | | [optional] | -|**positionSide** | [**PositionSideEnum**](#PositionSideEnum) | | [optional] | -|**type** | **String** | | [optional] | -|**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | | [optional] | |**quantity** | **Double** | | [optional] | -|**reduceOnly** | **String** | | [optional] | |**price** | **Double** | | [optional] | -|**newClientOrderId** | **String** | | [optional] | -|**stopPrice** | **Double** | | [optional] | -|**activationPrice** | **Double** | | [optional] | -|**callbackRate** | **Double** | | [optional] | -|**workingType** | [**WorkingTypeEnum**](#WorkingTypeEnum) | | [optional] | -|**priceProtect** | **String** | | [optional] | -|**newOrderRespType** | [**NewOrderRespTypeEnum**](#NewOrderRespTypeEnum) | | [optional] | |**priceMatch** | [**PriceMatchEnum**](#PriceMatchEnum) | | [optional] | -|**selfTradePreventionMode** | [**SelfTradePreventionModeEnum**](#SelfTradePreventionModeEnum) | | [optional] | -|**goodTillDate** | **Long** | | [optional] | +|**recvWindow** | **Long** | | [optional] | @@ -37,46 +27,6 @@ -## Enum: PositionSideEnum - -| Name | Value | -|---- | -----| -| BOTH | "BOTH" | -| LONG | "LONG" | -| SHORT | "SHORT" | - - - -## Enum: TimeInForceEnum - -| Name | Value | -|---- | -----| -| GTC | "GTC" | -| IOC | "IOC" | -| FOK | "FOK" | -| GTX | "GTX" | -| GTD | "GTD" | - - - -## Enum: WorkingTypeEnum - -| Name | Value | -|---- | -----| -| MARK_PRICE | "MARK_PRICE" | -| CONTRACT_PRICE | "CONTRACT_PRICE" | - - - -## Enum: NewOrderRespTypeEnum - -| Name | Value | -|---- | -----| -| ACK | "ACK" | -| RESULT | "RESULT" | - - - ## Enum: PriceMatchEnum | Name | Value | @@ -93,13 +43,3 @@ -## Enum: SelfTradePreventionModeEnum - -| Name | Value | -|---- | -----| -| EXPIRE_TAKER | "EXPIRE_TAKER" | -| EXPIRE_BOTH | "EXPIRE_BOTH" | -| EXPIRE_MAKER | "EXPIRE_MAKER" | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrders.md b/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrders.md new file mode 100644 index 00000000..d41e556f --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrders.md @@ -0,0 +1,12 @@ + + +# BatchOrdersPlaceMultipleOrders + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md b/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md new file mode 100644 index 00000000..18576940 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md @@ -0,0 +1,105 @@ + + +# BatchOrdersPlaceMultipleOrdersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**side** | [**SideEnum**](#SideEnum) | | [optional] | +|**positionSide** | [**PositionSideEnum**](#PositionSideEnum) | | [optional] | +|**type** | **String** | | [optional] | +|**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | | [optional] | +|**quantity** | **Double** | | [optional] | +|**reduceOnly** | **String** | | [optional] | +|**price** | **Double** | | [optional] | +|**newClientOrderId** | **String** | | [optional] | +|**stopPrice** | **Double** | | [optional] | +|**activationPrice** | **Double** | | [optional] | +|**callbackRate** | **Double** | | [optional] | +|**workingType** | [**WorkingTypeEnum**](#WorkingTypeEnum) | | [optional] | +|**priceProtect** | **String** | | [optional] | +|**newOrderRespType** | [**NewOrderRespTypeEnum**](#NewOrderRespTypeEnum) | | [optional] | +|**priceMatch** | [**PriceMatchEnum**](#PriceMatchEnum) | | [optional] | +|**selfTradePreventionMode** | [**SelfTradePreventionModeEnum**](#SelfTradePreventionModeEnum) | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + +## Enum: SideEnum + +| Name | Value | +|---- | -----| +| BUY | "BUY" | +| SELL | "SELL" | + + + +## Enum: PositionSideEnum + +| Name | Value | +|---- | -----| +| BOTH | "BOTH" | +| LONG | "LONG" | +| SHORT | "SHORT" | + + + +## Enum: TimeInForceEnum + +| Name | Value | +|---- | -----| +| GTC | "GTC" | +| IOC | "IOC" | +| FOK | "FOK" | +| GTX | "GTX" | +| GTD | "GTD" | + + + +## Enum: WorkingTypeEnum + +| Name | Value | +|---- | -----| +| MARK_PRICE | "MARK_PRICE" | +| CONTRACT_PRICE | "CONTRACT_PRICE" | + + + +## Enum: NewOrderRespTypeEnum + +| Name | Value | +|---- | -----| +| ACK | "ACK" | +| RESULT | "RESULT" | + + + +## Enum: PriceMatchEnum + +| Name | Value | +|---- | -----| +| NONE | "NONE" | +| OPPONENT | "OPPONENT" | +| OPPONENT_5 | "OPPONENT_5" | +| OPPONENT_10 | "OPPONENT_10" | +| OPPONENT_20 | "OPPONENT_20" | +| QUEUE | "QUEUE" | +| QUEUE_5 | "QUEUE_5" | +| QUEUE_10 | "QUEUE_10" | +| QUEUE_20 | "QUEUE_20" | + + + +## Enum: SelfTradePreventionModeEnum + +| Name | Value | +|---- | -----| +| EXPIRE_TAKER | "EXPIRE_TAKER" | +| EXPIRE_BOTH | "EXPIRE_BOTH" | +| EXPIRE_MAKER | "EXPIRE_MAKER" | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/ConditionalOrderTriggerReject.md b/clients/derivatives-trading-usds-futures/docs/ConditionalOrderTriggerReject.md new file mode 100644 index 00000000..fa013026 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/ConditionalOrderTriggerReject.md @@ -0,0 +1,15 @@ + + +# ConditionalOrderTriggerReject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**or** | [**ConditionalOrderTriggerRejectOr**](ConditionalOrderTriggerRejectOr.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/ConditionalOrderTriggerRejectOr.md b/clients/derivatives-trading-usds-futures/docs/ConditionalOrderTriggerRejectOr.md new file mode 100644 index 00000000..07534caa --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/ConditionalOrderTriggerRejectOr.md @@ -0,0 +1,15 @@ + + +# ConditionalOrderTriggerRejectOr + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**rLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/GridUpdate.md b/clients/derivatives-trading-usds-futures/docs/GridUpdate.md new file mode 100644 index 00000000..6ef473ae --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/GridUpdate.md @@ -0,0 +1,15 @@ + + +# GridUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**T** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | +|**gu** | [**GridUpdateGu**](GridUpdateGu.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/GridUpdateGu.md b/clients/derivatives-trading-usds-futures/docs/GridUpdateGu.md new file mode 100644 index 00000000..350ff7bb --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/GridUpdateGu.md @@ -0,0 +1,22 @@ + + +# GridUpdateGu + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**si** | **Long** | | [optional] | +|**st** | **String** | | [optional] | +|**ss** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**up** | **String** | | [optional] | +|**uq** | **String** | | [optional] | +|**uf** | **String** | | [optional] | +|**mp** | **String** | | [optional] | +|**ut** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/Listenkeyexpired.md b/clients/derivatives-trading-usds-futures/docs/Listenkeyexpired.md new file mode 100644 index 00000000..a4f18a41 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/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-usds-futures/docs/MarginCall.md b/clients/derivatives-trading-usds-futures/docs/MarginCall.md new file mode 100644 index 00000000..babc95e0 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/MarginCall.md @@ -0,0 +1,15 @@ + + +# MarginCall + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**cw** | **String** | | [optional] | +|**pLowerCase** | [**List<MarginCallPInner>**](MarginCallPInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/MarginCallPInner.md b/clients/derivatives-trading-usds-futures/docs/MarginCallPInner.md new file mode 100644 index 00000000..0cdf73fb --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/MarginCallPInner.md @@ -0,0 +1,20 @@ + + +# MarginCallPInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**ps** | **String** | | [optional] | +|**pa** | **String** | | [optional] | +|**mt** | **String** | | [optional] | +|**iw** | **String** | | [optional] | +|**mp** | **String** | | [optional] | +|**up** | **String** | | [optional] | +|**mm** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/OpenInterestStatisticsResponseInner.md b/clients/derivatives-trading-usds-futures/docs/OpenInterestStatisticsResponseInner.md index 0d52e7f9..4921c71a 100644 --- a/clients/derivatives-trading-usds-futures/docs/OpenInterestStatisticsResponseInner.md +++ b/clients/derivatives-trading-usds-futures/docs/OpenInterestStatisticsResponseInner.md @@ -10,6 +10,7 @@ |**symbol** | **String** | | [optional] | |**sumOpenInterest** | **String** | | [optional] | |**sumOpenInterestValue** | **String** | | [optional] | +|**cmCCirculatingSupply** | **String** | | [optional] | |**timestamp** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdate.md b/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdate.md new file mode 100644 index 00000000..06401790 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdate.md @@ -0,0 +1,15 @@ + + +# OrderTradeUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**oLowerCase** | [**OrderTradeUpdateO**](OrderTradeUpdateO.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdateO.md b/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdateO.md new file mode 100644 index 00000000..d6f53432 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdateO.md @@ -0,0 +1,48 @@ + + +# 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] | +|**sp** | **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] | +|**wt** | **String** | | [optional] | +|**ot** | **String** | | [optional] | +|**ps** | **String** | | [optional] | +|**cp** | **Boolean** | | [optional] | +|**AP** | **String** | | [optional] | +|**cr** | **String** | | [optional] | +|**pP** | **Boolean** | | [optional] | +|**si** | **Long** | | [optional] | +|**ss** | **Long** | | [optional] | +|**rp** | **String** | | [optional] | +|**V** | **String** | | [optional] | +|**pm** | **String** | | [optional] | +|**gtd** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersRequest.md b/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersRequest.md index 7c31f8d3..22e63396 100644 --- a/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersRequest.md +++ b/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**batchOrders** | **BatchOrders** | | | +|**batchOrders** | **BatchOrdersPlaceMultipleOrders** | | | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/StrategyUpdate.md b/clients/derivatives-trading-usds-futures/docs/StrategyUpdate.md new file mode 100644 index 00000000..cf642fdf --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/StrategyUpdate.md @@ -0,0 +1,15 @@ + + +# StrategyUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**T** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | +|**su** | [**StrategyUpdateSu**](StrategyUpdateSu.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/StrategyUpdateSu.md b/clients/derivatives-trading-usds-futures/docs/StrategyUpdateSu.md new file mode 100644 index 00000000..e9329247 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/StrategyUpdateSu.md @@ -0,0 +1,18 @@ + + +# StrategyUpdateSu + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**si** | **Long** | | [optional] | +|**st** | **String** | | [optional] | +|**ss** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**ut** | **Long** | | [optional] | +|**cLowerCase** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/TradeLite.md b/clients/derivatives-trading-usds-futures/docs/TradeLite.md new file mode 100644 index 00000000..8a2df143 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/TradeLite.md @@ -0,0 +1,24 @@ + + +# TradeLite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-usds-futures/docs/UserDataStreamEventsResponse.md new file mode 100644 index 00000000..405062fd --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/UserDataStreamEventsResponse.md @@ -0,0 +1,33 @@ + + +# UserDataStreamEventsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**ac** | [**AccountConfigUpdateAc**](AccountConfigUpdateAc.md) | | [optional] | +|**ai** | [**AccountConfigUpdateAi**](AccountConfigUpdateAi.md) | | [optional] | +|**aLowerCase** | [**AccountUpdateA**](AccountUpdateA.md) | | [optional] | +|**or** | [**ConditionalOrderTriggerRejectOr**](ConditionalOrderTriggerRejectOr.md) | | [optional] | +|**gu** | [**GridUpdateGu**](GridUpdateGu.md) | | [optional] | +|**cw** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**oLowerCase** | [**OrderTradeUpdateO**](OrderTradeUpdateO.md) | | [optional] | +|**su** | [**StrategyUpdateSu**](StrategyUpdateSu.md) | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**listenKey** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/example_rest.md b/clients/derivatives-trading-usds-futures/example_rest.md index 0d1d2f54..cc31b32d 100644 --- a/clients/derivatives-trading-usds-futures/example_rest.md +++ b/clients/derivatives-trading-usds-futures/example_rest.md @@ -46,7 +46,7 @@ [POST /fapi/v1/convert/acceptQuote](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) - acceptTheOfferedQuote - [AcceptTheOfferedQuoteExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/convert/AcceptTheOfferedQuoteExample.java#L48) -[GET /fapi/v1/convert/exchangeInfo](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/List-All-Convert-Pairs) - listAllConvertPairs - [ListAllConvertPairsExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/convert/ListAllConvertPairsExample.java#L50) +[GET /fapi/v1/convert/exchangeInfo](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/) - listAllConvertPairs - [ListAllConvertPairsExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/convert/ListAllConvertPairsExample.java#L50) [GET /fapi/v1/convert/orderStatus](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) - orderStatus - [OrderStatusExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/convert/OrderStatusExample.java#L47) diff --git a/clients/derivatives-trading-usds-futures/example_websocket_api.md b/clients/derivatives-trading-usds-futures/example_websocket_api.md index 9dbc7ce9..2f417d78 100644 --- a/clients/derivatives-trading-usds-futures/example_websocket_api.md +++ b/clients/derivatives-trading-usds-futures/example_websocket_api.md @@ -1,40 +1,40 @@ ## Account -[account.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) - accountInformation - [AccountInformationExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationExample.java#L47) +[account.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) - accountInformation - [AccountInformationExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationExample.java#L49) -[v2/account.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) - accountInformationV2 - [AccountInformationV2ExampleAsync.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java#L47) +[v2/account.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) - accountInformationV2 - [AccountInformationV2ExampleAsync.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java#L49) -[account.balance](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) - futuresAccountBalance - [FuturesAccountBalanceExample.java:46](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceExample.java#L46) +[account.balance](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) - futuresAccountBalance - [FuturesAccountBalanceExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceExample.java#L48) -[v2/account.balance](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance-V2) - futuresAccountBalanceV2 - [FuturesAccountBalanceV2ExampleAsync.java:46](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java#L46) +[v2/account.balance](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance-V2) - futuresAccountBalanceV2 - [FuturesAccountBalanceV2ExampleAsync.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java#L48) ## MarketData -[depth](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book) - orderBook - [OrderBookExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java#L51) +[depth](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book) - orderBook - [OrderBookExample.java:53](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java#L53) -[ticker.book](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) - symbolOrderBookTicker - [SymbolOrderBookTickerExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java#L49) +[ticker.book](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) - symbolOrderBookTicker - [SymbolOrderBookTickerExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java#L51) -[ticker.price](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) - symbolPriceTicker - [SymbolPriceTickerExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolPriceTickerExample.java#L48) +[ticker.price](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) - symbolPriceTicker - [SymbolPriceTickerExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolPriceTickerExample.java#L50) ## Trade -[order.cancel](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) - cancelOrder - [CancelOrderExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelOrderExample.java#L47) +[order.cancel](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) - cancelOrder - [CancelOrderExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelOrderExample.java#L49) -[order.modify](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) - modifyOrder - [ModifyOrderExample.java:58](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java#L58) +[order.modify](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) - modifyOrder - [ModifyOrderExample.java:60](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java#L60) -[order.place](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order) - newOrder - [NewOrderExample.java:79](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewOrderExample.java#L79) +[order.place](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order) - newOrder - [NewOrderExample.java:81](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewOrderExample.java#L81) -[account.position](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) - positionInformation - [PositionInformationExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationExample.java#L47) +[account.position](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) - positionInformation - [PositionInformationExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationExample.java#L49) -[v2/account.position](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) - positionInformationV2 - [PositionInformationV2ExampleAsync.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java#L48) +[v2/account.position](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) - positionInformationV2 - [PositionInformationV2ExampleAsync.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java#L50) -[order.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) - queryOrder - [QueryOrderExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/QueryOrderExample.java#L50) +[order.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) - queryOrder - [QueryOrderExample.java:52](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/QueryOrderExample.java#L52) ## UserDataStreams -[userDataStream.stop](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) - closeUserDataStream - [CloseUserDataStreamExample.java:46](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java#L46) +[userDataStream.stop](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) - closeUserDataStream - [CloseUserDataStreamExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java#L48) -[userDataStream.ping](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) - keepaliveUserDataStream - [KeepaliveUserDataStreamExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java#L47) +[userDataStream.ping](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) - keepaliveUserDataStream - [KeepaliveUserDataStreamExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java#L49) -[userDataStream.start](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) - startUserDataStream - [StartUserDataStreamExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java#L48) +[userDataStream.start](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) - startUserDataStream - [StartUserDataStreamExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java#L50) diff --git a/clients/derivatives-trading-usds-futures/pom.xml b/clients/derivatives-trading-usds-futures/pom.xml index ef887dcc..27f3049b 100644 --- a/clients/derivatives-trading-usds-futures/pom.xml +++ b/clients/derivatives-trading-usds-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-usds-futures derivatives-trading-usds-futures - 3.1.0 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.3.0 + 1.4.0 \ No newline at end of file diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java index 2bddfc84..7286b926 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java @@ -162,6 +162,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .BatchOrdersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .BatchOrdersPlaceMultipleOrders.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .BatchOrdersPlaceMultipleOrdersInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .CancelAllOpenOrdersResponse.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java index 302d0f6c..93574f03 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java @@ -64,7 +64,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/3.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java index 31b581b6..63b65c6e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java @@ -49,7 +49,7 @@ public class ConvertApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/3.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -247,7 +247,7 @@ public ApiResponse acceptTheOfferedQuote( * * * @see List + * href="https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/">List * All Convert Pairs Documentation */ private okhttp3.Call listAllConvertPairsCall(String fromAsset, String toAsset) @@ -365,7 +365,7 @@ private okhttp3.Call listAllConvertPairsValidateBeforeCall(String fromAsset, Str * * * @see List + * href="https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/">List * All Convert Pairs Documentation */ public ApiResponse listAllConvertPairs( diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java index 8c6aa8d0..abd72c72 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java @@ -723,7 +723,7 @@ public ApiResponse acceptTheOfferedQuote( * * * @see List + * href="https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/">List * All Convert Pairs Documentation */ public ApiResponse listAllConvertPairs( diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java index d305465f..561219d1 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java @@ -74,7 +74,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/3.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java index c113ac86..56c0388e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/3.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java index f559a53f..fb3794fb 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java @@ -83,7 +83,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/3.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java index 49bcd943..b63119bd 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java @@ -43,7 +43,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/3.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java index 64493f4d..3a2e2cc6 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java @@ -38,6 +38,18 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class BatchOrdersInner { + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_ORIG_CLIENT_ORDER_ID = "origClientOrderId"; + + @SerializedName(SERIALIZED_NAME_ORIG_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String origClientOrderId; + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; @SerializedName(SERIALIZED_NAME_SYMBOL) @@ -101,296 +113,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @jakarta.annotation.Nullable private SideEnum side; - /** Gets or Sets positionSide */ - @JsonAdapter(PositionSideEnum.Adapter.class) - public enum PositionSideEnum { - BOTH("BOTH"), - - LONG("LONG"), - - SHORT("SHORT"); - - private String value; - - PositionSideEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static PositionSideEnum fromValue(String value) { - for (PositionSideEnum b : PositionSideEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final PositionSideEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public PositionSideEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return PositionSideEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - PositionSideEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; - - @SerializedName(SERIALIZED_NAME_POSITION_SIDE) - @jakarta.annotation.Nullable - private PositionSideEnum positionSide; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @jakarta.annotation.Nullable - private String type; - - /** Gets or Sets timeInForce */ - @JsonAdapter(TimeInForceEnum.Adapter.class) - public enum TimeInForceEnum { - GTC("GTC"), - - IOC("IOC"), - - FOK("FOK"), - - GTX("GTX"), - - GTD("GTD"); - - private String value; - - TimeInForceEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TimeInForceEnum fromValue(String value) { - for (TimeInForceEnum b : TimeInForceEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TimeInForceEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TimeInForceEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TimeInForceEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; - - @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) - @jakarta.annotation.Nullable - private TimeInForceEnum timeInForce; - public static final String SERIALIZED_NAME_QUANTITY = "quantity"; @SerializedName(SERIALIZED_NAME_QUANTITY) @jakarta.annotation.Nullable private Double quantity; - public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; - - @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) - @jakarta.annotation.Nullable - private String reduceOnly; - public static final String SERIALIZED_NAME_PRICE = "price"; @SerializedName(SERIALIZED_NAME_PRICE) @jakarta.annotation.Nullable private Double price; - public static final String SERIALIZED_NAME_NEW_CLIENT_ORDER_ID = "newClientOrderId"; - - @SerializedName(SERIALIZED_NAME_NEW_CLIENT_ORDER_ID) - @jakarta.annotation.Nullable - private String newClientOrderId; - - public static final String SERIALIZED_NAME_STOP_PRICE = "stopPrice"; - - @SerializedName(SERIALIZED_NAME_STOP_PRICE) - @jakarta.annotation.Nullable - private Double stopPrice; - - public static final String SERIALIZED_NAME_ACTIVATION_PRICE = "activationPrice"; - - @SerializedName(SERIALIZED_NAME_ACTIVATION_PRICE) - @jakarta.annotation.Nullable - private Double activationPrice; - - public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; - - @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) - @jakarta.annotation.Nullable - private Double callbackRate; - - /** Gets or Sets workingType */ - @JsonAdapter(WorkingTypeEnum.Adapter.class) - public enum WorkingTypeEnum { - MARK_PRICE("MARK_PRICE"), - - CONTRACT_PRICE("CONTRACT_PRICE"); - - private String value; - - WorkingTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static WorkingTypeEnum fromValue(String value) { - for (WorkingTypeEnum b : WorkingTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final WorkingTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public WorkingTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return WorkingTypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - WorkingTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; - - @SerializedName(SERIALIZED_NAME_WORKING_TYPE) - @jakarta.annotation.Nullable - private WorkingTypeEnum workingType; - - public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; - - @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) - @jakarta.annotation.Nullable - private String priceProtect; - - /** Gets or Sets newOrderRespType */ - @JsonAdapter(NewOrderRespTypeEnum.Adapter.class) - public enum NewOrderRespTypeEnum { - ACK("ACK"), - - RESULT("RESULT"); - - private String value; - - NewOrderRespTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static NewOrderRespTypeEnum fromValue(String value) { - for (NewOrderRespTypeEnum b : NewOrderRespTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final NewOrderRespTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public NewOrderRespTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return NewOrderRespTypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - NewOrderRespTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_NEW_ORDER_RESP_TYPE = "newOrderRespType"; - - @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESP_TYPE) - @jakarta.annotation.Nullable - private NewOrderRespTypeEnum newOrderRespType; - /** Gets or Sets priceMatch */ @JsonAdapter(PriceMatchEnum.Adapter.class) public enum PriceMatchEnum { @@ -462,170 +196,89 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @jakarta.annotation.Nullable private PriceMatchEnum priceMatch; - /** Gets or Sets selfTradePreventionMode */ - @JsonAdapter(SelfTradePreventionModeEnum.Adapter.class) - public enum SelfTradePreventionModeEnum { - EXPIRE_TAKER("EXPIRE_TAKER"), - - EXPIRE_BOTH("EXPIRE_BOTH"), - - EXPIRE_MAKER("EXPIRE_MAKER"); - - private String value; - - SelfTradePreventionModeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; - @Override - public String toString() { - return String.valueOf(value); - } - - public static SelfTradePreventionModeEnum fromValue(String value) { - for (SelfTradePreventionModeEnum b : SelfTradePreventionModeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write( - final JsonWriter jsonWriter, final SelfTradePreventionModeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SelfTradePreventionModeEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return SelfTradePreventionModeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - SelfTradePreventionModeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = - "selfTradePreventionMode"; - - @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private SelfTradePreventionModeEnum selfTradePreventionMode; - - public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; - - @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) - @jakarta.annotation.Nullable - private Long goodTillDate; + private Long recvWindow; public BatchOrdersInner() {} - public BatchOrdersInner symbol(@jakarta.annotation.Nullable String symbol) { - this.symbol = symbol; - return this; - } - - /** - * Get symbol - * - * @return symbol - */ - @jakarta.annotation.Nullable - public String getSymbol() { - return symbol; - } - - public void setSymbol(@jakarta.annotation.Nullable String symbol) { - this.symbol = symbol; - } - - public BatchOrdersInner side(@jakarta.annotation.Nullable SideEnum side) { - this.side = side; + public BatchOrdersInner orderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; return this; } /** - * Get side + * Get orderId * - * @return side + * @return orderId */ @jakarta.annotation.Nullable - public SideEnum getSide() { - return side; + public Long getOrderId() { + return orderId; } - public void setSide(@jakarta.annotation.Nullable SideEnum side) { - this.side = side; + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; } - public BatchOrdersInner positionSide( - @jakarta.annotation.Nullable PositionSideEnum positionSide) { - this.positionSide = positionSide; + public BatchOrdersInner origClientOrderId( + @jakarta.annotation.Nullable String origClientOrderId) { + this.origClientOrderId = origClientOrderId; return this; } /** - * Get positionSide + * Get origClientOrderId * - * @return positionSide + * @return origClientOrderId */ @jakarta.annotation.Nullable - public PositionSideEnum getPositionSide() { - return positionSide; + public String getOrigClientOrderId() { + return origClientOrderId; } - public void setPositionSide(@jakarta.annotation.Nullable PositionSideEnum positionSide) { - this.positionSide = positionSide; + public void setOrigClientOrderId(@jakarta.annotation.Nullable String origClientOrderId) { + this.origClientOrderId = origClientOrderId; } - public BatchOrdersInner type(@jakarta.annotation.Nullable String type) { - this.type = type; + public BatchOrdersInner symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; return this; } /** - * Get type + * Get symbol * - * @return type + * @return symbol */ @jakarta.annotation.Nullable - public String getType() { - return type; + public String getSymbol() { + return symbol; } - public void setType(@jakarta.annotation.Nullable String type) { - this.type = type; + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; } - public BatchOrdersInner timeInForce(@jakarta.annotation.Nullable TimeInForceEnum timeInForce) { - this.timeInForce = timeInForce; + public BatchOrdersInner side(@jakarta.annotation.Nullable SideEnum side) { + this.side = side; return this; } /** - * Get timeInForce + * Get side * - * @return timeInForce + * @return side */ @jakarta.annotation.Nullable - public TimeInForceEnum getTimeInForce() { - return timeInForce; + public SideEnum getSide() { + return side; } - public void setTimeInForce(@jakarta.annotation.Nullable TimeInForceEnum timeInForce) { - this.timeInForce = timeInForce; + public void setSide(@jakarta.annotation.Nullable SideEnum side) { + this.side = side; } public BatchOrdersInner quantity(@jakarta.annotation.Nullable Double quantity) { @@ -648,25 +301,6 @@ public void setQuantity(@jakarta.annotation.Nullable Double quantity) { this.quantity = quantity; } - public BatchOrdersInner reduceOnly(@jakarta.annotation.Nullable String reduceOnly) { - this.reduceOnly = reduceOnly; - return this; - } - - /** - * Get reduceOnly - * - * @return reduceOnly - */ - @jakarta.annotation.Nullable - public String getReduceOnly() { - return reduceOnly; - } - - public void setReduceOnly(@jakarta.annotation.Nullable String reduceOnly) { - this.reduceOnly = reduceOnly; - } - public BatchOrdersInner price(@jakarta.annotation.Nullable Double price) { this.price = price; return this; @@ -687,144 +321,6 @@ public void setPrice(@jakarta.annotation.Nullable Double price) { this.price = price; } - public BatchOrdersInner newClientOrderId(@jakarta.annotation.Nullable String newClientOrderId) { - this.newClientOrderId = newClientOrderId; - return this; - } - - /** - * Get newClientOrderId - * - * @return newClientOrderId - */ - @jakarta.annotation.Nullable - public String getNewClientOrderId() { - return newClientOrderId; - } - - public void setNewClientOrderId(@jakarta.annotation.Nullable String newClientOrderId) { - this.newClientOrderId = newClientOrderId; - } - - public BatchOrdersInner stopPrice(@jakarta.annotation.Nullable Double stopPrice) { - this.stopPrice = stopPrice; - return this; - } - - /** - * Get stopPrice - * - * @return stopPrice - */ - @jakarta.annotation.Nullable - @Valid - public Double getStopPrice() { - return stopPrice; - } - - public void setStopPrice(@jakarta.annotation.Nullable Double stopPrice) { - this.stopPrice = stopPrice; - } - - public BatchOrdersInner activationPrice(@jakarta.annotation.Nullable Double activationPrice) { - this.activationPrice = activationPrice; - return this; - } - - /** - * Get activationPrice - * - * @return activationPrice - */ - @jakarta.annotation.Nullable - @Valid - public Double getActivationPrice() { - return activationPrice; - } - - public void setActivationPrice(@jakarta.annotation.Nullable Double activationPrice) { - this.activationPrice = activationPrice; - } - - public BatchOrdersInner callbackRate(@jakarta.annotation.Nullable Double callbackRate) { - this.callbackRate = callbackRate; - return this; - } - - /** - * Get callbackRate - * - * @return callbackRate - */ - @jakarta.annotation.Nullable - @Valid - public Double getCallbackRate() { - return callbackRate; - } - - public void setCallbackRate(@jakarta.annotation.Nullable Double callbackRate) { - this.callbackRate = callbackRate; - } - - public BatchOrdersInner workingType(@jakarta.annotation.Nullable WorkingTypeEnum workingType) { - this.workingType = workingType; - return this; - } - - /** - * Get workingType - * - * @return workingType - */ - @jakarta.annotation.Nullable - public WorkingTypeEnum getWorkingType() { - return workingType; - } - - public void setWorkingType(@jakarta.annotation.Nullable WorkingTypeEnum workingType) { - this.workingType = workingType; - } - - public BatchOrdersInner priceProtect(@jakarta.annotation.Nullable String priceProtect) { - this.priceProtect = priceProtect; - return this; - } - - /** - * Get priceProtect - * - * @return priceProtect - */ - @jakarta.annotation.Nullable - public String getPriceProtect() { - return priceProtect; - } - - public void setPriceProtect(@jakarta.annotation.Nullable String priceProtect) { - this.priceProtect = priceProtect; - } - - public BatchOrdersInner newOrderRespType( - @jakarta.annotation.Nullable NewOrderRespTypeEnum newOrderRespType) { - this.newOrderRespType = newOrderRespType; - return this; - } - - /** - * Get newOrderRespType - * - * @return newOrderRespType - */ - @jakarta.annotation.Nullable - public NewOrderRespTypeEnum getNewOrderRespType() { - return newOrderRespType; - } - - public void setNewOrderRespType( - @jakarta.annotation.Nullable NewOrderRespTypeEnum newOrderRespType) { - this.newOrderRespType = newOrderRespType; - } - public BatchOrdersInner priceMatch(@jakarta.annotation.Nullable PriceMatchEnum priceMatch) { this.priceMatch = priceMatch; return this; @@ -844,44 +340,23 @@ public void setPriceMatch(@jakarta.annotation.Nullable PriceMatchEnum priceMatch this.priceMatch = priceMatch; } - public BatchOrdersInner selfTradePreventionMode( - @jakarta.annotation.Nullable SelfTradePreventionModeEnum selfTradePreventionMode) { - this.selfTradePreventionMode = selfTradePreventionMode; + public BatchOrdersInner recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; return this; } /** - * Get selfTradePreventionMode + * Get recvWindow * - * @return selfTradePreventionMode + * @return recvWindow */ @jakarta.annotation.Nullable - public SelfTradePreventionModeEnum getSelfTradePreventionMode() { - return selfTradePreventionMode; - } - - public void setSelfTradePreventionMode( - @jakarta.annotation.Nullable SelfTradePreventionModeEnum selfTradePreventionMode) { - this.selfTradePreventionMode = selfTradePreventionMode; + public Long getRecvWindow() { + return recvWindow; } - public BatchOrdersInner goodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { - this.goodTillDate = goodTillDate; - return this; - } - - /** - * Get goodTillDate - * - * @return goodTillDate - */ - @jakarta.annotation.Nullable - public Long getGoodTillDate() { - return goodTillDate; - } - - public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { - this.goodTillDate = goodTillDate; + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; } @Override @@ -893,74 +368,34 @@ public boolean equals(Object o) { return false; } BatchOrdersInner batchOrdersInner = (BatchOrdersInner) o; - return Objects.equals(this.symbol, batchOrdersInner.symbol) + return Objects.equals(this.orderId, batchOrdersInner.orderId) + && Objects.equals(this.origClientOrderId, batchOrdersInner.origClientOrderId) + && Objects.equals(this.symbol, batchOrdersInner.symbol) && Objects.equals(this.side, batchOrdersInner.side) - && Objects.equals(this.positionSide, batchOrdersInner.positionSide) - && Objects.equals(this.type, batchOrdersInner.type) - && Objects.equals(this.timeInForce, batchOrdersInner.timeInForce) && Objects.equals(this.quantity, batchOrdersInner.quantity) - && Objects.equals(this.reduceOnly, batchOrdersInner.reduceOnly) && Objects.equals(this.price, batchOrdersInner.price) - && Objects.equals(this.newClientOrderId, batchOrdersInner.newClientOrderId) - && Objects.equals(this.stopPrice, batchOrdersInner.stopPrice) - && Objects.equals(this.activationPrice, batchOrdersInner.activationPrice) - && Objects.equals(this.callbackRate, batchOrdersInner.callbackRate) - && Objects.equals(this.workingType, batchOrdersInner.workingType) - && Objects.equals(this.priceProtect, batchOrdersInner.priceProtect) - && Objects.equals(this.newOrderRespType, batchOrdersInner.newOrderRespType) && Objects.equals(this.priceMatch, batchOrdersInner.priceMatch) - && Objects.equals( - this.selfTradePreventionMode, batchOrdersInner.selfTradePreventionMode) - && Objects.equals(this.goodTillDate, batchOrdersInner.goodTillDate); + && Objects.equals(this.recvWindow, batchOrdersInner.recvWindow); } @Override public int hashCode() { return Objects.hash( - symbol, - side, - positionSide, - type, - timeInForce, - quantity, - reduceOnly, - price, - newClientOrderId, - stopPrice, - activationPrice, - callbackRate, - workingType, - priceProtect, - newOrderRespType, - priceMatch, - selfTradePreventionMode, - goodTillDate); + orderId, origClientOrderId, symbol, side, quantity, price, priceMatch, recvWindow); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BatchOrdersInner {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" origClientOrderId: ").append(toIndentedString(origClientOrderId)).append("\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" newClientOrderId: ").append(toIndentedString(newClientOrderId)).append("\n"); - sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); - sb.append(" activationPrice: ").append(toIndentedString(activationPrice)).append("\n"); - sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); - sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); - sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); - sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); - sb.append(" selfTradePreventionMode: ") - .append(toIndentedString(selfTradePreventionMode)) - .append("\n"); - sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); } @@ -968,6 +403,16 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object origClientOrderIdValue = getOrigClientOrderId(); + String origClientOrderIdValueAsString = ""; + origClientOrderIdValueAsString = origClientOrderIdValue.toString(); + sb.append("origClientOrderId=") + .append(urlEncode(origClientOrderIdValueAsString)) + .append(""); Object symbolValue = getSymbol(); String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); @@ -976,72 +421,22 @@ public String toUrlQueryString() { String sideValueAsString = ""; sideValueAsString = sideValue.toString(); sb.append("side=").append(urlEncode(sideValueAsString)).append(""); - Object positionSideValue = getPositionSide(); - String positionSideValueAsString = ""; - positionSideValueAsString = positionSideValue.toString(); - sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); - Object typeValue = getType(); - String typeValueAsString = ""; - typeValueAsString = typeValue.toString(); - sb.append("type=").append(urlEncode(typeValueAsString)).append(""); - Object timeInForceValue = getTimeInForce(); - String timeInForceValueAsString = ""; - timeInForceValueAsString = timeInForceValue.toString(); - sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); Object quantityValue = getQuantity(); String quantityValueAsString = ""; quantityValueAsString = quantityValue.toString(); sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); - Object reduceOnlyValue = getReduceOnly(); - String reduceOnlyValueAsString = ""; - reduceOnlyValueAsString = reduceOnlyValue.toString(); - sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); Object priceValue = getPrice(); String priceValueAsString = ""; priceValueAsString = priceValue.toString(); sb.append("price=").append(urlEncode(priceValueAsString)).append(""); - Object newClientOrderIdValue = getNewClientOrderId(); - String newClientOrderIdValueAsString = ""; - newClientOrderIdValueAsString = newClientOrderIdValue.toString(); - sb.append("newClientOrderId=").append(urlEncode(newClientOrderIdValueAsString)).append(""); - Object stopPriceValue = getStopPrice(); - String stopPriceValueAsString = ""; - stopPriceValueAsString = stopPriceValue.toString(); - sb.append("stopPrice=").append(urlEncode(stopPriceValueAsString)).append(""); - Object activationPriceValue = getActivationPrice(); - String activationPriceValueAsString = ""; - activationPriceValueAsString = activationPriceValue.toString(); - sb.append("activationPrice=").append(urlEncode(activationPriceValueAsString)).append(""); - Object callbackRateValue = getCallbackRate(); - String callbackRateValueAsString = ""; - callbackRateValueAsString = callbackRateValue.toString(); - sb.append("callbackRate=").append(urlEncode(callbackRateValueAsString)).append(""); - Object workingTypeValue = getWorkingType(); - String workingTypeValueAsString = ""; - workingTypeValueAsString = workingTypeValue.toString(); - sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); - Object priceProtectValue = getPriceProtect(); - String priceProtectValueAsString = ""; - priceProtectValueAsString = priceProtectValue.toString(); - sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); - Object newOrderRespTypeValue = getNewOrderRespType(); - String newOrderRespTypeValueAsString = ""; - newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); - sb.append("newOrderRespType=").append(urlEncode(newOrderRespTypeValueAsString)).append(""); Object priceMatchValue = getPriceMatch(); String priceMatchValueAsString = ""; priceMatchValueAsString = priceMatchValue.toString(); sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); - Object selfTradePreventionModeValue = getSelfTradePreventionMode(); - String selfTradePreventionModeValueAsString = ""; - selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); - sb.append("selfTradePreventionMode=") - .append(urlEncode(selfTradePreventionModeValueAsString)) - .append(""); - Object goodTillDateValue = getGoodTillDate(); - String goodTillDateValueAsString = ""; - goodTillDateValueAsString = goodTillDateValue.toString(); - sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); return sb.toString(); } @@ -1070,24 +465,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("orderId"); + openapiFields.add("origClientOrderId"); openapiFields.add("symbol"); openapiFields.add("side"); - openapiFields.add("positionSide"); - openapiFields.add("type"); - openapiFields.add("timeInForce"); openapiFields.add("quantity"); - openapiFields.add("reduceOnly"); openapiFields.add("price"); - openapiFields.add("newClientOrderId"); - openapiFields.add("stopPrice"); - openapiFields.add("activationPrice"); - openapiFields.add("callbackRate"); - openapiFields.add("workingType"); - openapiFields.add("priceProtect"); - openapiFields.add("newOrderRespType"); openapiFields.add("priceMatch"); - openapiFields.add("selfTradePreventionMode"); - openapiFields.add("goodTillDate"); + openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1111,6 +496,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("origClientOrderId") != null + && !jsonObj.get("origClientOrderId").isJsonNull()) + && !jsonObj.get("origClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origClientOrderId").toString())); + } if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1131,89 +525,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) { SideEnum.validateJsonElement(jsonObj.get("side")); } - if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) - && !jsonObj.get("positionSide").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `positionSide` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("positionSide").toString())); - } - // validate the optional field `positionSide` - if (jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) { - PositionSideEnum.validateJsonElement(jsonObj.get("positionSide")); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) - && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if ((jsonObj.get("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())); - } - // validate the optional field `timeInForce` - if (jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) { - TimeInForceEnum.validateJsonElement(jsonObj.get("timeInForce")); - } - if ((jsonObj.get("reduceOnly") != null && !jsonObj.get("reduceOnly").isJsonNull()) - && !jsonObj.get("reduceOnly").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `reduceOnly` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("reduceOnly").toString())); - } - if ((jsonObj.get("newClientOrderId") != null - && !jsonObj.get("newClientOrderId").isJsonNull()) - && !jsonObj.get("newClientOrderId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newClientOrderId` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("newClientOrderId").toString())); - } - if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) - && !jsonObj.get("workingType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `workingType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("workingType").toString())); - } - // validate the optional field `workingType` - if (jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) { - WorkingTypeEnum.validateJsonElement(jsonObj.get("workingType")); - } - if ((jsonObj.get("priceProtect") != null && !jsonObj.get("priceProtect").isJsonNull()) - && !jsonObj.get("priceProtect").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `priceProtect` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("priceProtect").toString())); - } - if ((jsonObj.get("newOrderRespType") != null - && !jsonObj.get("newOrderRespType").isJsonNull()) - && !jsonObj.get("newOrderRespType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newOrderRespType` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("newOrderRespType").toString())); - } - // validate the optional field `newOrderRespType` - if (jsonObj.get("newOrderRespType") != null - && !jsonObj.get("newOrderRespType").isJsonNull()) { - NewOrderRespTypeEnum.validateJsonElement(jsonObj.get("newOrderRespType")); - } if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) && !jsonObj.get("priceMatch").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1226,20 +537,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) { PriceMatchEnum.validateJsonElement(jsonObj.get("priceMatch")); } - if ((jsonObj.get("selfTradePreventionMode") != null - && !jsonObj.get("selfTradePreventionMode").isJsonNull()) - && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `selfTradePreventionMode` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("selfTradePreventionMode").toString())); - } - // validate the optional field `selfTradePreventionMode` - if (jsonObj.get("selfTradePreventionMode") != null - && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { - SelfTradePreventionModeEnum.validateJsonElement(jsonObj.get("selfTradePreventionMode")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrders.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrders.java new file mode 100644 index 00000000..b2fd2c46 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrders.java @@ -0,0 +1,187 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** BatchOrdersPlaceMultipleOrders */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BatchOrdersPlaceMultipleOrders extends ArrayList { + public BatchOrdersPlaceMultipleOrders() {} + + @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 BatchOrdersPlaceMultipleOrders {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * BatchOrdersPlaceMultipleOrders + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + BatchOrdersPlaceMultipleOrdersInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!BatchOrdersPlaceMultipleOrders.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in BatchOrdersPlaceMultipleOrders is not" + + " found in the empty JSON string", + BatchOrdersPlaceMultipleOrders.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchOrdersPlaceMultipleOrders.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchOrdersPlaceMultipleOrders' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(BatchOrdersPlaceMultipleOrders.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchOrdersPlaceMultipleOrders value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public BatchOrdersPlaceMultipleOrders read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BatchOrdersPlaceMultipleOrders given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchOrdersPlaceMultipleOrders + * @throws IOException if the JSON string is invalid with respect to + * BatchOrdersPlaceMultipleOrders + */ + public static BatchOrdersPlaceMultipleOrders fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchOrdersPlaceMultipleOrders.class); + } + + /** + * Convert an instance of BatchOrdersPlaceMultipleOrders to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java new file mode 100644 index 00000000..01ad6380 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java @@ -0,0 +1,1321 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** BatchOrdersPlaceMultipleOrdersInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BatchOrdersPlaceMultipleOrdersInner { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + /** Gets or Sets side */ + @JsonAdapter(SideEnum.Adapter.class) + public enum SideEnum { + BUY("BUY"), + + SELL("SELL"); + + private String value; + + SideEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SideEnum fromValue(String value) { + for (SideEnum b : SideEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SideEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SideEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SideEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SideEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private SideEnum side; + + /** Gets or Sets positionSide */ + @JsonAdapter(PositionSideEnum.Adapter.class) + public enum PositionSideEnum { + BOTH("BOTH"), + + LONG("LONG"), + + SHORT("SHORT"); + + private String value; + + PositionSideEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PositionSideEnum fromValue(String value) { + for (PositionSideEnum b : PositionSideEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionSideEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionSideEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionSideEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PositionSideEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private PositionSideEnum positionSide; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + /** Gets or Sets timeInForce */ + @JsonAdapter(TimeInForceEnum.Adapter.class) + public enum TimeInForceEnum { + GTC("GTC"), + + IOC("IOC"), + + FOK("FOK"), + + GTX("GTX"), + + GTD("GTD"); + + private String value; + + TimeInForceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TimeInForceEnum fromValue(String value) { + for (TimeInForceEnum b : TimeInForceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TimeInForceEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TimeInForceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TimeInForceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private TimeInForceEnum timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private Double quantity; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private String reduceOnly; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private Double price; + + public static final String SERIALIZED_NAME_NEW_CLIENT_ORDER_ID = "newClientOrderId"; + + @SerializedName(SERIALIZED_NAME_NEW_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String newClientOrderId; + + public static final String SERIALIZED_NAME_STOP_PRICE = "stopPrice"; + + @SerializedName(SERIALIZED_NAME_STOP_PRICE) + @jakarta.annotation.Nullable + private Double stopPrice; + + public static final String SERIALIZED_NAME_ACTIVATION_PRICE = "activationPrice"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION_PRICE) + @jakarta.annotation.Nullable + private Double activationPrice; + + public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; + + @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) + @jakarta.annotation.Nullable + private Double callbackRate; + + /** Gets or Sets workingType */ + @JsonAdapter(WorkingTypeEnum.Adapter.class) + public enum WorkingTypeEnum { + MARK_PRICE("MARK_PRICE"), + + CONTRACT_PRICE("CONTRACT_PRICE"); + + private String value; + + WorkingTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WorkingTypeEnum fromValue(String value) { + for (WorkingTypeEnum b : WorkingTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WorkingTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WorkingTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WorkingTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WorkingTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private WorkingTypeEnum workingType; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private String priceProtect; + + /** Gets or Sets newOrderRespType */ + @JsonAdapter(NewOrderRespTypeEnum.Adapter.class) + public enum NewOrderRespTypeEnum { + ACK("ACK"), + + RESULT("RESULT"); + + private String value; + + NewOrderRespTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NewOrderRespTypeEnum fromValue(String value) { + for (NewOrderRespTypeEnum b : NewOrderRespTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NewOrderRespTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NewOrderRespTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NewOrderRespTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + NewOrderRespTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_NEW_ORDER_RESP_TYPE = "newOrderRespType"; + + @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESP_TYPE) + @jakarta.annotation.Nullable + private NewOrderRespTypeEnum newOrderRespType; + + /** Gets or Sets priceMatch */ + @JsonAdapter(PriceMatchEnum.Adapter.class) + public enum PriceMatchEnum { + NONE("NONE"), + + OPPONENT("OPPONENT"), + + OPPONENT_5("OPPONENT_5"), + + OPPONENT_10("OPPONENT_10"), + + OPPONENT_20("OPPONENT_20"), + + QUEUE("QUEUE"), + + QUEUE_5("QUEUE_5"), + + QUEUE_10("QUEUE_10"), + + QUEUE_20("QUEUE_20"); + + private String value; + + PriceMatchEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PriceMatchEnum fromValue(String value) { + for (PriceMatchEnum b : PriceMatchEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PriceMatchEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PriceMatchEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PriceMatchEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PriceMatchEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private PriceMatchEnum priceMatch; + + /** Gets or Sets selfTradePreventionMode */ + @JsonAdapter(SelfTradePreventionModeEnum.Adapter.class) + public enum SelfTradePreventionModeEnum { + EXPIRE_TAKER("EXPIRE_TAKER"), + + EXPIRE_BOTH("EXPIRE_BOTH"), + + EXPIRE_MAKER("EXPIRE_MAKER"); + + private String value; + + SelfTradePreventionModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SelfTradePreventionModeEnum fromValue(String value) { + for (SelfTradePreventionModeEnum b : SelfTradePreventionModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write( + final JsonWriter jsonWriter, final SelfTradePreventionModeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SelfTradePreventionModeEnum read(final JsonReader jsonReader) + throws IOException { + String value = jsonReader.nextString(); + return SelfTradePreventionModeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SelfTradePreventionModeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private SelfTradePreventionModeEnum selfTradePreventionMode; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public BatchOrdersPlaceMultipleOrdersInner() {} + + public BatchOrdersPlaceMultipleOrdersInner symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public BatchOrdersPlaceMultipleOrdersInner side(@jakarta.annotation.Nullable SideEnum side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public SideEnum getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable SideEnum side) { + this.side = side; + } + + public BatchOrdersPlaceMultipleOrdersInner positionSide( + @jakarta.annotation.Nullable PositionSideEnum positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public PositionSideEnum getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable PositionSideEnum positionSide) { + this.positionSide = positionSide; + } + + public BatchOrdersPlaceMultipleOrdersInner type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + public BatchOrdersPlaceMultipleOrdersInner timeInForce( + @jakarta.annotation.Nullable TimeInForceEnum timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + public TimeInForceEnum getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable TimeInForceEnum timeInForce) { + this.timeInForce = timeInForce; + } + + public BatchOrdersPlaceMultipleOrdersInner quantity( + @jakarta.annotation.Nullable Double quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + @Valid + public Double getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable Double quantity) { + this.quantity = quantity; + } + + public BatchOrdersPlaceMultipleOrdersInner reduceOnly( + @jakarta.annotation.Nullable String reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public String getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable String reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public BatchOrdersPlaceMultipleOrdersInner price(@jakarta.annotation.Nullable Double price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price + */ + @jakarta.annotation.Nullable + @Valid + public Double getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable Double price) { + this.price = price; + } + + public BatchOrdersPlaceMultipleOrdersInner newClientOrderId( + @jakarta.annotation.Nullable String newClientOrderId) { + this.newClientOrderId = newClientOrderId; + return this; + } + + /** + * Get newClientOrderId + * + * @return newClientOrderId + */ + @jakarta.annotation.Nullable + public String getNewClientOrderId() { + return newClientOrderId; + } + + public void setNewClientOrderId(@jakarta.annotation.Nullable String newClientOrderId) { + this.newClientOrderId = newClientOrderId; + } + + public BatchOrdersPlaceMultipleOrdersInner stopPrice( + @jakarta.annotation.Nullable Double stopPrice) { + this.stopPrice = stopPrice; + return this; + } + + /** + * Get stopPrice + * + * @return stopPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getStopPrice() { + return stopPrice; + } + + public void setStopPrice(@jakarta.annotation.Nullable Double stopPrice) { + this.stopPrice = stopPrice; + } + + public BatchOrdersPlaceMultipleOrdersInner activationPrice( + @jakarta.annotation.Nullable Double activationPrice) { + this.activationPrice = activationPrice; + return this; + } + + /** + * Get activationPrice + * + * @return activationPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getActivationPrice() { + return activationPrice; + } + + public void setActivationPrice(@jakarta.annotation.Nullable Double activationPrice) { + this.activationPrice = activationPrice; + } + + public BatchOrdersPlaceMultipleOrdersInner callbackRate( + @jakarta.annotation.Nullable Double callbackRate) { + this.callbackRate = callbackRate; + return this; + } + + /** + * Get callbackRate + * + * @return callbackRate + */ + @jakarta.annotation.Nullable + @Valid + public Double getCallbackRate() { + return callbackRate; + } + + public void setCallbackRate(@jakarta.annotation.Nullable Double callbackRate) { + this.callbackRate = callbackRate; + } + + public BatchOrdersPlaceMultipleOrdersInner workingType( + @jakarta.annotation.Nullable WorkingTypeEnum workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public WorkingTypeEnum getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable WorkingTypeEnum workingType) { + this.workingType = workingType; + } + + public BatchOrdersPlaceMultipleOrdersInner priceProtect( + @jakarta.annotation.Nullable String priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public String getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable String priceProtect) { + this.priceProtect = priceProtect; + } + + public BatchOrdersPlaceMultipleOrdersInner newOrderRespType( + @jakarta.annotation.Nullable NewOrderRespTypeEnum newOrderRespType) { + this.newOrderRespType = newOrderRespType; + return this; + } + + /** + * Get newOrderRespType + * + * @return newOrderRespType + */ + @jakarta.annotation.Nullable + public NewOrderRespTypeEnum getNewOrderRespType() { + return newOrderRespType; + } + + public void setNewOrderRespType( + @jakarta.annotation.Nullable NewOrderRespTypeEnum newOrderRespType) { + this.newOrderRespType = newOrderRespType; + } + + public BatchOrdersPlaceMultipleOrdersInner priceMatch( + @jakarta.annotation.Nullable PriceMatchEnum priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public PriceMatchEnum getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable PriceMatchEnum priceMatch) { + this.priceMatch = priceMatch; + } + + public BatchOrdersPlaceMultipleOrdersInner selfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionModeEnum selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public SelfTradePreventionModeEnum getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionModeEnum selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public BatchOrdersPlaceMultipleOrdersInner goodTillDate( + @jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + return this; + } + + /** + * Get goodTillDate + * + * @return goodTillDate + */ + @jakarta.annotation.Nullable + public Long getGoodTillDate() { + return goodTillDate; + } + + public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchOrdersPlaceMultipleOrdersInner batchOrdersPlaceMultipleOrdersInner = + (BatchOrdersPlaceMultipleOrdersInner) o; + return Objects.equals(this.symbol, batchOrdersPlaceMultipleOrdersInner.symbol) + && Objects.equals(this.side, batchOrdersPlaceMultipleOrdersInner.side) + && Objects.equals( + this.positionSide, batchOrdersPlaceMultipleOrdersInner.positionSide) + && Objects.equals(this.type, batchOrdersPlaceMultipleOrdersInner.type) + && Objects.equals(this.timeInForce, batchOrdersPlaceMultipleOrdersInner.timeInForce) + && Objects.equals(this.quantity, batchOrdersPlaceMultipleOrdersInner.quantity) + && Objects.equals(this.reduceOnly, batchOrdersPlaceMultipleOrdersInner.reduceOnly) + && Objects.equals(this.price, batchOrdersPlaceMultipleOrdersInner.price) + && Objects.equals( + this.newClientOrderId, batchOrdersPlaceMultipleOrdersInner.newClientOrderId) + && Objects.equals(this.stopPrice, batchOrdersPlaceMultipleOrdersInner.stopPrice) + && Objects.equals( + this.activationPrice, batchOrdersPlaceMultipleOrdersInner.activationPrice) + && Objects.equals( + this.callbackRate, batchOrdersPlaceMultipleOrdersInner.callbackRate) + && Objects.equals(this.workingType, batchOrdersPlaceMultipleOrdersInner.workingType) + && Objects.equals( + this.priceProtect, batchOrdersPlaceMultipleOrdersInner.priceProtect) + && Objects.equals( + this.newOrderRespType, batchOrdersPlaceMultipleOrdersInner.newOrderRespType) + && Objects.equals(this.priceMatch, batchOrdersPlaceMultipleOrdersInner.priceMatch) + && Objects.equals( + this.selfTradePreventionMode, + batchOrdersPlaceMultipleOrdersInner.selfTradePreventionMode) + && Objects.equals( + this.goodTillDate, batchOrdersPlaceMultipleOrdersInner.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + side, + positionSide, + type, + timeInForce, + quantity, + reduceOnly, + price, + newClientOrderId, + stopPrice, + activationPrice, + callbackRate, + workingType, + priceProtect, + newOrderRespType, + priceMatch, + selfTradePreventionMode, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchOrdersPlaceMultipleOrdersInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" newClientOrderId: ").append(toIndentedString(newClientOrderId)).append("\n"); + sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); + sb.append(" activationPrice: ").append(toIndentedString(activationPrice)).append("\n"); + sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object newClientOrderIdValue = getNewClientOrderId(); + String newClientOrderIdValueAsString = ""; + newClientOrderIdValueAsString = newClientOrderIdValue.toString(); + sb.append("newClientOrderId=").append(urlEncode(newClientOrderIdValueAsString)).append(""); + Object stopPriceValue = getStopPrice(); + String stopPriceValueAsString = ""; + stopPriceValueAsString = stopPriceValue.toString(); + sb.append("stopPrice=").append(urlEncode(stopPriceValueAsString)).append(""); + Object activationPriceValue = getActivationPrice(); + String activationPriceValueAsString = ""; + activationPriceValueAsString = activationPriceValue.toString(); + sb.append("activationPrice=").append(urlEncode(activationPriceValueAsString)).append(""); + Object callbackRateValue = getCallbackRate(); + String callbackRateValueAsString = ""; + callbackRateValueAsString = callbackRateValue.toString(); + sb.append("callbackRate=").append(urlEncode(callbackRateValueAsString)).append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object newOrderRespTypeValue = getNewOrderRespType(); + String newOrderRespTypeValueAsString = ""; + newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); + sb.append("newOrderRespType=").append(urlEncode(newOrderRespTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("type"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("reduceOnly"); + openapiFields.add("price"); + openapiFields.add("newClientOrderId"); + openapiFields.add("stopPrice"); + openapiFields.add("activationPrice"); + openapiFields.add("callbackRate"); + openapiFields.add("workingType"); + openapiFields.add("priceProtect"); + openapiFields.add("newOrderRespType"); + openapiFields.add("priceMatch"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * BatchOrdersPlaceMultipleOrdersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchOrdersPlaceMultipleOrdersInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in BatchOrdersPlaceMultipleOrdersInner is" + + " not found in the empty JSON string", + BatchOrdersPlaceMultipleOrdersInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + // validate the optional field `side` + if (jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) { + SideEnum.validateJsonElement(jsonObj.get("side")); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + // validate the optional field `positionSide` + if (jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) { + PositionSideEnum.validateJsonElement(jsonObj.get("positionSide")); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("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())); + } + // validate the optional field `timeInForce` + if (jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) { + TimeInForceEnum.validateJsonElement(jsonObj.get("timeInForce")); + } + if ((jsonObj.get("reduceOnly") != null && !jsonObj.get("reduceOnly").isJsonNull()) + && !jsonObj.get("reduceOnly").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reduceOnly` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reduceOnly").toString())); + } + if ((jsonObj.get("newClientOrderId") != null + && !jsonObj.get("newClientOrderId").isJsonNull()) + && !jsonObj.get("newClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("newClientOrderId").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + // validate the optional field `workingType` + if (jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) { + WorkingTypeEnum.validateJsonElement(jsonObj.get("workingType")); + } + if ((jsonObj.get("priceProtect") != null && !jsonObj.get("priceProtect").isJsonNull()) + && !jsonObj.get("priceProtect").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceProtect` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceProtect").toString())); + } + if ((jsonObj.get("newOrderRespType") != null + && !jsonObj.get("newOrderRespType").isJsonNull()) + && !jsonObj.get("newOrderRespType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newOrderRespType` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("newOrderRespType").toString())); + } + // validate the optional field `newOrderRespType` + if (jsonObj.get("newOrderRespType") != null + && !jsonObj.get("newOrderRespType").isJsonNull()) { + NewOrderRespTypeEnum.validateJsonElement(jsonObj.get("newOrderRespType")); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + // validate the optional field `priceMatch` + if (jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) { + PriceMatchEnum.validateJsonElement(jsonObj.get("priceMatch")); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + // validate the optional field `selfTradePreventionMode` + if (jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { + SelfTradePreventionModeEnum.validateJsonElement(jsonObj.get("selfTradePreventionMode")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchOrdersPlaceMultipleOrdersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchOrdersPlaceMultipleOrdersInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(BatchOrdersPlaceMultipleOrdersInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchOrdersPlaceMultipleOrdersInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchOrdersPlaceMultipleOrdersInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BatchOrdersPlaceMultipleOrdersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchOrdersPlaceMultipleOrdersInner + * @throws IOException if the JSON string is invalid with respect to + * BatchOrdersPlaceMultipleOrdersInner + */ + public static BatchOrdersPlaceMultipleOrdersInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, BatchOrdersPlaceMultipleOrdersInner.class); + } + + /** + * Convert an instance of BatchOrdersPlaceMultipleOrdersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponseInner.java index 315cd7a9..0a3f9b17 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponseInner.java @@ -54,6 +54,12 @@ public class OpenInterestStatisticsResponseInner { @jakarta.annotation.Nullable private String sumOpenInterestValue; + public static final String SERIALIZED_NAME_CM_C_CIRCULATING_SUPPLY = "CMCCirculatingSupply"; + + @SerializedName(SERIALIZED_NAME_CM_C_CIRCULATING_SUPPLY) + @jakarta.annotation.Nullable + private String cmCCirculatingSupply; + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; @SerializedName(SERIALIZED_NAME_TIMESTAMP) @@ -121,6 +127,26 @@ public void setSumOpenInterestValue(@jakarta.annotation.Nullable String sumOpenI this.sumOpenInterestValue = sumOpenInterestValue; } + public OpenInterestStatisticsResponseInner cmCCirculatingSupply( + @jakarta.annotation.Nullable String cmCCirculatingSupply) { + this.cmCCirculatingSupply = cmCCirculatingSupply; + return this; + } + + /** + * Get cmCCirculatingSupply + * + * @return cmCCirculatingSupply + */ + @jakarta.annotation.Nullable + public String getCmCCirculatingSupply() { + return cmCCirculatingSupply; + } + + public void setCmCCirculatingSupply(@jakarta.annotation.Nullable String cmCCirculatingSupply) { + this.cmCCirculatingSupply = cmCCirculatingSupply; + } + public OpenInterestStatisticsResponseInner timestamp( @jakarta.annotation.Nullable String timestamp) { this.timestamp = timestamp; @@ -157,12 +183,16 @@ public boolean equals(Object o) { && Objects.equals( this.sumOpenInterestValue, openInterestStatisticsResponseInner.sumOpenInterestValue) + && Objects.equals( + this.cmCCirculatingSupply, + openInterestStatisticsResponseInner.cmCCirculatingSupply) && Objects.equals(this.timestamp, openInterestStatisticsResponseInner.timestamp); } @Override public int hashCode() { - return Objects.hash(symbol, sumOpenInterest, sumOpenInterestValue, timestamp); + return Objects.hash( + symbol, sumOpenInterest, sumOpenInterestValue, cmCCirculatingSupply, timestamp); } @Override @@ -174,6 +204,9 @@ public String toString() { sb.append(" sumOpenInterestValue: ") .append(toIndentedString(sumOpenInterestValue)) .append("\n"); + sb.append(" cmCCirculatingSupply: ") + .append(toIndentedString(cmCCirculatingSupply)) + .append("\n"); sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); sb.append("}"); return sb.toString(); @@ -196,6 +229,12 @@ public String toUrlQueryString() { sb.append("sumOpenInterestValue=") .append(urlEncode(sumOpenInterestValueValueAsString)) .append(""); + Object cmCCirculatingSupplyValue = getCmCCirculatingSupply(); + String cmCCirculatingSupplyValueAsString = ""; + cmCCirculatingSupplyValueAsString = cmCCirculatingSupplyValue.toString(); + sb.append("cmCCirculatingSupply=") + .append(urlEncode(cmCCirculatingSupplyValueAsString)) + .append(""); Object timestampValue = getTimestamp(); String timestampValueAsString = ""; timestampValueAsString = timestampValue.toString(); @@ -231,6 +270,7 @@ private String toIndentedString(Object o) { openapiFields.add("symbol"); openapiFields.add("sumOpenInterest"); openapiFields.add("sumOpenInterestValue"); + openapiFields.add("CMCCirculatingSupply"); openapiFields.add("timestamp"); // a set of required properties/fields (JSON key names) @@ -282,6 +322,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " the JSON string but got `%s`", jsonObj.get("sumOpenInterestValue").toString())); } + if ((jsonObj.get("CMCCirculatingSupply") != null + && !jsonObj.get("CMCCirculatingSupply").isJsonNull()) + && !jsonObj.get("CMCCirculatingSupply").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `CMCCirculatingSupply` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("CMCCirculatingSupply").toString())); + } if ((jsonObj.get("timestamp") != null && !jsonObj.get("timestamp").isJsonNull()) && !jsonObj.get("timestamp").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersRequest.java index 30b1a76b..83ceef89 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersRequest.java @@ -41,7 +41,7 @@ public class PlaceMultipleOrdersRequest { @SerializedName(SERIALIZED_NAME_BATCH_ORDERS) @jakarta.annotation.Nonnull - private BatchOrders batchOrders; + private BatchOrdersPlaceMultipleOrders batchOrders; public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @@ -52,7 +52,7 @@ public class PlaceMultipleOrdersRequest { public PlaceMultipleOrdersRequest() {} public PlaceMultipleOrdersRequest batchOrders( - @jakarta.annotation.Nonnull BatchOrders batchOrders) { + @jakarta.annotation.Nonnull BatchOrdersPlaceMultipleOrders batchOrders) { this.batchOrders = batchOrders; return this; } @@ -65,11 +65,12 @@ public PlaceMultipleOrdersRequest batchOrders( @jakarta.annotation.Nonnull @NotNull @Valid - public BatchOrders getBatchOrders() { + public BatchOrdersPlaceMultipleOrders getBatchOrders() { return batchOrders; } - public void setBatchOrders(@jakarta.annotation.Nonnull BatchOrders batchOrders) { + public void setBatchOrders( + @jakarta.annotation.Nonnull BatchOrdersPlaceMultipleOrders batchOrders) { this.batchOrders = batchOrders; } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java index 5719fc81..08453e14 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java @@ -44,7 +44,7 @@ public class DerivativesTradingUsdsFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/3.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/JSON.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/JSON.java index ec54ece1..0f18f8c9 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/JSON.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/JSON.java @@ -26,6 +26,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -37,6 +38,7 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.HashMap; import java.util.Map; import okio.ByteString; @@ -58,7 +60,128 @@ public class JSON { @SuppressWarnings("unchecked") public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client.derivatives_trading_usds_futures + .websocket.stream.model.UserDataStreamEventsResponse.class, + new TypeSelector< + com.binance.connector.client + .derivatives_trading_usds_futures.websocket.stream + .model.UserDataStreamEventsResponse>() { + @Override + public Class< + ? extends + com.binance.connector.client + .derivatives_trading_usds_futures + .websocket.stream.model + .UserDataStreamEventsResponse> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "ACCOUNT_CONFIG_UPDATE", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.AccountConfigUpdate.class); + classByDiscriminatorValue.put( + "ACCOUNT_UPDATE", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.AccountUpdate.class); + classByDiscriminatorValue.put( + "CONDITIONAL_ORDER_TRIGGER_REJECT", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.ConditionalOrderTriggerReject + .class); + classByDiscriminatorValue.put( + "GRID_UPDATE", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.GridUpdate.class); + classByDiscriminatorValue.put( + "MARGIN_CALL", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.MarginCall.class); + classByDiscriminatorValue.put( + "ORDER_TRADE_UPDATE", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.OrderTradeUpdate.class); + classByDiscriminatorValue.put( + "STRATEGY_UPDATE", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.StrategyUpdate.class); + classByDiscriminatorValue.put( + "TRADE_LITE", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.TradeLite.class); + classByDiscriminatorValue.put( + "listenKeyExpired", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.Listenkeyexpired.class); + classByDiscriminatorValue.put( + "accountConfigUpdate", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.AccountConfigUpdate.class); + classByDiscriminatorValue.put( + "accountUpdate", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.AccountUpdate.class); + classByDiscriminatorValue.put( + "conditionalOrderTriggerReject", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.ConditionalOrderTriggerReject + .class); + classByDiscriminatorValue.put( + "gridUpdate", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.GridUpdate.class); + classByDiscriminatorValue.put( + "listenkeyexpired", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.Listenkeyexpired.class); + classByDiscriminatorValue.put( + "marginCall", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.MarginCall.class); + classByDiscriminatorValue.put( + "orderTradeUpdate", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.OrderTradeUpdate.class); + classByDiscriminatorValue.put( + "strategyUpdate", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.StrategyUpdate.class); + classByDiscriminatorValue.put( + "tradeLite", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.TradeLite.class); + classByDiscriminatorValue.put( + "UserDataStreamEventsResponse", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.UserDataStreamEventsResponse + .class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "e")); + } + }); GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; } @@ -108,6 +231,27 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.AccountConfigUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.AccountConfigUpdateAc.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.AccountConfigUpdateAi.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.AccountUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.AccountUpdateA.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.AccountUpdateABInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.AccountUpdateAPInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.AggregateTradeStreamsRequest.CustomTypeAdapterFactory()); @@ -160,6 +304,12 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.CompositeIndexSymbolInformationStreamsResponseCInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.ConditionalOrderTriggerReject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.ConditionalOrderTriggerRejectOr.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.ContinuousContractKlineCandlestickStreamsRequest @@ -193,6 +343,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.DiffBookDepthStreamsResponseBItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.GridUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.GridUpdateGu.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.IndividualSymbolBookTickerStreamsRequest.CustomTypeAdapterFactory()); @@ -227,6 +383,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.LiquidationOrderStreamsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.Listenkeyexpired.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.MarginCall.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.MarginCallPInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.MarkPriceStreamForAllMarketRequest.CustomTypeAdapterFactory()); @@ -251,6 +416,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.MultiAssetsModeAssetIndexResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.OrderTradeUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.OrderTradeUpdateO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.PartialBookDepthStreamsRequest.CustomTypeAdapterFactory()); @@ -263,6 +434,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.PartialBookDepthStreamsResponseBItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.StrategyUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.StrategyUpdateSu.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.TradeLite.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.UserDataStreamEventsResponse.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java index 31fe4a3e..674177a5 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java @@ -6,6 +6,8 @@ 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_usds_futures.websocket.stream.JSON; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AggregateTradeStreamsRequest; @@ -44,13 +46,21 @@ import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MultiAssetsModeAssetIndexResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.UserDataStreamEventsResponse; +import com.google.gson.reflect.TypeToken; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.UUID; public class DerivativesTradingUsdsFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/3.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private final StreamConnectionInterface connection; + private WebsocketMarketStreamsApi websocketMarketStreamsApi; public DerivativesTradingUsdsFuturesWebSocketStreams( @@ -66,6 +76,7 @@ public DerivativesTradingUsdsFuturesWebSocketStreams(StreamConnectionInterface c if (!connection.isConnected()) { connection.connect(); } + this.connection = connection; this.websocketMarketStreamsApi = new WebsocketMarketStreamsApi(connection); } @@ -187,4 +198,29 @@ public StreamBlockingQueueWrapper partialBookDe PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { return websocketMarketStreamsApi.partialBookDepthStreams(partialBookDepthStreamsRequest); } + + /** + * Subscribes to the user data WebSocket stream using the provided listen key. + * + * @param listenKey - The listen key for the user data WebSocket stream. + * @return A WebSocket stream handler for the user data stream. + */ + public StreamBlockingQueueWrapper userData(String listenKey) { + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(listenKey)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + + TypeToken typeToken = new TypeToken<>() {}; + StreamBlockingQueue queue = queuesMap.get(listenKey); + return new StreamBlockingQueueWrapper<>(queue, typeToken, JSON.getGson()); + } + + public String getRequestID() { + return UUID.randomUUID().toString(); + } } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdate.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdate.java new file mode 100644 index 00000000..63fcc541 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdate.java @@ -0,0 +1,354 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountConfigUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountConfigUpdate 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_AC = "ac"; + + @SerializedName(SERIALIZED_NAME_AC) + @jakarta.annotation.Nullable + private AccountConfigUpdateAc ac; + + public static final String SERIALIZED_NAME_AI = "ai"; + + @SerializedName(SERIALIZED_NAME_AI) + @jakarta.annotation.Nullable + private AccountConfigUpdateAi ai; + + public AccountConfigUpdate() {} + + public AccountConfigUpdate 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 AccountConfigUpdate 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 AccountConfigUpdate ac(@jakarta.annotation.Nullable AccountConfigUpdateAc ac) { + this.ac = ac; + return this; + } + + /** + * Get ac + * + * @return ac + */ + @jakarta.annotation.Nullable + @Valid + public AccountConfigUpdateAc getAc() { + return ac; + } + + public void setAc(@jakarta.annotation.Nullable AccountConfigUpdateAc ac) { + this.ac = ac; + } + + public AccountConfigUpdate ai(@jakarta.annotation.Nullable AccountConfigUpdateAi ai) { + this.ai = ai; + return this; + } + + /** + * Get ai + * + * @return ai + */ + @jakarta.annotation.Nullable + @Valid + public AccountConfigUpdateAi getAi() { + return ai; + } + + public void setAi(@jakarta.annotation.Nullable AccountConfigUpdateAi ai) { + this.ai = ai; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountConfigUpdate accountConfigUpdate = (AccountConfigUpdate) o; + return Objects.equals(this.E, accountConfigUpdate.E) + && Objects.equals(this.T, accountConfigUpdate.T) + && Objects.equals(this.ac, accountConfigUpdate.ac) + && Objects.equals(this.ai, accountConfigUpdate.ai); + } + + @Override + public int hashCode() { + return Objects.hash(E, T, ac, ai); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountConfigUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" ac: ").append(toIndentedString(ac)).append("\n"); + sb.append(" ai: ").append(toIndentedString(ai)).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); + } + AccountConfigUpdateAc acValue = getAc(); + if (acValue != null) { + String acValueAsString = JSON.getGson().toJson(acValue); + valMap.put("ac", acValueAsString); + } + AccountConfigUpdateAi aiValue = getAi(); + if (aiValue != null) { + String aiValueAsString = JSON.getGson().toJson(aiValue); + valMap.put("ai", aiValueAsString); + } + + 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 acValue = getAc(); + if (acValue != null) { + valMap.put("ac", acValue); + } + Object aiValue = getAi(); + if (aiValue != null) { + valMap.put("ai", aiValue); + } + + 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("ac"); + openapiFields.add("ai"); + + // 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 AccountConfigUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountConfigUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountConfigUpdate is not found in" + + " the empty JSON string", + AccountConfigUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountConfigUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountConfigUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `ac` + if (jsonObj.get("ac") != null && !jsonObj.get("ac").isJsonNull()) { + AccountConfigUpdateAc.validateJsonElement(jsonObj.get("ac")); + } + // validate the optional field `ai` + if (jsonObj.get("ai") != null && !jsonObj.get("ai").isJsonNull()) { + AccountConfigUpdateAi.validateJsonElement(jsonObj.get("ai")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountConfigUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountConfigUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountConfigUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountConfigUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountConfigUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountConfigUpdate + * @throws IOException if the JSON string is invalid with respect to AccountConfigUpdate + */ + public static AccountConfigUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountConfigUpdate.class); + } + + /** + * Convert an instance of AccountConfigUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdateAc.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdateAc.java new file mode 100644 index 00000000..1f75abe9 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdateAc.java @@ -0,0 +1,277 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountConfigUpdateAc */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountConfigUpdateAc 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_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private Long lLowerCase; + + public AccountConfigUpdateAc() {} + + public AccountConfigUpdateAc 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 AccountConfigUpdateAc lLowerCase(@jakarta.annotation.Nullable Long lLowerCase) { + this.lLowerCase = lLowerCase; + return this; + } + + /** + * Get lLowerCase + * + * @return lLowerCase + */ + @jakarta.annotation.Nullable + public Long getlLowerCase() { + return lLowerCase; + } + + public void setlLowerCase(@jakarta.annotation.Nullable Long lLowerCase) { + this.lLowerCase = lLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountConfigUpdateAc accountConfigUpdateAc = (AccountConfigUpdateAc) o; + return Objects.equals(this.sLowerCase, accountConfigUpdateAc.sLowerCase) + && Objects.equals(this.lLowerCase, accountConfigUpdateAc.lLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, lLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountConfigUpdateAc {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).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); + } + Long lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + + 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 lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + + 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("l"); + + // 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 AccountConfigUpdateAc + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountConfigUpdateAc.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountConfigUpdateAc is not found in" + + " the empty JSON string", + AccountConfigUpdateAc.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountConfigUpdateAc.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountConfigUpdateAc` 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountConfigUpdateAc.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountConfigUpdateAc' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdateAc.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountConfigUpdateAc value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountConfigUpdateAc read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountConfigUpdateAc given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountConfigUpdateAc + * @throws IOException if the JSON string is invalid with respect to AccountConfigUpdateAc + */ + public static AccountConfigUpdateAc fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountConfigUpdateAc.class); + } + + /** + * Convert an instance of AccountConfigUpdateAc to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdateAi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdateAi.java new file mode 100644 index 00000000..92931a7f --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountConfigUpdateAi.java @@ -0,0 +1,232 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountConfigUpdateAi */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountConfigUpdateAi extends BaseDTO { + public static final String SERIALIZED_NAME_J_LOWER_CASE = "j"; + + @SerializedName(SERIALIZED_NAME_J_LOWER_CASE) + @jakarta.annotation.Nullable + private Boolean jLowerCase; + + public AccountConfigUpdateAi() {} + + public AccountConfigUpdateAi jLowerCase(@jakarta.annotation.Nullable Boolean jLowerCase) { + this.jLowerCase = jLowerCase; + return this; + } + + /** + * Get jLowerCase + * + * @return jLowerCase + */ + @jakarta.annotation.Nullable + public Boolean getjLowerCase() { + return jLowerCase; + } + + public void setjLowerCase(@jakarta.annotation.Nullable Boolean jLowerCase) { + this.jLowerCase = jLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountConfigUpdateAi accountConfigUpdateAi = (AccountConfigUpdateAi) o; + return Objects.equals(this.jLowerCase, accountConfigUpdateAi.jLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(jLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountConfigUpdateAi {\n"); + sb.append(" jLowerCase: ").append(toIndentedString(jLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Boolean jLowerCaseValue = getjLowerCase(); + if (jLowerCaseValue != null) { + String jLowerCaseValueAsString = jLowerCaseValue.toString(); + valMap.put("jLowerCase", jLowerCaseValueAsString); + } + + 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 jLowerCaseValue = getjLowerCase(); + if (jLowerCaseValue != null) { + valMap.put("jLowerCase", jLowerCaseValue); + } + + 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("j"); + + // 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 AccountConfigUpdateAi + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountConfigUpdateAi.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountConfigUpdateAi is not found in" + + " the empty JSON string", + AccountConfigUpdateAi.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountConfigUpdateAi.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountConfigUpdateAi` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountConfigUpdateAi.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountConfigUpdateAi' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdateAi.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountConfigUpdateAi value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountConfigUpdateAi read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountConfigUpdateAi given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountConfigUpdateAi + * @throws IOException if the JSON string is invalid with respect to AccountConfigUpdateAi + */ + public static AccountConfigUpdateAi fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountConfigUpdateAi.class); + } + + /** + * Convert an instance of AccountConfigUpdateAi to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdate.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdate.java new file mode 100644 index 00000000..32dc75c0 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdate.java @@ -0,0 +1,311 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdate 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_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private AccountUpdateA aLowerCase; + + public AccountUpdate() {} + + public AccountUpdate 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 AccountUpdate 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 AccountUpdate aLowerCase(@jakarta.annotation.Nullable AccountUpdateA aLowerCase) { + this.aLowerCase = aLowerCase; + return this; + } + + /** + * Get aLowerCase + * + * @return aLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public AccountUpdateA getaLowerCase() { + return aLowerCase; + } + + public void setaLowerCase(@jakarta.annotation.Nullable AccountUpdateA aLowerCase) { + this.aLowerCase = aLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdate accountUpdate = (AccountUpdate) o; + return Objects.equals(this.E, accountUpdate.E) + && Objects.equals(this.T, accountUpdate.T) + && Objects.equals(this.aLowerCase, accountUpdate.aLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, T, aLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).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()); + 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); + } + AccountUpdateA 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 EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + 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("T"); + 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 AccountUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdate.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())); + } + } + + 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())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `a` + if (jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) { + AccountUpdateA.validateJsonElement(jsonObj.get("a")); + } + } + + 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 + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdate 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 + */ + public static AccountUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdate.class); + } + + /** + * Convert an instance of AccountUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateA.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateA.java new file mode 100644 index 00000000..7b88db76 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateA.java @@ -0,0 +1,373 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.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.*; + +/** AccountUpdateA */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdateA extends BaseDTO { + 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_B = "B"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private List<@Valid AccountUpdateABInner> B; + + public static final String SERIALIZED_NAME_P = "P"; + + @SerializedName(SERIALIZED_NAME_P) + @jakarta.annotation.Nullable + private List<@Valid AccountUpdateAPInner> P; + + public AccountUpdateA() {} + + public AccountUpdateA 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 AccountUpdateA B(@jakarta.annotation.Nullable List<@Valid AccountUpdateABInner> B) { + this.B = B; + return this; + } + + public AccountUpdateA addBItem(AccountUpdateABInner BItem) { + if (this.B == null) { + this.B = new ArrayList<>(); + } + this.B.add(BItem); + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid AccountUpdateABInner> getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable List<@Valid AccountUpdateABInner> B) { + this.B = B; + } + + public AccountUpdateA P(@jakarta.annotation.Nullable List<@Valid AccountUpdateAPInner> P) { + this.P = P; + return this; + } + + public AccountUpdateA addPItem(AccountUpdateAPInner PItem) { + if (this.P == null) { + this.P = new ArrayList<>(); + } + this.P.add(PItem); + return this; + } + + /** + * Get P + * + * @return P + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid AccountUpdateAPInner> getP() { + return P; + } + + public void setP(@jakarta.annotation.Nullable List<@Valid AccountUpdateAPInner> P) { + this.P = P; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdateA accountUpdateA = (AccountUpdateA) o; + return Objects.equals(this.mLowerCase, accountUpdateA.mLowerCase) + && Objects.equals(this.B, accountUpdateA.B) + && Objects.equals(this.P, accountUpdateA.P); + } + + @Override + public int hashCode() { + return Objects.hash(mLowerCase, B, P); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateA {\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).append("\n"); + sb.append(" P: ").append(toIndentedString(P)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + List<@Valid AccountUpdateABInner> BValue = getB(); + if (BValue != null) { + String BValueAsString = JSON.getGson().toJson(BValue); + valMap.put("B", BValueAsString); + } + List<@Valid AccountUpdateAPInner> PValue = getP(); + if (PValue != null) { + String PValueAsString = JSON.getGson().toJson(PValue); + valMap.put("P", PValueAsString); + } + + 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 mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); + } + Object PValue = getP(); + if (PValue != null) { + valMap.put("P", PValue); + } + + 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("m"); + openapiFields.add("B"); + 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 AccountUpdateA + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateA.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountUpdateA is not found in the" + + " empty JSON string", + AccountUpdateA.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountUpdateA.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateA` 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) { + // ensure the json data is an array + if (!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())); + } + + // validate the optional field `B` (array) + for (int i = 0; i < jsonArrayB.size(); i++) { + AccountUpdateABInner.validateJsonElement(jsonArrayB.get(i)); + } + ; + } + } + if (jsonObj.get("P") != null && !jsonObj.get("P").isJsonNull()) { + JsonArray jsonArrayP = jsonObj.getAsJsonArray("P"); + if (jsonArrayP != null) { + // ensure the json data is an array + if (!jsonObj.get("P").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `P` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("P").toString())); + } + + // validate the optional field `P` (array) + for (int i = 0; i < jsonArrayP.size(); i++) { + AccountUpdateAPInner.validateJsonElement(jsonArrayP.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountUpdateA.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdateA' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateA.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateA value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateA read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateA given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountUpdateA + * @throws IOException if the JSON string is invalid with respect to AccountUpdateA + */ + public static AccountUpdateA fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateA.class); + } + + /** + * Convert an instance of AccountUpdateA to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateABInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateABInner.java new file mode 100644 index 00000000..21d1b4f1 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateABInner.java @@ -0,0 +1,375 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountUpdateABInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdateABInner 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_WB = "wb"; + + @SerializedName(SERIALIZED_NAME_WB) + @jakarta.annotation.Nullable + private String wb; + + public static final String SERIALIZED_NAME_CW = "cw"; + + @SerializedName(SERIALIZED_NAME_CW) + @jakarta.annotation.Nullable + private String cw; + + public static final String SERIALIZED_NAME_BC = "bc"; + + @SerializedName(SERIALIZED_NAME_BC) + @jakarta.annotation.Nullable + private String bc; + + public AccountUpdateABInner() {} + + public AccountUpdateABInner 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 AccountUpdateABInner wb(@jakarta.annotation.Nullable String wb) { + this.wb = wb; + return this; + } + + /** + * Get wb + * + * @return wb + */ + @jakarta.annotation.Nullable + public String getWb() { + return wb; + } + + public void setWb(@jakarta.annotation.Nullable String wb) { + this.wb = wb; + } + + public AccountUpdateABInner cw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + return this; + } + + /** + * Get cw + * + * @return cw + */ + @jakarta.annotation.Nullable + public String getCw() { + return cw; + } + + public void setCw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + } + + public AccountUpdateABInner 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; + } + AccountUpdateABInner accountUpdateABInner = (AccountUpdateABInner) o; + return Objects.equals(this.aLowerCase, accountUpdateABInner.aLowerCase) + && Objects.equals(this.wb, accountUpdateABInner.wb) + && Objects.equals(this.cw, accountUpdateABInner.cw) + && Objects.equals(this.bc, accountUpdateABInner.bc); + } + + @Override + public int hashCode() { + return Objects.hash(aLowerCase, wb, cw, bc); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateABInner {\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" wb: ").append(toIndentedString(wb)).append("\n"); + sb.append(" cw: ").append(toIndentedString(cw)).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 wbValue = getWb(); + if (wbValue != null) { + String wbValueAsString = wbValue.toString(); + valMap.put("wb", wbValueAsString); + } + String cwValue = getCw(); + if (cwValue != null) { + String cwValueAsString = cwValue.toString(); + valMap.put("cw", cwValueAsString); + } + 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 wbValue = getWb(); + if (wbValue != null) { + valMap.put("wb", wbValue); + } + Object cwValue = getCw(); + if (cwValue != null) { + valMap.put("cw", cwValue); + } + 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("wb"); + openapiFields.add("cw"); + 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 AccountUpdateABInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateABInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountUpdateABInner is not found in" + + " the empty JSON string", + AccountUpdateABInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountUpdateABInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateABInner` 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("wb") != null && !jsonObj.get("wb").isJsonNull()) + && !jsonObj.get("wb").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `wb` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("wb").toString())); + } + if ((jsonObj.get("cw") != null && !jsonObj.get("cw").isJsonNull()) + && !jsonObj.get("cw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cw").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 (!AccountUpdateABInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdateABInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateABInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateABInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateABInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateABInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountUpdateABInner + * @throws IOException if the JSON string is invalid with respect to AccountUpdateABInner + */ + public static AccountUpdateABInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateABInner.class); + } + + /** + * Convert an instance of AccountUpdateABInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateAPInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateAPInner.java new file mode 100644 index 00000000..fb60a21c --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AccountUpdateAPInner.java @@ -0,0 +1,600 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AccountUpdateAPInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountUpdateAPInner 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_PA = "pa"; + + @SerializedName(SERIALIZED_NAME_PA) + @jakarta.annotation.Nullable + private String pa; + + public static final String SERIALIZED_NAME_EP = "ep"; + + @SerializedName(SERIALIZED_NAME_EP) + @jakarta.annotation.Nullable + private String ep; + + public static final String SERIALIZED_NAME_BEP = "bep"; + + @SerializedName(SERIALIZED_NAME_BEP) + @jakarta.annotation.Nullable + private String bep; + + public static final String SERIALIZED_NAME_CR = "cr"; + + @SerializedName(SERIALIZED_NAME_CR) + @jakarta.annotation.Nullable + private String cr; + + public static final String SERIALIZED_NAME_UP = "up"; + + @SerializedName(SERIALIZED_NAME_UP) + @jakarta.annotation.Nullable + private String up; + + public static final String SERIALIZED_NAME_MT = "mt"; + + @SerializedName(SERIALIZED_NAME_MT) + @jakarta.annotation.Nullable + private String mt; + + public static final String SERIALIZED_NAME_IW = "iw"; + + @SerializedName(SERIALIZED_NAME_IW) + @jakarta.annotation.Nullable + private String iw; + + public static final String SERIALIZED_NAME_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public AccountUpdateAPInner() {} + + public AccountUpdateAPInner 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 AccountUpdateAPInner pa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + return this; + } + + /** + * Get pa + * + * @return pa + */ + @jakarta.annotation.Nullable + public String getPa() { + return pa; + } + + public void setPa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + } + + public AccountUpdateAPInner ep(@jakarta.annotation.Nullable String ep) { + this.ep = ep; + return this; + } + + /** + * Get ep + * + * @return ep + */ + @jakarta.annotation.Nullable + public String getEp() { + return ep; + } + + public void setEp(@jakarta.annotation.Nullable String ep) { + this.ep = ep; + } + + public AccountUpdateAPInner bep(@jakarta.annotation.Nullable String bep) { + this.bep = bep; + return this; + } + + /** + * Get bep + * + * @return bep + */ + @jakarta.annotation.Nullable + public String getBep() { + return bep; + } + + public void setBep(@jakarta.annotation.Nullable String bep) { + this.bep = bep; + } + + public AccountUpdateAPInner cr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + return this; + } + + /** + * Get cr + * + * @return cr + */ + @jakarta.annotation.Nullable + public String getCr() { + return cr; + } + + public void setCr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + } + + public AccountUpdateAPInner up(@jakarta.annotation.Nullable String up) { + this.up = up; + return this; + } + + /** + * Get up + * + * @return up + */ + @jakarta.annotation.Nullable + public String getUp() { + return up; + } + + public void setUp(@jakarta.annotation.Nullable String up) { + this.up = up; + } + + public AccountUpdateAPInner mt(@jakarta.annotation.Nullable String mt) { + this.mt = mt; + return this; + } + + /** + * Get mt + * + * @return mt + */ + @jakarta.annotation.Nullable + public String getMt() { + return mt; + } + + public void setMt(@jakarta.annotation.Nullable String mt) { + this.mt = mt; + } + + public AccountUpdateAPInner iw(@jakarta.annotation.Nullable String iw) { + this.iw = iw; + return this; + } + + /** + * Get iw + * + * @return iw + */ + @jakarta.annotation.Nullable + public String getIw() { + return iw; + } + + public void setIw(@jakarta.annotation.Nullable String iw) { + this.iw = iw; + } + + public AccountUpdateAPInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdateAPInner accountUpdateAPInner = (AccountUpdateAPInner) o; + return Objects.equals(this.sLowerCase, accountUpdateAPInner.sLowerCase) + && Objects.equals(this.pa, accountUpdateAPInner.pa) + && Objects.equals(this.ep, accountUpdateAPInner.ep) + && Objects.equals(this.bep, accountUpdateAPInner.bep) + && Objects.equals(this.cr, accountUpdateAPInner.cr) + && Objects.equals(this.up, accountUpdateAPInner.up) + && Objects.equals(this.mt, accountUpdateAPInner.mt) + && Objects.equals(this.iw, accountUpdateAPInner.iw) + && Objects.equals(this.ps, accountUpdateAPInner.ps); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, pa, ep, bep, cr, up, mt, iw, ps); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateAPInner {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" pa: ").append(toIndentedString(pa)).append("\n"); + sb.append(" ep: ").append(toIndentedString(ep)).append("\n"); + sb.append(" bep: ").append(toIndentedString(bep)).append("\n"); + sb.append(" cr: ").append(toIndentedString(cr)).append("\n"); + sb.append(" up: ").append(toIndentedString(up)).append("\n"); + sb.append(" mt: ").append(toIndentedString(mt)).append("\n"); + sb.append(" iw: ").append(toIndentedString(iw)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).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 paValue = getPa(); + if (paValue != null) { + String paValueAsString = paValue.toString(); + valMap.put("pa", paValueAsString); + } + String epValue = getEp(); + if (epValue != null) { + String epValueAsString = epValue.toString(); + valMap.put("ep", epValueAsString); + } + String bepValue = getBep(); + if (bepValue != null) { + String bepValueAsString = bepValue.toString(); + valMap.put("bep", bepValueAsString); + } + String crValue = getCr(); + if (crValue != null) { + String crValueAsString = crValue.toString(); + valMap.put("cr", crValueAsString); + } + String upValue = getUp(); + if (upValue != null) { + String upValueAsString = upValue.toString(); + valMap.put("up", upValueAsString); + } + String mtValue = getMt(); + if (mtValue != null) { + String mtValueAsString = mtValue.toString(); + valMap.put("mt", mtValueAsString); + } + String iwValue = getIw(); + if (iwValue != null) { + String iwValueAsString = iwValue.toString(); + valMap.put("iw", iwValueAsString); + } + String psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + + 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 paValue = getPa(); + if (paValue != null) { + valMap.put("pa", paValue); + } + Object epValue = getEp(); + if (epValue != null) { + valMap.put("ep", epValue); + } + Object bepValue = getBep(); + if (bepValue != null) { + valMap.put("bep", bepValue); + } + Object crValue = getCr(); + if (crValue != null) { + valMap.put("cr", crValue); + } + Object upValue = getUp(); + if (upValue != null) { + valMap.put("up", upValue); + } + Object mtValue = getMt(); + if (mtValue != null) { + valMap.put("mt", mtValue); + } + Object iwValue = getIw(); + if (iwValue != null) { + valMap.put("iw", iwValue); + } + Object psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + + 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("pa"); + openapiFields.add("ep"); + openapiFields.add("bep"); + openapiFields.add("cr"); + openapiFields.add("up"); + openapiFields.add("mt"); + openapiFields.add("iw"); + openapiFields.add("ps"); + + // 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 AccountUpdateAPInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountUpdateAPInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountUpdateAPInner is not found in" + + " the empty JSON string", + AccountUpdateAPInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountUpdateAPInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountUpdateAPInner` 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("pa") != null && !jsonObj.get("pa").isJsonNull()) + && !jsonObj.get("pa").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pa` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pa").toString())); + } + if ((jsonObj.get("ep") != null && !jsonObj.get("ep").isJsonNull()) + && !jsonObj.get("ep").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ep` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ep").toString())); + } + if ((jsonObj.get("bep") != null && !jsonObj.get("bep").isJsonNull()) + && !jsonObj.get("bep").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bep` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("bep").toString())); + } + if ((jsonObj.get("cr") != null && !jsonObj.get("cr").isJsonNull()) + && !jsonObj.get("cr").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cr` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cr").toString())); + } + if ((jsonObj.get("up") != null && !jsonObj.get("up").isJsonNull()) + && !jsonObj.get("up").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `up` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("up").toString())); + } + if ((jsonObj.get("mt") != null && !jsonObj.get("mt").isJsonNull()) + && !jsonObj.get("mt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mt` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("mt").toString())); + } + if ((jsonObj.get("iw") != null && !jsonObj.get("iw").isJsonNull()) + && !jsonObj.get("iw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `iw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("iw").toString())); + } + if ((jsonObj.get("ps") != null && !jsonObj.get("ps").isJsonNull()) + && !jsonObj.get("ps").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ps` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ps").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountUpdateAPInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountUpdateAPInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateAPInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountUpdateAPInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountUpdateAPInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountUpdateAPInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountUpdateAPInner + * @throws IOException if the JSON string is invalid with respect to AccountUpdateAPInner + */ + public static AccountUpdateAPInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountUpdateAPInner.class); + } + + /** + * Convert an instance of AccountUpdateAPInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/ConditionalOrderTriggerReject.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/ConditionalOrderTriggerReject.java new file mode 100644 index 00000000..4c373dbb --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/ConditionalOrderTriggerReject.java @@ -0,0 +1,319 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ConditionalOrderTriggerReject */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ConditionalOrderTriggerReject 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_OR = "or"; + + @SerializedName(SERIALIZED_NAME_OR) + @jakarta.annotation.Nullable + private ConditionalOrderTriggerRejectOr or; + + public ConditionalOrderTriggerReject() {} + + public ConditionalOrderTriggerReject 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 ConditionalOrderTriggerReject 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 ConditionalOrderTriggerReject or( + @jakarta.annotation.Nullable ConditionalOrderTriggerRejectOr or) { + this.or = or; + return this; + } + + /** + * Get or + * + * @return or + */ + @jakarta.annotation.Nullable + @Valid + public ConditionalOrderTriggerRejectOr getOr() { + return or; + } + + public void setOr(@jakarta.annotation.Nullable ConditionalOrderTriggerRejectOr or) { + this.or = or; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConditionalOrderTriggerReject conditionalOrderTriggerReject = + (ConditionalOrderTriggerReject) o; + return Objects.equals(this.E, conditionalOrderTriggerReject.E) + && Objects.equals(this.T, conditionalOrderTriggerReject.T) + && Objects.equals(this.or, conditionalOrderTriggerReject.or); + } + + @Override + public int hashCode() { + return Objects.hash(E, T, or); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConditionalOrderTriggerReject {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" or: ").append(toIndentedString(or)).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); + } + ConditionalOrderTriggerRejectOr orValue = getOr(); + if (orValue != null) { + String orValueAsString = JSON.getGson().toJson(orValue); + valMap.put("or", orValueAsString); + } + + 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 orValue = getOr(); + if (orValue != null) { + valMap.put("or", orValue); + } + + 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("or"); + + // 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 + * ConditionalOrderTriggerReject + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConditionalOrderTriggerReject.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ConditionalOrderTriggerReject is not" + + " found in the empty JSON string", + ConditionalOrderTriggerReject.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConditionalOrderTriggerReject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConditionalOrderTriggerReject` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `or` + if (jsonObj.get("or") != null && !jsonObj.get("or").isJsonNull()) { + ConditionalOrderTriggerRejectOr.validateJsonElement(jsonObj.get("or")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConditionalOrderTriggerReject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConditionalOrderTriggerReject' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ConditionalOrderTriggerReject.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ConditionalOrderTriggerReject value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConditionalOrderTriggerReject read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ConditionalOrderTriggerReject given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConditionalOrderTriggerReject + * @throws IOException if the JSON string is invalid with respect to + * ConditionalOrderTriggerReject + */ + public static ConditionalOrderTriggerReject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConditionalOrderTriggerReject.class); + } + + /** + * Convert an instance of ConditionalOrderTriggerReject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/ConditionalOrderTriggerRejectOr.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/ConditionalOrderTriggerRejectOr.java new file mode 100644 index 00000000..c3abaffc --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/ConditionalOrderTriggerRejectOr.java @@ -0,0 +1,331 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ConditionalOrderTriggerRejectOr */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ConditionalOrderTriggerRejectOr 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private Long iLowerCase; + + public static final String SERIALIZED_NAME_R_LOWER_CASE = "r"; + + @SerializedName(SERIALIZED_NAME_R_LOWER_CASE) + @jakarta.annotation.Nullable + private String rLowerCase; + + public ConditionalOrderTriggerRejectOr() {} + + public ConditionalOrderTriggerRejectOr 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 ConditionalOrderTriggerRejectOr 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 ConditionalOrderTriggerRejectOr 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConditionalOrderTriggerRejectOr conditionalOrderTriggerRejectOr = + (ConditionalOrderTriggerRejectOr) o; + return Objects.equals(this.sLowerCase, conditionalOrderTriggerRejectOr.sLowerCase) + && Objects.equals(this.iLowerCase, conditionalOrderTriggerRejectOr.iLowerCase) + && Objects.equals(this.rLowerCase, conditionalOrderTriggerRejectOr.rLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, iLowerCase, rLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConditionalOrderTriggerRejectOr {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).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); + } + Long iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + String rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + String rLowerCaseValueAsString = rLowerCaseValue.toString(); + valMap.put("rLowerCase", rLowerCaseValueAsString); + } + + 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 iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + valMap.put("rLowerCase", rLowerCaseValue); + } + + 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("i"); + openapiFields.add("r"); + + // 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 + * ConditionalOrderTriggerRejectOr + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConditionalOrderTriggerRejectOr.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ConditionalOrderTriggerRejectOr is not" + + " found in the empty JSON string", + ConditionalOrderTriggerRejectOr.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConditionalOrderTriggerRejectOr.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConditionalOrderTriggerRejectOr` 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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConditionalOrderTriggerRejectOr.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConditionalOrderTriggerRejectOr' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ConditionalOrderTriggerRejectOr.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ConditionalOrderTriggerRejectOr value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConditionalOrderTriggerRejectOr read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ConditionalOrderTriggerRejectOr given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConditionalOrderTriggerRejectOr + * @throws IOException if the JSON string is invalid with respect to + * ConditionalOrderTriggerRejectOr + */ + public static ConditionalOrderTriggerRejectOr fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConditionalOrderTriggerRejectOr.class); + } + + /** + * Convert an instance of ConditionalOrderTriggerRejectOr to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/GridUpdate.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/GridUpdate.java new file mode 100644 index 00000000..bad1813d --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/GridUpdate.java @@ -0,0 +1,311 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GridUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GridUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_GU = "gu"; + + @SerializedName(SERIALIZED_NAME_GU) + @jakarta.annotation.Nullable + private GridUpdateGu gu; + + public GridUpdate() {} + + public GridUpdate 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 GridUpdate 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 GridUpdate gu(@jakarta.annotation.Nullable GridUpdateGu gu) { + this.gu = gu; + return this; + } + + /** + * Get gu + * + * @return gu + */ + @jakarta.annotation.Nullable + @Valid + public GridUpdateGu getGu() { + return gu; + } + + public void setGu(@jakarta.annotation.Nullable GridUpdateGu gu) { + this.gu = gu; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GridUpdate gridUpdate = (GridUpdate) o; + return Objects.equals(this.T, gridUpdate.T) + && Objects.equals(this.E, gridUpdate.E) + && Objects.equals(this.gu, gridUpdate.gu); + } + + @Override + public int hashCode() { + return Objects.hash(T, E, gu); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GridUpdate {\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" gu: ").append(toIndentedString(gu)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + GridUpdateGu guValue = getGu(); + if (guValue != null) { + String guValueAsString = JSON.getGson().toJson(guValue); + valMap.put("gu", guValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object guValue = getGu(); + if (guValue != null) { + valMap.put("gu", guValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("T"); + openapiFields.add("E"); + openapiFields.add("gu"); + + // 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 GridUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GridUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GridUpdate is not found in the empty" + + " JSON string", + GridUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GridUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GridUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `gu` + if (jsonObj.get("gu") != null && !jsonObj.get("gu").isJsonNull()) { + GridUpdateGu.validateJsonElement(jsonObj.get("gu")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GridUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GridUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GridUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GridUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GridUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GridUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of GridUpdate + * @throws IOException if the JSON string is invalid with respect to GridUpdate + */ + public static GridUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GridUpdate.class); + } + + /** + * Convert an instance of GridUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/GridUpdateGu.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/GridUpdateGu.java new file mode 100644 index 00000000..587d5e27 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/GridUpdateGu.java @@ -0,0 +1,628 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GridUpdateGu */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GridUpdateGu extends BaseDTO { + public static final String SERIALIZED_NAME_SI = "si"; + + @SerializedName(SERIALIZED_NAME_SI) + @jakarta.annotation.Nullable + private Long si; + + public static final String SERIALIZED_NAME_ST = "st"; + + @SerializedName(SERIALIZED_NAME_ST) + @jakarta.annotation.Nullable + private String st; + + public static final String SERIALIZED_NAME_SS = "ss"; + + @SerializedName(SERIALIZED_NAME_SS) + @jakarta.annotation.Nullable + private String ss; + + 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_R_LOWER_CASE = "r"; + + @SerializedName(SERIALIZED_NAME_R_LOWER_CASE) + @jakarta.annotation.Nullable + private String rLowerCase; + + public static final String SERIALIZED_NAME_UP = "up"; + + @SerializedName(SERIALIZED_NAME_UP) + @jakarta.annotation.Nullable + private String up; + + public static final String SERIALIZED_NAME_UQ = "uq"; + + @SerializedName(SERIALIZED_NAME_UQ) + @jakarta.annotation.Nullable + private String uq; + + public static final String SERIALIZED_NAME_UF = "uf"; + + @SerializedName(SERIALIZED_NAME_UF) + @jakarta.annotation.Nullable + private String uf; + + public static final String SERIALIZED_NAME_MP = "mp"; + + @SerializedName(SERIALIZED_NAME_MP) + @jakarta.annotation.Nullable + private String mp; + + public static final String SERIALIZED_NAME_UT = "ut"; + + @SerializedName(SERIALIZED_NAME_UT) + @jakarta.annotation.Nullable + private Long ut; + + public GridUpdateGu() {} + + public GridUpdateGu si(@jakarta.annotation.Nullable Long si) { + this.si = si; + return this; + } + + /** + * Get si + * + * @return si + */ + @jakarta.annotation.Nullable + public Long getSi() { + return si; + } + + public void setSi(@jakarta.annotation.Nullable Long si) { + this.si = si; + } + + public GridUpdateGu st(@jakarta.annotation.Nullable String st) { + this.st = st; + return this; + } + + /** + * Get st + * + * @return st + */ + @jakarta.annotation.Nullable + public String getSt() { + return st; + } + + public void setSt(@jakarta.annotation.Nullable String st) { + this.st = st; + } + + public GridUpdateGu ss(@jakarta.annotation.Nullable String ss) { + this.ss = ss; + return this; + } + + /** + * Get ss + * + * @return ss + */ + @jakarta.annotation.Nullable + public String getSs() { + return ss; + } + + public void setSs(@jakarta.annotation.Nullable String ss) { + this.ss = ss; + } + + public GridUpdateGu 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 GridUpdateGu 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 GridUpdateGu up(@jakarta.annotation.Nullable String up) { + this.up = up; + return this; + } + + /** + * Get up + * + * @return up + */ + @jakarta.annotation.Nullable + public String getUp() { + return up; + } + + public void setUp(@jakarta.annotation.Nullable String up) { + this.up = up; + } + + public GridUpdateGu uq(@jakarta.annotation.Nullable String uq) { + this.uq = uq; + return this; + } + + /** + * Get uq + * + * @return uq + */ + @jakarta.annotation.Nullable + public String getUq() { + return uq; + } + + public void setUq(@jakarta.annotation.Nullable String uq) { + this.uq = uq; + } + + public GridUpdateGu uf(@jakarta.annotation.Nullable String uf) { + this.uf = uf; + return this; + } + + /** + * Get uf + * + * @return uf + */ + @jakarta.annotation.Nullable + public String getUf() { + return uf; + } + + public void setUf(@jakarta.annotation.Nullable String uf) { + this.uf = uf; + } + + public GridUpdateGu 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 GridUpdateGu ut(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + return this; + } + + /** + * Get ut + * + * @return ut + */ + @jakarta.annotation.Nullable + public Long getUt() { + return ut; + } + + public void setUt(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GridUpdateGu gridUpdateGu = (GridUpdateGu) o; + return Objects.equals(this.si, gridUpdateGu.si) + && Objects.equals(this.st, gridUpdateGu.st) + && Objects.equals(this.ss, gridUpdateGu.ss) + && Objects.equals(this.sLowerCase, gridUpdateGu.sLowerCase) + && Objects.equals(this.rLowerCase, gridUpdateGu.rLowerCase) + && Objects.equals(this.up, gridUpdateGu.up) + && Objects.equals(this.uq, gridUpdateGu.uq) + && Objects.equals(this.uf, gridUpdateGu.uf) + && Objects.equals(this.mp, gridUpdateGu.mp) + && Objects.equals(this.ut, gridUpdateGu.ut); + } + + @Override + public int hashCode() { + return Objects.hash(si, st, ss, sLowerCase, rLowerCase, up, uq, uf, mp, ut); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GridUpdateGu {\n"); + sb.append(" si: ").append(toIndentedString(si)).append("\n"); + sb.append(" st: ").append(toIndentedString(st)).append("\n"); + sb.append(" ss: ").append(toIndentedString(ss)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).append("\n"); + sb.append(" up: ").append(toIndentedString(up)).append("\n"); + sb.append(" uq: ").append(toIndentedString(uq)).append("\n"); + sb.append(" uf: ").append(toIndentedString(uf)).append("\n"); + sb.append(" mp: ").append(toIndentedString(mp)).append("\n"); + sb.append(" ut: ").append(toIndentedString(ut)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long siValue = getSi(); + if (siValue != null) { + String siValueAsString = siValue.toString(); + valMap.put("si", siValueAsString); + } + String stValue = getSt(); + if (stValue != null) { + String stValueAsString = stValue.toString(); + valMap.put("st", stValueAsString); + } + String ssValue = getSs(); + if (ssValue != null) { + String ssValueAsString = ssValue.toString(); + valMap.put("ss", ssValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + String rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + String rLowerCaseValueAsString = rLowerCaseValue.toString(); + valMap.put("rLowerCase", rLowerCaseValueAsString); + } + String upValue = getUp(); + if (upValue != null) { + String upValueAsString = upValue.toString(); + valMap.put("up", upValueAsString); + } + String uqValue = getUq(); + if (uqValue != null) { + String uqValueAsString = uqValue.toString(); + valMap.put("uq", uqValueAsString); + } + String ufValue = getUf(); + if (ufValue != null) { + String ufValueAsString = ufValue.toString(); + valMap.put("uf", ufValueAsString); + } + String mpValue = getMp(); + if (mpValue != null) { + String mpValueAsString = mpValue.toString(); + valMap.put("mp", mpValueAsString); + } + Long utValue = getUt(); + if (utValue != null) { + String utValueAsString = utValue.toString(); + valMap.put("ut", utValueAsString); + } + + 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 siValue = getSi(); + if (siValue != null) { + valMap.put("si", siValue); + } + Object stValue = getSt(); + if (stValue != null) { + valMap.put("st", stValue); + } + Object ssValue = getSs(); + if (ssValue != null) { + valMap.put("ss", ssValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + valMap.put("rLowerCase", rLowerCaseValue); + } + Object upValue = getUp(); + if (upValue != null) { + valMap.put("up", upValue); + } + Object uqValue = getUq(); + if (uqValue != null) { + valMap.put("uq", uqValue); + } + Object ufValue = getUf(); + if (ufValue != null) { + valMap.put("uf", ufValue); + } + Object mpValue = getMp(); + if (mpValue != null) { + valMap.put("mp", mpValue); + } + Object utValue = getUt(); + if (utValue != null) { + valMap.put("ut", utValue); + } + + 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("si"); + openapiFields.add("st"); + openapiFields.add("ss"); + openapiFields.add("s"); + openapiFields.add("r"); + openapiFields.add("up"); + openapiFields.add("uq"); + openapiFields.add("uf"); + openapiFields.add("mp"); + openapiFields.add("ut"); + + // 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 GridUpdateGu + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GridUpdateGu.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GridUpdateGu is not found in the empty" + + " JSON string", + GridUpdateGu.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GridUpdateGu.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GridUpdateGu` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("st") != null && !jsonObj.get("st").isJsonNull()) + && !jsonObj.get("st").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `st` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("st").toString())); + } + if ((jsonObj.get("ss") != null && !jsonObj.get("ss").isJsonNull()) + && !jsonObj.get("ss").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ss` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ss").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("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("up") != null && !jsonObj.get("up").isJsonNull()) + && !jsonObj.get("up").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `up` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("up").toString())); + } + if ((jsonObj.get("uq") != null && !jsonObj.get("uq").isJsonNull()) + && !jsonObj.get("uq").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `uq` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("uq").toString())); + } + if ((jsonObj.get("uf") != null && !jsonObj.get("uf").isJsonNull()) + && !jsonObj.get("uf").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `uf` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("uf").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GridUpdateGu.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GridUpdateGu' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GridUpdateGu.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GridUpdateGu value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GridUpdateGu read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GridUpdateGu given an JSON string + * + * @param jsonString JSON string + * @return An instance of GridUpdateGu + * @throws IOException if the JSON string is invalid with respect to GridUpdateGu + */ + public static GridUpdateGu fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GridUpdateGu.class); + } + + /** + * Convert an instance of GridUpdateGu to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/Listenkeyexpired.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/Listenkeyexpired.java new file mode 100644 index 00000000..068704dd --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/Listenkeyexpired.java @@ -0,0 +1,285 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** 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-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/MarginCall.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/MarginCall.java new file mode 100644 index 00000000..b06a387e --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/MarginCall.java @@ -0,0 +1,347 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.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.*; + +/** MarginCall */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MarginCall 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_CW = "cw"; + + @SerializedName(SERIALIZED_NAME_CW) + @jakarta.annotation.Nullable + private String cw; + + public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; + + @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) + @jakarta.annotation.Nullable + private List<@Valid MarginCallPInner> pLowerCase; + + public MarginCall() {} + + public MarginCall 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 MarginCall cw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + return this; + } + + /** + * Get cw + * + * @return cw + */ + @jakarta.annotation.Nullable + public String getCw() { + return cw; + } + + public void setCw(@jakarta.annotation.Nullable String cw) { + this.cw = cw; + } + + public MarginCall pLowerCase( + @jakarta.annotation.Nullable List<@Valid MarginCallPInner> pLowerCase) { + this.pLowerCase = pLowerCase; + return this; + } + + public MarginCall addPLowerCaseItem(MarginCallPInner pLowerCaseItem) { + if (this.pLowerCase == null) { + this.pLowerCase = new ArrayList<>(); + } + this.pLowerCase.add(pLowerCaseItem); + return this; + } + + /** + * Get pLowerCase + * + * @return pLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid MarginCallPInner> getpLowerCase() { + return pLowerCase; + } + + public void setpLowerCase( + @jakarta.annotation.Nullable List<@Valid MarginCallPInner> pLowerCase) { + this.pLowerCase = pLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarginCall marginCall = (MarginCall) o; + return Objects.equals(this.E, marginCall.E) + && Objects.equals(this.cw, marginCall.cw) + && Objects.equals(this.pLowerCase, marginCall.pLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, cw, pLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarginCall {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" cw: ").append(toIndentedString(cw)).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()); + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + String cwValue = getCw(); + if (cwValue != null) { + String cwValueAsString = cwValue.toString(); + valMap.put("cw", cwValueAsString); + } + List<@Valid MarginCallPInner> pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + String pLowerCaseValueAsString = JSON.getGson().toJson(pLowerCaseValue); + 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 EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object cwValue = getCw(); + if (cwValue != null) { + valMap.put("cw", cwValue); + } + 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("cw"); + 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 MarginCall + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MarginCall.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MarginCall is not found in the empty" + + " JSON string", + MarginCall.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MarginCall.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MarginCall` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cw") != null && !jsonObj.get("cw").isJsonNull()) + && !jsonObj.get("cw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cw").toString())); + } + if (jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) { + JsonArray jsonArraypLowerCase = jsonObj.getAsJsonArray("p"); + if (jsonArraypLowerCase != null) { + // ensure the json data is an array + if (!jsonObj.get("p").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `p` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("p").toString())); + } + + // validate the optional field `p` (array) + for (int i = 0; i < jsonArraypLowerCase.size(); i++) { + MarginCallPInner.validateJsonElement(jsonArraypLowerCase.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MarginCall.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MarginCall' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MarginCall.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MarginCall value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MarginCall read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MarginCall given an JSON string + * + * @param jsonString JSON string + * @return An instance of MarginCall + * @throws IOException if the JSON string is invalid with respect to MarginCall + */ + public static MarginCall fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MarginCall.class); + } + + /** + * Convert an instance of MarginCall to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/MarginCallPInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/MarginCallPInner.java new file mode 100644 index 00000000..9351477b --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/MarginCallPInner.java @@ -0,0 +1,555 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MarginCallPInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MarginCallPInner 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_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public static final String SERIALIZED_NAME_PA = "pa"; + + @SerializedName(SERIALIZED_NAME_PA) + @jakarta.annotation.Nullable + private String pa; + + public static final String SERIALIZED_NAME_MT = "mt"; + + @SerializedName(SERIALIZED_NAME_MT) + @jakarta.annotation.Nullable + private String mt; + + public static final String SERIALIZED_NAME_IW = "iw"; + + @SerializedName(SERIALIZED_NAME_IW) + @jakarta.annotation.Nullable + private String iw; + + public static final String SERIALIZED_NAME_MP = "mp"; + + @SerializedName(SERIALIZED_NAME_MP) + @jakarta.annotation.Nullable + private String mp; + + public static final String SERIALIZED_NAME_UP = "up"; + + @SerializedName(SERIALIZED_NAME_UP) + @jakarta.annotation.Nullable + private String up; + + public static final String SERIALIZED_NAME_MM = "mm"; + + @SerializedName(SERIALIZED_NAME_MM) + @jakarta.annotation.Nullable + private String mm; + + public MarginCallPInner() {} + + public MarginCallPInner 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 MarginCallPInner 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 MarginCallPInner pa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + return this; + } + + /** + * Get pa + * + * @return pa + */ + @jakarta.annotation.Nullable + public String getPa() { + return pa; + } + + public void setPa(@jakarta.annotation.Nullable String pa) { + this.pa = pa; + } + + public MarginCallPInner mt(@jakarta.annotation.Nullable String mt) { + this.mt = mt; + return this; + } + + /** + * Get mt + * + * @return mt + */ + @jakarta.annotation.Nullable + public String getMt() { + return mt; + } + + public void setMt(@jakarta.annotation.Nullable String mt) { + this.mt = mt; + } + + public MarginCallPInner iw(@jakarta.annotation.Nullable String iw) { + this.iw = iw; + return this; + } + + /** + * Get iw + * + * @return iw + */ + @jakarta.annotation.Nullable + public String getIw() { + return iw; + } + + public void setIw(@jakarta.annotation.Nullable String iw) { + this.iw = iw; + } + + public MarginCallPInner 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 MarginCallPInner up(@jakarta.annotation.Nullable String up) { + this.up = up; + return this; + } + + /** + * Get up + * + * @return up + */ + @jakarta.annotation.Nullable + public String getUp() { + return up; + } + + public void setUp(@jakarta.annotation.Nullable String up) { + this.up = up; + } + + public MarginCallPInner mm(@jakarta.annotation.Nullable String mm) { + this.mm = mm; + return this; + } + + /** + * Get mm + * + * @return mm + */ + @jakarta.annotation.Nullable + public String getMm() { + return mm; + } + + public void setMm(@jakarta.annotation.Nullable String mm) { + this.mm = mm; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarginCallPInner marginCallPInner = (MarginCallPInner) o; + return Objects.equals(this.sLowerCase, marginCallPInner.sLowerCase) + && Objects.equals(this.ps, marginCallPInner.ps) + && Objects.equals(this.pa, marginCallPInner.pa) + && Objects.equals(this.mt, marginCallPInner.mt) + && Objects.equals(this.iw, marginCallPInner.iw) + && Objects.equals(this.mp, marginCallPInner.mp) + && Objects.equals(this.up, marginCallPInner.up) + && Objects.equals(this.mm, marginCallPInner.mm); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, ps, pa, mt, iw, mp, up, mm); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarginCallPInner {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" pa: ").append(toIndentedString(pa)).append("\n"); + sb.append(" mt: ").append(toIndentedString(mt)).append("\n"); + sb.append(" iw: ").append(toIndentedString(iw)).append("\n"); + sb.append(" mp: ").append(toIndentedString(mp)).append("\n"); + sb.append(" up: ").append(toIndentedString(up)).append("\n"); + sb.append(" mm: ").append(toIndentedString(mm)).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 psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + String paValue = getPa(); + if (paValue != null) { + String paValueAsString = paValue.toString(); + valMap.put("pa", paValueAsString); + } + String mtValue = getMt(); + if (mtValue != null) { + String mtValueAsString = mtValue.toString(); + valMap.put("mt", mtValueAsString); + } + String iwValue = getIw(); + if (iwValue != null) { + String iwValueAsString = iwValue.toString(); + valMap.put("iw", iwValueAsString); + } + String mpValue = getMp(); + if (mpValue != null) { + String mpValueAsString = mpValue.toString(); + valMap.put("mp", mpValueAsString); + } + String upValue = getUp(); + if (upValue != null) { + String upValueAsString = upValue.toString(); + valMap.put("up", upValueAsString); + } + String mmValue = getMm(); + if (mmValue != null) { + String mmValueAsString = mmValue.toString(); + valMap.put("mm", mmValueAsString); + } + + 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 psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + Object paValue = getPa(); + if (paValue != null) { + valMap.put("pa", paValue); + } + Object mtValue = getMt(); + if (mtValue != null) { + valMap.put("mt", mtValue); + } + Object iwValue = getIw(); + if (iwValue != null) { + valMap.put("iw", iwValue); + } + Object mpValue = getMp(); + if (mpValue != null) { + valMap.put("mp", mpValue); + } + Object upValue = getUp(); + if (upValue != null) { + valMap.put("up", upValue); + } + Object mmValue = getMm(); + if (mmValue != null) { + valMap.put("mm", mmValue); + } + + 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("ps"); + openapiFields.add("pa"); + openapiFields.add("mt"); + openapiFields.add("iw"); + openapiFields.add("mp"); + openapiFields.add("up"); + openapiFields.add("mm"); + + // 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 MarginCallPInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MarginCallPInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MarginCallPInner is not found in the" + + " empty JSON string", + MarginCallPInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MarginCallPInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MarginCallPInner` 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("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("pa") != null && !jsonObj.get("pa").isJsonNull()) + && !jsonObj.get("pa").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pa` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pa").toString())); + } + if ((jsonObj.get("mt") != null && !jsonObj.get("mt").isJsonNull()) + && !jsonObj.get("mt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mt` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("mt").toString())); + } + if ((jsonObj.get("iw") != null && !jsonObj.get("iw").isJsonNull()) + && !jsonObj.get("iw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `iw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("iw").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("up") != null && !jsonObj.get("up").isJsonNull()) + && !jsonObj.get("up").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `up` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("up").toString())); + } + if ((jsonObj.get("mm") != null && !jsonObj.get("mm").isJsonNull()) + && !jsonObj.get("mm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mm` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("mm").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MarginCallPInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MarginCallPInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MarginCallPInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MarginCallPInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MarginCallPInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MarginCallPInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of MarginCallPInner + * @throws IOException if the JSON string is invalid with respect to MarginCallPInner + */ + public static MarginCallPInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MarginCallPInner.class); + } + + /** + * Convert an instance of MarginCallPInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdate.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdate.java new file mode 100644 index 00000000..a4dfc8ba --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdate.java @@ -0,0 +1,312 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderTradeUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderTradeUpdate 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_O_LOWER_CASE = "o"; + + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @jakarta.annotation.Nullable + private OrderTradeUpdateO oLowerCase; + + public OrderTradeUpdate() {} + + public OrderTradeUpdate 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 OrderTradeUpdate 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 OrderTradeUpdate oLowerCase(@jakarta.annotation.Nullable OrderTradeUpdateO oLowerCase) { + this.oLowerCase = oLowerCase; + return this; + } + + /** + * Get oLowerCase + * + * @return oLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public OrderTradeUpdateO getoLowerCase() { + return oLowerCase; + } + + public void setoLowerCase(@jakarta.annotation.Nullable OrderTradeUpdateO oLowerCase) { + this.oLowerCase = oLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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, T, oLowerCase); + } + + @Override + 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(); + } + + 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); + } + OrderTradeUpdateO oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + String oLowerCaseValueAsString = JSON.getGson().toJson(oLowerCaseValue); + valMap.put("oLowerCase", oLowerCaseValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object EValue = getE(); + 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); + } + + 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("o"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrderTradeUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderTradeUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderTradeUpdate is not found in the" + + " empty JSON string", + OrderTradeUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderTradeUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderTradeUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `o` + if (jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) { + OrderTradeUpdateO.validateJsonElement(jsonObj.get("o")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderTradeUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderTradeUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderTradeUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderTradeUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderTradeUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderTradeUpdate + * @throws IOException if the JSON string is invalid with respect to OrderTradeUpdate + */ + public static OrderTradeUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderTradeUpdate.class); + } + + /** + * Convert an instance of OrderTradeUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdateO.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdateO.java new file mode 100644 index 00000000..ab24d518 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdateO.java @@ -0,0 +1,1771 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** 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_SP = "sp"; + + @SerializedName(SERIALIZED_NAME_SP) + @jakarta.annotation.Nullable + private String sp; + + 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_WT = "wt"; + + @SerializedName(SERIALIZED_NAME_WT) + @jakarta.annotation.Nullable + private String wt; + + public static final String SERIALIZED_NAME_OT = "ot"; + + @SerializedName(SERIALIZED_NAME_OT) + @jakarta.annotation.Nullable + private String ot; + + public static final String SERIALIZED_NAME_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public static final String SERIALIZED_NAME_CP = "cp"; + + @SerializedName(SERIALIZED_NAME_CP) + @jakarta.annotation.Nullable + private Boolean cp; + + public static final String SERIALIZED_NAME_A_P = "AP"; + + @SerializedName(SERIALIZED_NAME_A_P) + @jakarta.annotation.Nullable + private String AP; + + public static final String SERIALIZED_NAME_CR = "cr"; + + @SerializedName(SERIALIZED_NAME_CR) + @jakarta.annotation.Nullable + private String cr; + + public static final String SERIALIZED_NAME_P_P = "pP"; + + @SerializedName(SERIALIZED_NAME_P_P) + @jakarta.annotation.Nullable + private Boolean pP; + + public static final String SERIALIZED_NAME_SI = "si"; + + @SerializedName(SERIALIZED_NAME_SI) + @jakarta.annotation.Nullable + private Long si; + + public static final String SERIALIZED_NAME_SS = "ss"; + + @SerializedName(SERIALIZED_NAME_SS) + @jakarta.annotation.Nullable + private Long ss; + + public static final String SERIALIZED_NAME_RP = "rp"; + + @SerializedName(SERIALIZED_NAME_RP) + @jakarta.annotation.Nullable + private String rp; + + public static final String SERIALIZED_NAME_V = "V"; + + @SerializedName(SERIALIZED_NAME_V) + @jakarta.annotation.Nullable + private String V; + + public static final String SERIALIZED_NAME_PM = "pm"; + + @SerializedName(SERIALIZED_NAME_PM) + @jakarta.annotation.Nullable + private String pm; + + public static final String SERIALIZED_NAME_GTD = "gtd"; + + @SerializedName(SERIALIZED_NAME_GTD) + @jakarta.annotation.Nullable + private Long gtd; + + 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 sp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; + return this; + } + + /** + * Get sp + * + * @return sp + */ + @jakarta.annotation.Nullable + public String getSp() { + return sp; + } + + public void setSp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; + } + + 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 wt(@jakarta.annotation.Nullable String wt) { + this.wt = wt; + return this; + } + + /** + * Get wt + * + * @return wt + */ + @jakarta.annotation.Nullable + public String getWt() { + return wt; + } + + public void setWt(@jakarta.annotation.Nullable String wt) { + this.wt = wt; + } + + public 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 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 OrderTradeUpdateO cp(@jakarta.annotation.Nullable Boolean cp) { + this.cp = cp; + return this; + } + + /** + * Get cp + * + * @return cp + */ + @jakarta.annotation.Nullable + public Boolean getCp() { + return cp; + } + + public void setCp(@jakarta.annotation.Nullable Boolean cp) { + this.cp = cp; + } + + public 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 cr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + return this; + } + + /** + * Get cr + * + * @return cr + */ + @jakarta.annotation.Nullable + public String getCr() { + return cr; + } + + public void setCr(@jakarta.annotation.Nullable String cr) { + this.cr = cr; + } + + public OrderTradeUpdateO pP(@jakarta.annotation.Nullable Boolean pP) { + this.pP = pP; + return this; + } + + /** + * Get pP + * + * @return pP + */ + @jakarta.annotation.Nullable + public Boolean getpP() { + return pP; + } + + public void setpP(@jakarta.annotation.Nullable Boolean pP) { + this.pP = pP; + } + + public OrderTradeUpdateO si(@jakarta.annotation.Nullable Long si) { + this.si = si; + return this; + } + + /** + * Get si + * + * @return si + */ + @jakarta.annotation.Nullable + public Long getSi() { + return si; + } + + public void setSi(@jakarta.annotation.Nullable Long si) { + this.si = si; + } + + public OrderTradeUpdateO ss(@jakarta.annotation.Nullable Long ss) { + this.ss = ss; + return this; + } + + /** + * Get ss + * + * @return ss + */ + @jakarta.annotation.Nullable + public Long getSs() { + return ss; + } + + public void setSs(@jakarta.annotation.Nullable Long ss) { + this.ss = ss; + } + + 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; + } + + public OrderTradeUpdateO 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 OrderTradeUpdateO pm(@jakarta.annotation.Nullable String pm) { + this.pm = pm; + return this; + } + + /** + * Get pm + * + * @return pm + */ + @jakarta.annotation.Nullable + public String getPm() { + return pm; + } + + public void setPm(@jakarta.annotation.Nullable String pm) { + this.pm = pm; + } + + public OrderTradeUpdateO gtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + return this; + } + + /** + * Get gtd + * + * @return gtd + */ + @jakarta.annotation.Nullable + public Long getGtd() { + return gtd; + } + + public void setGtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + } + + @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.sp, orderTradeUpdateO.sp) + && 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.wt, orderTradeUpdateO.wt) + && Objects.equals(this.ot, orderTradeUpdateO.ot) + && Objects.equals(this.ps, orderTradeUpdateO.ps) + && Objects.equals(this.cp, orderTradeUpdateO.cp) + && Objects.equals(this.AP, orderTradeUpdateO.AP) + && Objects.equals(this.cr, orderTradeUpdateO.cr) + && Objects.equals(this.pP, orderTradeUpdateO.pP) + && Objects.equals(this.si, orderTradeUpdateO.si) + && Objects.equals(this.ss, orderTradeUpdateO.ss) + && Objects.equals(this.rp, orderTradeUpdateO.rp) + && Objects.equals(this.V, orderTradeUpdateO.V) + && Objects.equals(this.pm, orderTradeUpdateO.pm) + && Objects.equals(this.gtd, orderTradeUpdateO.gtd); + } + + @Override + public int hashCode() { + return Objects.hash( + sLowerCase, + cLowerCase, + S, + oLowerCase, + fLowerCase, + qLowerCase, + pLowerCase, + ap, + sp, + xLowerCase, + X, + iLowerCase, + lLowerCase, + zLowerCase, + L, + N, + nLowerCase, + T, + tLowerCase, + bLowerCase, + aLowerCase, + mLowerCase, + R, + wt, + ot, + ps, + cp, + AP, + cr, + pP, + si, + ss, + rp, + V, + pm, + gtd); + } + + @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(" sp: ").append(toIndentedString(sp)).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(" wt: ").append(toIndentedString(wt)).append("\n"); + sb.append(" ot: ").append(toIndentedString(ot)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" cp: ").append(toIndentedString(cp)).append("\n"); + sb.append(" AP: ").append(toIndentedString(AP)).append("\n"); + sb.append(" cr: ").append(toIndentedString(cr)).append("\n"); + sb.append(" pP: ").append(toIndentedString(pP)).append("\n"); + sb.append(" si: ").append(toIndentedString(si)).append("\n"); + sb.append(" ss: ").append(toIndentedString(ss)).append("\n"); + sb.append(" rp: ").append(toIndentedString(rp)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); + sb.append(" pm: ").append(toIndentedString(pm)).append("\n"); + sb.append(" gtd: ").append(toIndentedString(gtd)).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 spValue = getSp(); + if (spValue != null) { + String spValueAsString = spValue.toString(); + valMap.put("sp", spValueAsString); + } + 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 wtValue = getWt(); + if (wtValue != null) { + String wtValueAsString = wtValue.toString(); + valMap.put("wt", wtValueAsString); + } + String otValue = getOt(); + if (otValue != null) { + String otValueAsString = otValue.toString(); + valMap.put("ot", otValueAsString); + } + String psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + Boolean cpValue = getCp(); + if (cpValue != null) { + String cpValueAsString = cpValue.toString(); + valMap.put("cp", cpValueAsString); + } + String APValue = getAP(); + if (APValue != null) { + String APValueAsString = APValue.toString(); + valMap.put("AP", APValueAsString); + } + String crValue = getCr(); + if (crValue != null) { + String crValueAsString = crValue.toString(); + valMap.put("cr", crValueAsString); + } + Boolean pPValue = getpP(); + if (pPValue != null) { + String pPValueAsString = pPValue.toString(); + valMap.put("pP", pPValueAsString); + } + Long siValue = getSi(); + if (siValue != null) { + String siValueAsString = siValue.toString(); + valMap.put("si", siValueAsString); + } + Long ssValue = getSs(); + if (ssValue != null) { + String ssValueAsString = ssValue.toString(); + valMap.put("ss", ssValueAsString); + } + String rpValue = getRp(); + if (rpValue != null) { + String rpValueAsString = rpValue.toString(); + valMap.put("rp", rpValueAsString); + } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } + String pmValue = getPm(); + if (pmValue != null) { + String pmValueAsString = pmValue.toString(); + valMap.put("pm", pmValueAsString); + } + Long gtdValue = getGtd(); + if (gtdValue != null) { + String gtdValueAsString = gtdValue.toString(); + valMap.put("gtd", gtdValueAsString); + } + + 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 spValue = getSp(); + if (spValue != null) { + valMap.put("sp", spValue); + } + 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 wtValue = getWt(); + if (wtValue != null) { + valMap.put("wt", wtValue); + } + Object otValue = getOt(); + if (otValue != null) { + valMap.put("ot", otValue); + } + Object psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + Object cpValue = getCp(); + if (cpValue != null) { + valMap.put("cp", cpValue); + } + Object APValue = getAP(); + if (APValue != null) { + valMap.put("AP", APValue); + } + Object crValue = getCr(); + if (crValue != null) { + valMap.put("cr", crValue); + } + Object pPValue = getpP(); + if (pPValue != null) { + valMap.put("pP", pPValue); + } + Object siValue = getSi(); + if (siValue != null) { + valMap.put("si", siValue); + } + Object ssValue = getSs(); + if (ssValue != null) { + valMap.put("ss", ssValue); + } + Object rpValue = getRp(); + if (rpValue != null) { + valMap.put("rp", rpValue); + } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } + Object pmValue = getPm(); + if (pmValue != null) { + valMap.put("pm", pmValue); + } + Object gtdValue = getGtd(); + if (gtdValue != null) { + valMap.put("gtd", gtdValue); + } + + 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("sp"); + 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("wt"); + openapiFields.add("ot"); + openapiFields.add("ps"); + openapiFields.add("cp"); + openapiFields.add("AP"); + openapiFields.add("cr"); + openapiFields.add("pP"); + openapiFields.add("si"); + openapiFields.add("ss"); + openapiFields.add("rp"); + openapiFields.add("V"); + openapiFields.add("pm"); + openapiFields.add("gtd"); + + // 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("sp") != null && !jsonObj.get("sp").isJsonNull()) + && !jsonObj.get("sp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sp` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("sp").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("wt") != null && !jsonObj.get("wt").isJsonNull()) + && !jsonObj.get("wt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `wt` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("wt").toString())); + } + if ((jsonObj.get("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("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("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("cr") != null && !jsonObj.get("cr").isJsonNull()) + && !jsonObj.get("cr").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cr` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cr").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())); + } + 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("pm") != null && !jsonObj.get("pm").isJsonNull()) + && !jsonObj.get("pm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pm` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pm").toString())); + } + } + + 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-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/StrategyUpdate.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/StrategyUpdate.java new file mode 100644 index 00000000..fb33328b --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/StrategyUpdate.java @@ -0,0 +1,311 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** StrategyUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class StrategyUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_SU = "su"; + + @SerializedName(SERIALIZED_NAME_SU) + @jakarta.annotation.Nullable + private StrategyUpdateSu su; + + public StrategyUpdate() {} + + public StrategyUpdate 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 StrategyUpdate 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 StrategyUpdate su(@jakarta.annotation.Nullable StrategyUpdateSu su) { + this.su = su; + return this; + } + + /** + * Get su + * + * @return su + */ + @jakarta.annotation.Nullable + @Valid + public StrategyUpdateSu getSu() { + return su; + } + + public void setSu(@jakarta.annotation.Nullable StrategyUpdateSu su) { + this.su = su; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StrategyUpdate strategyUpdate = (StrategyUpdate) o; + return Objects.equals(this.T, strategyUpdate.T) + && Objects.equals(this.E, strategyUpdate.E) + && Objects.equals(this.su, strategyUpdate.su); + } + + @Override + public int hashCode() { + return Objects.hash(T, E, su); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StrategyUpdate {\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" su: ").append(toIndentedString(su)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + StrategyUpdateSu suValue = getSu(); + if (suValue != null) { + String suValueAsString = JSON.getGson().toJson(suValue); + valMap.put("su", suValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object suValue = getSu(); + if (suValue != null) { + valMap.put("su", suValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("T"); + openapiFields.add("E"); + openapiFields.add("su"); + + // 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 StrategyUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StrategyUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in StrategyUpdate is not found in the" + + " empty JSON string", + StrategyUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StrategyUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `StrategyUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `su` + if (jsonObj.get("su") != null && !jsonObj.get("su").isJsonNull()) { + StrategyUpdateSu.validateJsonElement(jsonObj.get("su")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StrategyUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StrategyUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(StrategyUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, StrategyUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StrategyUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of StrategyUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of StrategyUpdate + * @throws IOException if the JSON string is invalid with respect to StrategyUpdate + */ + public static StrategyUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StrategyUpdate.class); + } + + /** + * Convert an instance of StrategyUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/StrategyUpdateSu.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/StrategyUpdateSu.java new file mode 100644 index 00000000..f5a5c332 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/StrategyUpdateSu.java @@ -0,0 +1,441 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** StrategyUpdateSu */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class StrategyUpdateSu extends BaseDTO { + public static final String SERIALIZED_NAME_SI = "si"; + + @SerializedName(SERIALIZED_NAME_SI) + @jakarta.annotation.Nullable + private Long si; + + public static final String SERIALIZED_NAME_ST = "st"; + + @SerializedName(SERIALIZED_NAME_ST) + @jakarta.annotation.Nullable + private String st; + + public static final String SERIALIZED_NAME_SS = "ss"; + + @SerializedName(SERIALIZED_NAME_SS) + @jakarta.annotation.Nullable + private String ss; + + 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_UT = "ut"; + + @SerializedName(SERIALIZED_NAME_UT) + @jakarta.annotation.Nullable + private Long ut; + + public static final String SERIALIZED_NAME_C_LOWER_CASE = "c"; + + @SerializedName(SERIALIZED_NAME_C_LOWER_CASE) + @jakarta.annotation.Nullable + private Long cLowerCase; + + public StrategyUpdateSu() {} + + public StrategyUpdateSu si(@jakarta.annotation.Nullable Long si) { + this.si = si; + return this; + } + + /** + * Get si + * + * @return si + */ + @jakarta.annotation.Nullable + public Long getSi() { + return si; + } + + public void setSi(@jakarta.annotation.Nullable Long si) { + this.si = si; + } + + public StrategyUpdateSu st(@jakarta.annotation.Nullable String st) { + this.st = st; + return this; + } + + /** + * Get st + * + * @return st + */ + @jakarta.annotation.Nullable + public String getSt() { + return st; + } + + public void setSt(@jakarta.annotation.Nullable String st) { + this.st = st; + } + + public StrategyUpdateSu ss(@jakarta.annotation.Nullable String ss) { + this.ss = ss; + return this; + } + + /** + * Get ss + * + * @return ss + */ + @jakarta.annotation.Nullable + public String getSs() { + return ss; + } + + public void setSs(@jakarta.annotation.Nullable String ss) { + this.ss = ss; + } + + public StrategyUpdateSu 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 StrategyUpdateSu ut(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + return this; + } + + /** + * Get ut + * + * @return ut + */ + @jakarta.annotation.Nullable + public Long getUt() { + return ut; + } + + public void setUt(@jakarta.annotation.Nullable Long ut) { + this.ut = ut; + } + + public StrategyUpdateSu cLowerCase(@jakarta.annotation.Nullable Long cLowerCase) { + this.cLowerCase = cLowerCase; + return this; + } + + /** + * Get cLowerCase + * + * @return cLowerCase + */ + @jakarta.annotation.Nullable + public Long getcLowerCase() { + return cLowerCase; + } + + public void setcLowerCase(@jakarta.annotation.Nullable Long cLowerCase) { + this.cLowerCase = cLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StrategyUpdateSu strategyUpdateSu = (StrategyUpdateSu) o; + return Objects.equals(this.si, strategyUpdateSu.si) + && Objects.equals(this.st, strategyUpdateSu.st) + && Objects.equals(this.ss, strategyUpdateSu.ss) + && Objects.equals(this.sLowerCase, strategyUpdateSu.sLowerCase) + && Objects.equals(this.ut, strategyUpdateSu.ut) + && Objects.equals(this.cLowerCase, strategyUpdateSu.cLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(si, st, ss, sLowerCase, ut, cLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StrategyUpdateSu {\n"); + sb.append(" si: ").append(toIndentedString(si)).append("\n"); + sb.append(" st: ").append(toIndentedString(st)).append("\n"); + sb.append(" ss: ").append(toIndentedString(ss)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" ut: ").append(toIndentedString(ut)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long siValue = getSi(); + if (siValue != null) { + String siValueAsString = siValue.toString(); + valMap.put("si", siValueAsString); + } + String stValue = getSt(); + if (stValue != null) { + String stValueAsString = stValue.toString(); + valMap.put("st", stValueAsString); + } + String ssValue = getSs(); + if (ssValue != null) { + String ssValueAsString = ssValue.toString(); + valMap.put("ss", ssValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + Long utValue = getUt(); + if (utValue != null) { + String utValueAsString = utValue.toString(); + valMap.put("ut", utValueAsString); + } + Long cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + String cLowerCaseValueAsString = cLowerCaseValue.toString(); + valMap.put("cLowerCase", cLowerCaseValueAsString); + } + + 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 siValue = getSi(); + if (siValue != null) { + valMap.put("si", siValue); + } + Object stValue = getSt(); + if (stValue != null) { + valMap.put("st", stValue); + } + Object ssValue = getSs(); + if (ssValue != null) { + valMap.put("ss", ssValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object utValue = getUt(); + if (utValue != null) { + valMap.put("ut", utValue); + } + Object cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + valMap.put("cLowerCase", cLowerCaseValue); + } + + 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("si"); + openapiFields.add("st"); + openapiFields.add("ss"); + openapiFields.add("s"); + openapiFields.add("ut"); + openapiFields.add("c"); + + // 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 StrategyUpdateSu + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StrategyUpdateSu.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in StrategyUpdateSu is not found in the" + + " empty JSON string", + StrategyUpdateSu.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StrategyUpdateSu.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `StrategyUpdateSu` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("st") != null && !jsonObj.get("st").isJsonNull()) + && !jsonObj.get("st").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `st` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("st").toString())); + } + if ((jsonObj.get("ss") != null && !jsonObj.get("ss").isJsonNull()) + && !jsonObj.get("ss").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ss` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ss").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StrategyUpdateSu.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StrategyUpdateSu' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(StrategyUpdateSu.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, StrategyUpdateSu value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StrategyUpdateSu read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of StrategyUpdateSu given an JSON string + * + * @param jsonString JSON string + * @return An instance of StrategyUpdateSu + * @throws IOException if the JSON string is invalid with respect to StrategyUpdateSu + */ + public static StrategyUpdateSu fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StrategyUpdateSu.class); + } + + /** + * Convert an instance of StrategyUpdateSu to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradeLite.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradeLite.java new file mode 100644 index 00000000..7cc2bc20 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradeLite.java @@ -0,0 +1,706 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** TradeLite */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TradeLite 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_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + 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_M_LOWER_CASE = "m"; + + @SerializedName(SERIALIZED_NAME_M_LOWER_CASE) + @jakarta.annotation.Nullable + private Boolean mLowerCase; + + 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_L = "L"; + + @SerializedName(SERIALIZED_NAME_L) + @jakarta.annotation.Nullable + private String L; + + 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_T_LOWER_CASE = "t"; + + @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) + @jakarta.annotation.Nullable + private Long tLowerCase; + + public static final String SERIALIZED_NAME_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private Long iLowerCase; + + public TradeLite() {} + + public TradeLite 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 TradeLite 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 TradeLite 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 TradeLite 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 TradeLite 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 TradeLite 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 TradeLite 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 TradeLite 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 TradeLite 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 TradeLite 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 TradeLite 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 TradeLite 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TradeLite tradeLite = (TradeLite) o; + return Objects.equals(this.E, tradeLite.E) + && Objects.equals(this.T, tradeLite.T) + && Objects.equals(this.sLowerCase, tradeLite.sLowerCase) + && Objects.equals(this.qLowerCase, tradeLite.qLowerCase) + && Objects.equals(this.pLowerCase, tradeLite.pLowerCase) + && Objects.equals(this.mLowerCase, tradeLite.mLowerCase) + && Objects.equals(this.cLowerCase, tradeLite.cLowerCase) + && Objects.equals(this.S, tradeLite.S) + && Objects.equals(this.L, tradeLite.L) + && Objects.equals(this.lLowerCase, tradeLite.lLowerCase) + && Objects.equals(this.tLowerCase, tradeLite.tLowerCase) + && Objects.equals(this.iLowerCase, tradeLite.iLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash( + E, + T, + sLowerCase, + qLowerCase, + pLowerCase, + mLowerCase, + cLowerCase, + S, + L, + lLowerCase, + tLowerCase, + iLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TradeLite {\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(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); + sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); + sb.append(" S: ").append(toIndentedString(S)).append("\n"); + sb.append(" L: ").append(toIndentedString(L)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).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); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + 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); + } + Boolean mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + 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 LValue = getL(); + if (LValue != null) { + String LValueAsString = LValue.toString(); + valMap.put("L", LValueAsString); + } + String lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + Long tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + String tLowerCaseValueAsString = tLowerCaseValue.toString(); + valMap.put("tLowerCase", tLowerCaseValueAsString); + } + Long iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + + 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 sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object qLowerCaseValue = getqLowerCase(); + if (qLowerCaseValue != null) { + valMap.put("qLowerCase", qLowerCaseValue); + } + Object pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + valMap.put("pLowerCase", pLowerCaseValue); + } + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + Object cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + valMap.put("cLowerCase", cLowerCaseValue); + } + Object SValue = getS(); + if (SValue != null) { + valMap.put("S", SValue); + } + Object LValue = getL(); + if (LValue != null) { + valMap.put("L", LValue); + } + Object lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + + 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("s"); + openapiFields.add("q"); + openapiFields.add("p"); + openapiFields.add("m"); + openapiFields.add("c"); + openapiFields.add("S"); + openapiFields.add("L"); + openapiFields.add("l"); + openapiFields.add("t"); + openapiFields.add("i"); + + // 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 TradeLite + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TradeLite.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TradeLite is not found in the empty" + + " JSON string", + TradeLite.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TradeLite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TradeLite` 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("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("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("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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradeLite.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TradeLite' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TradeLite.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TradeLite value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TradeLite read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TradeLite given an JSON string + * + * @param jsonString JSON string + * @return An instance of TradeLite + * @throws IOException if the JSON string is invalid with respect to TradeLite + */ + public static TradeLite fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TradeLite.class); + } + + /** + * Convert an instance of TradeLite to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/UserDataStreamEventsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/UserDataStreamEventsResponse.java new file mode 100644 index 00000000..86716570 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/UserDataStreamEventsResponse.java @@ -0,0 +1,857 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.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 UserDataStreamEventsResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(UserDataStreamEventsResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDataStreamEventsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDataStreamEventsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAccountConfigUpdate = + gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdate.class)); + final TypeAdapter adapterAccountUpdate = + gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + final TypeAdapter adapterConditionalOrderTriggerReject = + gson.getDelegateAdapter( + this, TypeToken.get(ConditionalOrderTriggerReject.class)); + final TypeAdapter adapterGridUpdate = + gson.getDelegateAdapter(this, TypeToken.get(GridUpdate.class)); + final TypeAdapter adapterMarginCall = + gson.getDelegateAdapter(this, TypeToken.get(MarginCall.class)); + final TypeAdapter adapterOrderTradeUpdate = + gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdate.class)); + final TypeAdapter adapterStrategyUpdate = + gson.getDelegateAdapter(this, TypeToken.get(StrategyUpdate.class)); + final TypeAdapter adapterTradeLite = + gson.getDelegateAdapter(this, TypeToken.get(TradeLite.class)); + final TypeAdapter adapterListenkeyexpired = + gson.getDelegateAdapter(this, TypeToken.get(Listenkeyexpired.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDataStreamEventsResponse value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AccountConfigUpdate` + if (value.getActualInstance() instanceof AccountConfigUpdate) { + JsonElement element = + adapterAccountConfigUpdate.toJsonTree( + (AccountConfigUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AccountUpdate` + if (value.getActualInstance() instanceof AccountUpdate) { + JsonElement element = + adapterAccountUpdate.toJsonTree( + (AccountUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ConditionalOrderTriggerReject` + if (value.getActualInstance() + instanceof ConditionalOrderTriggerReject) { + JsonElement element = + adapterConditionalOrderTriggerReject.toJsonTree( + (ConditionalOrderTriggerReject) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `GridUpdate` + if (value.getActualInstance() instanceof GridUpdate) { + JsonElement element = + adapterGridUpdate.toJsonTree( + (GridUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MarginCall` + if (value.getActualInstance() instanceof MarginCall) { + JsonElement element = + adapterMarginCall.toJsonTree( + (MarginCall) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OrderTradeUpdate` + if (value.getActualInstance() instanceof OrderTradeUpdate) { + JsonElement element = + adapterOrderTradeUpdate.toJsonTree( + (OrderTradeUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `StrategyUpdate` + if (value.getActualInstance() instanceof StrategyUpdate) { + JsonElement element = + adapterStrategyUpdate.toJsonTree( + (StrategyUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TradeLite` + if (value.getActualInstance() instanceof TradeLite) { + JsonElement element = + adapterTradeLite.toJsonTree( + (TradeLite) value.getActualInstance()); + 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:" + + " AccountConfigUpdate, AccountUpdate," + + " ConditionalOrderTriggerReject, GridUpdate," + + " Listenkeyexpired, MarginCall, OrderTradeUpdate," + + " StrategyUpdate, TradeLite"); + } + + @Override + public UserDataStreamEventsResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + UserDataStreamEventsResponse newUserDataStreamEventsResponse = + new UserDataStreamEventsResponse(); + if (jsonObject.get("e") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for" + + " UserDataStreamEventsResponse as `e` was not found" + + " in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `e` + switch (jsonObject.get("e").getAsString()) { + case "ACCOUNT_CONFIG_UPDATE": + deserialized = + adapterAccountConfigUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "ACCOUNT_UPDATE": + deserialized = + adapterAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "CONDITIONAL_ORDER_TRIGGER_REJECT": + deserialized = + adapterConditionalOrderTriggerReject.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "GRID_UPDATE": + deserialized = adapterGridUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "MARGIN_CALL": + deserialized = adapterMarginCall.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "ORDER_TRADE_UPDATE": + deserialized = + adapterOrderTradeUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "STRATEGY_UPDATE": + deserialized = + adapterStrategyUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "TRADE_LITE": + deserialized = adapterTradeLite.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "listenKeyExpired": + deserialized = + adapterListenkeyexpired.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "accountConfigUpdate": + deserialized = + adapterAccountConfigUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "accountUpdate": + deserialized = + adapterAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "conditionalOrderTriggerReject": + deserialized = + adapterConditionalOrderTriggerReject.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "gridUpdate": + deserialized = adapterGridUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "listenkeyexpired": + deserialized = + adapterListenkeyexpired.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "marginCall": + deserialized = adapterMarginCall.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "orderTradeUpdate": + deserialized = + adapterOrderTradeUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "strategyUpdate": + deserialized = + adapterStrategyUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "tradeLite": + deserialized = adapterTradeLite.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + default: + newUserDataStreamEventsResponse.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for UserDataStreamEventsResponse." + + " Possible values:" + + " ACCOUNT_CONFIG_UPDATE" + + " ACCOUNT_UPDATE" + + " CONDITIONAL_ORDER_TRIGGER_REJECT" + + " GRID_UPDATE MARGIN_CALL" + + " ORDER_TRADE_UPDATE STRATEGY_UPDATE" + + " TRADE_LITE listenKeyExpired" + + " accountConfigUpdate accountUpdate" + + " conditionalOrderTriggerReject" + + " gridUpdate listenkeyexpired" + + " marginCall orderTradeUpdate" + + " strategyUpdate tradeLite. Falling" + + " back to String.", + jsonObject.get("e").getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AccountConfigUpdate + try { + // validate the JSON object to see if any exception is thrown + AccountConfigUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterAccountConfigUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'AccountConfigUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AccountConfigUpdate failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AccountConfigUpdate'", + e); + } + // deserialize AccountUpdate + try { + // validate the JSON object to see if any exception is thrown + AccountUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterAccountUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'AccountUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AccountUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AccountUpdate'", + e); + } + // deserialize ConditionalOrderTriggerReject + try { + // validate the JSON object to see if any exception is thrown + ConditionalOrderTriggerReject.validateJsonElement(jsonElement); + actualAdapter = adapterConditionalOrderTriggerReject; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ConditionalOrderTriggerReject'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ConditionalOrderTriggerReject" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ConditionalOrderTriggerReject'", + e); + } + // deserialize GridUpdate + try { + // validate the JSON object to see if any exception is thrown + GridUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterGridUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'GridUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for GridUpdate failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'GridUpdate'", + e); + } + // deserialize MarginCall + try { + // validate the JSON object to see if any exception is thrown + MarginCall.validateJsonElement(jsonElement); + actualAdapter = adapterMarginCall; + match++; + log.log(Level.FINER, "Input data matches schema 'MarginCall'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MarginCall failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MarginCall'", + e); + } + // deserialize OrderTradeUpdate + try { + // validate the JSON object to see if any exception is thrown + OrderTradeUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterOrderTradeUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'OrderTradeUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for OrderTradeUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'OrderTradeUpdate'", + e); + } + // deserialize StrategyUpdate + try { + // validate the JSON object to see if any exception is thrown + StrategyUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterStrategyUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'StrategyUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for StrategyUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'StrategyUpdate'", + e); + } + // deserialize TradeLite + try { + // validate the JSON object to see if any exception is thrown + TradeLite.validateJsonElement(jsonElement); + actualAdapter = adapterTradeLite; + match++; + log.log(Level.FINER, "Input data matches schema 'TradeLite'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for TradeLite failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'TradeLite'", + 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 = + new UserDataStreamEventsResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for" + + " UserDataStreamEventsResponse: %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 UserDataStreamEventsResponse() { + super("oneOf", Boolean.FALSE); + } + + public UserDataStreamEventsResponse(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AccountConfigUpdate", AccountConfigUpdate.class); + schemas.put("AccountUpdate", AccountUpdate.class); + schemas.put("ConditionalOrderTriggerReject", ConditionalOrderTriggerReject.class); + schemas.put("GridUpdate", GridUpdate.class); + schemas.put("MarginCall", MarginCall.class); + schemas.put("OrderTradeUpdate", OrderTradeUpdate.class); + schemas.put("StrategyUpdate", StrategyUpdate.class); + schemas.put("TradeLite", TradeLite.class); + schemas.put("Listenkeyexpired", Listenkeyexpired.class); + } + + @Override + public Map> getSchemas() { + return UserDataStreamEventsResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AccountConfigUpdate, AccountUpdate, + * ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired, MarginCall, OrderTradeUpdate, + * StrategyUpdate, TradeLite + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AccountConfigUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AccountUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ConditionalOrderTriggerReject) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GridUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MarginCall) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OrderTradeUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof StrategyUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TradeLite) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Listenkeyexpired) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be AccountConfigUpdate, AccountUpdate," + + " ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired, MarginCall," + + " OrderTradeUpdate, StrategyUpdate, TradeLite"); + } + + /** + * Get the actual instance, which can be the following: AccountConfigUpdate, AccountUpdate, + * ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired, MarginCall, OrderTradeUpdate, + * StrategyUpdate, TradeLite + * + * @return The actual instance (AccountConfigUpdate, AccountUpdate, + * ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired, MarginCall, + * OrderTradeUpdate, StrategyUpdate, TradeLite) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AccountConfigUpdate`. If the actual instance is not + * `AccountConfigUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `AccountConfigUpdate` + * @throws ClassCastException if the instance is not `AccountConfigUpdate` + */ + public AccountConfigUpdate getAccountConfigUpdate() throws ClassCastException { + return (AccountConfigUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `AccountUpdate`. If the actual instance is not `AccountUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AccountUpdate` + * @throws ClassCastException if the instance is not `AccountUpdate` + */ + public AccountUpdate getAccountUpdate() throws ClassCastException { + return (AccountUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `ConditionalOrderTriggerReject`. If the actual instance is not + * `ConditionalOrderTriggerReject`, the ClassCastException will be thrown. + * + * @return The actual instance of `ConditionalOrderTriggerReject` + * @throws ClassCastException if the instance is not `ConditionalOrderTriggerReject` + */ + public ConditionalOrderTriggerReject getConditionalOrderTriggerReject() + throws ClassCastException { + return (ConditionalOrderTriggerReject) super.getActualInstance(); + } + + /** + * Get the actual instance of `GridUpdate`. If the actual instance is not `GridUpdate`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `GridUpdate` + * @throws ClassCastException if the instance is not `GridUpdate` + */ + public GridUpdate getGridUpdate() throws ClassCastException { + return (GridUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `MarginCall`. If the actual instance is not `MarginCall`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `MarginCall` + * @throws ClassCastException if the instance is not `MarginCall` + */ + public MarginCall getMarginCall() throws ClassCastException { + return (MarginCall) super.getActualInstance(); + } + + /** + * Get the actual instance of `OrderTradeUpdate`. If the actual instance is not + * `OrderTradeUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `OrderTradeUpdate` + * @throws ClassCastException if the instance is not `OrderTradeUpdate` + */ + public OrderTradeUpdate getOrderTradeUpdate() throws ClassCastException { + return (OrderTradeUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `StrategyUpdate`. If the actual instance is not `StrategyUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `StrategyUpdate` + * @throws ClassCastException if the instance is not `StrategyUpdate` + */ + public StrategyUpdate getStrategyUpdate() throws ClassCastException { + return (StrategyUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `TradeLite`. If the actual instance is not `TradeLite`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `TradeLite` + * @throws ClassCastException if the instance is not `TradeLite` + */ + public TradeLite getTradeLite() throws ClassCastException { + return (TradeLite) 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 + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UserDataStreamEventsResponse + */ + 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 AccountConfigUpdate + try { + AccountConfigUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AccountConfigUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AccountUpdate + try { + AccountUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AccountUpdate failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ConditionalOrderTriggerReject + try { + ConditionalOrderTriggerReject.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ConditionalOrderTriggerReject failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with GridUpdate + try { + GridUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for GridUpdate failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with MarginCall + try { + MarginCall.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MarginCall failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OrderTradeUpdate + try { + OrderTradeUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for OrderTradeUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with StrategyUpdate + try { + StrategyUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for StrategyUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with TradeLite + try { + TradeLite.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for TradeLite failed with `%s`.", 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: AccountConfigUpdate, AccountUpdate," + + " ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired," + + " MarginCall, OrderTradeUpdate, StrategyUpdate, TradeLite. %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 UserDataStreamEventsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDataStreamEventsResponse + * @throws IOException if the JSON string is invalid with respect to + * UserDataStreamEventsResponse + */ + public static UserDataStreamEventsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDataStreamEventsResponse.class); + } + + /** + * Convert an instance of UserDataStreamEventsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApiTest.java b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApiTest.java index c975bcc4..1a1bbd6b 100644 --- a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApiTest.java +++ b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApiTest.java @@ -29,6 +29,7 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AutoCancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AutoCloseType; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.BatchOrders; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.BatchOrdersPlaceMultipleOrders; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelMultipleOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelOrderResponse; @@ -807,7 +808,7 @@ public void newOrderTest() throws ApiException, CryptoException { public void placeMultipleOrdersTest() throws ApiException, CryptoException { PlaceMultipleOrdersRequest placeMultipleOrdersRequest = new PlaceMultipleOrdersRequest(); - placeMultipleOrdersRequest.batchOrders(new BatchOrders()); + placeMultipleOrdersRequest.batchOrders(new BatchOrdersPlaceMultipleOrders()); ApiResponse response = api.placeMultipleOrders(placeMultipleOrdersRequest); diff --git a/clients/margin-trading/CHANGELOG.md b/clients/margin-trading/CHANGELOG.md index 8b248694..5c9558ec 100644 --- a/clients/margin-trading/CHANGELOG.md +++ b/clients/margin-trading/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 3.0.0 - 2025-07-16 + +### Added (1) + +- Support Risk and Trade Data Streams. + +### Changed (1) + +- Update `binance/common` module to version `1.4.0`. + ## 2.0.0 - 2025-07-08 ### Added (1) diff --git a/clients/margin-trading/docs/Balanceupdate.md b/clients/margin-trading/docs/Balanceupdate.md new file mode 100644 index 00000000..281a9621 --- /dev/null +++ b/clients/margin-trading/docs/Balanceupdate.md @@ -0,0 +1,16 @@ + + +# Balanceupdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**dLowerCase** | **String** | | [optional] | +|**T** | **Long** | | [optional] | + + + diff --git a/clients/margin-trading/docs/Executionreport.md b/clients/margin-trading/docs/Executionreport.md new file mode 100644 index 00000000..48c0b2d4 --- /dev/null +++ b/clients/margin-trading/docs/Executionreport.md @@ -0,0 +1,62 @@ + + +# Executionreport + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**P** | **String** | | [optional] | +|**F** | **String** | | [optional] | +|**gLowerCase** | **Long** | | [optional] | +|**C** | **String** | | [optional] | +|**xLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**zLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**nLowerCase** | **String** | | [optional] | +|**N** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**I** | **Long** | | [optional] | +|**wLowerCase** | **Boolean** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | +|**M** | **Boolean** | | [optional] | +|**O** | **Long** | | [optional] | +|**Z** | **String** | | [optional] | +|**Y** | **String** | | [optional] | +|**Q** | **String** | | [optional] | +|**W** | **Long** | | [optional] | +|**V** | **String** | | [optional] | +|**dLowerCase** | **String** | | [optional] | +|**D** | **String** | | [optional] | +|**jLowerCase** | **String** | | [optional] | +|**J** | **String** | | [optional] | +|**vLowerCase** | **String** | | [optional] | +|**A** | **String** | | [optional] | +|**B** | **String** | | [optional] | +|**uLowerCase** | **String** | | [optional] | +|**U** | **String** | | [optional] | +|**cs** | **String** | | [optional] | +|**pl** | **String** | | [optional] | +|**pL** | **String** | | [optional] | +|**pY** | **String** | | [optional] | +|**bLowerCase** | **String** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**kLowerCase** | **String** | | [optional] | +|**uS** | **Boolean** | | [optional] | + + + diff --git a/clients/margin-trading/docs/Listenkeyexpired.md b/clients/margin-trading/docs/Listenkeyexpired.md new file mode 100644 index 00000000..a4f18a41 --- /dev/null +++ b/clients/margin-trading/docs/Listenkeyexpired.md @@ -0,0 +1,14 @@ + + +# Listenkeyexpired + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **String** | | [optional] | +|**listenKey** | **String** | | [optional] | + + + diff --git a/clients/margin-trading/docs/Liststatus.md b/clients/margin-trading/docs/Liststatus.md new file mode 100644 index 00000000..4f412387 --- /dev/null +++ b/clients/margin-trading/docs/Liststatus.md @@ -0,0 +1,22 @@ + + +# Liststatus + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**gLowerCase** | **Long** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**C** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**O** | [**List<ListstatusOInner>**](ListstatusOInner.md) | | [optional] | + + + diff --git a/clients/margin-trading/docs/ListstatusOInner.md b/clients/margin-trading/docs/ListstatusOInner.md new file mode 100644 index 00000000..b0bd3c1e --- /dev/null +++ b/clients/margin-trading/docs/ListstatusOInner.md @@ -0,0 +1,15 @@ + + +# ListstatusOInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**cLowerCase** | **String** | | [optional] | + + + diff --git a/clients/margin-trading/docs/MarginAccountNewOrderResponse1.md b/clients/margin-trading/docs/MarginAccountNewOrderResponse1.md deleted file mode 100644 index 714d480b..00000000 --- a/clients/margin-trading/docs/MarginAccountNewOrderResponse1.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# MarginAccountNewOrderResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**isIsolated** | **Boolean** | | [optional] | -|**transactTime** | **Long** | | [optional] | - - - diff --git a/clients/margin-trading/docs/MarginAccountNewOrderResponse3FillsInner.md b/clients/margin-trading/docs/MarginAccountNewOrderResponse3FillsInner.md deleted file mode 100644 index 9cd69966..00000000 --- a/clients/margin-trading/docs/MarginAccountNewOrderResponse3FillsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# MarginAccountNewOrderResponse3FillsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**price** | **String** | | [optional] | -|**qty** | **String** | | [optional] | -|**commission** | **String** | | [optional] | -|**commissionAsset** | **String** | | [optional] | -|**tradeId** | **Long** | | [optional] | - - - diff --git a/clients/margin-trading/docs/MarginLevelStatusChange.md b/clients/margin-trading/docs/MarginLevelStatusChange.md new file mode 100644 index 00000000..ae191317 --- /dev/null +++ b/clients/margin-trading/docs/MarginLevelStatusChange.md @@ -0,0 +1,15 @@ + + +# MarginLevelStatusChange + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | + + + diff --git a/clients/margin-trading/docs/Outboundaccountposition.md b/clients/margin-trading/docs/Outboundaccountposition.md new file mode 100644 index 00000000..66c9d064 --- /dev/null +++ b/clients/margin-trading/docs/Outboundaccountposition.md @@ -0,0 +1,15 @@ + + +# Outboundaccountposition + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**B** | [**List<OutboundaccountpositionBInner>**](OutboundaccountpositionBInner.md) | | [optional] | + + + diff --git a/clients/margin-trading/docs/OutboundaccountpositionBInner.md b/clients/margin-trading/docs/OutboundaccountpositionBInner.md new file mode 100644 index 00000000..3b50c015 --- /dev/null +++ b/clients/margin-trading/docs/OutboundaccountpositionBInner.md @@ -0,0 +1,15 @@ + + +# OutboundaccountpositionBInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aLowerCase** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | + + + diff --git a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1.md b/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1.md deleted file mode 100644 index 9094edb8..00000000 --- a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# QueryIsolatedMarginAccountInfoResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**assets** | [**List<QueryIsolatedMarginAccountInfoResponse1AssetsInner>**](QueryIsolatedMarginAccountInfoResponse1AssetsInner.md) | | [optional] | -|**totalAssetOfBtc** | **String** | | [optional] | -|**totalLiabilityOfBtc** | **String** | | [optional] | -|**totalNetAssetOfBtc** | **String** | | [optional] | - - - diff --git a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInner.md b/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInner.md deleted file mode 100644 index a6b965b4..00000000 --- a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInner.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# QueryIsolatedMarginAccountInfoResponse1AssetsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**baseAsset** | [**QueryIsolatedMarginAccountInfoResponse1AssetsInnerBaseAsset**](QueryIsolatedMarginAccountInfoResponse1AssetsInnerBaseAsset.md) | | [optional] | -|**quoteAsset** | [**QueryIsolatedMarginAccountInfoResponse1AssetsInnerQuoteAsset**](QueryIsolatedMarginAccountInfoResponse1AssetsInnerQuoteAsset.md) | | [optional] | -|**symbol** | **String** | | [optional] | -|**isolatedCreated** | **Boolean** | | [optional] | -|**enabled** | **Boolean** | | [optional] | -|**marginLevel** | **String** | | [optional] | -|**marginLevelStatus** | **String** | | [optional] | -|**marginRatio** | **String** | | [optional] | -|**indexPrice** | **String** | | [optional] | -|**liquidatePrice** | **String** | | [optional] | -|**liquidateRate** | **String** | | [optional] | -|**tradeEnabled** | **Boolean** | | [optional] | - - - diff --git a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInnerBaseAsset.md b/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInnerBaseAsset.md deleted file mode 100644 index 509817d9..00000000 --- a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInnerBaseAsset.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# QueryIsolatedMarginAccountInfoResponse1AssetsInnerBaseAsset - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**borrowEnabled** | **Boolean** | | [optional] | -|**borrowed** | **String** | | [optional] | -|**free** | **String** | | [optional] | -|**interest** | **String** | | [optional] | -|**locked** | **String** | | [optional] | -|**netAsset** | **String** | | [optional] | -|**netAssetOfBtc** | **String** | | [optional] | -|**repayEnabled** | **Boolean** | | [optional] | -|**totalAsset** | **String** | | [optional] | - - - diff --git a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInnerQuoteAsset.md b/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInnerQuoteAsset.md deleted file mode 100644 index ef53afc0..00000000 --- a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse1AssetsInnerQuoteAsset.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# QueryIsolatedMarginAccountInfoResponse1AssetsInnerQuoteAsset - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**borrowEnabled** | **Boolean** | | [optional] | -|**borrowed** | **String** | | [optional] | -|**free** | **String** | | [optional] | -|**interest** | **String** | | [optional] | -|**locked** | **String** | | [optional] | -|**netAsset** | **String** | | [optional] | -|**netAssetOfBtc** | **String** | | [optional] | -|**repayEnabled** | **Boolean** | | [optional] | -|**totalAsset** | **String** | | [optional] | - - - diff --git a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse2.md b/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse2.md deleted file mode 100644 index 8650c6f6..00000000 --- a/clients/margin-trading/docs/QueryIsolatedMarginAccountInfoResponse2.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# QueryIsolatedMarginAccountInfoResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**assets** | [**List<QueryIsolatedMarginAccountInfoResponse1AssetsInner>**](QueryIsolatedMarginAccountInfoResponse1AssetsInner.md) | | [optional] | - - - diff --git a/clients/margin-trading/docs/RiskDataStreamEventsResponse.md b/clients/margin-trading/docs/RiskDataStreamEventsResponse.md new file mode 100644 index 00000000..920c6256 --- /dev/null +++ b/clients/margin-trading/docs/RiskDataStreamEventsResponse.md @@ -0,0 +1,19 @@ + + +# RiskDataStreamEventsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**tLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**iLowerCase** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | + + + diff --git a/clients/margin-trading/docs/TradeDataStreamEventsResponse.md b/clients/margin-trading/docs/TradeDataStreamEventsResponse.md new file mode 100644 index 00000000..7406c3a3 --- /dev/null +++ b/clients/margin-trading/docs/TradeDataStreamEventsResponse.md @@ -0,0 +1,63 @@ + + +# TradeDataStreamEventsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**uLowerCase** | **String** | | [optional] | +|**B** | **String** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**dLowerCase** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**listenKey** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**P** | **String** | | [optional] | +|**F** | **String** | | [optional] | +|**gLowerCase** | **Long** | | [optional] | +|**C** | **String** | | [optional] | +|**xLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**zLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**nLowerCase** | **String** | | [optional] | +|**N** | **String** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**I** | **Long** | | [optional] | +|**wLowerCase** | **Boolean** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | +|**M** | **Boolean** | | [optional] | +|**O** | [**List<ListstatusOInner>**](ListstatusOInner.md) | | [optional] | +|**Z** | **String** | | [optional] | +|**Y** | **String** | | [optional] | +|**Q** | **String** | | [optional] | +|**W** | **Long** | | [optional] | +|**V** | **String** | | [optional] | +|**D** | **String** | | [optional] | +|**jLowerCase** | **String** | | [optional] | +|**J** | **String** | | [optional] | +|**vLowerCase** | **String** | | [optional] | +|**A** | **String** | | [optional] | +|**U** | **String** | | [optional] | +|**cs** | **String** | | [optional] | +|**pl** | **String** | | [optional] | +|**pL** | **String** | | [optional] | +|**pY** | **String** | | [optional] | +|**bLowerCase** | **String** | | [optional] | +|**kLowerCase** | **String** | | [optional] | +|**uS** | **Boolean** | | [optional] | + + + diff --git a/clients/margin-trading/docs/UserLiabilityChange.md b/clients/margin-trading/docs/UserLiabilityChange.md new file mode 100644 index 00000000..bb89f6e2 --- /dev/null +++ b/clients/margin-trading/docs/UserLiabilityChange.md @@ -0,0 +1,17 @@ + + +# UserLiabilityChange + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**tLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**iLowerCase** | **String** | | [optional] | + + + diff --git a/clients/margin-trading/example_websocket_stream.md b/clients/margin-trading/example_websocket_stream.md new file mode 100644 index 00000000..e69de29b diff --git a/clients/margin-trading/pom.xml b/clients/margin-trading/pom.xml index 383fd9a0..8320bbd6 100644 --- a/clients/margin-trading/pom.xml +++ b/clients/margin-trading/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-margin-trading margin-trading - 2.0.0 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.3.0 + 1.4.0 \ No newline at end of file diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java index 6fa126b9..673a3c9d 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java @@ -55,7 +55,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/2.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java index 7ad106ac..bc53e8a5 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java @@ -49,7 +49,7 @@ public class BorrowRepayApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/2.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java index b61fb8ce..b5a060ce 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java @@ -51,7 +51,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/2.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java index a1d20a8c..d39a2e11 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java @@ -44,7 +44,7 @@ public class RiskDataStreamApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/2.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java index 7de4c1e3..c66e10c2 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java @@ -74,7 +74,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/2.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java index f00c2e9f..29453d18 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java @@ -47,7 +47,7 @@ public class TradeDataStreamApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/2.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java index 5995fbd2..64f78749 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java @@ -43,7 +43,7 @@ public class TransferApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/2.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/JSON.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/JSON.java new file mode 100644 index 00000000..239bb6c2 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/JSON.java @@ -0,0 +1,566 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream; + +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.websocket.service.DeserializeExclusionStrategy; +import com.binance.connector.client.common.websocket.service.SerializeExclusionStrategy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializer; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import okio.ByteString; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = + new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client.margin_trading.websocket.stream.model + .RiskDataStreamEventsResponse.class, + new TypeSelector< + com.binance.connector.client.margin_trading.websocket.stream + .model.RiskDataStreamEventsResponse>() { + @Override + public Class< + ? extends + com.binance.connector.client + .margin_trading.websocket.stream + .model + .RiskDataStreamEventsResponse> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "MARGIN_LEVEL_STATUS_CHANGE", + com.binance.connector.client.margin_trading + .websocket.stream.model + .MarginLevelStatusChange.class); + classByDiscriminatorValue.put( + "USER_LIABILITY_CHANGE", + com.binance.connector.client.margin_trading + .websocket.stream.model.UserLiabilityChange + .class); + classByDiscriminatorValue.put( + "marginLevelStatusChange", + com.binance.connector.client.margin_trading + .websocket.stream.model + .MarginLevelStatusChange.class); + classByDiscriminatorValue.put( + "userLiabilityChange", + com.binance.connector.client.margin_trading + .websocket.stream.model.UserLiabilityChange + .class); + classByDiscriminatorValue.put( + "RiskDataStreamEventsResponse", + com.binance.connector.client.margin_trading + .websocket.stream.model + .RiskDataStreamEventsResponse.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "e")); + } + }) + .registerTypeSelector( + com.binance.connector.client.margin_trading.websocket.stream.model + .TradeDataStreamEventsResponse.class, + new TypeSelector< + com.binance.connector.client.margin_trading.websocket.stream + .model.TradeDataStreamEventsResponse>() { + @Override + public Class< + ? extends + com.binance.connector.client + .margin_trading.websocket.stream + .model + .TradeDataStreamEventsResponse> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "balanceUpdate", + com.binance.connector.client.margin_trading + .websocket.stream.model.Balanceupdate + .class); + classByDiscriminatorValue.put( + "executionReport", + com.binance.connector.client.margin_trading + .websocket.stream.model.Executionreport + .class); + classByDiscriminatorValue.put( + "listStatus", + com.binance.connector.client.margin_trading + .websocket.stream.model.Liststatus.class); + classByDiscriminatorValue.put( + "listenKeyExpired", + com.binance.connector.client.margin_trading + .websocket.stream.model.Listenkeyexpired + .class); + classByDiscriminatorValue.put( + "outboundAccountPosition", + com.binance.connector.client.margin_trading + .websocket.stream.model + .Outboundaccountposition.class); + classByDiscriminatorValue.put( + "balanceupdate", + com.binance.connector.client.margin_trading + .websocket.stream.model.Balanceupdate + .class); + classByDiscriminatorValue.put( + "executionreport", + com.binance.connector.client.margin_trading + .websocket.stream.model.Executionreport + .class); + classByDiscriminatorValue.put( + "listenkeyexpired", + com.binance.connector.client.margin_trading + .websocket.stream.model.Listenkeyexpired + .class); + classByDiscriminatorValue.put( + "liststatus", + com.binance.connector.client.margin_trading + .websocket.stream.model.Liststatus.class); + classByDiscriminatorValue.put( + "outboundaccountposition", + com.binance.connector.client.margin_trading + .websocket.stream.model + .Outboundaccountposition.class); + classByDiscriminatorValue.put( + "TradeDataStreamEventsResponse", + com.binance.connector.client.margin_trading + .websocket.stream.model + .TradeDataStreamEventsResponse.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "e")); + } + }); + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue( + JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException( + "missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator + * value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator( + Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException( + "cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder + .registerTypeAdapter( + Double.class, + (JsonSerializer) + (src, typeOfSrc, context) -> { + DecimalFormat df = DecimalFormatter.getFormatter(); + return new JsonPrimitive(df.format(src)); + }) + .addSerializationExclusionStrategy(new SerializeExclusionStrategy()) + .addDeserializationExclusionStrategy(new DeserializeExclusionStrategy()); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model.Balanceupdate + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model + .Executionreport.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model + .Listenkeyexpired.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model.Liststatus + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model + .ListstatusOInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model + .MarginLevelStatusChange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model + .Outboundaccountposition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model + .OutboundaccountpositionBInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model + .RiskDataStreamEventsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model + .TradeDataStreamEventsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.websocket.stream.model + .UserLiabilityChange.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see + // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** Gson TypeAdapter for Byte Array type */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** Gson TypeAdapter for JSR310 OffsetDateTime type */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length() - 5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** Gson TypeAdapter for JSR310 LocalDate type */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" + * format will be used (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date( + ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be + * used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/MarginTradingWebSocketStreamsUtil.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/MarginTradingWebSocketStreamsUtil.java new file mode 100644 index 00000000..cd0f9cac --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/MarginTradingWebSocketStreamsUtil.java @@ -0,0 +1,18 @@ +package com.binance.connector.client.margin_trading.websocket.stream; + +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; + +public class MarginTradingWebSocketStreamsUtil { + private static final String BASE_URL = "wss://stream.binance.com:9443"; + private static final boolean HAS_TIME_UNIT = false; + + public static WebSocketClientConfiguration getClientConfiguration() { + WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); + if (!HAS_TIME_UNIT) { + clientConfiguration.setTimeUnit(null); + } + clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setAutoLogon(false); + return clientConfiguration; + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java new file mode 100644 index 00000000..156b52c9 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java @@ -0,0 +1,88 @@ +package com.binance.connector.client.margin_trading.websocket.stream.api; + +import com.binance.connector.client.common.SystemUtil; +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.margin_trading.websocket.stream.JSON; +import com.binance.connector.client.margin_trading.websocket.stream.model.RiskDataStreamEventsResponse; +import com.binance.connector.client.margin_trading.websocket.stream.model.TradeDataStreamEventsResponse; +import com.google.gson.reflect.TypeToken; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +public class MarginTradingWebSocketStreams { + private static final String USER_AGENT = + String.format( + "binance-margin-trading/3.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + + private final StreamConnectionInterface connection; + + public MarginTradingWebSocketStreams(WebSocketClientConfiguration configuration) { + this( + configuration.getUsePool() + ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) + : new StreamConnectionWrapper(configuration, JSON.getGson())); + } + + public MarginTradingWebSocketStreams(StreamConnectionInterface connection) { + connection.setUserAgent(USER_AGENT); + if (!connection.isConnected()) { + connection.connect(); + } + this.connection = connection; + } + + /** + * Subscribes to the risk data WebSocket stream using the provided listen key. + * + * @param listenKey - The listen key for the risk data WebSocket stream. + * @return A WebSocket stream handler for the risk data stream. + */ + public StreamBlockingQueueWrapper riskData(String listenKey) { + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(listenKey)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + + TypeToken typeToken = new TypeToken<>() {}; + StreamBlockingQueue queue = queuesMap.get(listenKey); + return new StreamBlockingQueueWrapper<>(queue, typeToken, JSON.getGson()); + } + + /** + * Subscribes to the trade data WebSocket stream using the provided listen key. + * + * @param listenKey - The listen key for the trade data WebSocket stream. + * @return A WebSocket stream handler for the trade data stream. + */ + public StreamBlockingQueueWrapper tradeData(String listenKey) { + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(listenKey)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + + TypeToken typeToken = new TypeToken<>() {}; + StreamBlockingQueue queue = queuesMap.get(listenKey); + return new StreamBlockingQueueWrapper<>(queue, typeToken, JSON.getGson()); + } + + public String getRequestID() { + return UUID.randomUUID().toString(); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/AbstractOpenApiSchema.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000..86215f07 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/AbstractOpenApiSchema.java @@ -0,0 +1,145 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import java.util.Map; +import java.util.Objects; + +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + // @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Balanceupdate.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Balanceupdate.java new file mode 100644 index 00000000..365f0e76 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Balanceupdate.java @@ -0,0 +1,358 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.margin_trading.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.*; + +/** Balanceupdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Balanceupdate 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_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 = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public Balanceupdate() {} + + public Balanceupdate 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 Balanceupdate 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 Balanceupdate 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 Balanceupdate 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Balanceupdate balanceupdate = (Balanceupdate) o; + return Objects.equals(this.E, balanceupdate.E) + && Objects.equals(this.aLowerCase, balanceupdate.aLowerCase) + && Objects.equals(this.dLowerCase, balanceupdate.dLowerCase) + && Objects.equals(this.T, balanceupdate.T); + } + + @Override + public int hashCode() { + return Objects.hash(E, aLowerCase, dLowerCase, T); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Balanceupdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).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); + } + 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); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + + 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 aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + valMap.put("dLowerCase", dLowerCaseValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + + 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("a"); + openapiFields.add("d"); + openapiFields.add("T"); + + // 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 Balanceupdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Balanceupdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Balanceupdate is not found in the" + + " empty JSON string", + Balanceupdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Balanceupdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Balanceupdate` 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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Balanceupdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Balanceupdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Balanceupdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Balanceupdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Balanceupdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Balanceupdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of Balanceupdate + * @throws IOException if the JSON string is invalid with respect to Balanceupdate + */ + public static Balanceupdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Balanceupdate.class); + } + + /** + * Convert an instance of Balanceupdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Executionreport.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Executionreport.java new file mode 100644 index 00000000..9d446ef3 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Executionreport.java @@ -0,0 +1,2399 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.margin_trading.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.*; + +/** Executionreport */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Executionreport 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_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_P = "P"; + + @SerializedName(SERIALIZED_NAME_P) + @jakarta.annotation.Nullable + private String P; + + public static final String SERIALIZED_NAME_F = "F"; + + @SerializedName(SERIALIZED_NAME_F) + @jakarta.annotation.Nullable + private String F; + + public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; + + @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) + @jakarta.annotation.Nullable + private Long gLowerCase; + + public static final String SERIALIZED_NAME_C = "C"; + + @SerializedName(SERIALIZED_NAME_C) + @jakarta.annotation.Nullable + private String C; + + 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_R_LOWER_CASE = "r"; + + @SerializedName(SERIALIZED_NAME_R_LOWER_CASE) + @jakarta.annotation.Nullable + private String rLowerCase; + + 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_LOWER_CASE = "n"; + + @SerializedName(SERIALIZED_NAME_N_LOWER_CASE) + @jakarta.annotation.Nullable + private String nLowerCase; + + public static final String SERIALIZED_NAME_N = "N"; + + @SerializedName(SERIALIZED_NAME_N) + @jakarta.annotation.Nullable + private String N; + + 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_I = "I"; + + @SerializedName(SERIALIZED_NAME_I) + @jakarta.annotation.Nullable + private Long I; + + public static final String SERIALIZED_NAME_W_LOWER_CASE = "w"; + + @SerializedName(SERIALIZED_NAME_W_LOWER_CASE) + @jakarta.annotation.Nullable + private Boolean wLowerCase; + + 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_M = "M"; + + @SerializedName(SERIALIZED_NAME_M) + @jakarta.annotation.Nullable + private Boolean M; + + public static final String SERIALIZED_NAME_O = "O"; + + @SerializedName(SERIALIZED_NAME_O) + @jakarta.annotation.Nullable + private Long O; + + public static final String SERIALIZED_NAME_Z = "Z"; + + @SerializedName(SERIALIZED_NAME_Z) + @jakarta.annotation.Nullable + private String Z; + + public static final String SERIALIZED_NAME_Y = "Y"; + + @SerializedName(SERIALIZED_NAME_Y) + @jakarta.annotation.Nullable + private String Y; + + public static final String SERIALIZED_NAME_Q = "Q"; + + @SerializedName(SERIALIZED_NAME_Q) + @jakarta.annotation.Nullable + private String Q; + + public static final String SERIALIZED_NAME_W = "W"; + + @SerializedName(SERIALIZED_NAME_W) + @jakarta.annotation.Nullable + private Long W; + + public static final String SERIALIZED_NAME_V = "V"; + + @SerializedName(SERIALIZED_NAME_V) + @jakarta.annotation.Nullable + private String V; + + 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_D = "D"; + + @SerializedName(SERIALIZED_NAME_D) + @jakarta.annotation.Nullable + private String D; + + public static final String SERIALIZED_NAME_J_LOWER_CASE = "j"; + + @SerializedName(SERIALIZED_NAME_J_LOWER_CASE) + @jakarta.annotation.Nullable + private String jLowerCase; + + public static final String SERIALIZED_NAME_J = "J"; + + @SerializedName(SERIALIZED_NAME_J) + @jakarta.annotation.Nullable + private String J; + + 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_A = "A"; + + @SerializedName(SERIALIZED_NAME_A) + @jakarta.annotation.Nullable + private String A; + + public static final String SERIALIZED_NAME_B = "B"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private String B; + + 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_U = "U"; + + @SerializedName(SERIALIZED_NAME_U) + @jakarta.annotation.Nullable + private String U; + + public static final String SERIALIZED_NAME_CS = "Cs"; + + @SerializedName(SERIALIZED_NAME_CS) + @jakarta.annotation.Nullable + private String cs; + + public static final String SERIALIZED_NAME_PL = "pl"; + + @SerializedName(SERIALIZED_NAME_PL) + @jakarta.annotation.Nullable + private String pl; + + public static final String SERIALIZED_NAME_P_L = "pL"; + + @SerializedName(SERIALIZED_NAME_P_L) + @jakarta.annotation.Nullable + private String pL; + + public static final String SERIALIZED_NAME_P_Y = "pY"; + + @SerializedName(SERIALIZED_NAME_P_Y) + @jakarta.annotation.Nullable + private String pY; + + 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_K_LOWER_CASE = "k"; + + @SerializedName(SERIALIZED_NAME_K_LOWER_CASE) + @jakarta.annotation.Nullable + private String kLowerCase; + + public static final String SERIALIZED_NAME_U_S = "uS"; + + @SerializedName(SERIALIZED_NAME_U_S) + @jakarta.annotation.Nullable + private Boolean uS; + + public Executionreport() {} + + public Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport gLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + return this; + } + + /** + * Get gLowerCase + * + * @return gLowerCase + */ + @jakarta.annotation.Nullable + public Long getgLowerCase() { + return gLowerCase; + } + + public void setgLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + } + + public Executionreport C(@jakarta.annotation.Nullable String C) { + this.C = C; + return this; + } + + /** + * Get C + * + * @return C + */ + @jakarta.annotation.Nullable + public String getC() { + return C; + } + + public void setC(@jakarta.annotation.Nullable String C) { + this.C = C; + } + + public Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport 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 Executionreport I(@jakarta.annotation.Nullable Long I) { + this.I = I; + return this; + } + + /** + * Get I + * + * @return I + */ + @jakarta.annotation.Nullable + public Long getI() { + return I; + } + + public void setI(@jakarta.annotation.Nullable Long I) { + this.I = I; + } + + public Executionreport wLowerCase(@jakarta.annotation.Nullable Boolean wLowerCase) { + this.wLowerCase = wLowerCase; + return this; + } + + /** + * Get wLowerCase + * + * @return wLowerCase + */ + @jakarta.annotation.Nullable + public Boolean getwLowerCase() { + return wLowerCase; + } + + public void setwLowerCase(@jakarta.annotation.Nullable Boolean wLowerCase) { + this.wLowerCase = wLowerCase; + } + + public Executionreport 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 Executionreport M(@jakarta.annotation.Nullable Boolean M) { + this.M = M; + return this; + } + + /** + * Get M + * + * @return M + */ + @jakarta.annotation.Nullable + public Boolean getM() { + return M; + } + + public void setM(@jakarta.annotation.Nullable Boolean M) { + this.M = M; + } + + public Executionreport O(@jakarta.annotation.Nullable Long O) { + this.O = O; + return this; + } + + /** + * Get O + * + * @return O + */ + @jakarta.annotation.Nullable + public Long getO() { + return O; + } + + public void setO(@jakarta.annotation.Nullable Long O) { + this.O = O; + } + + public Executionreport Z(@jakarta.annotation.Nullable String Z) { + this.Z = Z; + return this; + } + + /** + * Get Z + * + * @return Z + */ + @jakarta.annotation.Nullable + public String getZ() { + return Z; + } + + public void setZ(@jakarta.annotation.Nullable String Z) { + this.Z = Z; + } + + public Executionreport Y(@jakarta.annotation.Nullable String Y) { + this.Y = Y; + return this; + } + + /** + * Get Y + * + * @return Y + */ + @jakarta.annotation.Nullable + public String getY() { + return Y; + } + + public void setY(@jakarta.annotation.Nullable String Y) { + this.Y = Y; + } + + public Executionreport 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 Executionreport W(@jakarta.annotation.Nullable Long W) { + this.W = W; + return this; + } + + /** + * Get W + * + * @return W + */ + @jakarta.annotation.Nullable + public Long getW() { + return W; + } + + public void setW(@jakarta.annotation.Nullable Long W) { + this.W = W; + } + + public Executionreport 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 Executionreport 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 Executionreport D(@jakarta.annotation.Nullable String D) { + this.D = D; + return this; + } + + /** + * Get D + * + * @return D + */ + @jakarta.annotation.Nullable + public String getD() { + return D; + } + + public void setD(@jakarta.annotation.Nullable String D) { + this.D = D; + } + + public Executionreport jLowerCase(@jakarta.annotation.Nullable String jLowerCase) { + this.jLowerCase = jLowerCase; + return this; + } + + /** + * Get jLowerCase + * + * @return jLowerCase + */ + @jakarta.annotation.Nullable + public String getjLowerCase() { + return jLowerCase; + } + + public void setjLowerCase(@jakarta.annotation.Nullable String jLowerCase) { + this.jLowerCase = jLowerCase; + } + + public Executionreport J(@jakarta.annotation.Nullable String J) { + this.J = J; + return this; + } + + /** + * Get J + * + * @return J + */ + @jakarta.annotation.Nullable + public String getJ() { + return J; + } + + public void setJ(@jakarta.annotation.Nullable String J) { + this.J = J; + } + + public Executionreport 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 Executionreport 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 Executionreport B(@jakarta.annotation.Nullable String B) { + this.B = B; + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + public String getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable String B) { + this.B = B; + } + + public Executionreport uLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; + return this; + } + + /** + * Get uLowerCase + * + * @return uLowerCase + */ + @jakarta.annotation.Nullable + public String getuLowerCase() { + return uLowerCase; + } + + public void setuLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; + } + + public Executionreport U(@jakarta.annotation.Nullable String U) { + this.U = U; + return this; + } + + /** + * Get U + * + * @return U + */ + @jakarta.annotation.Nullable + public String getU() { + return U; + } + + public void setU(@jakarta.annotation.Nullable String U) { + this.U = U; + } + + public Executionreport cs(@jakarta.annotation.Nullable String cs) { + this.cs = cs; + return this; + } + + /** + * Get cs + * + * @return cs + */ + @jakarta.annotation.Nullable + public String getCs() { + return cs; + } + + public void setCs(@jakarta.annotation.Nullable String cs) { + this.cs = cs; + } + + public Executionreport pl(@jakarta.annotation.Nullable String pl) { + this.pl = pl; + return this; + } + + /** + * Get pl + * + * @return pl + */ + @jakarta.annotation.Nullable + public String getPl() { + return pl; + } + + public void setPl(@jakarta.annotation.Nullable String pl) { + this.pl = pl; + } + + public Executionreport pL(@jakarta.annotation.Nullable String pL) { + this.pL = pL; + return this; + } + + /** + * Get pL + * + * @return pL + */ + @jakarta.annotation.Nullable + public String getpL() { + return pL; + } + + public void setpL(@jakarta.annotation.Nullable String pL) { + this.pL = pL; + } + + public Executionreport pY(@jakarta.annotation.Nullable String pY) { + this.pY = pY; + return this; + } + + /** + * Get pY + * + * @return pY + */ + @jakarta.annotation.Nullable + public String getpY() { + return pY; + } + + public void setpY(@jakarta.annotation.Nullable String pY) { + this.pY = pY; + } + + public Executionreport 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 Executionreport 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 Executionreport kLowerCase(@jakarta.annotation.Nullable String kLowerCase) { + this.kLowerCase = kLowerCase; + return this; + } + + /** + * Get kLowerCase + * + * @return kLowerCase + */ + @jakarta.annotation.Nullable + public String getkLowerCase() { + return kLowerCase; + } + + public void setkLowerCase(@jakarta.annotation.Nullable String kLowerCase) { + this.kLowerCase = kLowerCase; + } + + public Executionreport uS(@jakarta.annotation.Nullable Boolean uS) { + this.uS = uS; + return this; + } + + /** + * Get uS + * + * @return uS + */ + @jakarta.annotation.Nullable + public Boolean getuS() { + return uS; + } + + public void setuS(@jakarta.annotation.Nullable Boolean uS) { + this.uS = uS; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Executionreport executionreport = (Executionreport) o; + return Objects.equals(this.E, executionreport.E) + && Objects.equals(this.sLowerCase, executionreport.sLowerCase) + && Objects.equals(this.cLowerCase, executionreport.cLowerCase) + && Objects.equals(this.S, executionreport.S) + && Objects.equals(this.oLowerCase, executionreport.oLowerCase) + && Objects.equals(this.fLowerCase, executionreport.fLowerCase) + && Objects.equals(this.qLowerCase, executionreport.qLowerCase) + && Objects.equals(this.pLowerCase, executionreport.pLowerCase) + && Objects.equals(this.P, executionreport.P) + && Objects.equals(this.F, executionreport.F) + && Objects.equals(this.gLowerCase, executionreport.gLowerCase) + && Objects.equals(this.C, executionreport.C) + && Objects.equals(this.xLowerCase, executionreport.xLowerCase) + && Objects.equals(this.X, executionreport.X) + && Objects.equals(this.rLowerCase, executionreport.rLowerCase) + && Objects.equals(this.iLowerCase, executionreport.iLowerCase) + && Objects.equals(this.lLowerCase, executionreport.lLowerCase) + && Objects.equals(this.zLowerCase, executionreport.zLowerCase) + && Objects.equals(this.L, executionreport.L) + && Objects.equals(this.nLowerCase, executionreport.nLowerCase) + && Objects.equals(this.N, executionreport.N) + && Objects.equals(this.T, executionreport.T) + && Objects.equals(this.tLowerCase, executionreport.tLowerCase) + && Objects.equals(this.I, executionreport.I) + && Objects.equals(this.wLowerCase, executionreport.wLowerCase) + && Objects.equals(this.mLowerCase, executionreport.mLowerCase) + && Objects.equals(this.M, executionreport.M) + && Objects.equals(this.O, executionreport.O) + && Objects.equals(this.Z, executionreport.Z) + && Objects.equals(this.Y, executionreport.Y) + && Objects.equals(this.Q, executionreport.Q) + && Objects.equals(this.W, executionreport.W) + && Objects.equals(this.V, executionreport.V) + && Objects.equals(this.dLowerCase, executionreport.dLowerCase) + && Objects.equals(this.D, executionreport.D) + && Objects.equals(this.jLowerCase, executionreport.jLowerCase) + && Objects.equals(this.J, executionreport.J) + && Objects.equals(this.vLowerCase, executionreport.vLowerCase) + && Objects.equals(this.A, executionreport.A) + && Objects.equals(this.B, executionreport.B) + && Objects.equals(this.uLowerCase, executionreport.uLowerCase) + && Objects.equals(this.U, executionreport.U) + && Objects.equals(this.cs, executionreport.cs) + && Objects.equals(this.pl, executionreport.pl) + && Objects.equals(this.pL, executionreport.pL) + && Objects.equals(this.pY, executionreport.pY) + && Objects.equals(this.bLowerCase, executionreport.bLowerCase) + && Objects.equals(this.aLowerCase, executionreport.aLowerCase) + && Objects.equals(this.kLowerCase, executionreport.kLowerCase) + && Objects.equals(this.uS, executionreport.uS); + } + + @Override + public int hashCode() { + return Objects.hash( + E, + sLowerCase, + cLowerCase, + S, + oLowerCase, + fLowerCase, + qLowerCase, + pLowerCase, + P, + F, + gLowerCase, + C, + xLowerCase, + X, + rLowerCase, + iLowerCase, + lLowerCase, + zLowerCase, + L, + nLowerCase, + N, + T, + tLowerCase, + I, + wLowerCase, + mLowerCase, + M, + O, + Z, + Y, + Q, + W, + V, + dLowerCase, + D, + jLowerCase, + J, + vLowerCase, + A, + B, + uLowerCase, + U, + cs, + pl, + pL, + pY, + bLowerCase, + aLowerCase, + kLowerCase, + uS); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Executionreport {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\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(" P: ").append(toIndentedString(P)).append("\n"); + sb.append(" F: ").append(toIndentedString(F)).append("\n"); + sb.append(" gLowerCase: ").append(toIndentedString(gLowerCase)).append("\n"); + sb.append(" C: ").append(toIndentedString(C)).append("\n"); + sb.append(" xLowerCase: ").append(toIndentedString(xLowerCase)).append("\n"); + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).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(" nLowerCase: ").append(toIndentedString(nLowerCase)).append("\n"); + sb.append(" N: ").append(toIndentedString(N)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); + sb.append(" I: ").append(toIndentedString(I)).append("\n"); + sb.append(" wLowerCase: ").append(toIndentedString(wLowerCase)).append("\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); + sb.append(" M: ").append(toIndentedString(M)).append("\n"); + sb.append(" O: ").append(toIndentedString(O)).append("\n"); + sb.append(" Z: ").append(toIndentedString(Z)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append(" Q: ").append(toIndentedString(Q)).append("\n"); + sb.append(" W: ").append(toIndentedString(W)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); + sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); + sb.append(" D: ").append(toIndentedString(D)).append("\n"); + sb.append(" jLowerCase: ").append(toIndentedString(jLowerCase)).append("\n"); + sb.append(" J: ").append(toIndentedString(J)).append("\n"); + sb.append(" vLowerCase: ").append(toIndentedString(vLowerCase)).append("\n"); + sb.append(" A: ").append(toIndentedString(A)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" U: ").append(toIndentedString(U)).append("\n"); + sb.append(" cs: ").append(toIndentedString(cs)).append("\n"); + sb.append(" pl: ").append(toIndentedString(pl)).append("\n"); + sb.append(" pL: ").append(toIndentedString(pL)).append("\n"); + sb.append(" pY: ").append(toIndentedString(pY)).append("\n"); + sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" kLowerCase: ").append(toIndentedString(kLowerCase)).append("\n"); + sb.append(" uS: ").append(toIndentedString(uS)).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); + } + 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 PValue = getP(); + if (PValue != null) { + String PValueAsString = PValue.toString(); + valMap.put("P", PValueAsString); + } + String FValue = getF(); + if (FValue != null) { + String FValueAsString = FValue.toString(); + valMap.put("F", FValueAsString); + } + Long gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + String gLowerCaseValueAsString = gLowerCaseValue.toString(); + valMap.put("gLowerCase", gLowerCaseValueAsString); + } + String CValue = getC(); + if (CValue != null) { + String CValueAsString = CValue.toString(); + valMap.put("C", CValueAsString); + } + 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); + } + String rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + String rLowerCaseValueAsString = rLowerCaseValue.toString(); + valMap.put("rLowerCase", rLowerCaseValueAsString); + } + 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 nLowerCaseValue = getnLowerCase(); + if (nLowerCaseValue != null) { + String nLowerCaseValueAsString = nLowerCaseValue.toString(); + valMap.put("nLowerCase", nLowerCaseValueAsString); + } + String NValue = getN(); + if (NValue != null) { + String NValueAsString = NValue.toString(); + valMap.put("N", NValueAsString); + } + 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); + } + Long IValue = getI(); + if (IValue != null) { + String IValueAsString = IValue.toString(); + valMap.put("I", IValueAsString); + } + Boolean wLowerCaseValue = getwLowerCase(); + if (wLowerCaseValue != null) { + String wLowerCaseValueAsString = wLowerCaseValue.toString(); + valMap.put("wLowerCase", wLowerCaseValueAsString); + } + Boolean mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + Boolean MValue = getM(); + if (MValue != null) { + String MValueAsString = MValue.toString(); + valMap.put("M", MValueAsString); + } + Long OValue = getO(); + if (OValue != null) { + String OValueAsString = OValue.toString(); + valMap.put("O", OValueAsString); + } + String ZValue = getZ(); + if (ZValue != null) { + String ZValueAsString = ZValue.toString(); + valMap.put("Z", ZValueAsString); + } + String YValue = getY(); + if (YValue != null) { + String YValueAsString = YValue.toString(); + valMap.put("Y", YValueAsString); + } + String QValue = getQ(); + if (QValue != null) { + String QValueAsString = QValue.toString(); + valMap.put("Q", QValueAsString); + } + Long WValue = getW(); + if (WValue != null) { + String WValueAsString = WValue.toString(); + valMap.put("W", WValueAsString); + } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } + String dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + String dLowerCaseValueAsString = dLowerCaseValue.toString(); + valMap.put("dLowerCase", dLowerCaseValueAsString); + } + String DValue = getD(); + if (DValue != null) { + String DValueAsString = DValue.toString(); + valMap.put("D", DValueAsString); + } + String jLowerCaseValue = getjLowerCase(); + if (jLowerCaseValue != null) { + String jLowerCaseValueAsString = jLowerCaseValue.toString(); + valMap.put("jLowerCase", jLowerCaseValueAsString); + } + String JValue = getJ(); + if (JValue != null) { + String JValueAsString = JValue.toString(); + valMap.put("J", JValueAsString); + } + String vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + String vLowerCaseValueAsString = vLowerCaseValue.toString(); + valMap.put("vLowerCase", vLowerCaseValueAsString); + } + String AValue = getA(); + if (AValue != null) { + String AValueAsString = AValue.toString(); + valMap.put("A", AValueAsString); + } + String BValue = getB(); + if (BValue != null) { + String BValueAsString = BValue.toString(); + valMap.put("B", BValueAsString); + } + String uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + String uLowerCaseValueAsString = uLowerCaseValue.toString(); + valMap.put("uLowerCase", uLowerCaseValueAsString); + } + String UValue = getU(); + if (UValue != null) { + String UValueAsString = UValue.toString(); + valMap.put("U", UValueAsString); + } + String csValue = getCs(); + if (csValue != null) { + String csValueAsString = csValue.toString(); + valMap.put("cs", csValueAsString); + } + String plValue = getPl(); + if (plValue != null) { + String plValueAsString = plValue.toString(); + valMap.put("pl", plValueAsString); + } + String pLValue = getpL(); + if (pLValue != null) { + String pLValueAsString = pLValue.toString(); + valMap.put("pL", pLValueAsString); + } + String pYValue = getpY(); + if (pYValue != null) { + String pYValueAsString = pYValue.toString(); + valMap.put("pY", pYValueAsString); + } + 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 kLowerCaseValue = getkLowerCase(); + if (kLowerCaseValue != null) { + String kLowerCaseValueAsString = kLowerCaseValue.toString(); + valMap.put("kLowerCase", kLowerCaseValueAsString); + } + Boolean uSValue = getuS(); + if (uSValue != null) { + String uSValueAsString = uSValue.toString(); + valMap.put("uS", uSValueAsString); + } + + 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 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 PValue = getP(); + if (PValue != null) { + valMap.put("P", PValue); + } + Object FValue = getF(); + if (FValue != null) { + valMap.put("F", FValue); + } + Object gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + valMap.put("gLowerCase", gLowerCaseValue); + } + Object CValue = getC(); + if (CValue != null) { + valMap.put("C", CValue); + } + Object xLowerCaseValue = getxLowerCase(); + if (xLowerCaseValue != null) { + valMap.put("xLowerCase", xLowerCaseValue); + } + Object XValue = getX(); + if (XValue != null) { + valMap.put("X", XValue); + } + Object rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + valMap.put("rLowerCase", rLowerCaseValue); + } + 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 nLowerCaseValue = getnLowerCase(); + if (nLowerCaseValue != null) { + valMap.put("nLowerCase", nLowerCaseValue); + } + Object NValue = getN(); + if (NValue != null) { + valMap.put("N", NValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } + Object IValue = getI(); + if (IValue != null) { + valMap.put("I", IValue); + } + Object wLowerCaseValue = getwLowerCase(); + if (wLowerCaseValue != null) { + valMap.put("wLowerCase", wLowerCaseValue); + } + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + Object MValue = getM(); + if (MValue != null) { + valMap.put("M", MValue); + } + Object OValue = getO(); + if (OValue != null) { + valMap.put("O", OValue); + } + Object ZValue = getZ(); + if (ZValue != null) { + valMap.put("Z", ZValue); + } + Object YValue = getY(); + if (YValue != null) { + valMap.put("Y", YValue); + } + Object QValue = getQ(); + if (QValue != null) { + valMap.put("Q", QValue); + } + Object WValue = getW(); + if (WValue != null) { + valMap.put("W", WValue); + } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } + Object dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + valMap.put("dLowerCase", dLowerCaseValue); + } + Object DValue = getD(); + if (DValue != null) { + valMap.put("D", DValue); + } + Object jLowerCaseValue = getjLowerCase(); + if (jLowerCaseValue != null) { + valMap.put("jLowerCase", jLowerCaseValue); + } + Object JValue = getJ(); + if (JValue != null) { + valMap.put("J", JValue); + } + Object vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + valMap.put("vLowerCase", vLowerCaseValue); + } + Object AValue = getA(); + if (AValue != null) { + valMap.put("A", AValue); + } + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); + } + Object uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object UValue = getU(); + if (UValue != null) { + valMap.put("U", UValue); + } + Object csValue = getCs(); + if (csValue != null) { + valMap.put("cs", csValue); + } + Object plValue = getPl(); + if (plValue != null) { + valMap.put("pl", plValue); + } + Object pLValue = getpL(); + if (pLValue != null) { + valMap.put("pL", pLValue); + } + Object pYValue = getpY(); + if (pYValue != null) { + valMap.put("pY", pYValue); + } + Object bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + valMap.put("bLowerCase", bLowerCaseValue); + } + Object aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object kLowerCaseValue = getkLowerCase(); + if (kLowerCaseValue != null) { + valMap.put("kLowerCase", kLowerCaseValue); + } + Object uSValue = getuS(); + if (uSValue != null) { + valMap.put("uS", uSValue); + } + + 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("s"); + openapiFields.add("c"); + openapiFields.add("S"); + openapiFields.add("o"); + openapiFields.add("f"); + openapiFields.add("q"); + openapiFields.add("p"); + openapiFields.add("P"); + openapiFields.add("F"); + openapiFields.add("g"); + openapiFields.add("C"); + openapiFields.add("x"); + openapiFields.add("X"); + openapiFields.add("r"); + 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("I"); + openapiFields.add("w"); + openapiFields.add("m"); + openapiFields.add("M"); + openapiFields.add("O"); + openapiFields.add("Z"); + openapiFields.add("Y"); + openapiFields.add("Q"); + openapiFields.add("W"); + openapiFields.add("V"); + openapiFields.add("d"); + openapiFields.add("D"); + openapiFields.add("j"); + openapiFields.add("J"); + openapiFields.add("v"); + openapiFields.add("A"); + openapiFields.add("B"); + openapiFields.add("u"); + openapiFields.add("U"); + openapiFields.add("Cs"); + openapiFields.add("pl"); + openapiFields.add("pL"); + openapiFields.add("pY"); + openapiFields.add("b"); + openapiFields.add("a"); + openapiFields.add("k"); + openapiFields.add("uS"); + + // 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 Executionreport + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Executionreport.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Executionreport is not found in the" + + " empty JSON string", + Executionreport.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Executionreport.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Executionreport` 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("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("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("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("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("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("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("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("Y") != null && !jsonObj.get("Y").isJsonNull()) + && !jsonObj.get("Y").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `Y` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("Y").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("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("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("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("j") != null && !jsonObj.get("j").isJsonNull()) + && !jsonObj.get("j").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `j` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("j").toString())); + } + if ((jsonObj.get("J") != null && !jsonObj.get("J").isJsonNull()) + && !jsonObj.get("J").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `J` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("J").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("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("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("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("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())); + } + if ((jsonObj.get("pl") != null && !jsonObj.get("pl").isJsonNull()) + && !jsonObj.get("pl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pl` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pl").toString())); + } + if ((jsonObj.get("pL") != null && !jsonObj.get("pL").isJsonNull()) + && !jsonObj.get("pL").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pL` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pL").toString())); + } + if ((jsonObj.get("pY") != null && !jsonObj.get("pY").isJsonNull()) + && !jsonObj.get("pY").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pY` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pY").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("k") != null && !jsonObj.get("k").isJsonNull()) + && !jsonObj.get("k").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `k` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("k").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Executionreport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Executionreport' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Executionreport.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Executionreport value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Executionreport read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Executionreport given an JSON string + * + * @param jsonString JSON string + * @return An instance of Executionreport + * @throws IOException if the JSON string is invalid with respect to Executionreport + */ + public static Executionreport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Executionreport.class); + } + + /** + * Convert an instance of Executionreport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Listenkeyexpired.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Listenkeyexpired.java new file mode 100644 index 00000000..5995e3a7 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Listenkeyexpired.java @@ -0,0 +1,285 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.margin_trading.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/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Liststatus.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Liststatus.java new file mode 100644 index 00000000..948bc7dd --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Liststatus.java @@ -0,0 +1,645 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.margin_trading.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.*; + +/** Liststatus */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Liststatus 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_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; + + @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) + @jakarta.annotation.Nullable + private Long gLowerCase; + + 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_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private String lLowerCase; + + public static final String SERIALIZED_NAME_L = "L"; + + @SerializedName(SERIALIZED_NAME_L) + @jakarta.annotation.Nullable + private String L; + + 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_C = "C"; + + @SerializedName(SERIALIZED_NAME_C) + @jakarta.annotation.Nullable + private String C; + + 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 = "O"; + + @SerializedName(SERIALIZED_NAME_O) + @jakarta.annotation.Nullable + private List<@Valid ListstatusOInner> O; + + public Liststatus() {} + + public Liststatus 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 Liststatus 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 Liststatus gLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + return this; + } + + /** + * Get gLowerCase + * + * @return gLowerCase + */ + @jakarta.annotation.Nullable + public Long getgLowerCase() { + return gLowerCase; + } + + public void setgLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + } + + public Liststatus 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 Liststatus 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 Liststatus 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 Liststatus 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 Liststatus C(@jakarta.annotation.Nullable String C) { + this.C = C; + return this; + } + + /** + * Get C + * + * @return C + */ + @jakarta.annotation.Nullable + public String getC() { + return C; + } + + public void setC(@jakarta.annotation.Nullable String C) { + this.C = C; + } + + public Liststatus 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 Liststatus O(@jakarta.annotation.Nullable List<@Valid ListstatusOInner> O) { + this.O = O; + return this; + } + + public Liststatus addOItem(ListstatusOInner OItem) { + if (this.O == null) { + this.O = new ArrayList<>(); + } + this.O.add(OItem); + return this; + } + + /** + * Get O + * + * @return O + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid ListstatusOInner> getO() { + return O; + } + + public void setO(@jakarta.annotation.Nullable List<@Valid ListstatusOInner> O) { + this.O = O; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Liststatus liststatus = (Liststatus) o; + return Objects.equals(this.E, liststatus.E) + && Objects.equals(this.sLowerCase, liststatus.sLowerCase) + && Objects.equals(this.gLowerCase, liststatus.gLowerCase) + && Objects.equals(this.cLowerCase, liststatus.cLowerCase) + && Objects.equals(this.lLowerCase, liststatus.lLowerCase) + && Objects.equals(this.L, liststatus.L) + && Objects.equals(this.rLowerCase, liststatus.rLowerCase) + && Objects.equals(this.C, liststatus.C) + && Objects.equals(this.T, liststatus.T) + && Objects.equals(this.O, liststatus.O); + } + + @Override + public int hashCode() { + return Objects.hash( + E, sLowerCase, gLowerCase, cLowerCase, lLowerCase, L, rLowerCase, C, T, O); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Liststatus {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" gLowerCase: ").append(toIndentedString(gLowerCase)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).append("\n"); + sb.append(" L: ").append(toIndentedString(L)).append("\n"); + sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).append("\n"); + sb.append(" C: ").append(toIndentedString(C)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" O: ").append(toIndentedString(O)).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); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + Long gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + String gLowerCaseValueAsString = gLowerCaseValue.toString(); + valMap.put("gLowerCase", gLowerCaseValueAsString); + } + String cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + String cLowerCaseValueAsString = cLowerCaseValue.toString(); + valMap.put("cLowerCase", cLowerCaseValueAsString); + } + String lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + String LValue = getL(); + if (LValue != null) { + String LValueAsString = LValue.toString(); + valMap.put("L", LValueAsString); + } + String rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + String rLowerCaseValueAsString = rLowerCaseValue.toString(); + valMap.put("rLowerCase", rLowerCaseValueAsString); + } + String CValue = getC(); + if (CValue != null) { + String CValueAsString = CValue.toString(); + valMap.put("C", CValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + List<@Valid ListstatusOInner> OValue = getO(); + if (OValue != null) { + String OValueAsString = JSON.getGson().toJson(OValue); + valMap.put("O", OValueAsString); + } + + 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 sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + valMap.put("gLowerCase", gLowerCaseValue); + } + Object cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + valMap.put("cLowerCase", cLowerCaseValue); + } + Object lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + Object LValue = getL(); + if (LValue != null) { + valMap.put("L", LValue); + } + Object rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + valMap.put("rLowerCase", rLowerCaseValue); + } + Object CValue = getC(); + if (CValue != null) { + valMap.put("C", CValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object OValue = getO(); + if (OValue != null) { + valMap.put("O", OValue); + } + + 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("s"); + openapiFields.add("g"); + openapiFields.add("c"); + openapiFields.add("l"); + openapiFields.add("L"); + openapiFields.add("r"); + openapiFields.add("C"); + openapiFields.add("T"); + openapiFields.add("O"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Liststatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Liststatus.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Liststatus is not found in the empty" + + " JSON string", + Liststatus.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Liststatus.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Liststatus` 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("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("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("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("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("O") != null && !jsonObj.get("O").isJsonNull()) { + JsonArray jsonArrayO = jsonObj.getAsJsonArray("O"); + if (jsonArrayO != 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 < jsonArrayO.size(); i++) { + ListstatusOInner.validateJsonElement(jsonArrayO.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Liststatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Liststatus' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Liststatus.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Liststatus value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Liststatus read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Liststatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of Liststatus + * @throws IOException if the JSON string is invalid with respect to Liststatus + */ + public static Liststatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Liststatus.class); + } + + /** + * Convert an instance of Liststatus to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/ListstatusOInner.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/ListstatusOInner.java new file mode 100644 index 00000000..3b0b0f93 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/ListstatusOInner.java @@ -0,0 +1,322 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.margin_trading.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.*; + +/** ListstatusOInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListstatusOInner 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private Long iLowerCase; + + public static final String SERIALIZED_NAME_C_LOWER_CASE = "c"; + + @SerializedName(SERIALIZED_NAME_C_LOWER_CASE) + @jakarta.annotation.Nullable + private String cLowerCase; + + public ListstatusOInner() {} + + public ListstatusOInner 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 ListstatusOInner 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 ListstatusOInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListstatusOInner liststatusOInner = (ListstatusOInner) o; + return Objects.equals(this.sLowerCase, liststatusOInner.sLowerCase) + && Objects.equals(this.iLowerCase, liststatusOInner.iLowerCase) + && Objects.equals(this.cLowerCase, liststatusOInner.cLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, iLowerCase, cLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListstatusOInner {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).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); + } + Long iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + String cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + String cLowerCaseValueAsString = cLowerCaseValue.toString(); + valMap.put("cLowerCase", cLowerCaseValueAsString); + } + + 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 iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + valMap.put("cLowerCase", cLowerCaseValue); + } + + 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("i"); + openapiFields.add("c"); + + // 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 ListstatusOInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListstatusOInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListstatusOInner is not found in the" + + " empty JSON string", + ListstatusOInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListstatusOInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListstatusOInner` 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListstatusOInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListstatusOInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListstatusOInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListstatusOInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListstatusOInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListstatusOInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListstatusOInner + * @throws IOException if the JSON string is invalid with respect to ListstatusOInner + */ + public static ListstatusOInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListstatusOInner.class); + } + + /** + * Convert an instance of ListstatusOInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/MarginLevelStatusChange.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/MarginLevelStatusChange.java new file mode 100644 index 00000000..bcb382e2 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/MarginLevelStatusChange.java @@ -0,0 +1,323 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.margin_trading.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.*; + +/** MarginLevelStatusChange */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MarginLevelStatusChange 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_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private String lLowerCase; + + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public MarginLevelStatusChange() {} + + public MarginLevelStatusChange 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 MarginLevelStatusChange 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 MarginLevelStatusChange 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarginLevelStatusChange marginLevelStatusChange = (MarginLevelStatusChange) o; + return Objects.equals(this.E, marginLevelStatusChange.E) + && Objects.equals(this.lLowerCase, marginLevelStatusChange.lLowerCase) + && Objects.equals(this.sLowerCase, marginLevelStatusChange.sLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, lLowerCase, sLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarginLevelStatusChange {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).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); + } + String lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + + 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 lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + + 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("l"); + openapiFields.add("s"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MarginLevelStatusChange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MarginLevelStatusChange.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MarginLevelStatusChange is not found" + + " in the empty JSON string", + MarginLevelStatusChange.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MarginLevelStatusChange.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MarginLevelStatusChange` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MarginLevelStatusChange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MarginLevelStatusChange' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MarginLevelStatusChange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MarginLevelStatusChange value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MarginLevelStatusChange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MarginLevelStatusChange given an JSON string + * + * @param jsonString JSON string + * @return An instance of MarginLevelStatusChange + * @throws IOException if the JSON string is invalid with respect to MarginLevelStatusChange + */ + public static MarginLevelStatusChange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MarginLevelStatusChange.class); + } + + /** + * Convert an instance of MarginLevelStatusChange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Outboundaccountposition.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Outboundaccountposition.java new file mode 100644 index 00000000..e3e8cac1 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/Outboundaccountposition.java @@ -0,0 +1,340 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.margin_trading.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.*; + +/** Outboundaccountposition */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Outboundaccountposition 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_U_LOWER_CASE = "u"; + + @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) + @jakarta.annotation.Nullable + private Long uLowerCase; + + public static final String SERIALIZED_NAME_B = "B"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private List<@Valid OutboundaccountpositionBInner> B; + + public Outboundaccountposition() {} + + public Outboundaccountposition 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 Outboundaccountposition 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 Outboundaccountposition B( + @jakarta.annotation.Nullable List<@Valid OutboundaccountpositionBInner> B) { + this.B = B; + return this; + } + + public Outboundaccountposition addBItem(OutboundaccountpositionBInner BItem) { + if (this.B == null) { + this.B = new ArrayList<>(); + } + this.B.add(BItem); + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OutboundaccountpositionBInner> getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable List<@Valid OutboundaccountpositionBInner> B) { + this.B = B; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Outboundaccountposition outboundaccountposition = (Outboundaccountposition) o; + return Objects.equals(this.E, outboundaccountposition.E) + && Objects.equals(this.uLowerCase, outboundaccountposition.uLowerCase) + && Objects.equals(this.B, outboundaccountposition.B); + } + + @Override + public int hashCode() { + return Objects.hash(E, uLowerCase, B); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Outboundaccountposition {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).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 uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + String uLowerCaseValueAsString = uLowerCaseValue.toString(); + valMap.put("uLowerCase", uLowerCaseValueAsString); + } + List<@Valid OutboundaccountpositionBInner> BValue = getB(); + if (BValue != null) { + String BValueAsString = JSON.getGson().toJson(BValue); + valMap.put("B", BValueAsString); + } + + 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 uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); + } + + 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("u"); + openapiFields.add("B"); + + // 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 Outboundaccountposition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Outboundaccountposition.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Outboundaccountposition is not found" + + " in the empty JSON string", + Outboundaccountposition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Outboundaccountposition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Outboundaccountposition` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("B") != null && !jsonObj.get("B").isJsonNull()) { + JsonArray jsonArrayB = jsonObj.getAsJsonArray("B"); + if (jsonArrayB != null) { + // ensure the json data is an array + if (!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())); + } + + // validate the optional field `B` (array) + for (int i = 0; i < jsonArrayB.size(); i++) { + OutboundaccountpositionBInner.validateJsonElement(jsonArrayB.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Outboundaccountposition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Outboundaccountposition' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Outboundaccountposition.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Outboundaccountposition value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Outboundaccountposition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Outboundaccountposition given an JSON string + * + * @param jsonString JSON string + * @return An instance of Outboundaccountposition + * @throws IOException if the JSON string is invalid with respect to Outboundaccountposition + */ + public static Outboundaccountposition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Outboundaccountposition.class); + } + + /** + * Convert an instance of Outboundaccountposition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/OutboundaccountpositionBInner.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/OutboundaccountpositionBInner.java new file mode 100644 index 00000000..6e53f31c --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/OutboundaccountpositionBInner.java @@ -0,0 +1,339 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.margin_trading.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.*; + +/** OutboundaccountpositionBInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OutboundaccountpositionBInner 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_F_LOWER_CASE = "f"; + + @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) + @jakarta.annotation.Nullable + private String fLowerCase; + + public static final String SERIALIZED_NAME_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private String lLowerCase; + + public OutboundaccountpositionBInner() {} + + public OutboundaccountpositionBInner 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 OutboundaccountpositionBInner 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 OutboundaccountpositionBInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutboundaccountpositionBInner outboundaccountpositionBInner = + (OutboundaccountpositionBInner) o; + return Objects.equals(this.aLowerCase, outboundaccountpositionBInner.aLowerCase) + && Objects.equals(this.fLowerCase, outboundaccountpositionBInner.fLowerCase) + && Objects.equals(this.lLowerCase, outboundaccountpositionBInner.lLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(aLowerCase, fLowerCase, lLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutboundaccountpositionBInner {\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).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 fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + String fLowerCaseValueAsString = fLowerCaseValue.toString(); + valMap.put("fLowerCase", fLowerCaseValueAsString); + } + String lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + + 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 fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + valMap.put("fLowerCase", fLowerCaseValue); + } + Object lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + + 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("f"); + openapiFields.add("l"); + + // 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 + * OutboundaccountpositionBInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OutboundaccountpositionBInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OutboundaccountpositionBInner is not" + + " found in the empty JSON string", + OutboundaccountpositionBInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OutboundaccountpositionBInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OutboundaccountpositionBInner` 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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OutboundaccountpositionBInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OutboundaccountpositionBInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OutboundaccountpositionBInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OutboundaccountpositionBInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OutboundaccountpositionBInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OutboundaccountpositionBInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OutboundaccountpositionBInner + * @throws IOException if the JSON string is invalid with respect to + * OutboundaccountpositionBInner + */ + public static OutboundaccountpositionBInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OutboundaccountpositionBInner.class); + } + + /** + * Convert an instance of OutboundaccountpositionBInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/RiskDataStreamEventsResponse.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/RiskDataStreamEventsResponse.java new file mode 100644 index 00000000..308cddab --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/RiskDataStreamEventsResponse.java @@ -0,0 +1,359 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.margin_trading.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.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 RiskDataStreamEventsResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(RiskDataStreamEventsResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RiskDataStreamEventsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RiskDataStreamEventsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterUserLiabilityChange = + gson.getDelegateAdapter(this, TypeToken.get(UserLiabilityChange.class)); + final TypeAdapter adapterMarginLevelStatusChange = + gson.getDelegateAdapter(this, TypeToken.get(MarginLevelStatusChange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RiskDataStreamEventsResponse value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `UserLiabilityChange` + if (value.getActualInstance() instanceof UserLiabilityChange) { + JsonElement element = + adapterUserLiabilityChange.toJsonTree( + (UserLiabilityChange) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MarginLevelStatusChange` + if (value.getActualInstance() instanceof MarginLevelStatusChange) { + JsonElement element = + adapterMarginLevelStatusChange.toJsonTree( + (MarginLevelStatusChange) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " MarginLevelStatusChange, UserLiabilityChange"); + } + + @Override + public RiskDataStreamEventsResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + RiskDataStreamEventsResponse newRiskDataStreamEventsResponse = + new RiskDataStreamEventsResponse(); + if (jsonObject.get("e") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for" + + " RiskDataStreamEventsResponse as `e` was not found" + + " in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `e` + switch (jsonObject.get("e").getAsString()) { + case "MARGIN_LEVEL_STATUS_CHANGE": + deserialized = + adapterMarginLevelStatusChange.fromJsonTree( + jsonObject); + newRiskDataStreamEventsResponse.setActualInstance( + deserialized); + return newRiskDataStreamEventsResponse; + case "USER_LIABILITY_CHANGE": + deserialized = + adapterUserLiabilityChange.fromJsonTree(jsonObject); + newRiskDataStreamEventsResponse.setActualInstance( + deserialized); + return newRiskDataStreamEventsResponse; + case "marginLevelStatusChange": + deserialized = + adapterMarginLevelStatusChange.fromJsonTree( + jsonObject); + newRiskDataStreamEventsResponse.setActualInstance( + deserialized); + return newRiskDataStreamEventsResponse; + case "userLiabilityChange": + deserialized = + adapterUserLiabilityChange.fromJsonTree(jsonObject); + newRiskDataStreamEventsResponse.setActualInstance( + deserialized); + return newRiskDataStreamEventsResponse; + default: + newRiskDataStreamEventsResponse.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for RiskDataStreamEventsResponse." + + " Possible values:" + + " MARGIN_LEVEL_STATUS_CHANGE" + + " USER_LIABILITY_CHANGE" + + " marginLevelStatusChange" + + " userLiabilityChange. Falling back" + + " to String.", + jsonObject.get("e").getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize UserLiabilityChange + try { + // validate the JSON object to see if any exception is thrown + UserLiabilityChange.validateJsonElement(jsonElement); + actualAdapter = adapterUserLiabilityChange; + match++; + log.log( + Level.FINER, + "Input data matches schema 'UserLiabilityChange'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for UserLiabilityChange failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'UserLiabilityChange'", + e); + } + // deserialize MarginLevelStatusChange + try { + // validate the JSON object to see if any exception is thrown + MarginLevelStatusChange.validateJsonElement(jsonElement); + actualAdapter = adapterMarginLevelStatusChange; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MarginLevelStatusChange'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MarginLevelStatusChange failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'MarginLevelStatusChange'", + e); + } + + if (match == 1) { + RiskDataStreamEventsResponse ret = + new RiskDataStreamEventsResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for" + + " RiskDataStreamEventsResponse: %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 RiskDataStreamEventsResponse() { + super("oneOf", Boolean.FALSE); + } + + public RiskDataStreamEventsResponse(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("UserLiabilityChange", UserLiabilityChange.class); + schemas.put("MarginLevelStatusChange", MarginLevelStatusChange.class); + } + + @Override + public Map> getSchemas() { + return RiskDataStreamEventsResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: MarginLevelStatusChange, UserLiabilityChange + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof UserLiabilityChange) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MarginLevelStatusChange) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be MarginLevelStatusChange, UserLiabilityChange"); + } + + /** + * Get the actual instance, which can be the following: MarginLevelStatusChange, + * UserLiabilityChange + * + * @return The actual instance (MarginLevelStatusChange, UserLiabilityChange) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `UserLiabilityChange`. If the actual instance is not + * `UserLiabilityChange`, the ClassCastException will be thrown. + * + * @return The actual instance of `UserLiabilityChange` + * @throws ClassCastException if the instance is not `UserLiabilityChange` + */ + public UserLiabilityChange getUserLiabilityChange() throws ClassCastException { + return (UserLiabilityChange) super.getActualInstance(); + } + + /** + * Get the actual instance of `MarginLevelStatusChange`. If the actual instance is not + * `MarginLevelStatusChange`, the ClassCastException will be thrown. + * + * @return The actual instance of `MarginLevelStatusChange` + * @throws ClassCastException if the instance is not `MarginLevelStatusChange` + */ + public MarginLevelStatusChange getMarginLevelStatusChange() throws ClassCastException { + return (MarginLevelStatusChange) 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 + * RiskDataStreamEventsResponse + */ + 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 UserLiabilityChange + try { + UserLiabilityChange.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for UserLiabilityChange failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MarginLevelStatusChange + try { + MarginLevelStatusChange.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MarginLevelStatusChange failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for RiskDataStreamEventsResponse with oneOf" + + " schemas: MarginLevelStatusChange, UserLiabilityChange. %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 RiskDataStreamEventsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RiskDataStreamEventsResponse + * @throws IOException if the JSON string is invalid with respect to + * RiskDataStreamEventsResponse + */ + public static RiskDataStreamEventsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RiskDataStreamEventsResponse.class); + } + + /** + * Convert an instance of RiskDataStreamEventsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/TradeDataStreamEventsResponse.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/TradeDataStreamEventsResponse.java new file mode 100644 index 00000000..71af2b65 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/TradeDataStreamEventsResponse.java @@ -0,0 +1,569 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.margin_trading.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.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 TradeDataStreamEventsResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(TradeDataStreamEventsResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradeDataStreamEventsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TradeDataStreamEventsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterOutboundaccountposition = + gson.getDelegateAdapter(this, TypeToken.get(Outboundaccountposition.class)); + final TypeAdapter adapterBalanceupdate = + gson.getDelegateAdapter(this, TypeToken.get(Balanceupdate.class)); + final TypeAdapter adapterListenkeyexpired = + gson.getDelegateAdapter(this, TypeToken.get(Listenkeyexpired.class)); + final TypeAdapter adapterExecutionreport = + gson.getDelegateAdapter(this, TypeToken.get(Executionreport.class)); + final TypeAdapter adapterListstatus = + gson.getDelegateAdapter(this, TypeToken.get(Liststatus.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TradeDataStreamEventsResponse value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Outboundaccountposition` + if (value.getActualInstance() instanceof Outboundaccountposition) { + JsonElement element = + adapterOutboundaccountposition.toJsonTree( + (Outboundaccountposition) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Balanceupdate` + if (value.getActualInstance() instanceof Balanceupdate) { + JsonElement element = + adapterBalanceupdate.toJsonTree( + (Balanceupdate) value.getActualInstance()); + 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; + } + // check if the actual instance is of the type `Executionreport` + if (value.getActualInstance() instanceof Executionreport) { + JsonElement element = + adapterExecutionreport.toJsonTree( + (Executionreport) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Liststatus` + if (value.getActualInstance() instanceof Liststatus) { + JsonElement element = + adapterListstatus.toJsonTree( + (Liststatus) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " Balanceupdate, Executionreport, Listenkeyexpired," + + " Liststatus, Outboundaccountposition"); + } + + @Override + public TradeDataStreamEventsResponse read(JsonReader in) + throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + TradeDataStreamEventsResponse newTradeDataStreamEventsResponse = + new TradeDataStreamEventsResponse(); + if (jsonObject.get("e") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for" + + " TradeDataStreamEventsResponse as `e` was not found" + + " in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `e` + switch (jsonObject.get("e").getAsString()) { + case "balanceUpdate": + deserialized = + adapterBalanceupdate.fromJsonTree(jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + case "executionReport": + deserialized = + adapterExecutionreport.fromJsonTree(jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + case "listStatus": + deserialized = adapterListstatus.fromJsonTree(jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + case "listenKeyExpired": + deserialized = + adapterListenkeyexpired.fromJsonTree(jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + case "outboundAccountPosition": + deserialized = + adapterOutboundaccountposition.fromJsonTree( + jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + case "balanceupdate": + deserialized = + adapterBalanceupdate.fromJsonTree(jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + case "executionreport": + deserialized = + adapterExecutionreport.fromJsonTree(jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + case "listenkeyexpired": + deserialized = + adapterListenkeyexpired.fromJsonTree(jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + case "liststatus": + deserialized = adapterListstatus.fromJsonTree(jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + case "outboundaccountposition": + deserialized = + adapterOutboundaccountposition.fromJsonTree( + jsonObject); + newTradeDataStreamEventsResponse.setActualInstance( + deserialized); + return newTradeDataStreamEventsResponse; + default: + newTradeDataStreamEventsResponse.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for TradeDataStreamEventsResponse." + + " Possible values: balanceUpdate" + + " executionReport listStatus" + + " listenKeyExpired" + + " outboundAccountPosition" + + " balanceupdate executionreport" + + " listenkeyexpired liststatus" + + " outboundaccountposition. Falling" + + " back to String.", + jsonObject.get("e").getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Outboundaccountposition + try { + // validate the JSON object to see if any exception is thrown + Outboundaccountposition.validateJsonElement(jsonElement); + actualAdapter = adapterOutboundaccountposition; + match++; + log.log( + Level.FINER, + "Input data matches schema 'Outboundaccountposition'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Outboundaccountposition failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'Outboundaccountposition'", + e); + } + // deserialize Balanceupdate + try { + // validate the JSON object to see if any exception is thrown + Balanceupdate.validateJsonElement(jsonElement); + actualAdapter = adapterBalanceupdate; + match++; + log.log(Level.FINER, "Input data matches schema 'Balanceupdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Balanceupdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Balanceupdate'", + 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); + } + // deserialize Executionreport + try { + // validate the JSON object to see if any exception is thrown + Executionreport.validateJsonElement(jsonElement); + actualAdapter = adapterExecutionreport; + match++; + log.log(Level.FINER, "Input data matches schema 'Executionreport'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Executionreport failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Executionreport'", + e); + } + // deserialize Liststatus + try { + // validate the JSON object to see if any exception is thrown + Liststatus.validateJsonElement(jsonElement); + actualAdapter = adapterListstatus; + match++; + log.log(Level.FINER, "Input data matches schema 'Liststatus'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Liststatus failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Liststatus'", + e); + } + + if (match == 1) { + TradeDataStreamEventsResponse ret = + new TradeDataStreamEventsResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for" + + " TradeDataStreamEventsResponse: %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 TradeDataStreamEventsResponse() { + super("oneOf", Boolean.FALSE); + } + + public TradeDataStreamEventsResponse(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Outboundaccountposition", Outboundaccountposition.class); + schemas.put("Balanceupdate", Balanceupdate.class); + schemas.put("Listenkeyexpired", Listenkeyexpired.class); + schemas.put("Executionreport", Executionreport.class); + schemas.put("Liststatus", Liststatus.class); + } + + @Override + public Map> getSchemas() { + return TradeDataStreamEventsResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Balanceupdate, Executionreport, Listenkeyexpired, + * Liststatus, Outboundaccountposition + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Outboundaccountposition) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Balanceupdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Listenkeyexpired) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Executionreport) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Liststatus) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be Balanceupdate, Executionreport, Listenkeyexpired," + + " Liststatus, Outboundaccountposition"); + } + + /** + * Get the actual instance, which can be the following: Balanceupdate, Executionreport, + * Listenkeyexpired, Liststatus, Outboundaccountposition + * + * @return The actual instance (Balanceupdate, Executionreport, Listenkeyexpired, Liststatus, + * Outboundaccountposition) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Outboundaccountposition`. If the actual instance is not + * `Outboundaccountposition`, the ClassCastException will be thrown. + * + * @return The actual instance of `Outboundaccountposition` + * @throws ClassCastException if the instance is not `Outboundaccountposition` + */ + public Outboundaccountposition getOutboundaccountposition() throws ClassCastException { + return (Outboundaccountposition) super.getActualInstance(); + } + + /** + * Get the actual instance of `Balanceupdate`. If the actual instance is not `Balanceupdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Balanceupdate` + * @throws ClassCastException if the instance is not `Balanceupdate` + */ + public Balanceupdate getBalanceupdate() throws ClassCastException { + return (Balanceupdate) 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(); + } + + /** + * Get the actual instance of `Executionreport`. If the actual instance is not + * `Executionreport`, the ClassCastException will be thrown. + * + * @return The actual instance of `Executionreport` + * @throws ClassCastException if the instance is not `Executionreport` + */ + public Executionreport getExecutionreport() throws ClassCastException { + return (Executionreport) super.getActualInstance(); + } + + /** + * Get the actual instance of `Liststatus`. If the actual instance is not `Liststatus`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `Liststatus` + * @throws ClassCastException if the instance is not `Liststatus` + */ + public Liststatus getListstatus() throws ClassCastException { + return (Liststatus) 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 + * TradeDataStreamEventsResponse + */ + 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 Outboundaccountposition + try { + Outboundaccountposition.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Outboundaccountposition failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with Balanceupdate + try { + Balanceupdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Balanceupdate failed with `%s`.", 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 + } + // validate the json string with Executionreport + try { + Executionreport.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Executionreport failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with Liststatus + try { + Liststatus.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Liststatus failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for TradeDataStreamEventsResponse with" + + " oneOf schemas: Balanceupdate, Executionreport," + + " Listenkeyexpired, Liststatus, Outboundaccountposition. %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 TradeDataStreamEventsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TradeDataStreamEventsResponse + * @throws IOException if the JSON string is invalid with respect to + * TradeDataStreamEventsResponse + */ + public static TradeDataStreamEventsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TradeDataStreamEventsResponse.class); + } + + /** + * Convert an instance of TradeDataStreamEventsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/UserLiabilityChange.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/UserLiabilityChange.java new file mode 100644 index 00000000..e043a3a5 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/model/UserLiabilityChange.java @@ -0,0 +1,412 @@ +/* + * Binance Margin Trading WebSocket Market Streams + * OpenAPI Specification for the Binance Margin Trading 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.margin_trading.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.margin_trading.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.*; + +/** UserLiabilityChange */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UserLiabilityChange 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_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private String aLowerCase; + + 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private String iLowerCase; + + public UserLiabilityChange() {} + + public UserLiabilityChange 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 UserLiabilityChange 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 UserLiabilityChange 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 UserLiabilityChange 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 UserLiabilityChange iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + return this; + } + + /** + * Get iLowerCase + * + * @return iLowerCase + */ + @jakarta.annotation.Nullable + public String getiLowerCase() { + return iLowerCase; + } + + public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserLiabilityChange userLiabilityChange = (UserLiabilityChange) o; + return Objects.equals(this.E, userLiabilityChange.E) + && Objects.equals(this.aLowerCase, userLiabilityChange.aLowerCase) + && Objects.equals(this.tLowerCase, userLiabilityChange.tLowerCase) + && Objects.equals(this.pLowerCase, userLiabilityChange.pLowerCase) + && Objects.equals(this.iLowerCase, userLiabilityChange.iLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(E, aLowerCase, tLowerCase, pLowerCase, iLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserLiabilityChange {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); + sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).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); + } + String aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = aLowerCaseValue.toString(); + valMap.put("aLowerCase", aLowerCaseValueAsString); + } + 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 iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + + 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 aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } + Object pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + valMap.put("pLowerCase", pLowerCaseValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + + 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("a"); + openapiFields.add("t"); + openapiFields.add("p"); + openapiFields.add("i"); + + // 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 UserLiabilityChange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserLiabilityChange.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UserLiabilityChange is not found in" + + " the empty JSON string", + UserLiabilityChange.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserLiabilityChange.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UserLiabilityChange` 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("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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserLiabilityChange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserLiabilityChange' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UserLiabilityChange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UserLiabilityChange value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserLiabilityChange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UserLiabilityChange given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserLiabilityChange + * @throws IOException if the JSON string is invalid with respect to UserLiabilityChange + */ + public static UserLiabilityChange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserLiabilityChange.class); + } + + /** + * Convert an instance of UserLiabilityChange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/CHANGELOG.md b/clients/spot/CHANGELOG.md index ac544db2..c50f7cc4 100644 --- a/clients/spot/CHANGELOG.md +++ b/clients/spot/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 4.0.0 - 2025-07-16 + +### Added (1) + +- Support User Data Streams. + +### Changed (1) + +- Update `binance/common` module to version `1.4.0`. + ## 3.1.0 - 2025-07-08 - Update `binance/common` module to version `1.3.0`. diff --git a/clients/spot/docs/BalanceUpdate.md b/clients/spot/docs/BalanceUpdate.md new file mode 100644 index 00000000..600ac5b3 --- /dev/null +++ b/clients/spot/docs/BalanceUpdate.md @@ -0,0 +1,16 @@ + + +# BalanceUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**dLowerCase** | **String** | | [optional] | +|**T** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/EventStreamTerminated.md b/clients/spot/docs/EventStreamTerminated.md new file mode 100644 index 00000000..ce20cc04 --- /dev/null +++ b/clients/spot/docs/EventStreamTerminated.md @@ -0,0 +1,13 @@ + + +# EventStreamTerminated + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/ExecutionReport.md b/clients/spot/docs/ExecutionReport.md new file mode 100644 index 00000000..8d7b30f1 --- /dev/null +++ b/clients/spot/docs/ExecutionReport.md @@ -0,0 +1,62 @@ + + +# ExecutionReport + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**P** | **String** | | [optional] | +|**F** | **String** | | [optional] | +|**gLowerCase** | **Long** | | [optional] | +|**C** | **String** | | [optional] | +|**xLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**zLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**nLowerCase** | **String** | | [optional] | +|**N** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**vLowerCase** | **Long** | | [optional] | +|**I** | **Long** | | [optional] | +|**wLowerCase** | **Boolean** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | +|**M** | **Boolean** | | [optional] | +|**O** | **Long** | | [optional] | +|**Z** | **String** | | [optional] | +|**Y** | **String** | | [optional] | +|**Q** | **String** | | [optional] | +|**W** | **Long** | | [optional] | +|**V** | **String** | | [optional] | +|**dLowerCase** | **Long** | | [optional] | +|**D** | **Long** | | [optional] | +|**jLowerCase** | **Long** | | [optional] | +|**J** | **Long** | | [optional] | +|**A** | **String** | | [optional] | +|**B** | **String** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**U** | **Long** | | [optional] | +|**cs** | **String** | | [optional] | +|**pl** | **String** | | [optional] | +|**pL** | **String** | | [optional] | +|**pY** | **String** | | [optional] | +|**bLowerCase** | **String** | | [optional] | +|**aLowerCase** | **Long** | | [optional] | +|**kLowerCase** | **String** | | [optional] | +|**uS** | **Boolean** | | [optional] | + + + diff --git a/clients/spot/docs/ExternalLockUpdate.md b/clients/spot/docs/ExternalLockUpdate.md new file mode 100644 index 00000000..b9f1e74b --- /dev/null +++ b/clients/spot/docs/ExternalLockUpdate.md @@ -0,0 +1,16 @@ + + +# ExternalLockUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**dLowerCase** | **String** | | [optional] | +|**T** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/ListStatus.md b/clients/spot/docs/ListStatus.md new file mode 100644 index 00000000..7c799408 --- /dev/null +++ b/clients/spot/docs/ListStatus.md @@ -0,0 +1,22 @@ + + +# ListStatus + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**gLowerCase** | **Long** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**C** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**O** | [**List<ListStatusOInner>**](ListStatusOInner.md) | | [optional] | + + + diff --git a/clients/spot/docs/ListStatusOInner.md b/clients/spot/docs/ListStatusOInner.md new file mode 100644 index 00000000..e96dac73 --- /dev/null +++ b/clients/spot/docs/ListStatusOInner.md @@ -0,0 +1,15 @@ + + +# ListStatusOInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**cLowerCase** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/ListenKeyExpired.md b/clients/spot/docs/ListenKeyExpired.md new file mode 100644 index 00000000..ce30d5a4 --- /dev/null +++ b/clients/spot/docs/ListenKeyExpired.md @@ -0,0 +1,14 @@ + + +# ListenKeyExpired + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**listenKey** | **String** | | [optional] | + + + diff --git a/clients/margin-trading/docs/MarginAccountNewOrderResponse2.md b/clients/spot/docs/OrderCancelReplaceResponseCancelResponse.md similarity index 78% rename from clients/margin-trading/docs/MarginAccountNewOrderResponse2.md rename to clients/spot/docs/OrderCancelReplaceResponseCancelResponse.md index 4ea5426f..db2c334e 100644 --- a/clients/margin-trading/docs/MarginAccountNewOrderResponse2.md +++ b/clients/spot/docs/OrderCancelReplaceResponseCancelResponse.md @@ -1,6 +1,6 @@ -# MarginAccountNewOrderResponse2 +# OrderCancelReplaceResponseCancelResponse ## Properties @@ -8,18 +8,20 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | +|**origClientOrderId** | **String** | | [optional] | |**orderId** | **Long** | | [optional] | +|**orderListId** | **Long** | | [optional] | |**clientOrderId** | **String** | | [optional] | |**transactTime** | **Long** | | [optional] | |**price** | **String** | | [optional] | |**origQty** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | +|**origQuoteOrderQty** | **String** | | [optional] | |**cummulativeQuoteQty** | **String** | | [optional] | |**status** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | |**type** | **String** | | [optional] | |**side** | **String** | | [optional] | -|**isIsolated** | **Boolean** | | [optional] | |**selfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/spot/docs/OrderCancelReplaceResponseDataCancelResponse.md b/clients/spot/docs/OrderCancelReplaceResponseDataCancelResponse.md index acd68ab6..f6124e56 100644 --- a/clients/spot/docs/OrderCancelReplaceResponseDataCancelResponse.md +++ b/clients/spot/docs/OrderCancelReplaceResponseDataCancelResponse.md @@ -7,6 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**code** | **Long** | | [optional] | +|**msg** | **String** | | [optional] | |**symbol** | **String** | | [optional] | |**origClientOrderId** | **String** | | [optional] | |**orderId** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderCancelReplaceResponseDataNewOrderResponse.md b/clients/spot/docs/OrderCancelReplaceResponseDataNewOrderResponse.md index 6555881c..87f37bdc 100644 --- a/clients/spot/docs/OrderCancelReplaceResponseDataNewOrderResponse.md +++ b/clients/spot/docs/OrderCancelReplaceResponseDataNewOrderResponse.md @@ -9,6 +9,11 @@ |------------ | ------------- | ------------- | -------------| |**code** | **Long** | | [optional] | |**msg** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**orderListId** | **Long** | | [optional] | +|**clientOrderId** | **String** | | [optional] | +|**transactTime** | **Long** | | [optional] | diff --git a/clients/margin-trading/docs/MarginAccountNewOrderResponse3.md b/clients/spot/docs/OrderCancelReplaceResponseNewOrderResponse.md similarity index 68% rename from clients/margin-trading/docs/MarginAccountNewOrderResponse3.md rename to clients/spot/docs/OrderCancelReplaceResponseNewOrderResponse.md index fa16dfc1..f995b4e8 100644 --- a/clients/margin-trading/docs/MarginAccountNewOrderResponse3.md +++ b/clients/spot/docs/OrderCancelReplaceResponseNewOrderResponse.md @@ -1,6 +1,6 @@ -# MarginAccountNewOrderResponse3 +# OrderCancelReplaceResponseNewOrderResponse ## Properties @@ -9,21 +9,21 @@ |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | |**orderId** | **Long** | | [optional] | +|**orderListId** | **Long** | | [optional] | |**clientOrderId** | **String** | | [optional] | |**transactTime** | **Long** | | [optional] | |**price** | **String** | | [optional] | |**origQty** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | +|**origQuoteOrderQty** | **String** | | [optional] | |**cummulativeQuoteQty** | **String** | | [optional] | |**status** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | |**type** | **String** | | [optional] | |**side** | **String** | | [optional] | -|**marginBuyBorrowAmount** | **Long** | | [optional] | -|**marginBuyBorrowAsset** | **String** | | [optional] | -|**isIsolated** | **Boolean** | | [optional] | +|**workingTime** | **Long** | | [optional] | +|**fills** | **List<String>** | | [optional] | |**selfTradePreventionMode** | **String** | | [optional] | -|**fills** | [**List<MarginAccountNewOrderResponse3FillsInner>**](MarginAccountNewOrderResponse3FillsInner.md) | | [optional] | diff --git a/clients/spot/docs/OutboundAccountPosition.md b/clients/spot/docs/OutboundAccountPosition.md new file mode 100644 index 00000000..d37e6e76 --- /dev/null +++ b/clients/spot/docs/OutboundAccountPosition.md @@ -0,0 +1,15 @@ + + +# OutboundAccountPosition + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**B** | [**List<OutboundAccountPositionBInner>**](OutboundAccountPositionBInner.md) | | [optional] | + + + diff --git a/clients/spot/docs/OutboundAccountPositionBInner.md b/clients/spot/docs/OutboundAccountPositionBInner.md new file mode 100644 index 00000000..0b76413e --- /dev/null +++ b/clients/spot/docs/OutboundAccountPositionBInner.md @@ -0,0 +1,15 @@ + + +# OutboundAccountPositionBInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aLowerCase** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**lLowerCase** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/Ticker24hrResponse2Inner.md b/clients/spot/docs/Ticker24hrResponse2Inner.md index eddaeb29..a04f9dd4 100644 --- a/clients/spot/docs/Ticker24hrResponse2Inner.md +++ b/clients/spot/docs/Ticker24hrResponse2Inner.md @@ -8,10 +8,19 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | +|**priceChange** | **String** | | [optional] | +|**priceChangePercent** | **String** | | [optional] | +|**weightedAvgPrice** | **String** | | [optional] | +|**prevClosePrice** | **String** | | [optional] | +|**lastPrice** | **String** | | [optional] | +|**lastQty** | **String** | | [optional] | +|**bidPrice** | **String** | | [optional] | +|**bidQty** | **String** | | [optional] | +|**askPrice** | **String** | | [optional] | +|**askQty** | **String** | | [optional] | |**openPrice** | **String** | | [optional] | |**highPrice** | **String** | | [optional] | |**lowPrice** | **String** | | [optional] | -|**lastPrice** | **String** | | [optional] | |**volume** | **String** | | [optional] | |**quoteVolume** | **String** | | [optional] | |**openTime** | **Long** | | [optional] | diff --git a/clients/spot/docs/TickerResponse2Inner.md b/clients/spot/docs/TickerResponse2Inner.md index a5fea6ab..000402e0 100644 --- a/clients/spot/docs/TickerResponse2Inner.md +++ b/clients/spot/docs/TickerResponse2Inner.md @@ -8,6 +8,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | +|**priceChange** | **String** | | [optional] | +|**priceChangePercent** | **String** | | [optional] | +|**weightedAvgPrice** | **String** | | [optional] | |**openPrice** | **String** | | [optional] | |**highPrice** | **String** | | [optional] | |**lowPrice** | **String** | | [optional] | diff --git a/clients/spot/docs/TickerTradingDayResponse1.md b/clients/spot/docs/TickerTradingDayResponse1.md index b9c2df2b..d4eeeea6 100644 --- a/clients/spot/docs/TickerTradingDayResponse1.md +++ b/clients/spot/docs/TickerTradingDayResponse1.md @@ -8,6 +8,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | +|**priceChange** | **String** | | [optional] | +|**priceChangePercent** | **String** | | [optional] | +|**weightedAvgPrice** | **String** | | [optional] | |**openPrice** | **String** | | [optional] | |**highPrice** | **String** | | [optional] | |**lowPrice** | **String** | | [optional] | diff --git a/clients/spot/docs/TickerTradingDayResponse2Inner.md b/clients/spot/docs/TickerTradingDayResponse2Inner.md index 0af90da1..77a3f9eb 100644 --- a/clients/spot/docs/TickerTradingDayResponse2Inner.md +++ b/clients/spot/docs/TickerTradingDayResponse2Inner.md @@ -8,6 +8,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | +|**priceChange** | **String** | | [optional] | +|**priceChangePercent** | **String** | | [optional] | +|**weightedAvgPrice** | **String** | | [optional] | |**openPrice** | **String** | | [optional] | |**highPrice** | **String** | | [optional] | |**lowPrice** | **String** | | [optional] | diff --git a/clients/spot/docs/UserDataStreamEventsResponse.md b/clients/spot/docs/UserDataStreamEventsResponse.md new file mode 100644 index 00000000..4085d33b --- /dev/null +++ b/clients/spot/docs/UserDataStreamEventsResponse.md @@ -0,0 +1,63 @@ + + +# UserDataStreamEventsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**B** | **String** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**dLowerCase** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**P** | **String** | | [optional] | +|**F** | **String** | | [optional] | +|**gLowerCase** | **Long** | | [optional] | +|**C** | **String** | | [optional] | +|**xLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**rLowerCase** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**zLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**nLowerCase** | **String** | | [optional] | +|**N** | **String** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**vLowerCase** | **Long** | | [optional] | +|**I** | **Long** | | [optional] | +|**wLowerCase** | **Boolean** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | +|**M** | **Boolean** | | [optional] | +|**O** | [**List<ListStatusOInner>**](ListStatusOInner.md) | | [optional] | +|**Z** | **String** | | [optional] | +|**Y** | **String** | | [optional] | +|**Q** | **String** | | [optional] | +|**W** | **Long** | | [optional] | +|**V** | **String** | | [optional] | +|**D** | **Long** | | [optional] | +|**jLowerCase** | **Long** | | [optional] | +|**J** | **Long** | | [optional] | +|**A** | **String** | | [optional] | +|**U** | **Long** | | [optional] | +|**cs** | **String** | | [optional] | +|**pl** | **String** | | [optional] | +|**pL** | **String** | | [optional] | +|**pY** | **String** | | [optional] | +|**bLowerCase** | **String** | | [optional] | +|**kLowerCase** | **String** | | [optional] | +|**uS** | **Boolean** | | [optional] | +|**listenKey** | **String** | | [optional] | + + + diff --git a/clients/spot/example_websocket_api.md b/clients/spot/example_websocket_api.md index f964c54d..1d4a75ce 100644 --- a/clients/spot/example_websocket_api.md +++ b/clients/spot/example_websocket_api.md @@ -1,110 +1,110 @@ ## Account -[account.commission](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-commission-rates-user_data) - accountCommission - [AccountCommissionExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountCommissionExample.java#L46) +[account.commission](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-commission-rates-user_data) - accountCommission - [AccountCommissionExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountCommissionExample.java#L48) -[account.rateLimits.orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#unfilled-order-count-user_data) - accountRateLimitsOrders - [AccountRateLimitsOrdersExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountRateLimitsOrdersExample.java#L46) +[account.rateLimits.orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#unfilled-order-count-user_data) - accountRateLimitsOrders - [AccountRateLimitsOrdersExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountRateLimitsOrdersExample.java#L48) -[account.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-information-user_data) - accountStatus - [AccountStatusExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountStatusExample.java#L46) +[account.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-information-user_data) - accountStatus - [AccountStatusExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountStatusExample.java#L48) -[allOrderLists](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-order-list-history-user_data) - allOrderLists - [AllOrderListsExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java#L46) +[allOrderLists](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-order-list-history-user_data) - allOrderLists - [AllOrderListsExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java#L48) -[allOrders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-order-history-user_data) - allOrders - [AllOrdersExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrdersExample.java#L47) +[allOrders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-order-history-user_data) - allOrders - [AllOrdersExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrdersExample.java#L49) -[myAllocations](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-allocations-user_data) - myAllocations - [MyAllocationsExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyAllocationsExample.java#L46) +[myAllocations](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-allocations-user_data) - myAllocations - [MyAllocationsExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyAllocationsExample.java#L48) -[myPreventedMatches](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-prevented-matches-user_data) - myPreventedMatches - [MyPreventedMatchesExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyPreventedMatchesExample.java#L52) +[myPreventedMatches](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-prevented-matches-user_data) - myPreventedMatches - [MyPreventedMatchesExample.java:54](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyPreventedMatchesExample.java#L54) -[myTrades](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data) - myTrades - [MyTradesExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyTradesExample.java#L47) +[myTrades](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data) - myTrades - [MyTradesExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyTradesExample.java#L49) -[openOrderLists.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#current-open-order-lists-user_data) - openOrderListsStatus - [OpenOrderListsStatusExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java#L48) +[openOrderLists.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#current-open-order-lists-user_data) - openOrderListsStatus - [OpenOrderListsStatusExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java#L50) -[openOrders.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#current-open-orders-user_data) - openOrdersStatus - [OpenOrdersStatusExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java#L50) +[openOrders.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#current-open-orders-user_data) - openOrdersStatus - [OpenOrdersStatusExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java#L52) -[order.amendments](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-amendments-user_data) - orderAmendments - [OrderAmendmentsExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderAmendmentsExample.java#L46) +[order.amendments](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-amendments-user_data) - orderAmendments - [OrderAmendmentsExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderAmendmentsExample.java#L48) -[orderList.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-list-user_data) - orderListStatus - [OrderListStatusExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java#L47) +[orderList.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-list-user_data) - orderListStatus - [OrderListStatusExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java#L49) -[order.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-user_data) - orderStatus - [OrderStatusExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java#L46) +[order.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-user_data) - orderStatus - [OrderStatusExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java#L48) ## Auth -[session.logon](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests#log-in-with-api-key-signed) - sessionLogon - [SessionLogonExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogonExample.java#L50) +[session.logon](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests#log-in-with-api-key-signed) - sessionLogon - [SessionLogonExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogonExample.java#L52) -[session.logout](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests#log-out-of-the-session) - sessionLogout - [SessionLogoutExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogoutExample.java#L49) +[session.logout](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests#log-out-of-the-session) - sessionLogout - [SessionLogoutExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogoutExample.java#L51) -[session.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests#query-session-status) - sessionStatus - [SessionStatusExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionStatusExample.java#L46) +[session.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests#query-session-status) - sessionStatus - [SessionStatusExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionStatusExample.java#L48) ## General -[exchangeInfo](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#exchange-information) - exchangeInfo - [ExchangeInfoExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/ExchangeInfoExample.java#L46) +[exchangeInfo](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#exchange-information) - exchangeInfo - [ExchangeInfoExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/ExchangeInfoExample.java#L48) -[ping](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#test-connectivity) - ping - [PingExample.java:45](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java#L45) +[ping](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#test-connectivity) - ping - [PingExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java#L47) -[time](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#check-server-time) - time - [TimeExample.java:45](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/TimeExample.java#L45) +[time](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#check-server-time) - time - [TimeExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/TimeExample.java#L47) ## Market -[avgPrice](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#current-average-price) - avgPrice - [AvgPriceExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/AvgPriceExample.java#L46) +[avgPrice](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#current-average-price) - avgPrice - [AvgPriceExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/AvgPriceExample.java#L48) -[depth](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#order-book) - depth - [DepthExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/DepthExample.java#L52) +[depth](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#order-book) - depth - [DepthExample.java:54](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/DepthExample.java#L54) -[klines](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines) - klines - [KlinesExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/KlinesExample.java#L51) +[klines](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines) - klines - [KlinesExample.java:53](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/KlinesExample.java#L53) -[ticker](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#rolling-window-price-change-statistics) - ticker - [TickerExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerExample.java#L49) +[ticker](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#rolling-window-price-change-statistics) - ticker - [TickerExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerExample.java#L51) -[ticker.24hr](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#24hr-ticker-price-change-statistics) - ticker24hr - [HrExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java#L52) +[ticker.24hr](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#24hr-ticker-price-change-statistics) - ticker24hr - [HrExample.java:54](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java#L54) -[ticker.book](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#symbol-order-book-ticker) - tickerBook - [TickerBookExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerBookExample.java#L50) +[ticker.book](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#symbol-order-book-ticker) - tickerBook - [TickerBookExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerBookExample.java#L52) -[ticker.price](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#symbol-price-ticker) - tickerPrice - [TickerPriceExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerPriceExample.java#L50) +[ticker.price](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#symbol-price-ticker) - tickerPrice - [TickerPriceExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerPriceExample.java#L52) -[ticker.tradingDay](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#trading-day-ticker) - tickerTradingDay - [TickerTradingDayExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerTradingDayExample.java#L48) +[ticker.tradingDay](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#trading-day-ticker) - tickerTradingDay - [TickerTradingDayExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerTradingDayExample.java#L50) -[trades.aggregate](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades) - tradesAggregate - [TradesAggregateExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesAggregateExample.java#L52) +[trades.aggregate](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades) - tradesAggregate - [TradesAggregateExample.java:54](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesAggregateExample.java#L54) -[trades.historical](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#historical-trades) - tradesHistorical - [TradesHistoricalExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesHistoricalExample.java#L46) +[trades.historical](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#historical-trades) - tradesHistorical - [TradesHistoricalExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesHistoricalExample.java#L48) -[trades.recent](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades) - tradesRecent - [TradesRecentExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesRecentExample.java#L47) +[trades.recent](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades) - tradesRecent - [TradesRecentExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesRecentExample.java#L49) -[uiKlines](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#ui-klines) - uiKlines - [UiKlinesExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/UiKlinesExample.java#L49) +[uiKlines](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#ui-klines) - uiKlines - [UiKlinesExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/UiKlinesExample.java#L51) ## Trade -[openOrders.cancelAll](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-open-orders-trade) - openOrdersCancelAll - [OpenOrdersCancelAllExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersCancelAllExample.java#L47) +[openOrders.cancelAll](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-open-orders-trade) - openOrdersCancelAll - [OpenOrdersCancelAllExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersCancelAllExample.java#L49) -[order.amend.keepPriority](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-amend-keep-priority-trade) - orderAmendKeepPriority - [OrderAmendKeepPriorityExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderAmendKeepPriorityExample.java#L48) +[order.amend.keepPriority](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-amend-keep-priority-trade) - orderAmendKeepPriority - [OrderAmendKeepPriorityExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderAmendKeepPriorityExample.java#L50) -[order.cancel](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-trade) - orderCancel - [OrderCancelExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelExample.java#L46) +[order.cancel](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-trade) - orderCancel - [OrderCancelExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelExample.java#L48) -[order.cancelReplace](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-and-replace-order-trade) - orderCancelReplace - [OrderCancelReplaceExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelReplaceExample.java#L51) +[order.cancelReplace](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-and-replace-order-trade) - orderCancelReplace - [OrderCancelReplaceExample.java:53](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelReplaceExample.java#L53) -[orderList.cancel](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-list-trade) - orderListCancel - [OrderListCancelExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListCancelExample.java#L46) +[orderList.cancel](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-list-trade) - orderListCancel - [OrderListCancelExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListCancelExample.java#L48) -[orderList.place](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-oco---deprecated-trade) - orderListPlace - [OrderListPlaceExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceExample.java#L50) +[orderList.place](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-oco---deprecated-trade) - orderListPlace - [OrderListPlaceExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceExample.java#L52) -[orderList.place.oco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---oco-trade) - orderListPlaceOco - [OrderListPlaceOcoExample.java:61](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java#L61) +[orderList.place.oco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---oco-trade) - orderListPlaceOco - [OrderListPlaceOcoExample.java:63](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java#L63) -[orderList.place.oto](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---oto-trade) - orderListPlaceOto - [OrderListPlaceOtoExample.java:62](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java#L62) +[orderList.place.oto](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---oto-trade) - orderListPlaceOto - [OrderListPlaceOtoExample.java:64](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java#L64) -[orderList.place.otoco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---otoco-trade) - orderListPlaceOtoco - [OrderListPlaceOtocoExample.java:59](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java#L59) +[orderList.place.otoco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---otoco-trade) - orderListPlaceOtoco - [OrderListPlaceOtocoExample.java:61](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java#L61) -[order.place](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-trade) - orderPlace - [OrderPlaceExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderPlaceExample.java#L49) +[order.place](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-trade) - orderPlace - [OrderPlaceExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderPlaceExample.java#L51) -[order.test](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#test-new-order-trade) - orderTest - [OrderTestExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderTestExample.java#L49) +[order.test](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#test-new-order-trade) - orderTest - [OrderTestExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderTestExample.java#L51) -[sor.order.place](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-using-sor-trade) - sorOrderPlace - [SorOrderPlaceExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java#L50) +[sor.order.place](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-using-sor-trade) - sorOrderPlace - [SorOrderPlaceExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java#L52) -[sor.order.test](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#test-new-order-using-sor-trade) - sorOrderTest - [SorOrderTestExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderTestExample.java#L49) +[sor.order.test](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#test-new-order-using-sor-trade) - sorOrderTest - [SorOrderTestExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderTestExample.java#L51) ## UserDataStream -[userDataStream.ping](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#ping-user-data-stream-user_stream) - userDataStreamPing - [UserDataStreamPingExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java#L49) +[userDataStream.ping](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#ping-user-data-stream-user_stream) - userDataStreamPing - [UserDataStreamPingExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java#L51) -[userDataStream.start](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#start-user-data-stream-user_stream) - userDataStreamStart - [UserDataStreamStartExample.java:45](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java#L45) +[userDataStream.start](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#start-user-data-stream-user_stream) - userDataStreamStart - [UserDataStreamStartExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java#L47) -[userDataStream.stop](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#stop-user-data-stream-user_stream) - userDataStreamStop - [UserDataStreamStopExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java#L46) +[userDataStream.stop](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#stop-user-data-stream-user_stream) - userDataStreamStop - [UserDataStreamStopExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java#L48) -[userDataStream.subscribe](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#subscribe-to-user-data-stream-user_stream) - userDataStreamSubscribe - [UserDataStreamSubscribeExample.java:45](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeExample.java#L45) +[userDataStream.subscribe](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#subscribe-to-user-data-stream-user_stream) - userDataStreamSubscribe - [UserDataStreamSubscribeExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeExample.java#L49) -[userDataStream.unsubscribe](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#unsubscribe-from-user-data-stream-user_stream) - userDataStreamUnsubscribe - [UserDataStreamUnsubscribeExample.java:45](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java#L45) +[userDataStream.unsubscribe](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#unsubscribe-from-user-data-stream-user_stream) - userDataStreamUnsubscribe - [UserDataStreamUnsubscribeExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java#L47) diff --git a/clients/spot/pom.xml b/clients/spot/pom.xml index 7b024282..dac1d91e 100644 --- a/clients/spot/pom.xml +++ b/clients/spot/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-spot spot - 3.1.0 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.3.0 + 1.4.0 \ No newline at end of file diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java index d8875fe5..55c77988 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java @@ -283,6 +283,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.OrderCancelReplaceResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model + .OrderCancelReplaceResponseCancelResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.OrderCancelReplaceResponseData .CustomTypeAdapterFactory()); @@ -292,6 +295,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model .OrderCancelReplaceResponseDataNewOrderResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model + .OrderCancelReplaceResponseNewOrderResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.OrderListOcoRequest .CustomTypeAdapterFactory()); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java index 7b45e4bd..25f8a92d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java @@ -54,7 +54,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-spot/3.1.0 (Java/%s; %s; %s)", + "binance-spot/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java index ed124b8e..4070d909 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java @@ -47,7 +47,7 @@ public class GeneralApi { private static final String USER_AGENT = String.format( - "binance-spot/3.1.0 (Java/%s; %s; %s)", + "binance-spot/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java index dbd0bf3d..a62add63 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java @@ -58,7 +58,7 @@ public class MarketApi { private static final String USER_AGENT = String.format( - "binance-spot/3.1.0 (Java/%s; %s; %s)", + "binance-spot/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java index 425a5b26..28b315d1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java @@ -67,7 +67,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-spot/3.1.0 (Java/%s; %s; %s)", + "binance-spot/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java index 86c0ea57..75bfa3bf 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java @@ -44,7 +44,7 @@ public class UserDataStreamApi { private static final String USER_AGENT = String.format( - "binance-spot/3.1.0 (Java/%s; %s; %s)", + "binance-spot/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponse.java index 97a7aa21..f6b018e9 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponse.java @@ -37,6 +37,30 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class OrderCancelReplaceResponse { + public static final String SERIALIZED_NAME_CANCEL_RESULT = "cancelResult"; + + @SerializedName(SERIALIZED_NAME_CANCEL_RESULT) + @jakarta.annotation.Nullable + private String cancelResult; + + public static final String SERIALIZED_NAME_NEW_ORDER_RESULT = "newOrderResult"; + + @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESULT) + @jakarta.annotation.Nullable + private String newOrderResult; + + public static final String SERIALIZED_NAME_CANCEL_RESPONSE = "cancelResponse"; + + @SerializedName(SERIALIZED_NAME_CANCEL_RESPONSE) + @jakarta.annotation.Nullable + private OrderCancelReplaceResponseCancelResponse cancelResponse; + + public static final String SERIALIZED_NAME_NEW_ORDER_RESPONSE = "newOrderResponse"; + + @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESPONSE) + @jakarta.annotation.Nullable + private OrderCancelReplaceResponseNewOrderResponse newOrderResponse; + public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) @@ -57,6 +81,92 @@ public class OrderCancelReplaceResponse { public OrderCancelReplaceResponse() {} + public OrderCancelReplaceResponse cancelResult( + @jakarta.annotation.Nullable String cancelResult) { + this.cancelResult = cancelResult; + return this; + } + + /** + * Get cancelResult + * + * @return cancelResult + */ + @jakarta.annotation.Nullable + public String getCancelResult() { + return cancelResult; + } + + public void setCancelResult(@jakarta.annotation.Nullable String cancelResult) { + this.cancelResult = cancelResult; + } + + public OrderCancelReplaceResponse newOrderResult( + @jakarta.annotation.Nullable String newOrderResult) { + this.newOrderResult = newOrderResult; + return this; + } + + /** + * Get newOrderResult + * + * @return newOrderResult + */ + @jakarta.annotation.Nullable + public String getNewOrderResult() { + return newOrderResult; + } + + public void setNewOrderResult(@jakarta.annotation.Nullable String newOrderResult) { + this.newOrderResult = newOrderResult; + } + + public OrderCancelReplaceResponse cancelResponse( + @jakarta.annotation.Nullable OrderCancelReplaceResponseCancelResponse cancelResponse) { + this.cancelResponse = cancelResponse; + return this; + } + + /** + * Get cancelResponse + * + * @return cancelResponse + */ + @jakarta.annotation.Nullable + @Valid + public OrderCancelReplaceResponseCancelResponse getCancelResponse() { + return cancelResponse; + } + + public void setCancelResponse( + @jakarta.annotation.Nullable OrderCancelReplaceResponseCancelResponse cancelResponse) { + this.cancelResponse = cancelResponse; + } + + public OrderCancelReplaceResponse newOrderResponse( + @jakarta.annotation.Nullable + OrderCancelReplaceResponseNewOrderResponse newOrderResponse) { + this.newOrderResponse = newOrderResponse; + return this; + } + + /** + * Get newOrderResponse + * + * @return newOrderResponse + */ + @jakarta.annotation.Nullable + @Valid + public OrderCancelReplaceResponseNewOrderResponse getNewOrderResponse() { + return newOrderResponse; + } + + public void setNewOrderResponse( + @jakarta.annotation.Nullable + OrderCancelReplaceResponseNewOrderResponse newOrderResponse) { + this.newOrderResponse = newOrderResponse; + } + public OrderCancelReplaceResponse code(@jakarta.annotation.Nullable Long code) { this.code = code; return this; @@ -125,20 +235,30 @@ public boolean equals(Object o) { return false; } OrderCancelReplaceResponse orderCancelReplaceResponse = (OrderCancelReplaceResponse) o; - return Objects.equals(this.code, orderCancelReplaceResponse.code) + return Objects.equals(this.cancelResult, orderCancelReplaceResponse.cancelResult) + && Objects.equals(this.newOrderResult, orderCancelReplaceResponse.newOrderResult) + && Objects.equals(this.cancelResponse, orderCancelReplaceResponse.cancelResponse) + && Objects.equals( + this.newOrderResponse, orderCancelReplaceResponse.newOrderResponse) + && Objects.equals(this.code, orderCancelReplaceResponse.code) && Objects.equals(this.msg, orderCancelReplaceResponse.msg) && Objects.equals(this.data, orderCancelReplaceResponse.data); } @Override public int hashCode() { - return Objects.hash(code, msg, data); + return Objects.hash( + cancelResult, newOrderResult, cancelResponse, newOrderResponse, code, msg, data); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrderCancelReplaceResponse {\n"); + sb.append(" cancelResult: ").append(toIndentedString(cancelResult)).append("\n"); + sb.append(" newOrderResult: ").append(toIndentedString(newOrderResult)).append("\n"); + sb.append(" cancelResponse: ").append(toIndentedString(cancelResponse)).append("\n"); + sb.append(" newOrderResponse: ").append(toIndentedString(newOrderResponse)).append("\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"); @@ -149,6 +269,22 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); + Object cancelResultValue = getCancelResult(); + String cancelResultValueAsString = ""; + cancelResultValueAsString = cancelResultValue.toString(); + sb.append("cancelResult=").append(urlEncode(cancelResultValueAsString)).append(""); + Object newOrderResultValue = getNewOrderResult(); + String newOrderResultValueAsString = ""; + newOrderResultValueAsString = newOrderResultValue.toString(); + sb.append("newOrderResult=").append(urlEncode(newOrderResultValueAsString)).append(""); + Object cancelResponseValue = getCancelResponse(); + String cancelResponseValueAsString = ""; + cancelResponseValueAsString = cancelResponseValue.toString(); + sb.append("cancelResponse=").append(urlEncode(cancelResponseValueAsString)).append(""); + Object newOrderResponseValue = getNewOrderResponse(); + String newOrderResponseValueAsString = ""; + newOrderResponseValueAsString = newOrderResponseValue.toString(); + sb.append("newOrderResponse=").append(urlEncode(newOrderResponseValueAsString)).append(""); Object codeValue = getCode(); String codeValueAsString = ""; codeValueAsString = codeValue.toString(); @@ -189,6 +325,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("cancelResult"); + openapiFields.add("newOrderResult"); + openapiFields.add("cancelResponse"); + openapiFields.add("newOrderResponse"); openapiFields.add("code"); openapiFields.add("msg"); openapiFields.add("data"); @@ -215,6 +355,33 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cancelResult") != null && !jsonObj.get("cancelResult").isJsonNull()) + && !jsonObj.get("cancelResult").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cancelResult` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("cancelResult").toString())); + } + if ((jsonObj.get("newOrderResult") != null && !jsonObj.get("newOrderResult").isJsonNull()) + && !jsonObj.get("newOrderResult").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newOrderResult` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newOrderResult").toString())); + } + // validate the optional field `cancelResponse` + if (jsonObj.get("cancelResponse") != null && !jsonObj.get("cancelResponse").isJsonNull()) { + OrderCancelReplaceResponseCancelResponse.validateJsonElement( + jsonObj.get("cancelResponse")); + } + // validate the optional field `newOrderResponse` + if (jsonObj.get("newOrderResponse") != null + && !jsonObj.get("newOrderResponse").isJsonNull()) { + OrderCancelReplaceResponseNewOrderResponse.validateJsonElement( + jsonObj.get("newOrderResponse")); + } if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseCancelResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseCancelResponse.java new file mode 100644 index 00000000..71a5598a --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseCancelResponse.java @@ -0,0 +1,858 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.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.*; + +/** OrderCancelReplaceResponseCancelResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderCancelReplaceResponseCancelResponse { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORIG_CLIENT_ORDER_ID = "origClientOrderId"; + + @SerializedName(SERIALIZED_NAME_ORIG_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String origClientOrderId; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public static final String SERIALIZED_NAME_TRANSACT_TIME = "transactTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACT_TIME) + @jakarta.annotation.Nullable + private Long transactTime; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QTY) + @jakarta.annotation.Nullable + private String origQty; + + public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; + + @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) + @jakarta.annotation.Nullable + private String executedQty; + + public static final String SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY = "origQuoteOrderQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY) + @jakarta.annotation.Nullable + private String origQuoteOrderQty; + + public static final String SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY = "cummulativeQuoteQty"; + + @SerializedName(SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY) + @jakarta.annotation.Nullable + private String cummulativeQuoteQty; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public OrderCancelReplaceResponseCancelResponse() {} + + public OrderCancelReplaceResponseCancelResponse symbol( + @jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public OrderCancelReplaceResponseCancelResponse origClientOrderId( + @jakarta.annotation.Nullable String origClientOrderId) { + this.origClientOrderId = origClientOrderId; + return this; + } + + /** + * Get origClientOrderId + * + * @return origClientOrderId + */ + @jakarta.annotation.Nullable + public String getOrigClientOrderId() { + return origClientOrderId; + } + + public void setOrigClientOrderId(@jakarta.annotation.Nullable String origClientOrderId) { + this.origClientOrderId = origClientOrderId; + } + + public OrderCancelReplaceResponseCancelResponse orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderCancelReplaceResponseCancelResponse orderListId( + @jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderCancelReplaceResponseCancelResponse clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public OrderCancelReplaceResponseCancelResponse transactTime( + @jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + return this; + } + + /** + * Get transactTime + * + * @return transactTime + */ + @jakarta.annotation.Nullable + public Long getTransactTime() { + return transactTime; + } + + public void setTransactTime(@jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + } + + public OrderCancelReplaceResponseCancelResponse 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 OrderCancelReplaceResponseCancelResponse origQty( + @jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + return this; + } + + /** + * Get origQty + * + * @return origQty + */ + @jakarta.annotation.Nullable + public String getOrigQty() { + return origQty; + } + + public void setOrigQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + } + + public OrderCancelReplaceResponseCancelResponse 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 OrderCancelReplaceResponseCancelResponse origQuoteOrderQty( + @jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + return this; + } + + /** + * Get origQuoteOrderQty + * + * @return origQuoteOrderQty + */ + @jakarta.annotation.Nullable + public String getOrigQuoteOrderQty() { + return origQuoteOrderQty; + } + + public void setOrigQuoteOrderQty(@jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + } + + public OrderCancelReplaceResponseCancelResponse cummulativeQuoteQty( + @jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + return this; + } + + /** + * Get cummulativeQuoteQty + * + * @return cummulativeQuoteQty + */ + @jakarta.annotation.Nullable + public String getCummulativeQuoteQty() { + return cummulativeQuoteQty; + } + + public void setCummulativeQuoteQty(@jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + } + + public OrderCancelReplaceResponseCancelResponse 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 OrderCancelReplaceResponseCancelResponse 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 OrderCancelReplaceResponseCancelResponse type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + public OrderCancelReplaceResponseCancelResponse side(@jakarta.annotation.Nullable String side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public String getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable String side) { + this.side = side; + } + + public OrderCancelReplaceResponseCancelResponse selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderCancelReplaceResponseCancelResponse orderCancelReplaceResponseCancelResponse = + (OrderCancelReplaceResponseCancelResponse) o; + return Objects.equals(this.symbol, orderCancelReplaceResponseCancelResponse.symbol) + && Objects.equals( + this.origClientOrderId, + orderCancelReplaceResponseCancelResponse.origClientOrderId) + && Objects.equals(this.orderId, orderCancelReplaceResponseCancelResponse.orderId) + && Objects.equals( + this.orderListId, orderCancelReplaceResponseCancelResponse.orderListId) + && Objects.equals( + this.clientOrderId, orderCancelReplaceResponseCancelResponse.clientOrderId) + && Objects.equals( + this.transactTime, orderCancelReplaceResponseCancelResponse.transactTime) + && Objects.equals(this.price, orderCancelReplaceResponseCancelResponse.price) + && Objects.equals(this.origQty, orderCancelReplaceResponseCancelResponse.origQty) + && Objects.equals( + this.executedQty, orderCancelReplaceResponseCancelResponse.executedQty) + && Objects.equals( + this.origQuoteOrderQty, + orderCancelReplaceResponseCancelResponse.origQuoteOrderQty) + && Objects.equals( + this.cummulativeQuoteQty, + orderCancelReplaceResponseCancelResponse.cummulativeQuoteQty) + && Objects.equals(this.status, orderCancelReplaceResponseCancelResponse.status) + && Objects.equals( + this.timeInForce, orderCancelReplaceResponseCancelResponse.timeInForce) + && Objects.equals(this.type, orderCancelReplaceResponseCancelResponse.type) + && Objects.equals(this.side, orderCancelReplaceResponseCancelResponse.side) + && Objects.equals( + this.selfTradePreventionMode, + orderCancelReplaceResponseCancelResponse.selfTradePreventionMode); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + origClientOrderId, + orderId, + orderListId, + clientOrderId, + transactTime, + price, + origQty, + executedQty, + origQuoteOrderQty, + cummulativeQuoteQty, + status, + timeInForce, + type, + side, + selfTradePreventionMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderCancelReplaceResponseCancelResponse {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" origClientOrderId: ").append(toIndentedString(origClientOrderId)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" transactTime: ").append(toIndentedString(transactTime)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); + sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); + sb.append(" origQuoteOrderQty: ").append(toIndentedString(origQuoteOrderQty)).append("\n"); + sb.append(" cummulativeQuoteQty: ") + .append(toIndentedString(cummulativeQuoteQty)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object origClientOrderIdValue = getOrigClientOrderId(); + String origClientOrderIdValueAsString = ""; + origClientOrderIdValueAsString = origClientOrderIdValue.toString(); + sb.append("origClientOrderId=") + .append(urlEncode(origClientOrderIdValueAsString)) + .append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object orderListIdValue = getOrderListId(); + String orderListIdValueAsString = ""; + orderListIdValueAsString = orderListIdValue.toString(); + sb.append("orderListId=").append(urlEncode(orderListIdValueAsString)).append(""); + Object clientOrderIdValue = getClientOrderId(); + String clientOrderIdValueAsString = ""; + clientOrderIdValueAsString = clientOrderIdValue.toString(); + sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + Object transactTimeValue = getTransactTime(); + String transactTimeValueAsString = ""; + transactTimeValueAsString = transactTimeValue.toString(); + sb.append("transactTime=").append(urlEncode(transactTimeValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object origQtyValue = getOrigQty(); + String origQtyValueAsString = ""; + origQtyValueAsString = origQtyValue.toString(); + sb.append("origQty=").append(urlEncode(origQtyValueAsString)).append(""); + Object executedQtyValue = getExecutedQty(); + String executedQtyValueAsString = ""; + executedQtyValueAsString = executedQtyValue.toString(); + sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); + Object origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + String origQuoteOrderQtyValueAsString = ""; + origQuoteOrderQtyValueAsString = origQuoteOrderQtyValue.toString(); + sb.append("origQuoteOrderQty=") + .append(urlEncode(origQuoteOrderQtyValueAsString)) + .append(""); + Object cummulativeQuoteQtyValue = getCummulativeQuoteQty(); + String cummulativeQuoteQtyValueAsString = ""; + cummulativeQuoteQtyValueAsString = cummulativeQuoteQtyValue.toString(); + sb.append("cummulativeQuoteQty=") + .append(urlEncode(cummulativeQuoteQtyValueAsString)) + .append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("origClientOrderId"); + openapiFields.add("orderId"); + openapiFields.add("orderListId"); + openapiFields.add("clientOrderId"); + openapiFields.add("transactTime"); + openapiFields.add("price"); + openapiFields.add("origQty"); + openapiFields.add("executedQty"); + openapiFields.add("origQuoteOrderQty"); + openapiFields.add("cummulativeQuoteQty"); + openapiFields.add("status"); + openapiFields.add("timeInForce"); + openapiFields.add("type"); + openapiFields.add("side"); + openapiFields.add("selfTradePreventionMode"); + + // 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 + * OrderCancelReplaceResponseCancelResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderCancelReplaceResponseCancelResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " OrderCancelReplaceResponseCancelResponse is not found in" + + " the empty JSON string", + OrderCancelReplaceResponseCancelResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("origClientOrderId") != null + && !jsonObj.get("origClientOrderId").isJsonNull()) + && !jsonObj.get("origClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origClientOrderId").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) + && !jsonObj.get("origQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("origQty").toString())); + } + if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) + && !jsonObj.get("executedQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executedQty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executedQty").toString())); + } + if ((jsonObj.get("origQuoteOrderQty") != null + && !jsonObj.get("origQuoteOrderQty").isJsonNull()) + && !jsonObj.get("origQuoteOrderQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQuoteOrderQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origQuoteOrderQty").toString())); + } + if ((jsonObj.get("cummulativeQuoteQty") != null + && !jsonObj.get("cummulativeQuoteQty").isJsonNull()) + && !jsonObj.get("cummulativeQuoteQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cummulativeQuoteQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("cummulativeQuoteQty").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderCancelReplaceResponseCancelResponse.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'OrderCancelReplaceResponseCancelResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderCancelReplaceResponseCancelResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, OrderCancelReplaceResponseCancelResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderCancelReplaceResponseCancelResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderCancelReplaceResponseCancelResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderCancelReplaceResponseCancelResponse + * @throws IOException if the JSON string is invalid with respect to + * OrderCancelReplaceResponseCancelResponse + */ + public static OrderCancelReplaceResponseCancelResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, OrderCancelReplaceResponseCancelResponse.class); + } + + /** + * Convert an instance of OrderCancelReplaceResponseCancelResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataCancelResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataCancelResponse.java index 9002c5e5..e0504e00 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataCancelResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataCancelResponse.java @@ -36,6 +36,18 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class OrderCancelReplaceResponseDataCancelResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Long code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; @SerializedName(SERIALIZED_NAME_SYMBOL) @@ -135,6 +147,46 @@ public class OrderCancelReplaceResponseDataCancelResponse { public OrderCancelReplaceResponseDataCancelResponse() {} + public OrderCancelReplaceResponseDataCancelResponse code( + @jakarta.annotation.Nullable Long code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public Long getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Long code) { + this.code = code; + } + + public OrderCancelReplaceResponseDataCancelResponse msg( + @jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + public OrderCancelReplaceResponseDataCancelResponse symbol( @jakarta.annotation.Nullable String symbol) { this.symbol = symbol; @@ -466,7 +518,9 @@ public boolean equals(Object o) { } OrderCancelReplaceResponseDataCancelResponse orderCancelReplaceResponseDataCancelResponse = (OrderCancelReplaceResponseDataCancelResponse) o; - return Objects.equals(this.symbol, orderCancelReplaceResponseDataCancelResponse.symbol) + return Objects.equals(this.code, orderCancelReplaceResponseDataCancelResponse.code) + && Objects.equals(this.msg, orderCancelReplaceResponseDataCancelResponse.msg) + && Objects.equals(this.symbol, orderCancelReplaceResponseDataCancelResponse.symbol) && Objects.equals( this.origClientOrderId, orderCancelReplaceResponseDataCancelResponse.origClientOrderId) @@ -504,6 +558,8 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + code, + msg, symbol, origClientOrderId, orderId, @@ -526,6 +582,8 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrderCancelReplaceResponseDataCancelResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" origClientOrderId: ").append(toIndentedString(origClientOrderId)).append("\n"); sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); @@ -553,6 +611,14 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); Object symbolValue = getSymbol(); String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); @@ -653,6 +719,8 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("msg"); openapiFields.add("symbol"); openapiFields.add("origClientOrderId"); openapiFields.add("orderId"); @@ -695,6 +763,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataNewOrderResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataNewOrderResponse.java index feaf2183..d1fbd400 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataNewOrderResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataNewOrderResponse.java @@ -48,6 +48,36 @@ public class OrderCancelReplaceResponseDataNewOrderResponse { @jakarta.annotation.Nullable private String msg; + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public static final String SERIALIZED_NAME_TRANSACT_TIME = "transactTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACT_TIME) + @jakarta.annotation.Nullable + private Long transactTime; + public OrderCancelReplaceResponseDataNewOrderResponse() {} public OrderCancelReplaceResponseDataNewOrderResponse code( @@ -90,6 +120,106 @@ public void setMsg(@jakarta.annotation.Nullable String msg) { this.msg = msg; } + public OrderCancelReplaceResponseDataNewOrderResponse symbol( + @jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public OrderCancelReplaceResponseDataNewOrderResponse orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderCancelReplaceResponseDataNewOrderResponse orderListId( + @jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderCancelReplaceResponseDataNewOrderResponse clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public OrderCancelReplaceResponseDataNewOrderResponse transactTime( + @jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + return this; + } + + /** + * Get transactTime + * + * @return transactTime + */ + @jakarta.annotation.Nullable + public Long getTransactTime() { + return transactTime; + } + + public void setTransactTime(@jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -102,12 +232,25 @@ public boolean equals(Object o) { orderCancelReplaceResponseDataNewOrderResponse = (OrderCancelReplaceResponseDataNewOrderResponse) o; return Objects.equals(this.code, orderCancelReplaceResponseDataNewOrderResponse.code) - && Objects.equals(this.msg, orderCancelReplaceResponseDataNewOrderResponse.msg); + && Objects.equals(this.msg, orderCancelReplaceResponseDataNewOrderResponse.msg) + && Objects.equals( + this.symbol, orderCancelReplaceResponseDataNewOrderResponse.symbol) + && Objects.equals( + this.orderId, orderCancelReplaceResponseDataNewOrderResponse.orderId) + && Objects.equals( + this.orderListId, + orderCancelReplaceResponseDataNewOrderResponse.orderListId) + && Objects.equals( + this.clientOrderId, + orderCancelReplaceResponseDataNewOrderResponse.clientOrderId) + && Objects.equals( + this.transactTime, + orderCancelReplaceResponseDataNewOrderResponse.transactTime); } @Override public int hashCode() { - return Objects.hash(code, msg); + return Objects.hash(code, msg, symbol, orderId, orderListId, clientOrderId, transactTime); } @Override @@ -116,6 +259,11 @@ public String toString() { sb.append("class OrderCancelReplaceResponseDataNewOrderResponse {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" transactTime: ").append(toIndentedString(transactTime)).append("\n"); sb.append("}"); return sb.toString(); } @@ -131,6 +279,26 @@ public String toUrlQueryString() { String msgValueAsString = ""; msgValueAsString = msgValue.toString(); sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object orderListIdValue = getOrderListId(); + String orderListIdValueAsString = ""; + orderListIdValueAsString = orderListIdValue.toString(); + sb.append("orderListId=").append(urlEncode(orderListIdValueAsString)).append(""); + Object clientOrderIdValue = getClientOrderId(); + String clientOrderIdValueAsString = ""; + clientOrderIdValueAsString = clientOrderIdValue.toString(); + sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + Object transactTimeValue = getTransactTime(); + String transactTimeValueAsString = ""; + transactTimeValueAsString = transactTimeValue.toString(); + sb.append("transactTime=").append(urlEncode(transactTimeValueAsString)).append(""); return sb.toString(); } @@ -161,6 +329,11 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("code"); openapiFields.add("msg"); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("orderListId"); + openapiFields.add("clientOrderId"); + openapiFields.add("transactTime"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -195,6 +368,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("msg").toString())); } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseNewOrderResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseNewOrderResponse.java new file mode 100644 index 00000000..79a14299 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseNewOrderResponse.java @@ -0,0 +1,909 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.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.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.*; + +/** OrderCancelReplaceResponseNewOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderCancelReplaceResponseNewOrderResponse { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public static final String SERIALIZED_NAME_TRANSACT_TIME = "transactTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACT_TIME) + @jakarta.annotation.Nullable + private Long transactTime; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QTY) + @jakarta.annotation.Nullable + private String origQty; + + public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; + + @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) + @jakarta.annotation.Nullable + private String executedQty; + + public static final String SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY = "origQuoteOrderQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY) + @jakarta.annotation.Nullable + private String origQuoteOrderQty; + + public static final String SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY = "cummulativeQuoteQty"; + + @SerializedName(SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY) + @jakarta.annotation.Nullable + private String cummulativeQuoteQty; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_WORKING_TIME = "workingTime"; + + @SerializedName(SERIALIZED_NAME_WORKING_TIME) + @jakarta.annotation.Nullable + private Long workingTime; + + public static final String SERIALIZED_NAME_FILLS = "fills"; + + @SerializedName(SERIALIZED_NAME_FILLS) + @jakarta.annotation.Nullable + private List fills; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public OrderCancelReplaceResponseNewOrderResponse() {} + + public OrderCancelReplaceResponseNewOrderResponse symbol( + @jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public OrderCancelReplaceResponseNewOrderResponse orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderCancelReplaceResponseNewOrderResponse orderListId( + @jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderCancelReplaceResponseNewOrderResponse clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public OrderCancelReplaceResponseNewOrderResponse transactTime( + @jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + return this; + } + + /** + * Get transactTime + * + * @return transactTime + */ + @jakarta.annotation.Nullable + public Long getTransactTime() { + return transactTime; + } + + public void setTransactTime(@jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + } + + public OrderCancelReplaceResponseNewOrderResponse 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 OrderCancelReplaceResponseNewOrderResponse origQty( + @jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + return this; + } + + /** + * Get origQty + * + * @return origQty + */ + @jakarta.annotation.Nullable + public String getOrigQty() { + return origQty; + } + + public void setOrigQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + } + + public OrderCancelReplaceResponseNewOrderResponse 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 OrderCancelReplaceResponseNewOrderResponse origQuoteOrderQty( + @jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + return this; + } + + /** + * Get origQuoteOrderQty + * + * @return origQuoteOrderQty + */ + @jakarta.annotation.Nullable + public String getOrigQuoteOrderQty() { + return origQuoteOrderQty; + } + + public void setOrigQuoteOrderQty(@jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + } + + public OrderCancelReplaceResponseNewOrderResponse cummulativeQuoteQty( + @jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + return this; + } + + /** + * Get cummulativeQuoteQty + * + * @return cummulativeQuoteQty + */ + @jakarta.annotation.Nullable + public String getCummulativeQuoteQty() { + return cummulativeQuoteQty; + } + + public void setCummulativeQuoteQty(@jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + } + + public OrderCancelReplaceResponseNewOrderResponse 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 OrderCancelReplaceResponseNewOrderResponse 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 OrderCancelReplaceResponseNewOrderResponse type( + @jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + public OrderCancelReplaceResponseNewOrderResponse side( + @jakarta.annotation.Nullable String side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public String getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable String side) { + this.side = side; + } + + public OrderCancelReplaceResponseNewOrderResponse workingTime( + @jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + return this; + } + + /** + * Get workingTime + * + * @return workingTime + */ + @jakarta.annotation.Nullable + public Long getWorkingTime() { + return workingTime; + } + + public void setWorkingTime(@jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + } + + public OrderCancelReplaceResponseNewOrderResponse fills( + @jakarta.annotation.Nullable List fills) { + this.fills = fills; + return this; + } + + public OrderCancelReplaceResponseNewOrderResponse addFillsItem(String fillsItem) { + if (this.fills == null) { + this.fills = new ArrayList<>(); + } + this.fills.add(fillsItem); + return this; + } + + /** + * Get fills + * + * @return fills + */ + @jakarta.annotation.Nullable + public List getFills() { + return fills; + } + + public void setFills(@jakarta.annotation.Nullable List fills) { + this.fills = fills; + } + + public OrderCancelReplaceResponseNewOrderResponse selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderCancelReplaceResponseNewOrderResponse orderCancelReplaceResponseNewOrderResponse = + (OrderCancelReplaceResponseNewOrderResponse) o; + return Objects.equals(this.symbol, orderCancelReplaceResponseNewOrderResponse.symbol) + && Objects.equals(this.orderId, orderCancelReplaceResponseNewOrderResponse.orderId) + && Objects.equals( + this.orderListId, orderCancelReplaceResponseNewOrderResponse.orderListId) + && Objects.equals( + this.clientOrderId, + orderCancelReplaceResponseNewOrderResponse.clientOrderId) + && Objects.equals( + this.transactTime, orderCancelReplaceResponseNewOrderResponse.transactTime) + && Objects.equals(this.price, orderCancelReplaceResponseNewOrderResponse.price) + && Objects.equals(this.origQty, orderCancelReplaceResponseNewOrderResponse.origQty) + && Objects.equals( + this.executedQty, orderCancelReplaceResponseNewOrderResponse.executedQty) + && Objects.equals( + this.origQuoteOrderQty, + orderCancelReplaceResponseNewOrderResponse.origQuoteOrderQty) + && Objects.equals( + this.cummulativeQuoteQty, + orderCancelReplaceResponseNewOrderResponse.cummulativeQuoteQty) + && Objects.equals(this.status, orderCancelReplaceResponseNewOrderResponse.status) + && Objects.equals( + this.timeInForce, orderCancelReplaceResponseNewOrderResponse.timeInForce) + && Objects.equals(this.type, orderCancelReplaceResponseNewOrderResponse.type) + && Objects.equals(this.side, orderCancelReplaceResponseNewOrderResponse.side) + && Objects.equals( + this.workingTime, orderCancelReplaceResponseNewOrderResponse.workingTime) + && Objects.equals(this.fills, orderCancelReplaceResponseNewOrderResponse.fills) + && Objects.equals( + this.selfTradePreventionMode, + orderCancelReplaceResponseNewOrderResponse.selfTradePreventionMode); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + orderId, + orderListId, + clientOrderId, + transactTime, + price, + origQty, + executedQty, + origQuoteOrderQty, + cummulativeQuoteQty, + status, + timeInForce, + type, + side, + workingTime, + fills, + selfTradePreventionMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderCancelReplaceResponseNewOrderResponse {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" transactTime: ").append(toIndentedString(transactTime)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); + sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); + sb.append(" origQuoteOrderQty: ").append(toIndentedString(origQuoteOrderQty)).append("\n"); + sb.append(" cummulativeQuoteQty: ") + .append(toIndentedString(cummulativeQuoteQty)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" workingTime: ").append(toIndentedString(workingTime)).append("\n"); + sb.append(" fills: ").append(toIndentedString(fills)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object orderListIdValue = getOrderListId(); + String orderListIdValueAsString = ""; + orderListIdValueAsString = orderListIdValue.toString(); + sb.append("orderListId=").append(urlEncode(orderListIdValueAsString)).append(""); + Object clientOrderIdValue = getClientOrderId(); + String clientOrderIdValueAsString = ""; + clientOrderIdValueAsString = clientOrderIdValue.toString(); + sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + Object transactTimeValue = getTransactTime(); + String transactTimeValueAsString = ""; + transactTimeValueAsString = transactTimeValue.toString(); + sb.append("transactTime=").append(urlEncode(transactTimeValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object origQtyValue = getOrigQty(); + String origQtyValueAsString = ""; + origQtyValueAsString = origQtyValue.toString(); + sb.append("origQty=").append(urlEncode(origQtyValueAsString)).append(""); + Object executedQtyValue = getExecutedQty(); + String executedQtyValueAsString = ""; + executedQtyValueAsString = executedQtyValue.toString(); + sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); + Object origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + String origQuoteOrderQtyValueAsString = ""; + origQuoteOrderQtyValueAsString = origQuoteOrderQtyValue.toString(); + sb.append("origQuoteOrderQty=") + .append(urlEncode(origQuoteOrderQtyValueAsString)) + .append(""); + Object cummulativeQuoteQtyValue = getCummulativeQuoteQty(); + String cummulativeQuoteQtyValueAsString = ""; + cummulativeQuoteQtyValueAsString = cummulativeQuoteQtyValue.toString(); + sb.append("cummulativeQuoteQty=") + .append(urlEncode(cummulativeQuoteQtyValueAsString)) + .append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object workingTimeValue = getWorkingTime(); + String workingTimeValueAsString = ""; + workingTimeValueAsString = workingTimeValue.toString(); + sb.append("workingTime=").append(urlEncode(workingTimeValueAsString)).append(""); + Object fillsValue = getFills(); + String fillsValueAsString = ""; + fillsValueAsString = + (String) + ((Collection) fillsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("fills=").append(urlEncode(fillsValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("orderListId"); + openapiFields.add("clientOrderId"); + openapiFields.add("transactTime"); + openapiFields.add("price"); + openapiFields.add("origQty"); + openapiFields.add("executedQty"); + openapiFields.add("origQuoteOrderQty"); + openapiFields.add("cummulativeQuoteQty"); + openapiFields.add("status"); + openapiFields.add("timeInForce"); + openapiFields.add("type"); + openapiFields.add("side"); + openapiFields.add("workingTime"); + openapiFields.add("fills"); + openapiFields.add("selfTradePreventionMode"); + + // 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 + * OrderCancelReplaceResponseNewOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderCancelReplaceResponseNewOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " OrderCancelReplaceResponseNewOrderResponse is not found in" + + " the empty JSON string", + OrderCancelReplaceResponseNewOrderResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) + && !jsonObj.get("origQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("origQty").toString())); + } + if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) + && !jsonObj.get("executedQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executedQty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executedQty").toString())); + } + if ((jsonObj.get("origQuoteOrderQty") != null + && !jsonObj.get("origQuoteOrderQty").isJsonNull()) + && !jsonObj.get("origQuoteOrderQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQuoteOrderQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origQuoteOrderQty").toString())); + } + if ((jsonObj.get("cummulativeQuoteQty") != null + && !jsonObj.get("cummulativeQuoteQty").isJsonNull()) + && !jsonObj.get("cummulativeQuoteQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cummulativeQuoteQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("cummulativeQuoteQty").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("fills") != null + && !jsonObj.get("fills").isJsonNull() + && !jsonObj.get("fills").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fills` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("fills").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderCancelReplaceResponseNewOrderResponse.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'OrderCancelReplaceResponseNewOrderResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderCancelReplaceResponseNewOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, OrderCancelReplaceResponseNewOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderCancelReplaceResponseNewOrderResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderCancelReplaceResponseNewOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderCancelReplaceResponseNewOrderResponse + * @throws IOException if the JSON string is invalid with respect to + * OrderCancelReplaceResponseNewOrderResponse + */ + public static OrderCancelReplaceResponseNewOrderResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, OrderCancelReplaceResponseNewOrderResponse.class); + } + + /** + * Convert an instance of OrderCancelReplaceResponseNewOrderResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse1.java index e8f78c3b..e353e2f6 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse1.java @@ -42,6 +42,66 @@ public class Ticker24hrResponse1 { @jakarta.annotation.Nullable private String symbol; + public static final String SERIALIZED_NAME_PRICE_CHANGE = "priceChange"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE) + @jakarta.annotation.Nullable + private String priceChange; + + public static final String SERIALIZED_NAME_PRICE_CHANGE_PERCENT = "priceChangePercent"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE_PERCENT) + @jakarta.annotation.Nullable + private String priceChangePercent; + + public static final String SERIALIZED_NAME_WEIGHTED_AVG_PRICE = "weightedAvgPrice"; + + @SerializedName(SERIALIZED_NAME_WEIGHTED_AVG_PRICE) + @jakarta.annotation.Nullable + private String weightedAvgPrice; + + public static final String SERIALIZED_NAME_PREV_CLOSE_PRICE = "prevClosePrice"; + + @SerializedName(SERIALIZED_NAME_PREV_CLOSE_PRICE) + @jakarta.annotation.Nullable + private String prevClosePrice; + + public static final String SERIALIZED_NAME_LAST_PRICE = "lastPrice"; + + @SerializedName(SERIALIZED_NAME_LAST_PRICE) + @jakarta.annotation.Nullable + private String lastPrice; + + public static final String SERIALIZED_NAME_LAST_QTY = "lastQty"; + + @SerializedName(SERIALIZED_NAME_LAST_QTY) + @jakarta.annotation.Nullable + private String lastQty; + + public static final String SERIALIZED_NAME_BID_PRICE = "bidPrice"; + + @SerializedName(SERIALIZED_NAME_BID_PRICE) + @jakarta.annotation.Nullable + private String bidPrice; + + public static final String SERIALIZED_NAME_BID_QTY = "bidQty"; + + @SerializedName(SERIALIZED_NAME_BID_QTY) + @jakarta.annotation.Nullable + private String bidQty; + + public static final String SERIALIZED_NAME_ASK_PRICE = "askPrice"; + + @SerializedName(SERIALIZED_NAME_ASK_PRICE) + @jakarta.annotation.Nullable + private String askPrice; + + public static final String SERIALIZED_NAME_ASK_QTY = "askQty"; + + @SerializedName(SERIALIZED_NAME_ASK_QTY) + @jakarta.annotation.Nullable + private String askQty; + public static final String SERIALIZED_NAME_OPEN_PRICE = "openPrice"; @SerializedName(SERIALIZED_NAME_OPEN_PRICE) @@ -60,12 +120,6 @@ public class Ticker24hrResponse1 { @jakarta.annotation.Nullable private String lowPrice; - public static final String SERIALIZED_NAME_LAST_PRICE = "lastPrice"; - - @SerializedName(SERIALIZED_NAME_LAST_PRICE) - @jakarta.annotation.Nullable - private String lastPrice; - public static final String SERIALIZED_NAME_VOLUME = "volume"; @SerializedName(SERIALIZED_NAME_VOLUME) @@ -129,6 +183,198 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } + public Ticker24hrResponse1 priceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + return this; + } + + /** + * Get priceChange + * + * @return priceChange + */ + @jakarta.annotation.Nullable + public String getPriceChange() { + return priceChange; + } + + public void setPriceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + } + + public Ticker24hrResponse1 priceChangePercent( + @jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + return this; + } + + /** + * Get priceChangePercent + * + * @return priceChangePercent + */ + @jakarta.annotation.Nullable + public String getPriceChangePercent() { + return priceChangePercent; + } + + public void setPriceChangePercent(@jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + } + + public Ticker24hrResponse1 weightedAvgPrice( + @jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + return this; + } + + /** + * Get weightedAvgPrice + * + * @return weightedAvgPrice + */ + @jakarta.annotation.Nullable + public String getWeightedAvgPrice() { + return weightedAvgPrice; + } + + public void setWeightedAvgPrice(@jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + } + + public Ticker24hrResponse1 prevClosePrice(@jakarta.annotation.Nullable String prevClosePrice) { + this.prevClosePrice = prevClosePrice; + return this; + } + + /** + * Get prevClosePrice + * + * @return prevClosePrice + */ + @jakarta.annotation.Nullable + public String getPrevClosePrice() { + return prevClosePrice; + } + + public void setPrevClosePrice(@jakarta.annotation.Nullable String prevClosePrice) { + this.prevClosePrice = prevClosePrice; + } + + public Ticker24hrResponse1 lastPrice(@jakarta.annotation.Nullable String lastPrice) { + this.lastPrice = lastPrice; + return this; + } + + /** + * Get lastPrice + * + * @return lastPrice + */ + @jakarta.annotation.Nullable + public String getLastPrice() { + return lastPrice; + } + + public void setLastPrice(@jakarta.annotation.Nullable String lastPrice) { + this.lastPrice = lastPrice; + } + + public Ticker24hrResponse1 lastQty(@jakarta.annotation.Nullable String lastQty) { + this.lastQty = lastQty; + return this; + } + + /** + * Get lastQty + * + * @return lastQty + */ + @jakarta.annotation.Nullable + public String getLastQty() { + return lastQty; + } + + public void setLastQty(@jakarta.annotation.Nullable String lastQty) { + this.lastQty = lastQty; + } + + public Ticker24hrResponse1 bidPrice(@jakarta.annotation.Nullable String bidPrice) { + this.bidPrice = bidPrice; + return this; + } + + /** + * Get bidPrice + * + * @return bidPrice + */ + @jakarta.annotation.Nullable + public String getBidPrice() { + return bidPrice; + } + + public void setBidPrice(@jakarta.annotation.Nullable String bidPrice) { + this.bidPrice = bidPrice; + } + + public Ticker24hrResponse1 bidQty(@jakarta.annotation.Nullable String bidQty) { + this.bidQty = bidQty; + return this; + } + + /** + * Get bidQty + * + * @return bidQty + */ + @jakarta.annotation.Nullable + public String getBidQty() { + return bidQty; + } + + public void setBidQty(@jakarta.annotation.Nullable String bidQty) { + this.bidQty = bidQty; + } + + public Ticker24hrResponse1 askPrice(@jakarta.annotation.Nullable String askPrice) { + this.askPrice = askPrice; + return this; + } + + /** + * Get askPrice + * + * @return askPrice + */ + @jakarta.annotation.Nullable + public String getAskPrice() { + return askPrice; + } + + public void setAskPrice(@jakarta.annotation.Nullable String askPrice) { + this.askPrice = askPrice; + } + + public Ticker24hrResponse1 askQty(@jakarta.annotation.Nullable String askQty) { + this.askQty = askQty; + return this; + } + + /** + * Get askQty + * + * @return askQty + */ + @jakarta.annotation.Nullable + public String getAskQty() { + return askQty; + } + + public void setAskQty(@jakarta.annotation.Nullable String askQty) { + this.askQty = askQty; + } + public Ticker24hrResponse1 openPrice(@jakarta.annotation.Nullable String openPrice) { this.openPrice = openPrice; return this; @@ -186,25 +432,6 @@ public void setLowPrice(@jakarta.annotation.Nullable String lowPrice) { this.lowPrice = lowPrice; } - public Ticker24hrResponse1 lastPrice(@jakarta.annotation.Nullable String lastPrice) { - this.lastPrice = lastPrice; - return this; - } - - /** - * Get lastPrice - * - * @return lastPrice - */ - @jakarta.annotation.Nullable - public String getLastPrice() { - return lastPrice; - } - - public void setLastPrice(@jakarta.annotation.Nullable String lastPrice) { - this.lastPrice = lastPrice; - } - public Ticker24hrResponse1 volume(@jakarta.annotation.Nullable String volume) { this.volume = volume; return this; @@ -348,10 +575,19 @@ public boolean equals(Object o) { } Ticker24hrResponse1 ticker24hrResponse1 = (Ticker24hrResponse1) o; return Objects.equals(this.symbol, ticker24hrResponse1.symbol) + && Objects.equals(this.priceChange, ticker24hrResponse1.priceChange) + && Objects.equals(this.priceChangePercent, ticker24hrResponse1.priceChangePercent) + && Objects.equals(this.weightedAvgPrice, ticker24hrResponse1.weightedAvgPrice) + && Objects.equals(this.prevClosePrice, ticker24hrResponse1.prevClosePrice) + && Objects.equals(this.lastPrice, ticker24hrResponse1.lastPrice) + && Objects.equals(this.lastQty, ticker24hrResponse1.lastQty) + && Objects.equals(this.bidPrice, ticker24hrResponse1.bidPrice) + && Objects.equals(this.bidQty, ticker24hrResponse1.bidQty) + && Objects.equals(this.askPrice, ticker24hrResponse1.askPrice) + && Objects.equals(this.askQty, ticker24hrResponse1.askQty) && Objects.equals(this.openPrice, ticker24hrResponse1.openPrice) && Objects.equals(this.highPrice, ticker24hrResponse1.highPrice) && Objects.equals(this.lowPrice, ticker24hrResponse1.lowPrice) - && Objects.equals(this.lastPrice, ticker24hrResponse1.lastPrice) && Objects.equals(this.volume, ticker24hrResponse1.volume) && Objects.equals(this.quoteVolume, ticker24hrResponse1.quoteVolume) && Objects.equals(this.openTime, ticker24hrResponse1.openTime) @@ -365,10 +601,19 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( symbol, + priceChange, + priceChangePercent, + weightedAvgPrice, + prevClosePrice, + lastPrice, + lastQty, + bidPrice, + bidQty, + askPrice, + askQty, openPrice, highPrice, lowPrice, - lastPrice, volume, quoteVolume, openTime, @@ -383,10 +628,21 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Ticker24hrResponse1 {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" priceChange: ").append(toIndentedString(priceChange)).append("\n"); + sb.append(" priceChangePercent: ") + .append(toIndentedString(priceChangePercent)) + .append("\n"); + sb.append(" weightedAvgPrice: ").append(toIndentedString(weightedAvgPrice)).append("\n"); + sb.append(" prevClosePrice: ").append(toIndentedString(prevClosePrice)).append("\n"); + sb.append(" lastPrice: ").append(toIndentedString(lastPrice)).append("\n"); + sb.append(" lastQty: ").append(toIndentedString(lastQty)).append("\n"); + sb.append(" bidPrice: ").append(toIndentedString(bidPrice)).append("\n"); + sb.append(" bidQty: ").append(toIndentedString(bidQty)).append("\n"); + sb.append(" askPrice: ").append(toIndentedString(askPrice)).append("\n"); + sb.append(" askQty: ").append(toIndentedString(askQty)).append("\n"); sb.append(" openPrice: ").append(toIndentedString(openPrice)).append("\n"); sb.append(" highPrice: ").append(toIndentedString(highPrice)).append("\n"); sb.append(" lowPrice: ").append(toIndentedString(lowPrice)).append("\n"); - sb.append(" lastPrice: ").append(toIndentedString(lastPrice)).append("\n"); sb.append(" volume: ").append(toIndentedString(volume)).append("\n"); sb.append(" quoteVolume: ").append(toIndentedString(quoteVolume)).append("\n"); sb.append(" openTime: ").append(toIndentedString(openTime)).append("\n"); @@ -405,6 +661,48 @@ public String toUrlQueryString() { String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object priceChangeValue = getPriceChange(); + String priceChangeValueAsString = ""; + priceChangeValueAsString = priceChangeValue.toString(); + sb.append("priceChange=").append(urlEncode(priceChangeValueAsString)).append(""); + Object priceChangePercentValue = getPriceChangePercent(); + String priceChangePercentValueAsString = ""; + priceChangePercentValueAsString = priceChangePercentValue.toString(); + sb.append("priceChangePercent=") + .append(urlEncode(priceChangePercentValueAsString)) + .append(""); + Object weightedAvgPriceValue = getWeightedAvgPrice(); + String weightedAvgPriceValueAsString = ""; + weightedAvgPriceValueAsString = weightedAvgPriceValue.toString(); + sb.append("weightedAvgPrice=").append(urlEncode(weightedAvgPriceValueAsString)).append(""); + Object prevClosePriceValue = getPrevClosePrice(); + String prevClosePriceValueAsString = ""; + prevClosePriceValueAsString = prevClosePriceValue.toString(); + sb.append("prevClosePrice=").append(urlEncode(prevClosePriceValueAsString)).append(""); + Object lastPriceValue = getLastPrice(); + String lastPriceValueAsString = ""; + lastPriceValueAsString = lastPriceValue.toString(); + sb.append("lastPrice=").append(urlEncode(lastPriceValueAsString)).append(""); + Object lastQtyValue = getLastQty(); + String lastQtyValueAsString = ""; + lastQtyValueAsString = lastQtyValue.toString(); + sb.append("lastQty=").append(urlEncode(lastQtyValueAsString)).append(""); + Object bidPriceValue = getBidPrice(); + String bidPriceValueAsString = ""; + bidPriceValueAsString = bidPriceValue.toString(); + sb.append("bidPrice=").append(urlEncode(bidPriceValueAsString)).append(""); + Object bidQtyValue = getBidQty(); + String bidQtyValueAsString = ""; + bidQtyValueAsString = bidQtyValue.toString(); + sb.append("bidQty=").append(urlEncode(bidQtyValueAsString)).append(""); + Object askPriceValue = getAskPrice(); + String askPriceValueAsString = ""; + askPriceValueAsString = askPriceValue.toString(); + sb.append("askPrice=").append(urlEncode(askPriceValueAsString)).append(""); + Object askQtyValue = getAskQty(); + String askQtyValueAsString = ""; + askQtyValueAsString = askQtyValue.toString(); + sb.append("askQty=").append(urlEncode(askQtyValueAsString)).append(""); Object openPriceValue = getOpenPrice(); String openPriceValueAsString = ""; openPriceValueAsString = openPriceValue.toString(); @@ -417,10 +715,6 @@ public String toUrlQueryString() { String lowPriceValueAsString = ""; lowPriceValueAsString = lowPriceValue.toString(); sb.append("lowPrice=").append(urlEncode(lowPriceValueAsString)).append(""); - Object lastPriceValue = getLastPrice(); - String lastPriceValueAsString = ""; - lastPriceValueAsString = lastPriceValue.toString(); - sb.append("lastPrice=").append(urlEncode(lastPriceValueAsString)).append(""); Object volumeValue = getVolume(); String volumeValueAsString = ""; volumeValueAsString = volumeValue.toString(); @@ -478,10 +772,19 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("symbol"); + openapiFields.add("priceChange"); + openapiFields.add("priceChangePercent"); + openapiFields.add("weightedAvgPrice"); + openapiFields.add("prevClosePrice"); + openapiFields.add("lastPrice"); + openapiFields.add("lastQty"); + openapiFields.add("bidPrice"); + openapiFields.add("bidQty"); + openapiFields.add("askPrice"); + openapiFields.add("askQty"); openapiFields.add("openPrice"); openapiFields.add("highPrice"); openapiFields.add("lowPrice"); - openapiFields.add("lastPrice"); openapiFields.add("volume"); openapiFields.add("quoteVolume"); openapiFields.add("openTime"); @@ -520,6 +823,88 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + if ((jsonObj.get("priceChange") != null && !jsonObj.get("priceChange").isJsonNull()) + && !jsonObj.get("priceChange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChange` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceChange").toString())); + } + if ((jsonObj.get("priceChangePercent") != null + && !jsonObj.get("priceChangePercent").isJsonNull()) + && !jsonObj.get("priceChangePercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChangePercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("priceChangePercent").toString())); + } + if ((jsonObj.get("weightedAvgPrice") != null + && !jsonObj.get("weightedAvgPrice").isJsonNull()) + && !jsonObj.get("weightedAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `weightedAvgPrice` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("weightedAvgPrice").toString())); + } + if ((jsonObj.get("prevClosePrice") != null && !jsonObj.get("prevClosePrice").isJsonNull()) + && !jsonObj.get("prevClosePrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `prevClosePrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("prevClosePrice").toString())); + } + if ((jsonObj.get("lastPrice") != null && !jsonObj.get("lastPrice").isJsonNull()) + && !jsonObj.get("lastPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `lastPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("lastPrice").toString())); + } + if ((jsonObj.get("lastQty") != null && !jsonObj.get("lastQty").isJsonNull()) + && !jsonObj.get("lastQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `lastQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("lastQty").toString())); + } + if ((jsonObj.get("bidPrice") != null && !jsonObj.get("bidPrice").isJsonNull()) + && !jsonObj.get("bidPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("bidPrice").toString())); + } + if ((jsonObj.get("bidQty") != null && !jsonObj.get("bidQty").isJsonNull()) + && !jsonObj.get("bidQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("bidQty").toString())); + } + if ((jsonObj.get("askPrice") != null && !jsonObj.get("askPrice").isJsonNull()) + && !jsonObj.get("askPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("askPrice").toString())); + } + if ((jsonObj.get("askQty") != null && !jsonObj.get("askQty").isJsonNull()) + && !jsonObj.get("askQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("askQty").toString())); + } if ((jsonObj.get("openPrice") != null && !jsonObj.get("openPrice").isJsonNull()) && !jsonObj.get("openPrice").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -544,14 +929,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("lowPrice").toString())); } - if ((jsonObj.get("lastPrice") != null && !jsonObj.get("lastPrice").isJsonNull()) - && !jsonObj.get("lastPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `lastPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("lastPrice").toString())); - } if ((jsonObj.get("volume") != null && !jsonObj.get("volume").isJsonNull()) && !jsonObj.get("volume").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2Inner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2Inner.java index c418e1d8..9ba378af 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2Inner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2Inner.java @@ -42,6 +42,66 @@ public class Ticker24hrResponse2Inner { @jakarta.annotation.Nullable private String symbol; + public static final String SERIALIZED_NAME_PRICE_CHANGE = "priceChange"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE) + @jakarta.annotation.Nullable + private String priceChange; + + public static final String SERIALIZED_NAME_PRICE_CHANGE_PERCENT = "priceChangePercent"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE_PERCENT) + @jakarta.annotation.Nullable + private String priceChangePercent; + + public static final String SERIALIZED_NAME_WEIGHTED_AVG_PRICE = "weightedAvgPrice"; + + @SerializedName(SERIALIZED_NAME_WEIGHTED_AVG_PRICE) + @jakarta.annotation.Nullable + private String weightedAvgPrice; + + public static final String SERIALIZED_NAME_PREV_CLOSE_PRICE = "prevClosePrice"; + + @SerializedName(SERIALIZED_NAME_PREV_CLOSE_PRICE) + @jakarta.annotation.Nullable + private String prevClosePrice; + + public static final String SERIALIZED_NAME_LAST_PRICE = "lastPrice"; + + @SerializedName(SERIALIZED_NAME_LAST_PRICE) + @jakarta.annotation.Nullable + private String lastPrice; + + public static final String SERIALIZED_NAME_LAST_QTY = "lastQty"; + + @SerializedName(SERIALIZED_NAME_LAST_QTY) + @jakarta.annotation.Nullable + private String lastQty; + + public static final String SERIALIZED_NAME_BID_PRICE = "bidPrice"; + + @SerializedName(SERIALIZED_NAME_BID_PRICE) + @jakarta.annotation.Nullable + private String bidPrice; + + public static final String SERIALIZED_NAME_BID_QTY = "bidQty"; + + @SerializedName(SERIALIZED_NAME_BID_QTY) + @jakarta.annotation.Nullable + private String bidQty; + + public static final String SERIALIZED_NAME_ASK_PRICE = "askPrice"; + + @SerializedName(SERIALIZED_NAME_ASK_PRICE) + @jakarta.annotation.Nullable + private String askPrice; + + public static final String SERIALIZED_NAME_ASK_QTY = "askQty"; + + @SerializedName(SERIALIZED_NAME_ASK_QTY) + @jakarta.annotation.Nullable + private String askQty; + public static final String SERIALIZED_NAME_OPEN_PRICE = "openPrice"; @SerializedName(SERIALIZED_NAME_OPEN_PRICE) @@ -60,12 +120,6 @@ public class Ticker24hrResponse2Inner { @jakarta.annotation.Nullable private String lowPrice; - public static final String SERIALIZED_NAME_LAST_PRICE = "lastPrice"; - - @SerializedName(SERIALIZED_NAME_LAST_PRICE) - @jakarta.annotation.Nullable - private String lastPrice; - public static final String SERIALIZED_NAME_VOLUME = "volume"; @SerializedName(SERIALIZED_NAME_VOLUME) @@ -129,6 +183,199 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } + public Ticker24hrResponse2Inner priceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + return this; + } + + /** + * Get priceChange + * + * @return priceChange + */ + @jakarta.annotation.Nullable + public String getPriceChange() { + return priceChange; + } + + public void setPriceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + } + + public Ticker24hrResponse2Inner priceChangePercent( + @jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + return this; + } + + /** + * Get priceChangePercent + * + * @return priceChangePercent + */ + @jakarta.annotation.Nullable + public String getPriceChangePercent() { + return priceChangePercent; + } + + public void setPriceChangePercent(@jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + } + + public Ticker24hrResponse2Inner weightedAvgPrice( + @jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + return this; + } + + /** + * Get weightedAvgPrice + * + * @return weightedAvgPrice + */ + @jakarta.annotation.Nullable + public String getWeightedAvgPrice() { + return weightedAvgPrice; + } + + public void setWeightedAvgPrice(@jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + } + + public Ticker24hrResponse2Inner prevClosePrice( + @jakarta.annotation.Nullable String prevClosePrice) { + this.prevClosePrice = prevClosePrice; + return this; + } + + /** + * Get prevClosePrice + * + * @return prevClosePrice + */ + @jakarta.annotation.Nullable + public String getPrevClosePrice() { + return prevClosePrice; + } + + public void setPrevClosePrice(@jakarta.annotation.Nullable String prevClosePrice) { + this.prevClosePrice = prevClosePrice; + } + + public Ticker24hrResponse2Inner lastPrice(@jakarta.annotation.Nullable String lastPrice) { + this.lastPrice = lastPrice; + return this; + } + + /** + * Get lastPrice + * + * @return lastPrice + */ + @jakarta.annotation.Nullable + public String getLastPrice() { + return lastPrice; + } + + public void setLastPrice(@jakarta.annotation.Nullable String lastPrice) { + this.lastPrice = lastPrice; + } + + public Ticker24hrResponse2Inner lastQty(@jakarta.annotation.Nullable String lastQty) { + this.lastQty = lastQty; + return this; + } + + /** + * Get lastQty + * + * @return lastQty + */ + @jakarta.annotation.Nullable + public String getLastQty() { + return lastQty; + } + + public void setLastQty(@jakarta.annotation.Nullable String lastQty) { + this.lastQty = lastQty; + } + + public Ticker24hrResponse2Inner bidPrice(@jakarta.annotation.Nullable String bidPrice) { + this.bidPrice = bidPrice; + return this; + } + + /** + * Get bidPrice + * + * @return bidPrice + */ + @jakarta.annotation.Nullable + public String getBidPrice() { + return bidPrice; + } + + public void setBidPrice(@jakarta.annotation.Nullable String bidPrice) { + this.bidPrice = bidPrice; + } + + public Ticker24hrResponse2Inner bidQty(@jakarta.annotation.Nullable String bidQty) { + this.bidQty = bidQty; + return this; + } + + /** + * Get bidQty + * + * @return bidQty + */ + @jakarta.annotation.Nullable + public String getBidQty() { + return bidQty; + } + + public void setBidQty(@jakarta.annotation.Nullable String bidQty) { + this.bidQty = bidQty; + } + + public Ticker24hrResponse2Inner askPrice(@jakarta.annotation.Nullable String askPrice) { + this.askPrice = askPrice; + return this; + } + + /** + * Get askPrice + * + * @return askPrice + */ + @jakarta.annotation.Nullable + public String getAskPrice() { + return askPrice; + } + + public void setAskPrice(@jakarta.annotation.Nullable String askPrice) { + this.askPrice = askPrice; + } + + public Ticker24hrResponse2Inner askQty(@jakarta.annotation.Nullable String askQty) { + this.askQty = askQty; + return this; + } + + /** + * Get askQty + * + * @return askQty + */ + @jakarta.annotation.Nullable + public String getAskQty() { + return askQty; + } + + public void setAskQty(@jakarta.annotation.Nullable String askQty) { + this.askQty = askQty; + } + public Ticker24hrResponse2Inner openPrice(@jakarta.annotation.Nullable String openPrice) { this.openPrice = openPrice; return this; @@ -186,25 +433,6 @@ public void setLowPrice(@jakarta.annotation.Nullable String lowPrice) { this.lowPrice = lowPrice; } - public Ticker24hrResponse2Inner lastPrice(@jakarta.annotation.Nullable String lastPrice) { - this.lastPrice = lastPrice; - return this; - } - - /** - * Get lastPrice - * - * @return lastPrice - */ - @jakarta.annotation.Nullable - public String getLastPrice() { - return lastPrice; - } - - public void setLastPrice(@jakarta.annotation.Nullable String lastPrice) { - this.lastPrice = lastPrice; - } - public Ticker24hrResponse2Inner volume(@jakarta.annotation.Nullable String volume) { this.volume = volume; return this; @@ -348,10 +576,20 @@ public boolean equals(Object o) { } Ticker24hrResponse2Inner ticker24hrResponse2Inner = (Ticker24hrResponse2Inner) o; return Objects.equals(this.symbol, ticker24hrResponse2Inner.symbol) + && Objects.equals(this.priceChange, ticker24hrResponse2Inner.priceChange) + && Objects.equals( + this.priceChangePercent, ticker24hrResponse2Inner.priceChangePercent) + && Objects.equals(this.weightedAvgPrice, ticker24hrResponse2Inner.weightedAvgPrice) + && Objects.equals(this.prevClosePrice, ticker24hrResponse2Inner.prevClosePrice) + && Objects.equals(this.lastPrice, ticker24hrResponse2Inner.lastPrice) + && Objects.equals(this.lastQty, ticker24hrResponse2Inner.lastQty) + && Objects.equals(this.bidPrice, ticker24hrResponse2Inner.bidPrice) + && Objects.equals(this.bidQty, ticker24hrResponse2Inner.bidQty) + && Objects.equals(this.askPrice, ticker24hrResponse2Inner.askPrice) + && Objects.equals(this.askQty, ticker24hrResponse2Inner.askQty) && Objects.equals(this.openPrice, ticker24hrResponse2Inner.openPrice) && Objects.equals(this.highPrice, ticker24hrResponse2Inner.highPrice) && Objects.equals(this.lowPrice, ticker24hrResponse2Inner.lowPrice) - && Objects.equals(this.lastPrice, ticker24hrResponse2Inner.lastPrice) && Objects.equals(this.volume, ticker24hrResponse2Inner.volume) && Objects.equals(this.quoteVolume, ticker24hrResponse2Inner.quoteVolume) && Objects.equals(this.openTime, ticker24hrResponse2Inner.openTime) @@ -365,10 +603,19 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( symbol, + priceChange, + priceChangePercent, + weightedAvgPrice, + prevClosePrice, + lastPrice, + lastQty, + bidPrice, + bidQty, + askPrice, + askQty, openPrice, highPrice, lowPrice, - lastPrice, volume, quoteVolume, openTime, @@ -383,10 +630,21 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Ticker24hrResponse2Inner {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" priceChange: ").append(toIndentedString(priceChange)).append("\n"); + sb.append(" priceChangePercent: ") + .append(toIndentedString(priceChangePercent)) + .append("\n"); + sb.append(" weightedAvgPrice: ").append(toIndentedString(weightedAvgPrice)).append("\n"); + sb.append(" prevClosePrice: ").append(toIndentedString(prevClosePrice)).append("\n"); + sb.append(" lastPrice: ").append(toIndentedString(lastPrice)).append("\n"); + sb.append(" lastQty: ").append(toIndentedString(lastQty)).append("\n"); + sb.append(" bidPrice: ").append(toIndentedString(bidPrice)).append("\n"); + sb.append(" bidQty: ").append(toIndentedString(bidQty)).append("\n"); + sb.append(" askPrice: ").append(toIndentedString(askPrice)).append("\n"); + sb.append(" askQty: ").append(toIndentedString(askQty)).append("\n"); sb.append(" openPrice: ").append(toIndentedString(openPrice)).append("\n"); sb.append(" highPrice: ").append(toIndentedString(highPrice)).append("\n"); sb.append(" lowPrice: ").append(toIndentedString(lowPrice)).append("\n"); - sb.append(" lastPrice: ").append(toIndentedString(lastPrice)).append("\n"); sb.append(" volume: ").append(toIndentedString(volume)).append("\n"); sb.append(" quoteVolume: ").append(toIndentedString(quoteVolume)).append("\n"); sb.append(" openTime: ").append(toIndentedString(openTime)).append("\n"); @@ -405,6 +663,48 @@ public String toUrlQueryString() { String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object priceChangeValue = getPriceChange(); + String priceChangeValueAsString = ""; + priceChangeValueAsString = priceChangeValue.toString(); + sb.append("priceChange=").append(urlEncode(priceChangeValueAsString)).append(""); + Object priceChangePercentValue = getPriceChangePercent(); + String priceChangePercentValueAsString = ""; + priceChangePercentValueAsString = priceChangePercentValue.toString(); + sb.append("priceChangePercent=") + .append(urlEncode(priceChangePercentValueAsString)) + .append(""); + Object weightedAvgPriceValue = getWeightedAvgPrice(); + String weightedAvgPriceValueAsString = ""; + weightedAvgPriceValueAsString = weightedAvgPriceValue.toString(); + sb.append("weightedAvgPrice=").append(urlEncode(weightedAvgPriceValueAsString)).append(""); + Object prevClosePriceValue = getPrevClosePrice(); + String prevClosePriceValueAsString = ""; + prevClosePriceValueAsString = prevClosePriceValue.toString(); + sb.append("prevClosePrice=").append(urlEncode(prevClosePriceValueAsString)).append(""); + Object lastPriceValue = getLastPrice(); + String lastPriceValueAsString = ""; + lastPriceValueAsString = lastPriceValue.toString(); + sb.append("lastPrice=").append(urlEncode(lastPriceValueAsString)).append(""); + Object lastQtyValue = getLastQty(); + String lastQtyValueAsString = ""; + lastQtyValueAsString = lastQtyValue.toString(); + sb.append("lastQty=").append(urlEncode(lastQtyValueAsString)).append(""); + Object bidPriceValue = getBidPrice(); + String bidPriceValueAsString = ""; + bidPriceValueAsString = bidPriceValue.toString(); + sb.append("bidPrice=").append(urlEncode(bidPriceValueAsString)).append(""); + Object bidQtyValue = getBidQty(); + String bidQtyValueAsString = ""; + bidQtyValueAsString = bidQtyValue.toString(); + sb.append("bidQty=").append(urlEncode(bidQtyValueAsString)).append(""); + Object askPriceValue = getAskPrice(); + String askPriceValueAsString = ""; + askPriceValueAsString = askPriceValue.toString(); + sb.append("askPrice=").append(urlEncode(askPriceValueAsString)).append(""); + Object askQtyValue = getAskQty(); + String askQtyValueAsString = ""; + askQtyValueAsString = askQtyValue.toString(); + sb.append("askQty=").append(urlEncode(askQtyValueAsString)).append(""); Object openPriceValue = getOpenPrice(); String openPriceValueAsString = ""; openPriceValueAsString = openPriceValue.toString(); @@ -417,10 +717,6 @@ public String toUrlQueryString() { String lowPriceValueAsString = ""; lowPriceValueAsString = lowPriceValue.toString(); sb.append("lowPrice=").append(urlEncode(lowPriceValueAsString)).append(""); - Object lastPriceValue = getLastPrice(); - String lastPriceValueAsString = ""; - lastPriceValueAsString = lastPriceValue.toString(); - sb.append("lastPrice=").append(urlEncode(lastPriceValueAsString)).append(""); Object volumeValue = getVolume(); String volumeValueAsString = ""; volumeValueAsString = volumeValue.toString(); @@ -478,10 +774,19 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("symbol"); + openapiFields.add("priceChange"); + openapiFields.add("priceChangePercent"); + openapiFields.add("weightedAvgPrice"); + openapiFields.add("prevClosePrice"); + openapiFields.add("lastPrice"); + openapiFields.add("lastQty"); + openapiFields.add("bidPrice"); + openapiFields.add("bidQty"); + openapiFields.add("askPrice"); + openapiFields.add("askQty"); openapiFields.add("openPrice"); openapiFields.add("highPrice"); openapiFields.add("lowPrice"); - openapiFields.add("lastPrice"); openapiFields.add("volume"); openapiFields.add("quoteVolume"); openapiFields.add("openTime"); @@ -520,6 +825,88 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + if ((jsonObj.get("priceChange") != null && !jsonObj.get("priceChange").isJsonNull()) + && !jsonObj.get("priceChange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChange` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceChange").toString())); + } + if ((jsonObj.get("priceChangePercent") != null + && !jsonObj.get("priceChangePercent").isJsonNull()) + && !jsonObj.get("priceChangePercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChangePercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("priceChangePercent").toString())); + } + if ((jsonObj.get("weightedAvgPrice") != null + && !jsonObj.get("weightedAvgPrice").isJsonNull()) + && !jsonObj.get("weightedAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `weightedAvgPrice` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("weightedAvgPrice").toString())); + } + if ((jsonObj.get("prevClosePrice") != null && !jsonObj.get("prevClosePrice").isJsonNull()) + && !jsonObj.get("prevClosePrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `prevClosePrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("prevClosePrice").toString())); + } + if ((jsonObj.get("lastPrice") != null && !jsonObj.get("lastPrice").isJsonNull()) + && !jsonObj.get("lastPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `lastPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("lastPrice").toString())); + } + if ((jsonObj.get("lastQty") != null && !jsonObj.get("lastQty").isJsonNull()) + && !jsonObj.get("lastQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `lastQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("lastQty").toString())); + } + if ((jsonObj.get("bidPrice") != null && !jsonObj.get("bidPrice").isJsonNull()) + && !jsonObj.get("bidPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("bidPrice").toString())); + } + if ((jsonObj.get("bidQty") != null && !jsonObj.get("bidQty").isJsonNull()) + && !jsonObj.get("bidQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("bidQty").toString())); + } + if ((jsonObj.get("askPrice") != null && !jsonObj.get("askPrice").isJsonNull()) + && !jsonObj.get("askPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("askPrice").toString())); + } + if ((jsonObj.get("askQty") != null && !jsonObj.get("askQty").isJsonNull()) + && !jsonObj.get("askQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("askQty").toString())); + } if ((jsonObj.get("openPrice") != null && !jsonObj.get("openPrice").isJsonNull()) && !jsonObj.get("openPrice").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -544,14 +931,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("lowPrice").toString())); } - if ((jsonObj.get("lastPrice") != null && !jsonObj.get("lastPrice").isJsonNull()) - && !jsonObj.get("lastPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `lastPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("lastPrice").toString())); - } if ((jsonObj.get("volume") != null && !jsonObj.get("volume").isJsonNull()) && !jsonObj.get("volume").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse1.java index 3f9322bf..8a624c09 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse1.java @@ -42,6 +42,24 @@ public class TickerResponse1 { @jakarta.annotation.Nullable private String symbol; + public static final String SERIALIZED_NAME_PRICE_CHANGE = "priceChange"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE) + @jakarta.annotation.Nullable + private String priceChange; + + public static final String SERIALIZED_NAME_PRICE_CHANGE_PERCENT = "priceChangePercent"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE_PERCENT) + @jakarta.annotation.Nullable + private String priceChangePercent; + + public static final String SERIALIZED_NAME_WEIGHTED_AVG_PRICE = "weightedAvgPrice"; + + @SerializedName(SERIALIZED_NAME_WEIGHTED_AVG_PRICE) + @jakarta.annotation.Nullable + private String weightedAvgPrice; + public static final String SERIALIZED_NAME_OPEN_PRICE = "openPrice"; @SerializedName(SERIALIZED_NAME_OPEN_PRICE) @@ -129,6 +147,64 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } + public TickerResponse1 priceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + return this; + } + + /** + * Get priceChange + * + * @return priceChange + */ + @jakarta.annotation.Nullable + public String getPriceChange() { + return priceChange; + } + + public void setPriceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + } + + public TickerResponse1 priceChangePercent( + @jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + return this; + } + + /** + * Get priceChangePercent + * + * @return priceChangePercent + */ + @jakarta.annotation.Nullable + public String getPriceChangePercent() { + return priceChangePercent; + } + + public void setPriceChangePercent(@jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + } + + public TickerResponse1 weightedAvgPrice(@jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + return this; + } + + /** + * Get weightedAvgPrice + * + * @return weightedAvgPrice + */ + @jakarta.annotation.Nullable + public String getWeightedAvgPrice() { + return weightedAvgPrice; + } + + public void setWeightedAvgPrice(@jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + } + public TickerResponse1 openPrice(@jakarta.annotation.Nullable String openPrice) { this.openPrice = openPrice; return this; @@ -348,6 +424,9 @@ public boolean equals(Object o) { } TickerResponse1 tickerResponse1 = (TickerResponse1) o; return Objects.equals(this.symbol, tickerResponse1.symbol) + && Objects.equals(this.priceChange, tickerResponse1.priceChange) + && Objects.equals(this.priceChangePercent, tickerResponse1.priceChangePercent) + && Objects.equals(this.weightedAvgPrice, tickerResponse1.weightedAvgPrice) && Objects.equals(this.openPrice, tickerResponse1.openPrice) && Objects.equals(this.highPrice, tickerResponse1.highPrice) && Objects.equals(this.lowPrice, tickerResponse1.lowPrice) @@ -365,6 +444,9 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( symbol, + priceChange, + priceChangePercent, + weightedAvgPrice, openPrice, highPrice, lowPrice, @@ -383,6 +465,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TickerResponse1 {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" priceChange: ").append(toIndentedString(priceChange)).append("\n"); + sb.append(" priceChangePercent: ") + .append(toIndentedString(priceChangePercent)) + .append("\n"); + sb.append(" weightedAvgPrice: ").append(toIndentedString(weightedAvgPrice)).append("\n"); sb.append(" openPrice: ").append(toIndentedString(openPrice)).append("\n"); sb.append(" highPrice: ").append(toIndentedString(highPrice)).append("\n"); sb.append(" lowPrice: ").append(toIndentedString(lowPrice)).append("\n"); @@ -405,6 +492,20 @@ public String toUrlQueryString() { String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object priceChangeValue = getPriceChange(); + String priceChangeValueAsString = ""; + priceChangeValueAsString = priceChangeValue.toString(); + sb.append("priceChange=").append(urlEncode(priceChangeValueAsString)).append(""); + Object priceChangePercentValue = getPriceChangePercent(); + String priceChangePercentValueAsString = ""; + priceChangePercentValueAsString = priceChangePercentValue.toString(); + sb.append("priceChangePercent=") + .append(urlEncode(priceChangePercentValueAsString)) + .append(""); + Object weightedAvgPriceValue = getWeightedAvgPrice(); + String weightedAvgPriceValueAsString = ""; + weightedAvgPriceValueAsString = weightedAvgPriceValue.toString(); + sb.append("weightedAvgPrice=").append(urlEncode(weightedAvgPriceValueAsString)).append(""); Object openPriceValue = getOpenPrice(); String openPriceValueAsString = ""; openPriceValueAsString = openPriceValue.toString(); @@ -478,6 +579,9 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("symbol"); + openapiFields.add("priceChange"); + openapiFields.add("priceChangePercent"); + openapiFields.add("weightedAvgPrice"); openapiFields.add("openPrice"); openapiFields.add("highPrice"); openapiFields.add("lowPrice"); @@ -520,6 +624,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + if ((jsonObj.get("priceChange") != null && !jsonObj.get("priceChange").isJsonNull()) + && !jsonObj.get("priceChange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChange` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceChange").toString())); + } + if ((jsonObj.get("priceChangePercent") != null + && !jsonObj.get("priceChangePercent").isJsonNull()) + && !jsonObj.get("priceChangePercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChangePercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("priceChangePercent").toString())); + } + if ((jsonObj.get("weightedAvgPrice") != null + && !jsonObj.get("weightedAvgPrice").isJsonNull()) + && !jsonObj.get("weightedAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `weightedAvgPrice` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("weightedAvgPrice").toString())); + } if ((jsonObj.get("openPrice") != null && !jsonObj.get("openPrice").isJsonNull()) && !jsonObj.get("openPrice").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2Inner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2Inner.java index 79c5a2f3..c1238d98 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2Inner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2Inner.java @@ -42,6 +42,24 @@ public class TickerResponse2Inner { @jakarta.annotation.Nullable private String symbol; + public static final String SERIALIZED_NAME_PRICE_CHANGE = "priceChange"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE) + @jakarta.annotation.Nullable + private String priceChange; + + public static final String SERIALIZED_NAME_PRICE_CHANGE_PERCENT = "priceChangePercent"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE_PERCENT) + @jakarta.annotation.Nullable + private String priceChangePercent; + + public static final String SERIALIZED_NAME_WEIGHTED_AVG_PRICE = "weightedAvgPrice"; + + @SerializedName(SERIALIZED_NAME_WEIGHTED_AVG_PRICE) + @jakarta.annotation.Nullable + private String weightedAvgPrice; + public static final String SERIALIZED_NAME_OPEN_PRICE = "openPrice"; @SerializedName(SERIALIZED_NAME_OPEN_PRICE) @@ -129,6 +147,65 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } + public TickerResponse2Inner priceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + return this; + } + + /** + * Get priceChange + * + * @return priceChange + */ + @jakarta.annotation.Nullable + public String getPriceChange() { + return priceChange; + } + + public void setPriceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + } + + public TickerResponse2Inner priceChangePercent( + @jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + return this; + } + + /** + * Get priceChangePercent + * + * @return priceChangePercent + */ + @jakarta.annotation.Nullable + public String getPriceChangePercent() { + return priceChangePercent; + } + + public void setPriceChangePercent(@jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + } + + public TickerResponse2Inner weightedAvgPrice( + @jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + return this; + } + + /** + * Get weightedAvgPrice + * + * @return weightedAvgPrice + */ + @jakarta.annotation.Nullable + public String getWeightedAvgPrice() { + return weightedAvgPrice; + } + + public void setWeightedAvgPrice(@jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + } + public TickerResponse2Inner openPrice(@jakarta.annotation.Nullable String openPrice) { this.openPrice = openPrice; return this; @@ -348,6 +425,9 @@ public boolean equals(Object o) { } TickerResponse2Inner tickerResponse2Inner = (TickerResponse2Inner) o; return Objects.equals(this.symbol, tickerResponse2Inner.symbol) + && Objects.equals(this.priceChange, tickerResponse2Inner.priceChange) + && Objects.equals(this.priceChangePercent, tickerResponse2Inner.priceChangePercent) + && Objects.equals(this.weightedAvgPrice, tickerResponse2Inner.weightedAvgPrice) && Objects.equals(this.openPrice, tickerResponse2Inner.openPrice) && Objects.equals(this.highPrice, tickerResponse2Inner.highPrice) && Objects.equals(this.lowPrice, tickerResponse2Inner.lowPrice) @@ -365,6 +445,9 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( symbol, + priceChange, + priceChangePercent, + weightedAvgPrice, openPrice, highPrice, lowPrice, @@ -383,6 +466,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TickerResponse2Inner {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" priceChange: ").append(toIndentedString(priceChange)).append("\n"); + sb.append(" priceChangePercent: ") + .append(toIndentedString(priceChangePercent)) + .append("\n"); + sb.append(" weightedAvgPrice: ").append(toIndentedString(weightedAvgPrice)).append("\n"); sb.append(" openPrice: ").append(toIndentedString(openPrice)).append("\n"); sb.append(" highPrice: ").append(toIndentedString(highPrice)).append("\n"); sb.append(" lowPrice: ").append(toIndentedString(lowPrice)).append("\n"); @@ -405,6 +493,20 @@ public String toUrlQueryString() { String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object priceChangeValue = getPriceChange(); + String priceChangeValueAsString = ""; + priceChangeValueAsString = priceChangeValue.toString(); + sb.append("priceChange=").append(urlEncode(priceChangeValueAsString)).append(""); + Object priceChangePercentValue = getPriceChangePercent(); + String priceChangePercentValueAsString = ""; + priceChangePercentValueAsString = priceChangePercentValue.toString(); + sb.append("priceChangePercent=") + .append(urlEncode(priceChangePercentValueAsString)) + .append(""); + Object weightedAvgPriceValue = getWeightedAvgPrice(); + String weightedAvgPriceValueAsString = ""; + weightedAvgPriceValueAsString = weightedAvgPriceValue.toString(); + sb.append("weightedAvgPrice=").append(urlEncode(weightedAvgPriceValueAsString)).append(""); Object openPriceValue = getOpenPrice(); String openPriceValueAsString = ""; openPriceValueAsString = openPriceValue.toString(); @@ -478,6 +580,9 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("symbol"); + openapiFields.add("priceChange"); + openapiFields.add("priceChangePercent"); + openapiFields.add("weightedAvgPrice"); openapiFields.add("openPrice"); openapiFields.add("highPrice"); openapiFields.add("lowPrice"); @@ -520,6 +625,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + if ((jsonObj.get("priceChange") != null && !jsonObj.get("priceChange").isJsonNull()) + && !jsonObj.get("priceChange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChange` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceChange").toString())); + } + if ((jsonObj.get("priceChangePercent") != null + && !jsonObj.get("priceChangePercent").isJsonNull()) + && !jsonObj.get("priceChangePercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChangePercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("priceChangePercent").toString())); + } + if ((jsonObj.get("weightedAvgPrice") != null + && !jsonObj.get("weightedAvgPrice").isJsonNull()) + && !jsonObj.get("weightedAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `weightedAvgPrice` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("weightedAvgPrice").toString())); + } if ((jsonObj.get("openPrice") != null && !jsonObj.get("openPrice").isJsonNull()) && !jsonObj.get("openPrice").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse1.java index cccd7b6b..57760593 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse1.java @@ -42,6 +42,24 @@ public class TickerTradingDayResponse1 { @jakarta.annotation.Nullable private String symbol; + public static final String SERIALIZED_NAME_PRICE_CHANGE = "priceChange"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE) + @jakarta.annotation.Nullable + private String priceChange; + + public static final String SERIALIZED_NAME_PRICE_CHANGE_PERCENT = "priceChangePercent"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE_PERCENT) + @jakarta.annotation.Nullable + private String priceChangePercent; + + public static final String SERIALIZED_NAME_WEIGHTED_AVG_PRICE = "weightedAvgPrice"; + + @SerializedName(SERIALIZED_NAME_WEIGHTED_AVG_PRICE) + @jakarta.annotation.Nullable + private String weightedAvgPrice; + public static final String SERIALIZED_NAME_OPEN_PRICE = "openPrice"; @SerializedName(SERIALIZED_NAME_OPEN_PRICE) @@ -129,6 +147,65 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } + public TickerTradingDayResponse1 priceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + return this; + } + + /** + * Get priceChange + * + * @return priceChange + */ + @jakarta.annotation.Nullable + public String getPriceChange() { + return priceChange; + } + + public void setPriceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + } + + public TickerTradingDayResponse1 priceChangePercent( + @jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + return this; + } + + /** + * Get priceChangePercent + * + * @return priceChangePercent + */ + @jakarta.annotation.Nullable + public String getPriceChangePercent() { + return priceChangePercent; + } + + public void setPriceChangePercent(@jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + } + + public TickerTradingDayResponse1 weightedAvgPrice( + @jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + return this; + } + + /** + * Get weightedAvgPrice + * + * @return weightedAvgPrice + */ + @jakarta.annotation.Nullable + public String getWeightedAvgPrice() { + return weightedAvgPrice; + } + + public void setWeightedAvgPrice(@jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + } + public TickerTradingDayResponse1 openPrice(@jakarta.annotation.Nullable String openPrice) { this.openPrice = openPrice; return this; @@ -348,6 +425,10 @@ public boolean equals(Object o) { } TickerTradingDayResponse1 tickerTradingDayResponse1 = (TickerTradingDayResponse1) o; return Objects.equals(this.symbol, tickerTradingDayResponse1.symbol) + && Objects.equals(this.priceChange, tickerTradingDayResponse1.priceChange) + && Objects.equals( + this.priceChangePercent, tickerTradingDayResponse1.priceChangePercent) + && Objects.equals(this.weightedAvgPrice, tickerTradingDayResponse1.weightedAvgPrice) && Objects.equals(this.openPrice, tickerTradingDayResponse1.openPrice) && Objects.equals(this.highPrice, tickerTradingDayResponse1.highPrice) && Objects.equals(this.lowPrice, tickerTradingDayResponse1.lowPrice) @@ -365,6 +446,9 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( symbol, + priceChange, + priceChangePercent, + weightedAvgPrice, openPrice, highPrice, lowPrice, @@ -383,6 +467,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TickerTradingDayResponse1 {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" priceChange: ").append(toIndentedString(priceChange)).append("\n"); + sb.append(" priceChangePercent: ") + .append(toIndentedString(priceChangePercent)) + .append("\n"); + sb.append(" weightedAvgPrice: ").append(toIndentedString(weightedAvgPrice)).append("\n"); sb.append(" openPrice: ").append(toIndentedString(openPrice)).append("\n"); sb.append(" highPrice: ").append(toIndentedString(highPrice)).append("\n"); sb.append(" lowPrice: ").append(toIndentedString(lowPrice)).append("\n"); @@ -405,6 +494,20 @@ public String toUrlQueryString() { String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object priceChangeValue = getPriceChange(); + String priceChangeValueAsString = ""; + priceChangeValueAsString = priceChangeValue.toString(); + sb.append("priceChange=").append(urlEncode(priceChangeValueAsString)).append(""); + Object priceChangePercentValue = getPriceChangePercent(); + String priceChangePercentValueAsString = ""; + priceChangePercentValueAsString = priceChangePercentValue.toString(); + sb.append("priceChangePercent=") + .append(urlEncode(priceChangePercentValueAsString)) + .append(""); + Object weightedAvgPriceValue = getWeightedAvgPrice(); + String weightedAvgPriceValueAsString = ""; + weightedAvgPriceValueAsString = weightedAvgPriceValue.toString(); + sb.append("weightedAvgPrice=").append(urlEncode(weightedAvgPriceValueAsString)).append(""); Object openPriceValue = getOpenPrice(); String openPriceValueAsString = ""; openPriceValueAsString = openPriceValue.toString(); @@ -478,6 +581,9 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("symbol"); + openapiFields.add("priceChange"); + openapiFields.add("priceChangePercent"); + openapiFields.add("weightedAvgPrice"); openapiFields.add("openPrice"); openapiFields.add("highPrice"); openapiFields.add("lowPrice"); @@ -520,6 +626,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + if ((jsonObj.get("priceChange") != null && !jsonObj.get("priceChange").isJsonNull()) + && !jsonObj.get("priceChange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChange` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceChange").toString())); + } + if ((jsonObj.get("priceChangePercent") != null + && !jsonObj.get("priceChangePercent").isJsonNull()) + && !jsonObj.get("priceChangePercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChangePercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("priceChangePercent").toString())); + } + if ((jsonObj.get("weightedAvgPrice") != null + && !jsonObj.get("weightedAvgPrice").isJsonNull()) + && !jsonObj.get("weightedAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `weightedAvgPrice` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("weightedAvgPrice").toString())); + } if ((jsonObj.get("openPrice") != null && !jsonObj.get("openPrice").isJsonNull()) && !jsonObj.get("openPrice").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2Inner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2Inner.java index 4d10e3d2..b684b108 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2Inner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2Inner.java @@ -42,6 +42,24 @@ public class TickerTradingDayResponse2Inner { @jakarta.annotation.Nullable private String symbol; + public static final String SERIALIZED_NAME_PRICE_CHANGE = "priceChange"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE) + @jakarta.annotation.Nullable + private String priceChange; + + public static final String SERIALIZED_NAME_PRICE_CHANGE_PERCENT = "priceChangePercent"; + + @SerializedName(SERIALIZED_NAME_PRICE_CHANGE_PERCENT) + @jakarta.annotation.Nullable + private String priceChangePercent; + + public static final String SERIALIZED_NAME_WEIGHTED_AVG_PRICE = "weightedAvgPrice"; + + @SerializedName(SERIALIZED_NAME_WEIGHTED_AVG_PRICE) + @jakarta.annotation.Nullable + private String weightedAvgPrice; + public static final String SERIALIZED_NAME_OPEN_PRICE = "openPrice"; @SerializedName(SERIALIZED_NAME_OPEN_PRICE) @@ -129,6 +147,66 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } + public TickerTradingDayResponse2Inner priceChange( + @jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + return this; + } + + /** + * Get priceChange + * + * @return priceChange + */ + @jakarta.annotation.Nullable + public String getPriceChange() { + return priceChange; + } + + public void setPriceChange(@jakarta.annotation.Nullable String priceChange) { + this.priceChange = priceChange; + } + + public TickerTradingDayResponse2Inner priceChangePercent( + @jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + return this; + } + + /** + * Get priceChangePercent + * + * @return priceChangePercent + */ + @jakarta.annotation.Nullable + public String getPriceChangePercent() { + return priceChangePercent; + } + + public void setPriceChangePercent(@jakarta.annotation.Nullable String priceChangePercent) { + this.priceChangePercent = priceChangePercent; + } + + public TickerTradingDayResponse2Inner weightedAvgPrice( + @jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + return this; + } + + /** + * Get weightedAvgPrice + * + * @return weightedAvgPrice + */ + @jakarta.annotation.Nullable + public String getWeightedAvgPrice() { + return weightedAvgPrice; + } + + public void setWeightedAvgPrice(@jakarta.annotation.Nullable String weightedAvgPrice) { + this.weightedAvgPrice = weightedAvgPrice; + } + public TickerTradingDayResponse2Inner openPrice(@jakarta.annotation.Nullable String openPrice) { this.openPrice = openPrice; return this; @@ -350,6 +428,11 @@ public boolean equals(Object o) { TickerTradingDayResponse2Inner tickerTradingDayResponse2Inner = (TickerTradingDayResponse2Inner) o; return Objects.equals(this.symbol, tickerTradingDayResponse2Inner.symbol) + && Objects.equals(this.priceChange, tickerTradingDayResponse2Inner.priceChange) + && Objects.equals( + this.priceChangePercent, tickerTradingDayResponse2Inner.priceChangePercent) + && Objects.equals( + this.weightedAvgPrice, tickerTradingDayResponse2Inner.weightedAvgPrice) && Objects.equals(this.openPrice, tickerTradingDayResponse2Inner.openPrice) && Objects.equals(this.highPrice, tickerTradingDayResponse2Inner.highPrice) && Objects.equals(this.lowPrice, tickerTradingDayResponse2Inner.lowPrice) @@ -367,6 +450,9 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( symbol, + priceChange, + priceChangePercent, + weightedAvgPrice, openPrice, highPrice, lowPrice, @@ -385,6 +471,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TickerTradingDayResponse2Inner {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" priceChange: ").append(toIndentedString(priceChange)).append("\n"); + sb.append(" priceChangePercent: ") + .append(toIndentedString(priceChangePercent)) + .append("\n"); + sb.append(" weightedAvgPrice: ").append(toIndentedString(weightedAvgPrice)).append("\n"); sb.append(" openPrice: ").append(toIndentedString(openPrice)).append("\n"); sb.append(" highPrice: ").append(toIndentedString(highPrice)).append("\n"); sb.append(" lowPrice: ").append(toIndentedString(lowPrice)).append("\n"); @@ -407,6 +498,20 @@ public String toUrlQueryString() { String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object priceChangeValue = getPriceChange(); + String priceChangeValueAsString = ""; + priceChangeValueAsString = priceChangeValue.toString(); + sb.append("priceChange=").append(urlEncode(priceChangeValueAsString)).append(""); + Object priceChangePercentValue = getPriceChangePercent(); + String priceChangePercentValueAsString = ""; + priceChangePercentValueAsString = priceChangePercentValue.toString(); + sb.append("priceChangePercent=") + .append(urlEncode(priceChangePercentValueAsString)) + .append(""); + Object weightedAvgPriceValue = getWeightedAvgPrice(); + String weightedAvgPriceValueAsString = ""; + weightedAvgPriceValueAsString = weightedAvgPriceValue.toString(); + sb.append("weightedAvgPrice=").append(urlEncode(weightedAvgPriceValueAsString)).append(""); Object openPriceValue = getOpenPrice(); String openPriceValueAsString = ""; openPriceValueAsString = openPriceValue.toString(); @@ -480,6 +585,9 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("symbol"); + openapiFields.add("priceChange"); + openapiFields.add("priceChangePercent"); + openapiFields.add("weightedAvgPrice"); openapiFields.add("openPrice"); openapiFields.add("highPrice"); openapiFields.add("lowPrice"); @@ -523,6 +631,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + if ((jsonObj.get("priceChange") != null && !jsonObj.get("priceChange").isJsonNull()) + && !jsonObj.get("priceChange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChange` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceChange").toString())); + } + if ((jsonObj.get("priceChangePercent") != null + && !jsonObj.get("priceChangePercent").isJsonNull()) + && !jsonObj.get("priceChangePercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceChangePercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("priceChangePercent").toString())); + } + if ((jsonObj.get("weightedAvgPrice") != null + && !jsonObj.get("weightedAvgPrice").isJsonNull()) + && !jsonObj.get("weightedAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `weightedAvgPrice` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("weightedAvgPrice").toString())); + } if ((jsonObj.get("openPrice") != null && !jsonObj.get("openPrice").isJsonNull()) && !jsonObj.get("openPrice").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java index 9c1eb8e2..c14629c1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java @@ -26,6 +26,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -37,6 +38,7 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.HashMap; import java.util.Map; import okio.ByteString; @@ -58,7 +60,60 @@ public class JSON { @SuppressWarnings("unchecked") public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client.spot.websocket.api.model + .UserDataStreamEventsResponse.class, + new TypeSelector< + com.binance.connector.client.spot.websocket.api.model + .UserDataStreamEventsResponse>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot + .websocket.api.model + .UserDataStreamEventsResponse> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "balanceUpdate", + com.binance.connector.client.spot.websocket.api + .model.BalanceUpdate.class); + classByDiscriminatorValue.put( + "eventStreamTerminated", + com.binance.connector.client.spot.websocket.api + .model.EventStreamTerminated.class); + classByDiscriminatorValue.put( + "executionReport", + com.binance.connector.client.spot.websocket.api + .model.ExecutionReport.class); + classByDiscriminatorValue.put( + "externalLockUpdate", + com.binance.connector.client.spot.websocket.api + .model.ExternalLockUpdate.class); + classByDiscriminatorValue.put( + "listStatus", + com.binance.connector.client.spot.websocket.api + .model.ListStatus.class); + classByDiscriminatorValue.put( + "listenKeyExpired", + com.binance.connector.client.spot.websocket.api + .model.ListenKeyExpired.class); + classByDiscriminatorValue.put( + "outboundAccountPosition", + com.binance.connector.client.spot.websocket.api + .model.OutboundAccountPosition.class); + classByDiscriminatorValue.put( + "UserDataStreamEventsResponse", + com.binance.connector.client.spot.websocket.api + .model.UserDataStreamEventsResponse.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "e")); + } + }); GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; } @@ -178,6 +233,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.AvgPriceResponseResult .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.BalanceUpdate + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.DepthRequest .CustomTypeAdapterFactory()); @@ -187,6 +245,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.DepthResponseResult .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.EventStreamTerminated + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.ExchangeFilters .CustomTypeAdapterFactory()); @@ -208,6 +269,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .ExchangeInfoResponseResultSymbolsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.ExecutionReport + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.ExternalLockUpdate + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.KlinesItem .CustomTypeAdapterFactory()); @@ -220,6 +287,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.KlinesResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.ListStatus + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.ListStatusOInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.ListenKeyExpired + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.MyAllocationsRequest .CustomTypeAdapterFactory()); @@ -458,6 +534,12 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.spot.websocket.api.model .OrderTestResponseResultStandardCommissionForOrder .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.OutboundAccountPosition + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .OutboundAccountPositionBInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.Permissions .CustomTypeAdapterFactory()); @@ -632,6 +714,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.UiKlinesResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .UserDataStreamEventsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingRequest .CustomTypeAdapterFactory()); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java index 88af54bd..dd02705e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java @@ -6,6 +6,7 @@ import com.binance.connector.client.common.websocket.adapter.ConnectionWrapper; import com.binance.connector.client.common.websocket.adapter.PoolConnectionWrapper; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.common.websocket.dtos.StreamResponse; import com.binance.connector.client.spot.websocket.api.JSON; import com.binance.connector.client.spot.websocket.api.model.AccountCommissionRequest; import com.binance.connector.client.spot.websocket.api.model.AccountCommissionResponse; @@ -91,6 +92,7 @@ import com.binance.connector.client.spot.websocket.api.model.TradesRecentResponse; import com.binance.connector.client.spot.websocket.api.model.UiKlinesRequest; import com.binance.connector.client.spot.websocket.api.model.UiKlinesResponse; +import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStartResponse; @@ -103,7 +105,7 @@ public class SpotWebSocketApi { private static final String USER_AGENT = String.format( - "binance-spot/3.1.0 (Java/%s; %s; %s)", + "binance-spot/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; @@ -364,8 +366,8 @@ public CompletableFuture userDataStreamStop( return userDataStreamApi.userDataStreamStop(userDataStreamStopRequest); } - public CompletableFuture userDataStreamSubscribe() - throws ApiException { + public StreamResponse + userDataStreamSubscribe() throws ApiException { return userDataStreamApi.userDataStreamSubscribe(); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApi.java index 91efb369..9c03bb26 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApi.java @@ -17,6 +17,11 @@ import com.binance.connector.client.common.websocket.adapter.ConnectionInterface; import com.binance.connector.client.common.websocket.dtos.ApiRequestWrapperDTO; import com.binance.connector.client.common.websocket.dtos.BaseRequestDTO; +import com.binance.connector.client.common.websocket.dtos.StreamResponse; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStartResponse; @@ -24,12 +29,14 @@ import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeResponse; +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.Set; import java.util.UUID; +import java.util.concurrent.BlockingQueue; import java.util.concurrent.CompletableFuture; import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; @@ -234,8 +241,8 @@ private void userDataStreamStopValidateBeforeCall( * href="https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#subscribe-to-user-data-stream-user_stream">WebSocket * Subscribe to User Data Stream Documentation */ - public CompletableFuture userDataStreamSubscribe() - throws ApiException { + public StreamResponse + userDataStreamSubscribe() throws ApiException { userDataStreamSubscribeValidateBeforeCall(); String methodName = "/userDataStream.subscribe".substring(1); ApiRequestWrapperDTO build = @@ -248,11 +255,16 @@ public CompletableFuture userDataStreamSubscrib .build(); try { - connection.send(build); + BlockingQueue queue = connection.sendForStream(build); + TypeToken typeToken = new TypeToken<>() {}; + + return new StreamResponse<>( + build.getResponseCallback(), + new StreamBlockingQueueWrapper<>( + new StreamBlockingQueue<>(queue), typeToken, JSON.getGson())); } catch (InterruptedException e) { throw new ApiException(e); } - return build.getResponseCallback(); } @SuppressWarnings("rawtypes") diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BalanceUpdate.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BalanceUpdate.java new file mode 100644 index 00000000..89b3b57e --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BalanceUpdate.java @@ -0,0 +1,358 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** BalanceUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BalanceUpdate 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_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 = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public BalanceUpdate() {} + + public BalanceUpdate 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 BalanceUpdate 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 BalanceUpdate 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 BalanceUpdate 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceUpdate balanceUpdate = (BalanceUpdate) o; + return Objects.equals(this.E, balanceUpdate.E) + && Objects.equals(this.aLowerCase, balanceUpdate.aLowerCase) + && Objects.equals(this.dLowerCase, balanceUpdate.dLowerCase) + && Objects.equals(this.T, balanceUpdate.T); + } + + @Override + public int hashCode() { + return Objects.hash(E, aLowerCase, dLowerCase, T); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).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); + } + 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); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + + 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 aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + valMap.put("dLowerCase", dLowerCaseValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + + 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("a"); + openapiFields.add("d"); + openapiFields.add("T"); + + // 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 BalanceUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BalanceUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in BalanceUpdate is not found in the" + + " empty JSON string", + BalanceUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BalanceUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `BalanceUpdate` 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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalanceUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalanceUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BalanceUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BalanceUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalanceUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BalanceUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceUpdate + * @throws IOException if the JSON string is invalid with respect to BalanceUpdate + */ + public static BalanceUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalanceUpdate.class); + } + + /** + * Convert an instance of BalanceUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/EventStreamTerminated.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/EventStreamTerminated.java new file mode 100644 index 00000000..d2150745 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/EventStreamTerminated.java @@ -0,0 +1,232 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** EventStreamTerminated */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class EventStreamTerminated extends BaseDTO { + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public EventStreamTerminated() {} + + public EventStreamTerminated 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventStreamTerminated eventStreamTerminated = (EventStreamTerminated) o; + return Objects.equals(this.E, eventStreamTerminated.E); + } + + @Override + public int hashCode() { + return Objects.hash(E); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventStreamTerminated {\n"); + sb.append(" E: ").append(toIndentedString(E)).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); + } + + 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); + } + + 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"); + + // 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 EventStreamTerminated + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventStreamTerminated.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EventStreamTerminated is not found in" + + " the empty JSON string", + EventStreamTerminated.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EventStreamTerminated.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EventStreamTerminated` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventStreamTerminated.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventStreamTerminated' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EventStreamTerminated.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EventStreamTerminated value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EventStreamTerminated read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of EventStreamTerminated given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventStreamTerminated + * @throws IOException if the JSON string is invalid with respect to EventStreamTerminated + */ + public static EventStreamTerminated fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventStreamTerminated.class); + } + + /** + * Convert an instance of EventStreamTerminated to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExecutionReport.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExecutionReport.java new file mode 100644 index 00000000..14eaa8c6 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExecutionReport.java @@ -0,0 +1,2335 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ExecutionReport */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExecutionReport 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_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_P = "P"; + + @SerializedName(SERIALIZED_NAME_P) + @jakarta.annotation.Nullable + private String P; + + public static final String SERIALIZED_NAME_F = "F"; + + @SerializedName(SERIALIZED_NAME_F) + @jakarta.annotation.Nullable + private String F; + + public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; + + @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) + @jakarta.annotation.Nullable + private Long gLowerCase; + + public static final String SERIALIZED_NAME_C = "C"; + + @SerializedName(SERIALIZED_NAME_C) + @jakarta.annotation.Nullable + private String C; + + 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_R_LOWER_CASE = "r"; + + @SerializedName(SERIALIZED_NAME_R_LOWER_CASE) + @jakarta.annotation.Nullable + private String rLowerCase; + + 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_LOWER_CASE = "n"; + + @SerializedName(SERIALIZED_NAME_N_LOWER_CASE) + @jakarta.annotation.Nullable + private String nLowerCase; + + public static final String SERIALIZED_NAME_N = "N"; + + @SerializedName(SERIALIZED_NAME_N) + @jakarta.annotation.Nullable + private String N; + + 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_V_LOWER_CASE = "v"; + + @SerializedName(SERIALIZED_NAME_V_LOWER_CASE) + @jakarta.annotation.Nullable + private Long vLowerCase; + + public static final String SERIALIZED_NAME_I = "I"; + + @SerializedName(SERIALIZED_NAME_I) + @jakarta.annotation.Nullable + private Long I; + + public static final String SERIALIZED_NAME_W_LOWER_CASE = "w"; + + @SerializedName(SERIALIZED_NAME_W_LOWER_CASE) + @jakarta.annotation.Nullable + private Boolean wLowerCase; + + 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_M = "M"; + + @SerializedName(SERIALIZED_NAME_M) + @jakarta.annotation.Nullable + private Boolean M; + + public static final String SERIALIZED_NAME_O = "O"; + + @SerializedName(SERIALIZED_NAME_O) + @jakarta.annotation.Nullable + private Long O; + + public static final String SERIALIZED_NAME_Z = "Z"; + + @SerializedName(SERIALIZED_NAME_Z) + @jakarta.annotation.Nullable + private String Z; + + public static final String SERIALIZED_NAME_Y = "Y"; + + @SerializedName(SERIALIZED_NAME_Y) + @jakarta.annotation.Nullable + private String Y; + + public static final String SERIALIZED_NAME_Q = "Q"; + + @SerializedName(SERIALIZED_NAME_Q) + @jakarta.annotation.Nullable + private String Q; + + public static final String SERIALIZED_NAME_W = "W"; + + @SerializedName(SERIALIZED_NAME_W) + @jakarta.annotation.Nullable + private Long W; + + public static final String SERIALIZED_NAME_V = "V"; + + @SerializedName(SERIALIZED_NAME_V) + @jakarta.annotation.Nullable + private String V; + + public static final String SERIALIZED_NAME_D_LOWER_CASE = "d"; + + @SerializedName(SERIALIZED_NAME_D_LOWER_CASE) + @jakarta.annotation.Nullable + private Long dLowerCase; + + public static final String SERIALIZED_NAME_D = "D"; + + @SerializedName(SERIALIZED_NAME_D) + @jakarta.annotation.Nullable + private Long D; + + public static final String SERIALIZED_NAME_J_LOWER_CASE = "j"; + + @SerializedName(SERIALIZED_NAME_J_LOWER_CASE) + @jakarta.annotation.Nullable + private Long jLowerCase; + + public static final String SERIALIZED_NAME_J = "J"; + + @SerializedName(SERIALIZED_NAME_J) + @jakarta.annotation.Nullable + private Long J; + + public static final String SERIALIZED_NAME_A = "A"; + + @SerializedName(SERIALIZED_NAME_A) + @jakarta.annotation.Nullable + private String A; + + public static final String SERIALIZED_NAME_B = "B"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private String B; + + 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_U = "U"; + + @SerializedName(SERIALIZED_NAME_U) + @jakarta.annotation.Nullable + private Long U; + + public static final String SERIALIZED_NAME_CS = "Cs"; + + @SerializedName(SERIALIZED_NAME_CS) + @jakarta.annotation.Nullable + private String cs; + + public static final String SERIALIZED_NAME_PL = "pl"; + + @SerializedName(SERIALIZED_NAME_PL) + @jakarta.annotation.Nullable + private String pl; + + public static final String SERIALIZED_NAME_P_L = "pL"; + + @SerializedName(SERIALIZED_NAME_P_L) + @jakarta.annotation.Nullable + private String pL; + + public static final String SERIALIZED_NAME_P_Y = "pY"; + + @SerializedName(SERIALIZED_NAME_P_Y) + @jakarta.annotation.Nullable + private String pY; + + 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 Long aLowerCase; + + public static final String SERIALIZED_NAME_K_LOWER_CASE = "k"; + + @SerializedName(SERIALIZED_NAME_K_LOWER_CASE) + @jakarta.annotation.Nullable + private String kLowerCase; + + public static final String SERIALIZED_NAME_U_S = "uS"; + + @SerializedName(SERIALIZED_NAME_U_S) + @jakarta.annotation.Nullable + private Boolean uS; + + public ExecutionReport() {} + + public ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport gLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + return this; + } + + /** + * Get gLowerCase + * + * @return gLowerCase + */ + @jakarta.annotation.Nullable + public Long getgLowerCase() { + return gLowerCase; + } + + public void setgLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + } + + public ExecutionReport C(@jakarta.annotation.Nullable String C) { + this.C = C; + return this; + } + + /** + * Get C + * + * @return C + */ + @jakarta.annotation.Nullable + public String getC() { + return C; + } + + public void setC(@jakarta.annotation.Nullable String C) { + this.C = C; + } + + public ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport 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 ExecutionReport vLowerCase(@jakarta.annotation.Nullable Long vLowerCase) { + this.vLowerCase = vLowerCase; + return this; + } + + /** + * Get vLowerCase + * + * @return vLowerCase + */ + @jakarta.annotation.Nullable + public Long getvLowerCase() { + return vLowerCase; + } + + public void setvLowerCase(@jakarta.annotation.Nullable Long vLowerCase) { + this.vLowerCase = vLowerCase; + } + + public ExecutionReport I(@jakarta.annotation.Nullable Long I) { + this.I = I; + return this; + } + + /** + * Get I + * + * @return I + */ + @jakarta.annotation.Nullable + public Long getI() { + return I; + } + + public void setI(@jakarta.annotation.Nullable Long I) { + this.I = I; + } + + public ExecutionReport wLowerCase(@jakarta.annotation.Nullable Boolean wLowerCase) { + this.wLowerCase = wLowerCase; + return this; + } + + /** + * Get wLowerCase + * + * @return wLowerCase + */ + @jakarta.annotation.Nullable + public Boolean getwLowerCase() { + return wLowerCase; + } + + public void setwLowerCase(@jakarta.annotation.Nullable Boolean wLowerCase) { + this.wLowerCase = wLowerCase; + } + + public ExecutionReport 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 ExecutionReport M(@jakarta.annotation.Nullable Boolean M) { + this.M = M; + return this; + } + + /** + * Get M + * + * @return M + */ + @jakarta.annotation.Nullable + public Boolean getM() { + return M; + } + + public void setM(@jakarta.annotation.Nullable Boolean M) { + this.M = M; + } + + public ExecutionReport O(@jakarta.annotation.Nullable Long O) { + this.O = O; + return this; + } + + /** + * Get O + * + * @return O + */ + @jakarta.annotation.Nullable + public Long getO() { + return O; + } + + public void setO(@jakarta.annotation.Nullable Long O) { + this.O = O; + } + + public ExecutionReport Z(@jakarta.annotation.Nullable String Z) { + this.Z = Z; + return this; + } + + /** + * Get Z + * + * @return Z + */ + @jakarta.annotation.Nullable + public String getZ() { + return Z; + } + + public void setZ(@jakarta.annotation.Nullable String Z) { + this.Z = Z; + } + + public ExecutionReport Y(@jakarta.annotation.Nullable String Y) { + this.Y = Y; + return this; + } + + /** + * Get Y + * + * @return Y + */ + @jakarta.annotation.Nullable + public String getY() { + return Y; + } + + public void setY(@jakarta.annotation.Nullable String Y) { + this.Y = Y; + } + + public ExecutionReport 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 ExecutionReport W(@jakarta.annotation.Nullable Long W) { + this.W = W; + return this; + } + + /** + * Get W + * + * @return W + */ + @jakarta.annotation.Nullable + public Long getW() { + return W; + } + + public void setW(@jakarta.annotation.Nullable Long W) { + this.W = W; + } + + public ExecutionReport 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 ExecutionReport dLowerCase(@jakarta.annotation.Nullable Long dLowerCase) { + this.dLowerCase = dLowerCase; + return this; + } + + /** + * Get dLowerCase + * + * @return dLowerCase + */ + @jakarta.annotation.Nullable + public Long getdLowerCase() { + return dLowerCase; + } + + public void setdLowerCase(@jakarta.annotation.Nullable Long dLowerCase) { + this.dLowerCase = dLowerCase; + } + + public ExecutionReport D(@jakarta.annotation.Nullable Long D) { + this.D = D; + return this; + } + + /** + * Get D + * + * @return D + */ + @jakarta.annotation.Nullable + public Long getD() { + return D; + } + + public void setD(@jakarta.annotation.Nullable Long D) { + this.D = D; + } + + public ExecutionReport jLowerCase(@jakarta.annotation.Nullable Long jLowerCase) { + this.jLowerCase = jLowerCase; + return this; + } + + /** + * Get jLowerCase + * + * @return jLowerCase + */ + @jakarta.annotation.Nullable + public Long getjLowerCase() { + return jLowerCase; + } + + public void setjLowerCase(@jakarta.annotation.Nullable Long jLowerCase) { + this.jLowerCase = jLowerCase; + } + + public ExecutionReport J(@jakarta.annotation.Nullable Long J) { + this.J = J; + return this; + } + + /** + * Get J + * + * @return J + */ + @jakarta.annotation.Nullable + public Long getJ() { + return J; + } + + public void setJ(@jakarta.annotation.Nullable Long J) { + this.J = J; + } + + public ExecutionReport 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 ExecutionReport B(@jakarta.annotation.Nullable String B) { + this.B = B; + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + public String getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable String B) { + this.B = B; + } + + public ExecutionReport 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 ExecutionReport 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 ExecutionReport cs(@jakarta.annotation.Nullable String cs) { + this.cs = cs; + return this; + } + + /** + * Get cs + * + * @return cs + */ + @jakarta.annotation.Nullable + public String getCs() { + return cs; + } + + public void setCs(@jakarta.annotation.Nullable String cs) { + this.cs = cs; + } + + public ExecutionReport pl(@jakarta.annotation.Nullable String pl) { + this.pl = pl; + return this; + } + + /** + * Get pl + * + * @return pl + */ + @jakarta.annotation.Nullable + public String getPl() { + return pl; + } + + public void setPl(@jakarta.annotation.Nullable String pl) { + this.pl = pl; + } + + public ExecutionReport pL(@jakarta.annotation.Nullable String pL) { + this.pL = pL; + return this; + } + + /** + * Get pL + * + * @return pL + */ + @jakarta.annotation.Nullable + public String getpL() { + return pL; + } + + public void setpL(@jakarta.annotation.Nullable String pL) { + this.pL = pL; + } + + public ExecutionReport pY(@jakarta.annotation.Nullable String pY) { + this.pY = pY; + return this; + } + + /** + * Get pY + * + * @return pY + */ + @jakarta.annotation.Nullable + public String getpY() { + return pY; + } + + public void setpY(@jakarta.annotation.Nullable String pY) { + this.pY = pY; + } + + public ExecutionReport 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 ExecutionReport 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 ExecutionReport kLowerCase(@jakarta.annotation.Nullable String kLowerCase) { + this.kLowerCase = kLowerCase; + return this; + } + + /** + * Get kLowerCase + * + * @return kLowerCase + */ + @jakarta.annotation.Nullable + public String getkLowerCase() { + return kLowerCase; + } + + public void setkLowerCase(@jakarta.annotation.Nullable String kLowerCase) { + this.kLowerCase = kLowerCase; + } + + public ExecutionReport uS(@jakarta.annotation.Nullable Boolean uS) { + this.uS = uS; + return this; + } + + /** + * Get uS + * + * @return uS + */ + @jakarta.annotation.Nullable + public Boolean getuS() { + return uS; + } + + public void setuS(@jakarta.annotation.Nullable Boolean uS) { + this.uS = uS; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExecutionReport executionReport = (ExecutionReport) o; + return Objects.equals(this.E, executionReport.E) + && Objects.equals(this.sLowerCase, executionReport.sLowerCase) + && Objects.equals(this.cLowerCase, executionReport.cLowerCase) + && Objects.equals(this.S, executionReport.S) + && Objects.equals(this.oLowerCase, executionReport.oLowerCase) + && Objects.equals(this.fLowerCase, executionReport.fLowerCase) + && Objects.equals(this.qLowerCase, executionReport.qLowerCase) + && Objects.equals(this.pLowerCase, executionReport.pLowerCase) + && Objects.equals(this.P, executionReport.P) + && Objects.equals(this.F, executionReport.F) + && Objects.equals(this.gLowerCase, executionReport.gLowerCase) + && Objects.equals(this.C, executionReport.C) + && Objects.equals(this.xLowerCase, executionReport.xLowerCase) + && Objects.equals(this.X, executionReport.X) + && Objects.equals(this.rLowerCase, executionReport.rLowerCase) + && Objects.equals(this.iLowerCase, executionReport.iLowerCase) + && Objects.equals(this.lLowerCase, executionReport.lLowerCase) + && Objects.equals(this.zLowerCase, executionReport.zLowerCase) + && Objects.equals(this.L, executionReport.L) + && Objects.equals(this.nLowerCase, executionReport.nLowerCase) + && Objects.equals(this.N, executionReport.N) + && Objects.equals(this.T, executionReport.T) + && Objects.equals(this.tLowerCase, executionReport.tLowerCase) + && Objects.equals(this.vLowerCase, executionReport.vLowerCase) + && Objects.equals(this.I, executionReport.I) + && Objects.equals(this.wLowerCase, executionReport.wLowerCase) + && Objects.equals(this.mLowerCase, executionReport.mLowerCase) + && Objects.equals(this.M, executionReport.M) + && Objects.equals(this.O, executionReport.O) + && Objects.equals(this.Z, executionReport.Z) + && Objects.equals(this.Y, executionReport.Y) + && Objects.equals(this.Q, executionReport.Q) + && Objects.equals(this.W, executionReport.W) + && Objects.equals(this.V, executionReport.V) + && Objects.equals(this.dLowerCase, executionReport.dLowerCase) + && Objects.equals(this.D, executionReport.D) + && Objects.equals(this.jLowerCase, executionReport.jLowerCase) + && Objects.equals(this.J, executionReport.J) + && Objects.equals(this.A, executionReport.A) + && Objects.equals(this.B, executionReport.B) + && Objects.equals(this.uLowerCase, executionReport.uLowerCase) + && Objects.equals(this.U, executionReport.U) + && Objects.equals(this.cs, executionReport.cs) + && Objects.equals(this.pl, executionReport.pl) + && Objects.equals(this.pL, executionReport.pL) + && Objects.equals(this.pY, executionReport.pY) + && Objects.equals(this.bLowerCase, executionReport.bLowerCase) + && Objects.equals(this.aLowerCase, executionReport.aLowerCase) + && Objects.equals(this.kLowerCase, executionReport.kLowerCase) + && Objects.equals(this.uS, executionReport.uS); + } + + @Override + public int hashCode() { + return Objects.hash( + E, + sLowerCase, + cLowerCase, + S, + oLowerCase, + fLowerCase, + qLowerCase, + pLowerCase, + P, + F, + gLowerCase, + C, + xLowerCase, + X, + rLowerCase, + iLowerCase, + lLowerCase, + zLowerCase, + L, + nLowerCase, + N, + T, + tLowerCase, + vLowerCase, + I, + wLowerCase, + mLowerCase, + M, + O, + Z, + Y, + Q, + W, + V, + dLowerCase, + D, + jLowerCase, + J, + A, + B, + uLowerCase, + U, + cs, + pl, + pL, + pY, + bLowerCase, + aLowerCase, + kLowerCase, + uS); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExecutionReport {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\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(" P: ").append(toIndentedString(P)).append("\n"); + sb.append(" F: ").append(toIndentedString(F)).append("\n"); + sb.append(" gLowerCase: ").append(toIndentedString(gLowerCase)).append("\n"); + sb.append(" C: ").append(toIndentedString(C)).append("\n"); + sb.append(" xLowerCase: ").append(toIndentedString(xLowerCase)).append("\n"); + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).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(" nLowerCase: ").append(toIndentedString(nLowerCase)).append("\n"); + sb.append(" N: ").append(toIndentedString(N)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); + sb.append(" vLowerCase: ").append(toIndentedString(vLowerCase)).append("\n"); + sb.append(" I: ").append(toIndentedString(I)).append("\n"); + sb.append(" wLowerCase: ").append(toIndentedString(wLowerCase)).append("\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); + sb.append(" M: ").append(toIndentedString(M)).append("\n"); + sb.append(" O: ").append(toIndentedString(O)).append("\n"); + sb.append(" Z: ").append(toIndentedString(Z)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append(" Q: ").append(toIndentedString(Q)).append("\n"); + sb.append(" W: ").append(toIndentedString(W)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); + sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); + sb.append(" D: ").append(toIndentedString(D)).append("\n"); + sb.append(" jLowerCase: ").append(toIndentedString(jLowerCase)).append("\n"); + sb.append(" J: ").append(toIndentedString(J)).append("\n"); + sb.append(" A: ").append(toIndentedString(A)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" U: ").append(toIndentedString(U)).append("\n"); + sb.append(" cs: ").append(toIndentedString(cs)).append("\n"); + sb.append(" pl: ").append(toIndentedString(pl)).append("\n"); + sb.append(" pL: ").append(toIndentedString(pL)).append("\n"); + sb.append(" pY: ").append(toIndentedString(pY)).append("\n"); + sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" kLowerCase: ").append(toIndentedString(kLowerCase)).append("\n"); + sb.append(" uS: ").append(toIndentedString(uS)).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); + } + 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 PValue = getP(); + if (PValue != null) { + String PValueAsString = PValue.toString(); + valMap.put("P", PValueAsString); + } + String FValue = getF(); + if (FValue != null) { + String FValueAsString = FValue.toString(); + valMap.put("F", FValueAsString); + } + Long gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + String gLowerCaseValueAsString = gLowerCaseValue.toString(); + valMap.put("gLowerCase", gLowerCaseValueAsString); + } + String CValue = getC(); + if (CValue != null) { + String CValueAsString = CValue.toString(); + valMap.put("C", CValueAsString); + } + 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); + } + String rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + String rLowerCaseValueAsString = rLowerCaseValue.toString(); + valMap.put("rLowerCase", rLowerCaseValueAsString); + } + 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 nLowerCaseValue = getnLowerCase(); + if (nLowerCaseValue != null) { + String nLowerCaseValueAsString = nLowerCaseValue.toString(); + valMap.put("nLowerCase", nLowerCaseValueAsString); + } + String NValue = getN(); + if (NValue != null) { + String NValueAsString = NValue.toString(); + valMap.put("N", NValueAsString); + } + 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); + } + Long vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + String vLowerCaseValueAsString = vLowerCaseValue.toString(); + valMap.put("vLowerCase", vLowerCaseValueAsString); + } + Long IValue = getI(); + if (IValue != null) { + String IValueAsString = IValue.toString(); + valMap.put("I", IValueAsString); + } + Boolean wLowerCaseValue = getwLowerCase(); + if (wLowerCaseValue != null) { + String wLowerCaseValueAsString = wLowerCaseValue.toString(); + valMap.put("wLowerCase", wLowerCaseValueAsString); + } + Boolean mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + Boolean MValue = getM(); + if (MValue != null) { + String MValueAsString = MValue.toString(); + valMap.put("M", MValueAsString); + } + Long OValue = getO(); + if (OValue != null) { + String OValueAsString = OValue.toString(); + valMap.put("O", OValueAsString); + } + String ZValue = getZ(); + if (ZValue != null) { + String ZValueAsString = ZValue.toString(); + valMap.put("Z", ZValueAsString); + } + String YValue = getY(); + if (YValue != null) { + String YValueAsString = YValue.toString(); + valMap.put("Y", YValueAsString); + } + String QValue = getQ(); + if (QValue != null) { + String QValueAsString = QValue.toString(); + valMap.put("Q", QValueAsString); + } + Long WValue = getW(); + if (WValue != null) { + String WValueAsString = WValue.toString(); + valMap.put("W", WValueAsString); + } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } + Long dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + String dLowerCaseValueAsString = dLowerCaseValue.toString(); + valMap.put("dLowerCase", dLowerCaseValueAsString); + } + Long DValue = getD(); + if (DValue != null) { + String DValueAsString = DValue.toString(); + valMap.put("D", DValueAsString); + } + Long jLowerCaseValue = getjLowerCase(); + if (jLowerCaseValue != null) { + String jLowerCaseValueAsString = jLowerCaseValue.toString(); + valMap.put("jLowerCase", jLowerCaseValueAsString); + } + Long JValue = getJ(); + if (JValue != null) { + String JValueAsString = JValue.toString(); + valMap.put("J", JValueAsString); + } + String AValue = getA(); + if (AValue != null) { + String AValueAsString = AValue.toString(); + valMap.put("A", AValueAsString); + } + String BValue = getB(); + if (BValue != null) { + String BValueAsString = BValue.toString(); + valMap.put("B", BValueAsString); + } + 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 csValue = getCs(); + if (csValue != null) { + String csValueAsString = csValue.toString(); + valMap.put("cs", csValueAsString); + } + String plValue = getPl(); + if (plValue != null) { + String plValueAsString = plValue.toString(); + valMap.put("pl", plValueAsString); + } + String pLValue = getpL(); + if (pLValue != null) { + String pLValueAsString = pLValue.toString(); + valMap.put("pL", pLValueAsString); + } + String pYValue = getpY(); + if (pYValue != null) { + String pYValueAsString = pYValue.toString(); + valMap.put("pY", pYValueAsString); + } + String 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); + } + String kLowerCaseValue = getkLowerCase(); + if (kLowerCaseValue != null) { + String kLowerCaseValueAsString = kLowerCaseValue.toString(); + valMap.put("kLowerCase", kLowerCaseValueAsString); + } + Boolean uSValue = getuS(); + if (uSValue != null) { + String uSValueAsString = uSValue.toString(); + valMap.put("uS", uSValueAsString); + } + + 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 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 PValue = getP(); + if (PValue != null) { + valMap.put("P", PValue); + } + Object FValue = getF(); + if (FValue != null) { + valMap.put("F", FValue); + } + Object gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + valMap.put("gLowerCase", gLowerCaseValue); + } + Object CValue = getC(); + if (CValue != null) { + valMap.put("C", CValue); + } + Object xLowerCaseValue = getxLowerCase(); + if (xLowerCaseValue != null) { + valMap.put("xLowerCase", xLowerCaseValue); + } + Object XValue = getX(); + if (XValue != null) { + valMap.put("X", XValue); + } + Object rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + valMap.put("rLowerCase", rLowerCaseValue); + } + 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 nLowerCaseValue = getnLowerCase(); + if (nLowerCaseValue != null) { + valMap.put("nLowerCase", nLowerCaseValue); + } + Object NValue = getN(); + if (NValue != null) { + valMap.put("N", NValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } + Object vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + valMap.put("vLowerCase", vLowerCaseValue); + } + Object IValue = getI(); + if (IValue != null) { + valMap.put("I", IValue); + } + Object wLowerCaseValue = getwLowerCase(); + if (wLowerCaseValue != null) { + valMap.put("wLowerCase", wLowerCaseValue); + } + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + Object MValue = getM(); + if (MValue != null) { + valMap.put("M", MValue); + } + Object OValue = getO(); + if (OValue != null) { + valMap.put("O", OValue); + } + Object ZValue = getZ(); + if (ZValue != null) { + valMap.put("Z", ZValue); + } + Object YValue = getY(); + if (YValue != null) { + valMap.put("Y", YValue); + } + Object QValue = getQ(); + if (QValue != null) { + valMap.put("Q", QValue); + } + Object WValue = getW(); + if (WValue != null) { + valMap.put("W", WValue); + } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } + Object dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + valMap.put("dLowerCase", dLowerCaseValue); + } + Object DValue = getD(); + if (DValue != null) { + valMap.put("D", DValue); + } + Object jLowerCaseValue = getjLowerCase(); + if (jLowerCaseValue != null) { + valMap.put("jLowerCase", jLowerCaseValue); + } + Object JValue = getJ(); + if (JValue != null) { + valMap.put("J", JValue); + } + Object AValue = getA(); + if (AValue != null) { + valMap.put("A", AValue); + } + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); + } + Object uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object UValue = getU(); + if (UValue != null) { + valMap.put("U", UValue); + } + Object csValue = getCs(); + if (csValue != null) { + valMap.put("cs", csValue); + } + Object plValue = getPl(); + if (plValue != null) { + valMap.put("pl", plValue); + } + Object pLValue = getpL(); + if (pLValue != null) { + valMap.put("pL", pLValue); + } + Object pYValue = getpY(); + if (pYValue != null) { + valMap.put("pY", pYValue); + } + Object bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + valMap.put("bLowerCase", bLowerCaseValue); + } + Object aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object kLowerCaseValue = getkLowerCase(); + if (kLowerCaseValue != null) { + valMap.put("kLowerCase", kLowerCaseValue); + } + Object uSValue = getuS(); + if (uSValue != null) { + valMap.put("uS", uSValue); + } + + 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("s"); + openapiFields.add("c"); + openapiFields.add("S"); + openapiFields.add("o"); + openapiFields.add("f"); + openapiFields.add("q"); + openapiFields.add("p"); + openapiFields.add("P"); + openapiFields.add("F"); + openapiFields.add("g"); + openapiFields.add("C"); + openapiFields.add("x"); + openapiFields.add("X"); + openapiFields.add("r"); + 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("v"); + openapiFields.add("I"); + openapiFields.add("w"); + openapiFields.add("m"); + openapiFields.add("M"); + openapiFields.add("O"); + openapiFields.add("Z"); + openapiFields.add("Y"); + openapiFields.add("Q"); + openapiFields.add("W"); + openapiFields.add("V"); + openapiFields.add("d"); + openapiFields.add("D"); + openapiFields.add("j"); + openapiFields.add("J"); + openapiFields.add("A"); + openapiFields.add("B"); + openapiFields.add("u"); + openapiFields.add("U"); + openapiFields.add("Cs"); + openapiFields.add("pl"); + openapiFields.add("pL"); + openapiFields.add("pY"); + openapiFields.add("b"); + openapiFields.add("a"); + openapiFields.add("k"); + openapiFields.add("uS"); + + // 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 ExecutionReport + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExecutionReport.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExecutionReport is not found in the" + + " empty JSON string", + ExecutionReport.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExecutionReport.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExecutionReport` 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("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("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("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("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("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("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("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("Y") != null && !jsonObj.get("Y").isJsonNull()) + && !jsonObj.get("Y").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `Y` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("Y").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("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("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("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())); + } + if ((jsonObj.get("pl") != null && !jsonObj.get("pl").isJsonNull()) + && !jsonObj.get("pl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pl` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pl").toString())); + } + if ((jsonObj.get("pL") != null && !jsonObj.get("pL").isJsonNull()) + && !jsonObj.get("pL").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pL` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pL").toString())); + } + if ((jsonObj.get("pY") != null && !jsonObj.get("pY").isJsonNull()) + && !jsonObj.get("pY").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pY` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pY").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("k") != null && !jsonObj.get("k").isJsonNull()) + && !jsonObj.get("k").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `k` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("k").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExecutionReport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExecutionReport' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExecutionReport.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExecutionReport value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExecutionReport read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExecutionReport given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExecutionReport + * @throws IOException if the JSON string is invalid with respect to ExecutionReport + */ + public static ExecutionReport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExecutionReport.class); + } + + /** + * Convert an instance of ExecutionReport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExternalLockUpdate.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExternalLockUpdate.java new file mode 100644 index 00000000..afcac025 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExternalLockUpdate.java @@ -0,0 +1,359 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ExternalLockUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExternalLockUpdate 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_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 = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public ExternalLockUpdate() {} + + public ExternalLockUpdate 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 ExternalLockUpdate 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 ExternalLockUpdate 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 ExternalLockUpdate 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExternalLockUpdate externalLockUpdate = (ExternalLockUpdate) o; + return Objects.equals(this.E, externalLockUpdate.E) + && Objects.equals(this.aLowerCase, externalLockUpdate.aLowerCase) + && Objects.equals(this.dLowerCase, externalLockUpdate.dLowerCase) + && Objects.equals(this.T, externalLockUpdate.T); + } + + @Override + public int hashCode() { + return Objects.hash(E, aLowerCase, dLowerCase, T); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExternalLockUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).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); + } + 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); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + + 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 aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + valMap.put("dLowerCase", dLowerCaseValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + + 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("a"); + openapiFields.add("d"); + openapiFields.add("T"); + + // 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 ExternalLockUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExternalLockUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExternalLockUpdate is not found in the" + + " empty JSON string", + ExternalLockUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExternalLockUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExternalLockUpdate` 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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExternalLockUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExternalLockUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExternalLockUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExternalLockUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExternalLockUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExternalLockUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExternalLockUpdate + * @throws IOException if the JSON string is invalid with respect to ExternalLockUpdate + */ + public static ExternalLockUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExternalLockUpdate.class); + } + + /** + * Convert an instance of ExternalLockUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListStatus.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListStatus.java new file mode 100644 index 00000000..7870b058 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListStatus.java @@ -0,0 +1,645 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.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.*; + +/** ListStatus */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListStatus 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_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; + + @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) + @jakarta.annotation.Nullable + private Long gLowerCase; + + 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_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private String lLowerCase; + + public static final String SERIALIZED_NAME_L = "L"; + + @SerializedName(SERIALIZED_NAME_L) + @jakarta.annotation.Nullable + private String L; + + 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_C = "C"; + + @SerializedName(SERIALIZED_NAME_C) + @jakarta.annotation.Nullable + private String C; + + 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 = "O"; + + @SerializedName(SERIALIZED_NAME_O) + @jakarta.annotation.Nullable + private List<@Valid ListStatusOInner> O; + + public ListStatus() {} + + public ListStatus 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 ListStatus 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 ListStatus gLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + return this; + } + + /** + * Get gLowerCase + * + * @return gLowerCase + */ + @jakarta.annotation.Nullable + public Long getgLowerCase() { + return gLowerCase; + } + + public void setgLowerCase(@jakarta.annotation.Nullable Long gLowerCase) { + this.gLowerCase = gLowerCase; + } + + public ListStatus 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 ListStatus 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 ListStatus 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 ListStatus 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 ListStatus C(@jakarta.annotation.Nullable String C) { + this.C = C; + return this; + } + + /** + * Get C + * + * @return C + */ + @jakarta.annotation.Nullable + public String getC() { + return C; + } + + public void setC(@jakarta.annotation.Nullable String C) { + this.C = C; + } + + public ListStatus 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 ListStatus O(@jakarta.annotation.Nullable List<@Valid ListStatusOInner> O) { + this.O = O; + return this; + } + + public ListStatus addOItem(ListStatusOInner OItem) { + if (this.O == null) { + this.O = new ArrayList<>(); + } + this.O.add(OItem); + return this; + } + + /** + * Get O + * + * @return O + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid ListStatusOInner> getO() { + return O; + } + + public void setO(@jakarta.annotation.Nullable List<@Valid ListStatusOInner> O) { + this.O = O; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListStatus listStatus = (ListStatus) o; + return Objects.equals(this.E, listStatus.E) + && Objects.equals(this.sLowerCase, listStatus.sLowerCase) + && Objects.equals(this.gLowerCase, listStatus.gLowerCase) + && Objects.equals(this.cLowerCase, listStatus.cLowerCase) + && Objects.equals(this.lLowerCase, listStatus.lLowerCase) + && Objects.equals(this.L, listStatus.L) + && Objects.equals(this.rLowerCase, listStatus.rLowerCase) + && Objects.equals(this.C, listStatus.C) + && Objects.equals(this.T, listStatus.T) + && Objects.equals(this.O, listStatus.O); + } + + @Override + public int hashCode() { + return Objects.hash( + E, sLowerCase, gLowerCase, cLowerCase, lLowerCase, L, rLowerCase, C, T, O); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListStatus {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" gLowerCase: ").append(toIndentedString(gLowerCase)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).append("\n"); + sb.append(" L: ").append(toIndentedString(L)).append("\n"); + sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).append("\n"); + sb.append(" C: ").append(toIndentedString(C)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" O: ").append(toIndentedString(O)).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); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + Long gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + String gLowerCaseValueAsString = gLowerCaseValue.toString(); + valMap.put("gLowerCase", gLowerCaseValueAsString); + } + String cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + String cLowerCaseValueAsString = cLowerCaseValue.toString(); + valMap.put("cLowerCase", cLowerCaseValueAsString); + } + String lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + String LValue = getL(); + if (LValue != null) { + String LValueAsString = LValue.toString(); + valMap.put("L", LValueAsString); + } + String rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + String rLowerCaseValueAsString = rLowerCaseValue.toString(); + valMap.put("rLowerCase", rLowerCaseValueAsString); + } + String CValue = getC(); + if (CValue != null) { + String CValueAsString = CValue.toString(); + valMap.put("C", CValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + List<@Valid ListStatusOInner> OValue = getO(); + if (OValue != null) { + String OValueAsString = JSON.getGson().toJson(OValue); + valMap.put("O", OValueAsString); + } + + 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 sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + valMap.put("gLowerCase", gLowerCaseValue); + } + Object cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + valMap.put("cLowerCase", cLowerCaseValue); + } + Object lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + Object LValue = getL(); + if (LValue != null) { + valMap.put("L", LValue); + } + Object rLowerCaseValue = getrLowerCase(); + if (rLowerCaseValue != null) { + valMap.put("rLowerCase", rLowerCaseValue); + } + Object CValue = getC(); + if (CValue != null) { + valMap.put("C", CValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object OValue = getO(); + if (OValue != null) { + valMap.put("O", OValue); + } + + 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("s"); + openapiFields.add("g"); + openapiFields.add("c"); + openapiFields.add("l"); + openapiFields.add("L"); + openapiFields.add("r"); + openapiFields.add("C"); + openapiFields.add("T"); + openapiFields.add("O"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListStatus.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListStatus is not found in the empty" + + " JSON string", + ListStatus.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListStatus.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListStatus` 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("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("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("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("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("O") != null && !jsonObj.get("O").isJsonNull()) { + JsonArray jsonArrayO = jsonObj.getAsJsonArray("O"); + if (jsonArrayO != 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 < jsonArrayO.size(); i++) { + ListStatusOInner.validateJsonElement(jsonArrayO.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListStatus' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListStatus.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListStatus value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListStatus read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListStatus + * @throws IOException if the JSON string is invalid with respect to ListStatus + */ + public static ListStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListStatus.class); + } + + /** + * Convert an instance of ListStatus to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListStatusOInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListStatusOInner.java new file mode 100644 index 00000000..c85c8390 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListStatusOInner.java @@ -0,0 +1,322 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ListStatusOInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListStatusOInner 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_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private Long iLowerCase; + + public static final String SERIALIZED_NAME_C_LOWER_CASE = "c"; + + @SerializedName(SERIALIZED_NAME_C_LOWER_CASE) + @jakarta.annotation.Nullable + private String cLowerCase; + + public ListStatusOInner() {} + + public ListStatusOInner 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 ListStatusOInner 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 ListStatusOInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListStatusOInner listStatusOInner = (ListStatusOInner) o; + return Objects.equals(this.sLowerCase, listStatusOInner.sLowerCase) + && Objects.equals(this.iLowerCase, listStatusOInner.iLowerCase) + && Objects.equals(this.cLowerCase, listStatusOInner.cLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(sLowerCase, iLowerCase, cLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListStatusOInner {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).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); + } + Long iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + String cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + String cLowerCaseValueAsString = cLowerCaseValue.toString(); + valMap.put("cLowerCase", cLowerCaseValueAsString); + } + + 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 iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + valMap.put("cLowerCase", cLowerCaseValue); + } + + 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("i"); + openapiFields.add("c"); + + // 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 ListStatusOInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListStatusOInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListStatusOInner is not found in the" + + " empty JSON string", + ListStatusOInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListStatusOInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListStatusOInner` 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListStatusOInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListStatusOInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListStatusOInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListStatusOInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListStatusOInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListStatusOInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListStatusOInner + * @throws IOException if the JSON string is invalid with respect to ListStatusOInner + */ + public static ListStatusOInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListStatusOInner.class); + } + + /** + * Convert an instance of ListStatusOInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListenKeyExpired.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListenKeyExpired.java new file mode 100644 index 00000000..175c5404 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListenKeyExpired.java @@ -0,0 +1,277 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** 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 Long 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 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 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()); + Long 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("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/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OutboundAccountPosition.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OutboundAccountPosition.java new file mode 100644 index 00000000..4fafffec --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OutboundAccountPosition.java @@ -0,0 +1,340 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.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.*; + +/** OutboundAccountPosition */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OutboundAccountPosition 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_U_LOWER_CASE = "u"; + + @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) + @jakarta.annotation.Nullable + private Long uLowerCase; + + public static final String SERIALIZED_NAME_B = "B"; + + @SerializedName(SERIALIZED_NAME_B) + @jakarta.annotation.Nullable + private List<@Valid OutboundAccountPositionBInner> B; + + public OutboundAccountPosition() {} + + public OutboundAccountPosition 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 OutboundAccountPosition 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 OutboundAccountPosition B( + @jakarta.annotation.Nullable List<@Valid OutboundAccountPositionBInner> B) { + this.B = B; + return this; + } + + public OutboundAccountPosition addBItem(OutboundAccountPositionBInner BItem) { + if (this.B == null) { + this.B = new ArrayList<>(); + } + this.B.add(BItem); + return this; + } + + /** + * Get B + * + * @return B + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OutboundAccountPositionBInner> getB() { + return B; + } + + public void setB(@jakarta.annotation.Nullable List<@Valid OutboundAccountPositionBInner> B) { + this.B = B; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutboundAccountPosition outboundAccountPosition = (OutboundAccountPosition) o; + return Objects.equals(this.E, outboundAccountPosition.E) + && Objects.equals(this.uLowerCase, outboundAccountPosition.uLowerCase) + && Objects.equals(this.B, outboundAccountPosition.B); + } + + @Override + public int hashCode() { + return Objects.hash(E, uLowerCase, B); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutboundAccountPosition {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).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 uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + String uLowerCaseValueAsString = uLowerCaseValue.toString(); + valMap.put("uLowerCase", uLowerCaseValueAsString); + } + List<@Valid OutboundAccountPositionBInner> BValue = getB(); + if (BValue != null) { + String BValueAsString = JSON.getGson().toJson(BValue); + valMap.put("B", BValueAsString); + } + + 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 uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); + } + + 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("u"); + openapiFields.add("B"); + + // 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 OutboundAccountPosition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OutboundAccountPosition.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OutboundAccountPosition is not found" + + " in the empty JSON string", + OutboundAccountPosition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OutboundAccountPosition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OutboundAccountPosition` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("B") != null && !jsonObj.get("B").isJsonNull()) { + JsonArray jsonArrayB = jsonObj.getAsJsonArray("B"); + if (jsonArrayB != null) { + // ensure the json data is an array + if (!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())); + } + + // validate the optional field `B` (array) + for (int i = 0; i < jsonArrayB.size(); i++) { + OutboundAccountPositionBInner.validateJsonElement(jsonArrayB.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OutboundAccountPosition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OutboundAccountPosition' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OutboundAccountPosition.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OutboundAccountPosition value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OutboundAccountPosition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OutboundAccountPosition given an JSON string + * + * @param jsonString JSON string + * @return An instance of OutboundAccountPosition + * @throws IOException if the JSON string is invalid with respect to OutboundAccountPosition + */ + public static OutboundAccountPosition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OutboundAccountPosition.class); + } + + /** + * Convert an instance of OutboundAccountPosition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OutboundAccountPositionBInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OutboundAccountPositionBInner.java new file mode 100644 index 00000000..f1dec0ab --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OutboundAccountPositionBInner.java @@ -0,0 +1,339 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OutboundAccountPositionBInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OutboundAccountPositionBInner 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_F_LOWER_CASE = "f"; + + @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) + @jakarta.annotation.Nullable + private String fLowerCase; + + public static final String SERIALIZED_NAME_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private String lLowerCase; + + public OutboundAccountPositionBInner() {} + + public OutboundAccountPositionBInner 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 OutboundAccountPositionBInner 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 OutboundAccountPositionBInner 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutboundAccountPositionBInner outboundAccountPositionBInner = + (OutboundAccountPositionBInner) o; + return Objects.equals(this.aLowerCase, outboundAccountPositionBInner.aLowerCase) + && Objects.equals(this.fLowerCase, outboundAccountPositionBInner.fLowerCase) + && Objects.equals(this.lLowerCase, outboundAccountPositionBInner.lLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(aLowerCase, fLowerCase, lLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutboundAccountPositionBInner {\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).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 fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + String fLowerCaseValueAsString = fLowerCaseValue.toString(); + valMap.put("fLowerCase", fLowerCaseValueAsString); + } + String lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + + 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 fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + valMap.put("fLowerCase", fLowerCaseValue); + } + Object lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + + 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("f"); + openapiFields.add("l"); + + // 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 + * OutboundAccountPositionBInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OutboundAccountPositionBInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OutboundAccountPositionBInner is not" + + " found in the empty JSON string", + OutboundAccountPositionBInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OutboundAccountPositionBInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OutboundAccountPositionBInner` 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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OutboundAccountPositionBInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OutboundAccountPositionBInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OutboundAccountPositionBInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OutboundAccountPositionBInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OutboundAccountPositionBInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OutboundAccountPositionBInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OutboundAccountPositionBInner + * @throws IOException if the JSON string is invalid with respect to + * OutboundAccountPositionBInner + */ + public static OutboundAccountPositionBInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OutboundAccountPositionBInner.class); + } + + /** + * Convert an instance of OutboundAccountPositionBInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamEventsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamEventsResponse.java new file mode 100644 index 00000000..23f3d9d5 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamEventsResponse.java @@ -0,0 +1,670 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.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 UserDataStreamEventsResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(UserDataStreamEventsResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDataStreamEventsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDataStreamEventsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterOutboundAccountPosition = + gson.getDelegateAdapter(this, TypeToken.get(OutboundAccountPosition.class)); + final TypeAdapter adapterBalanceUpdate = + gson.getDelegateAdapter(this, TypeToken.get(BalanceUpdate.class)); + final TypeAdapter adapterExecutionReport = + gson.getDelegateAdapter(this, TypeToken.get(ExecutionReport.class)); + final TypeAdapter adapterListStatus = + gson.getDelegateAdapter(this, TypeToken.get(ListStatus.class)); + final TypeAdapter adapterListenKeyExpired = + gson.getDelegateAdapter(this, TypeToken.get(ListenKeyExpired.class)); + final TypeAdapter adapterEventStreamTerminated = + gson.getDelegateAdapter(this, TypeToken.get(EventStreamTerminated.class)); + final TypeAdapter adapterExternalLockUpdate = + gson.getDelegateAdapter(this, TypeToken.get(ExternalLockUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDataStreamEventsResponse value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `OutboundAccountPosition` + if (value.getActualInstance() instanceof OutboundAccountPosition) { + JsonElement element = + adapterOutboundAccountPosition.toJsonTree( + (OutboundAccountPosition) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `BalanceUpdate` + if (value.getActualInstance() instanceof BalanceUpdate) { + JsonElement element = + adapterBalanceUpdate.toJsonTree( + (BalanceUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ExecutionReport` + if (value.getActualInstance() instanceof ExecutionReport) { + JsonElement element = + adapterExecutionReport.toJsonTree( + (ExecutionReport) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ListStatus` + if (value.getActualInstance() instanceof ListStatus) { + JsonElement element = + adapterListStatus.toJsonTree( + (ListStatus) value.getActualInstance()); + 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; + } + // check if the actual instance is of the type `EventStreamTerminated` + if (value.getActualInstance() instanceof EventStreamTerminated) { + JsonElement element = + adapterEventStreamTerminated.toJsonTree( + (EventStreamTerminated) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ExternalLockUpdate` + if (value.getActualInstance() instanceof ExternalLockUpdate) { + JsonElement element = + adapterExternalLockUpdate.toJsonTree( + (ExternalLockUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " BalanceUpdate, EventStreamTerminated, ExecutionReport," + + " ExternalLockUpdate, ListStatus, ListenKeyExpired," + + " OutboundAccountPosition"); + } + + @Override + public UserDataStreamEventsResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + UserDataStreamEventsResponse newUserDataStreamEventsResponse = + new UserDataStreamEventsResponse(); + if (jsonObject.get("e") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for" + + " UserDataStreamEventsResponse as `e` was not found" + + " in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `e` + switch (jsonObject.get("e").getAsString()) { + case "balanceUpdate": + deserialized = + adapterBalanceUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "eventStreamTerminated": + deserialized = + adapterEventStreamTerminated.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "executionReport": + deserialized = + adapterExecutionReport.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "externalLockUpdate": + deserialized = + adapterExternalLockUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "listStatus": + deserialized = adapterListStatus.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "listenKeyExpired": + deserialized = + adapterListenKeyExpired.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "outboundAccountPosition": + deserialized = + adapterOutboundAccountPosition.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + default: + newUserDataStreamEventsResponse.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for UserDataStreamEventsResponse." + + " Possible values: balanceUpdate" + + " eventStreamTerminated" + + " executionReport externalLockUpdate" + + " listStatus listenKeyExpired" + + " outboundAccountPosition. Falling" + + " back to String.", + jsonObject.get("e").getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize OutboundAccountPosition + try { + // validate the JSON object to see if any exception is thrown + OutboundAccountPosition.validateJsonElement(jsonElement); + actualAdapter = adapterOutboundAccountPosition; + match++; + log.log( + Level.FINER, + "Input data matches schema 'OutboundAccountPosition'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for OutboundAccountPosition failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'OutboundAccountPosition'", + e); + } + // deserialize BalanceUpdate + try { + // validate the JSON object to see if any exception is thrown + BalanceUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterBalanceUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'BalanceUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for BalanceUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'BalanceUpdate'", + e); + } + // deserialize ExecutionReport + try { + // validate the JSON object to see if any exception is thrown + ExecutionReport.validateJsonElement(jsonElement); + actualAdapter = adapterExecutionReport; + match++; + log.log(Level.FINER, "Input data matches schema 'ExecutionReport'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExecutionReport failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ExecutionReport'", + e); + } + // deserialize ListStatus + try { + // validate the JSON object to see if any exception is thrown + ListStatus.validateJsonElement(jsonElement); + actualAdapter = adapterListStatus; + match++; + log.log(Level.FINER, "Input data matches schema 'ListStatus'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ListStatus failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ListStatus'", + 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); + } + // deserialize EventStreamTerminated + try { + // validate the JSON object to see if any exception is thrown + EventStreamTerminated.validateJsonElement(jsonElement); + actualAdapter = adapterEventStreamTerminated; + match++; + log.log( + Level.FINER, + "Input data matches schema 'EventStreamTerminated'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for EventStreamTerminated failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'EventStreamTerminated'", + e); + } + // deserialize ExternalLockUpdate + try { + // validate the JSON object to see if any exception is thrown + ExternalLockUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterExternalLockUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'ExternalLockUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExternalLockUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ExternalLockUpdate'", + e); + } + + if (match == 1) { + UserDataStreamEventsResponse ret = + new UserDataStreamEventsResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for" + + " UserDataStreamEventsResponse: %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 UserDataStreamEventsResponse() { + super("oneOf", Boolean.FALSE); + } + + public UserDataStreamEventsResponse(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("OutboundAccountPosition", OutboundAccountPosition.class); + schemas.put("BalanceUpdate", BalanceUpdate.class); + schemas.put("ExecutionReport", ExecutionReport.class); + schemas.put("ListStatus", ListStatus.class); + schemas.put("ListenKeyExpired", ListenKeyExpired.class); + schemas.put("EventStreamTerminated", EventStreamTerminated.class); + schemas.put("ExternalLockUpdate", ExternalLockUpdate.class); + } + + @Override + public Map> getSchemas() { + return UserDataStreamEventsResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: BalanceUpdate, EventStreamTerminated, ExecutionReport, + * ExternalLockUpdate, ListStatus, ListenKeyExpired, OutboundAccountPosition + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof OutboundAccountPosition) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof BalanceUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExecutionReport) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ListStatus) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ListenKeyExpired) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventStreamTerminated) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExternalLockUpdate) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be BalanceUpdate, EventStreamTerminated," + + " ExecutionReport, ExternalLockUpdate, ListStatus, ListenKeyExpired," + + " OutboundAccountPosition"); + } + + /** + * Get the actual instance, which can be the following: BalanceUpdate, EventStreamTerminated, + * ExecutionReport, ExternalLockUpdate, ListStatus, ListenKeyExpired, OutboundAccountPosition + * + * @return The actual instance (BalanceUpdate, EventStreamTerminated, ExecutionReport, + * ExternalLockUpdate, ListStatus, ListenKeyExpired, OutboundAccountPosition) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `OutboundAccountPosition`. If the actual instance is not + * `OutboundAccountPosition`, the ClassCastException will be thrown. + * + * @return The actual instance of `OutboundAccountPosition` + * @throws ClassCastException if the instance is not `OutboundAccountPosition` + */ + public OutboundAccountPosition getOutboundAccountPosition() throws ClassCastException { + return (OutboundAccountPosition) super.getActualInstance(); + } + + /** + * Get the actual instance of `BalanceUpdate`. If the actual instance is not `BalanceUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BalanceUpdate` + * @throws ClassCastException if the instance is not `BalanceUpdate` + */ + public BalanceUpdate getBalanceUpdate() throws ClassCastException { + return (BalanceUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `ExecutionReport`. If the actual instance is not + * `ExecutionReport`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExecutionReport` + * @throws ClassCastException if the instance is not `ExecutionReport` + */ + public ExecutionReport getExecutionReport() throws ClassCastException { + return (ExecutionReport) super.getActualInstance(); + } + + /** + * Get the actual instance of `ListStatus`. If the actual instance is not `ListStatus`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `ListStatus` + * @throws ClassCastException if the instance is not `ListStatus` + */ + public ListStatus getListStatus() throws ClassCastException { + return (ListStatus) 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(); + } + + /** + * Get the actual instance of `EventStreamTerminated`. If the actual instance is not + * `EventStreamTerminated`, the ClassCastException will be thrown. + * + * @return The actual instance of `EventStreamTerminated` + * @throws ClassCastException if the instance is not `EventStreamTerminated` + */ + public EventStreamTerminated getEventStreamTerminated() throws ClassCastException { + return (EventStreamTerminated) super.getActualInstance(); + } + + /** + * Get the actual instance of `ExternalLockUpdate`. If the actual instance is not + * `ExternalLockUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExternalLockUpdate` + * @throws ClassCastException if the instance is not `ExternalLockUpdate` + */ + public ExternalLockUpdate getExternalLockUpdate() throws ClassCastException { + return (ExternalLockUpdate) 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 + * UserDataStreamEventsResponse + */ + 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 OutboundAccountPosition + try { + OutboundAccountPosition.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for OutboundAccountPosition failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with BalanceUpdate + try { + BalanceUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for BalanceUpdate failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ExecutionReport + try { + ExecutionReport.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExecutionReport failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ListStatus + try { + ListStatus.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ListStatus failed with `%s`.", 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 + } + // validate the json string with EventStreamTerminated + try { + EventStreamTerminated.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for EventStreamTerminated failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ExternalLockUpdate + try { + ExternalLockUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExternalLockUpdate 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: BalanceUpdate, EventStreamTerminated, ExecutionReport," + + " ExternalLockUpdate, ListStatus, ListenKeyExpired," + + " OutboundAccountPosition. %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 UserDataStreamEventsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDataStreamEventsResponse + * @throws IOException if the JSON string is invalid with respect to + * UserDataStreamEventsResponse + */ + public static UserDataStreamEventsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDataStreamEventsResponse.class); + } + + /** + * Convert an instance of UserDataStreamEventsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java index 8efbcf14..de292a1c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java @@ -34,13 +34,16 @@ import com.binance.connector.client.spot.websocket.stream.model.TickerResponse; import com.binance.connector.client.spot.websocket.stream.model.TradeRequest; import com.binance.connector.client.spot.websocket.stream.model.TradeResponse; +import java.util.UUID; public class SpotWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-spot/3.1.0 (Java/%s; %s; %s)", + "binance-spot/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private final StreamConnectionInterface connection; + private WebSocketStreamsApi webSocketStreamsApi; public SpotWebSocketStreams(WebSocketClientConfiguration configuration) { @@ -55,6 +58,7 @@ public SpotWebSocketStreams(StreamConnectionInterface connection) { if (!connection.isConnected()) { connection.connect(); } + this.connection = connection; this.webSocketStreamsApi = new WebSocketStreamsApi(connection); } @@ -129,4 +133,8 @@ public StreamBlockingQueueWrapper trade(TradeRequest tradeRequest throws ApiException { return webSocketStreamsApi.trade(tradeRequest); } + + public String getRequestID() { + return UUID.randomUUID().toString(); + } } diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java index 189fc3a8..9b5597ad 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java @@ -14,11 +14,12 @@ import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.common.websocket.dtos.StreamResponse; import com.binance.connector.client.common.websocket.adapter.ConnectionWrapper; - import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; import com.binance.connector.client.common.websocket.dtos.BaseRequestDTO; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; +import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStartResponse; @@ -26,14 +27,6 @@ import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeResponse; -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.concurrent.CompletableFuture; - import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.client.WebSocketClient; @@ -43,6 +36,14 @@ import org.mockito.Mockito; import org.skyscreamer.jsonassert.JSONAssert; +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.concurrent.CompletableFuture; + /** API tests for UserDataStreamApi */ public class UserDataStreamApiTest { @@ -189,7 +190,7 @@ public void userDataStreamStopTest() throws ApiException, URISyntaxException, IO */ @Test public void userDataStreamSubscribeTest() throws ApiException, URISyntaxException, IOException { - CompletableFuture response = api.userDataStreamSubscribe(); + StreamResponse userDataStreamSubscribe = api.userDataStreamSubscribe(); ArgumentCaptor> callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); diff --git a/examples/derivatives-trading-coin-futures/pom.xml b/examples/derivatives-trading-coin-futures/pom.xml index f81f388e..e8d007f3 100644 --- a/examples/derivatives-trading-coin-futures/pom.xml +++ b/examples/derivatives-trading-coin-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-coin-futures - 1.3.0 + 2.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java index 589bb452..8a1b1fb3 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java @@ -40,7 +40,7 @@ public DerivativesTradingCoinFuturesRestApi getApi() { /** * Query Index Price Constituents * - *

Query index price constituents Weight: 2 + *

Query index price constituents Weight: 1 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/AccountInformationExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/AccountInformationExample.java index 04a81421..a087c4f3 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/AccountInformationExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/AccountInformationExample.java @@ -28,7 +28,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/FuturesAccountBalanceExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/FuturesAccountBalanceExample.java index 884dbea4..96776641 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/FuturesAccountBalanceExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/account/FuturesAccountBalanceExample.java @@ -28,7 +28,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/CancelOrderExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/CancelOrderExample.java index 0c2a8bc1..e1003d0e 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/CancelOrderExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/CancelOrderExample.java @@ -28,7 +28,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java index af760715..6e82a38f 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java @@ -29,7 +29,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/NewOrderExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/NewOrderExample.java index 7b751163..5d312b41 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/NewOrderExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/NewOrderExample.java @@ -30,7 +30,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/PositionInformationExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/PositionInformationExample.java index cc185b90..1e383b08 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/PositionInformationExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/PositionInformationExample.java @@ -28,7 +28,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/QueryOrderExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/QueryOrderExample.java index edaa4384..3e9d6569 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/QueryOrderExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/QueryOrderExample.java @@ -28,7 +28,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java index cbb9631a..4e2129ae 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java @@ -28,7 +28,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java index 30853206..35fd4fa9 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java @@ -28,7 +28,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java index 9001dff5..c7ef0e0a 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java @@ -28,7 +28,9 @@ public DerivativesTradingCoinFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingCoinFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-options/pom.xml b/examples/derivatives-trading-options/pom.xml index 54604fcf..4856805c 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 - 1.3.0 + 2.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin-pro/pom.xml b/examples/derivatives-trading-portfolio-margin-pro/pom.xml index 84a657d9..4c1e4a66 100644 --- a/examples/derivatives-trading-portfolio-margin-pro/pom.xml +++ b/examples/derivatives-trading-portfolio-margin-pro/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-portfolio-margin-pro - 2.1.0 + 3.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin/pom.xml b/examples/derivatives-trading-portfolio-margin/pom.xml index 9098742a..5078ec56 100644 --- a/examples/derivatives-trading-portfolio-margin/pom.xml +++ b/examples/derivatives-trading-portfolio-margin/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-portfolio-margin - 1.3.0 + 2.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CmAccountTradeListExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CmAccountTradeListExample.java index ba23c5c0..ebeb14ac 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CmAccountTradeListExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CmAccountTradeListExample.java @@ -45,8 +45,10 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { * together * `pair` and `fromId` cannot be sent together * * `OrderId` can only be sent together with symbol * If a `pair` is sent, * tickers for all symbols of the `pair` will be returned * The parameter - * `fromId` cannot be sent with `startTime` or `endTime` Weight: - * 20 with symbol, 40 with pair + * `fromId` cannot be sent with `startTime` or `endTime` * If + * `startTime` and `endTime` are both not sent, then the last '24 + * hours' data will be returned. * The time between `startTime` and + * `endTime` cannot be longer than 24 hours. Weight: 20 with symbol, 40 with pair * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/UmAccountTradeListExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/UmAccountTradeListExample.java index 38ad9f59..ce41e926 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/UmAccountTradeListExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/UmAccountTradeListExample.java @@ -41,10 +41,10 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { * UM Account Trade List(USER_DATA) * *

Get trades for a specific account and UM symbol. * If `startTime` and - * `endTime` are both not sent, then the last '24 hours' data will be - * returned. * The time between `startTime` and `endTime` cannot be longer - * than 24 hours. * The parameter `fromId` cannot be sent with `startTime` - * or `endTime`. Weight: 5 + * `endTime` are both not sent, then the last '7 days' data will be returned. + * * The time between `startTime` and `endTime` cannot be longer than 7 + * days. * The parameter `fromId` cannot be sent with `startTime` or + * `endTime`. Weight: 5 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/pom.xml b/examples/derivatives-trading-usds-futures/pom.xml index 8d763ea8..b3b6d2b7 100644 --- a/examples/derivatives-trading-usds-futures/pom.xml +++ b/examples/derivatives-trading-usds-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-usds-futures - 3.1.0 + 4.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/PlaceMultipleOrdersExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/PlaceMultipleOrdersExample.java index 30dc626f..348cc890 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/PlaceMultipleOrdersExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/PlaceMultipleOrdersExample.java @@ -18,7 +18,7 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; -import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.BatchOrders; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.BatchOrdersPlaceMultipleOrders; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.PlaceMultipleOrdersRequest; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.PlaceMultipleOrdersResponse; @@ -52,7 +52,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { */ public void placeMultipleOrdersExample() throws ApiException { PlaceMultipleOrdersRequest placeMultipleOrdersRequest = new PlaceMultipleOrdersRequest(); - placeMultipleOrdersRequest.batchOrders(new BatchOrders()); + placeMultipleOrdersRequest.batchOrders(new BatchOrdersPlaceMultipleOrders()); ApiResponse response = getApi().placeMultipleOrders(placeMultipleOrdersRequest); System.out.println(response.getData()); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationExample.java index 36d21846..a4a7b2ba 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java index 18682f78..9183ae24 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleSync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleSync.java index c5a5c060..e2f4a607 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleSync.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleSync.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceExample.java index 5e7e8ab8..962d388e 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java index 6b59e530..c63c1e5a 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleSync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleSync.java index cc544c0f..05f9f01a 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleSync.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleSync.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java index 67c2726e..f1c68d3e 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java index 5c4dcec0..0eccac50 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolPriceTickerExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolPriceTickerExample.java index adaf66c8..0f5e8a24 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolPriceTickerExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolPriceTickerExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelOrderExample.java index 1945460c..4e7b8de8 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelOrderExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java index ff751c69..acda6f72 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java @@ -29,7 +29,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewOrderExample.java index 8b665b08..d08ba430 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewOrderExample.java @@ -29,7 +29,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationExample.java index 6a8b53cd..bfa147a6 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java index 4bd76b8b..f7e563bc 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleSync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleSync.java index b233799c..70184a24 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleSync.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleSync.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/QueryOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/QueryOrderExample.java index e87135a5..3360ad58 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/QueryOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/QueryOrderExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java index 7a104624..5a4c92a4 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/CloseUserDataStreamExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java index d455879d..21431101 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/KeepaliveUserDataStreamExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java index 216551ca..1aa72d29 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/userdatastreams/StartUserDataStreamExample.java @@ -28,7 +28,9 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/margin-trading/pom.xml b/examples/margin-trading/pom.xml index 821b33ea..68949870 100644 --- a/examples/margin-trading/pom.xml +++ b/examples/margin-trading/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-margin-trading - 2.0.0 + 3.0.0 \ No newline at end of file diff --git a/examples/spot/pom.xml b/examples/spot/pom.xml index 787335b0..e4d656ca 100644 --- a/examples/spot/pom.xml +++ b/examples/spot/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-spot - 3.1.0 + 4.0.0 \ No newline at end of file diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountCommissionExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountCommissionExample.java index 7c158e31..96c9f118 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountCommissionExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountCommissionExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountRateLimitsOrdersExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountRateLimitsOrdersExample.java index 53272f99..8e44dda2 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountRateLimitsOrdersExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountRateLimitsOrdersExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountStatusExample.java index 978cadff..8f05ee38 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AccountStatusExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java index f4dddc4e..d0fa7b43 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrdersExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrdersExample.java index 07777fac..508d9131 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrdersExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrdersExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyAllocationsExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyAllocationsExample.java index d8a5f69d..3aa2a4f9 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyAllocationsExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyAllocationsExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyPreventedMatchesExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyPreventedMatchesExample.java index e713fb30..0d4858a4 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyPreventedMatchesExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyPreventedMatchesExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyTradesExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyTradesExample.java index 3eff1f36..ecf231ed 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyTradesExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyTradesExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java index 7a9665e5..1c1bd9e8 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java index 806d5809..5925b3b6 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderAmendmentsExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderAmendmentsExample.java index 02e1ff8d..874de14f 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderAmendmentsExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderAmendmentsExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java index d875e4f7..b218bb64 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java index 3a167760..507e663a 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogonExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogonExample.java index 0f02216b..91781590 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogonExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogonExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogoutExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogoutExample.java index 76683d5d..31208db2 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogoutExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogoutExample.java @@ -27,7 +27,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionStatusExample.java index ba98cbed..cab7c447 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionStatusExample.java @@ -27,7 +27,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/ExchangeInfoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/ExchangeInfoExample.java index 7693890d..f488c3ac 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/ExchangeInfoExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/ExchangeInfoExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java index 3b7138c6..fd4b83c0 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java @@ -27,7 +27,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/TimeExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/TimeExample.java index 85be354f..55028f3c 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/TimeExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/TimeExample.java @@ -27,7 +27,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/AvgPriceExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/AvgPriceExample.java index 6b3ca70c..da9d0b6f 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/AvgPriceExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/AvgPriceExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/DepthExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/DepthExample.java index d967a1e9..1495e1db 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/DepthExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/DepthExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java index c74d5dc1..2f39bc33 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/KlinesExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/KlinesExample.java index c983459e..20e1162b 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/KlinesExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/KlinesExample.java @@ -29,7 +29,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerBookExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerBookExample.java index 76687f88..a76b15d9 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerBookExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerBookExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerExample.java index 23a2cbfc..ed98c667 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerPriceExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerPriceExample.java index 6ad9a383..8f65a18f 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerPriceExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerPriceExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerTradingDayExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerTradingDayExample.java index 65fd72dc..b806bfcc 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerTradingDayExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerTradingDayExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesAggregateExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesAggregateExample.java index 1ee26286..49d7fd71 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesAggregateExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesAggregateExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesHistoricalExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesHistoricalExample.java index bbfbed1c..09175a54 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesHistoricalExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesHistoricalExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesRecentExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesRecentExample.java index 2f0f6c42..7a63bc4c 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesRecentExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TradesRecentExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/UiKlinesExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/UiKlinesExample.java index cbc83e9b..d05493bf 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/UiKlinesExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/UiKlinesExample.java @@ -29,7 +29,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersCancelAllExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersCancelAllExample.java index 64c27d89..0751adae 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersCancelAllExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersCancelAllExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderAmendKeepPriorityExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderAmendKeepPriorityExample.java index f831a0a0..5962d59c 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderAmendKeepPriorityExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderAmendKeepPriorityExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelExample.java index 73d70147..a48e3d16 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelReplaceExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelReplaceExample.java index 5a8e8a70..6bcc4f2c 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelReplaceExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelReplaceExample.java @@ -31,7 +31,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListCancelExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListCancelExample.java index 0f2e267f..a2a68569 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListCancelExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListCancelExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceExample.java index 2f0dc9ac..29334353 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceExample.java @@ -29,7 +29,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java index 30305dde..305fcdd5 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java @@ -31,7 +31,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java index 6629ea88..8861edfe 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java @@ -32,7 +32,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java index fad4e7c0..76a482ff 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java @@ -32,7 +32,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderPlaceExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderPlaceExample.java index dee22551..ad88aa47 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderPlaceExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderPlaceExample.java @@ -30,7 +30,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderTestExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderTestExample.java index 1a509512..24d08ff1 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderTestExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderTestExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java index 062d3d9a..341bcf67 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java @@ -30,7 +30,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderTestExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderTestExample.java index 9d1bfb24..ea6c627a 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderTestExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderTestExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java index 094190e4..e21a32aa 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java index cfc47711..1841b51c 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java @@ -27,7 +27,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java index 0d5c0f86..aa977814 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java @@ -28,7 +28,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeExample.java index 04d43caf..a37d86a1 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeExample.java @@ -14,10 +14,12 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.common.websocket.dtos.StreamResponse; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; import com.binance.connector.client.spot.websocket.api.SpotWebSocketApiUtil; import com.binance.connector.client.spot.websocket.api.api.SpotWebSocketApi; +import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeResponse; -import java.util.concurrent.CompletableFuture; /** API examples for UserDataStreamApi */ public class UserDataStreamSubscribeExample { @@ -27,7 +29,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key"); @@ -42,28 +46,17 @@ public SpotWebSocketApi getApi() { * *

Subscribe to the User Data Stream in the current WebSocket connection. Weight: 2 */ - public void userDataStreamSubscribeExampleAsync() { - CompletableFuture future = + public void userDataStreamSubscribeExampleStream() throws InterruptedException { + StreamResponse resp = getApi().userDataStreamSubscribe(); - future.handle( - (response, error) -> { - if (error != null) { - System.err.println(error); - } - System.out.println(response); - return response; - }); - } - - /** - * WebSocket Subscribe to User Data Stream - * - *

Subscribe to the User Data Stream in the current WebSocket connection. Weight: 2 - */ - public void userDataStreamSubscribeExampleSync() { - CompletableFuture future = - getApi().userDataStreamSubscribe(); - UserDataStreamSubscribeResponse response = future.join(); - System.out.println(response); + resp.getResponse() + .thenAccept( + responseResult -> { + System.out.println(responseResult); + }); + StreamBlockingQueueWrapper stream = resp.getStream(); + while (true) { + System.out.println(stream.take().getActualInstance()); + } } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java index 04861987..132c3a20 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java @@ -27,7 +27,9 @@ public SpotWebSocketApi getApi() { if (api == null) { WebSocketClientConfiguration clientConfiguration = SpotWebSocketApiUtil.getClientConfiguration(); - clientConfiguration.setAutoLogon(false); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("/path/to/private.key");