From 0bc7878bc162af4563d7275a2228003872777ad1 Mon Sep 17 00:00:00 2001 From: theo-s68 <194042188+theo-s68@users.noreply.github.com> Date: Mon, 4 May 2026 14:08:11 +0700 Subject: [PATCH] Generate products 04/05/2026 --- MIGRATION.md | 2 +- README.md | 2 +- clients/algo/CHANGELOG.md | 1 + clients/alpha/CHANGELOG.md | 1 + clients/c2c/CHANGELOG.md | 30 + .../c2c/docs/GetC2CTradeHistoryResponse.md | 23 +- .../GetC2CTradeHistoryResponseDataInner.md | 26 - clients/c2c/docs/rest-api/migration-guide.md | 4 +- clients/c2c/pom.xml | 2 +- .../connector/client/c2c/rest/JSON.java | 3 - .../connector/client/c2c/rest/api/C2CApi.java | 2 +- .../model/GetC2CTradeHistoryResponse.java | 797 ++++++-- .../GetC2CTradeHistoryResponseDataInner.java | 766 ------- clients/convert/CHANGELOG.md | 1 + clients/copy-trading/CHANGELOG.md | 1 + clients/crypto-loan/CHANGELOG.md | 1 + .../CHANGELOG.md | 5 + .../docs/rest-api/migration-guide.md | 4 +- .../derivatives-trading-coin-futures/pom.xml | 2 +- .../rest/api/AccountApi.java | 2 +- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/PortfolioMarginEndpointsApi.java | 2 +- .../rest/api/TradeApi.java | 2 +- .../rest/api/UserDataStreamsApi.java | 2 +- .../websocket/api/api/AccountApi.java | 4 + ...vativesTradingCoinFuturesWebSocketApi.java | 12 +- .../websocket/api/api/TradeApi.java | 4 + .../websocket/api/api/UserDataStreamsApi.java | 4 + ...vesTradingCoinFuturesWebSocketStreams.java | 8 +- .../stream/api/WebsocketMarketStreamsApi.java | 6 +- .../derivatives-trading-options/CHANGELOG.md | 41 + .../docs/AccountApi.md | 2 +- ...CancelMultipleOptionOrdersResponseInner.md | 1 + .../docs/CancelOptionOrderResponse.md | 1 + .../docs/NewOrderRequest.md | 1 + .../docs/NewOrderResponse.md | 1 + .../OptionMarginAccountInformationResponse.md | 1 + .../docs/OrderTradeUpdateO.md | 1 + .../docs/OrdersInner.md | 11 + .../docs/PlaceMultipleOrdersResponseInner.md | 1 + ...eryCurrentOpenOptionOrdersResponseInner.md | 1 + .../docs/QuerySingleOrderResponse.md | 1 + .../docs/SelfTradePreventionMode.md | 15 + .../docs/TradeApi.md | 2 +- .../docs/rest-api/migration-guide.md | 4 +- .../example_rest.md | 2 +- clients/derivatives-trading-options/pom.xml | 2 +- .../rest/api/AccountApi.java | 5 +- .../api/DerivativesTradingOptionsRestApi.java | 6 +- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/MarketMakerBlockTradeApi.java | 2 +- .../rest/api/MarketMakerEndpointsApi.java | 2 +- .../rest/api/TradeApi.java | 10 +- .../rest/api/UserDataStreamsApi.java | 2 +- ...ncelMultipleOptionOrdersResponseInner.java | 55 +- .../rest/model/CancelOptionOrderResponse.java | 55 +- .../rest/model/NewOrderRequest.java | 47 + .../rest/model/NewOrderResponse.java | 54 +- ...ptionMarginAccountInformationResponse.java | 39 +- .../rest/model/OrdersInner.java | 114 +- .../PlaceMultipleOrdersResponseInner.java | 55 +- ...yCurrentOpenOptionOrdersResponseInner.java | 55 +- .../rest/model/QuerySingleOrderResponse.java | 55 +- .../rest/model/SelfTradePreventionMode.java | 75 + ...vativesTradingOptionsWebSocketStreams.java | 16 +- .../websocket/stream/api/MarketApi.java | 6 +- .../websocket/stream/api/PublicApi.java | 6 +- .../stream/model/OrderTradeUpdateO.java | 50 +- .../CHANGELOG.md | 13 + .../docs/AccountApi.md | 189 ++ .../docs/DeleteMarginCallLevelResponse.md | 13 + .../docs/GetMarginCallLevelResponse.md | 13 + .../docs/PmProAccountUpdate.md | 20 + .../docs/SetMarginCallLevelRequest.md | 14 + .../docs/SetMarginCallLevelResponse.md | 13 + .../docs/UserDataStreamEventsResponse.md | 6 +- .../docs/rest-api/migration-guide.md | 4 +- .../example_rest.md | 6 + .../pom.xml | 2 +- .../rest/JSON.java | 12 + .../rest/api/AccountApi.java | 419 +++- ...tivesTradingPortfolioMarginProRestApi.java | 77 + .../rest/api/MarketDataApi.java | 2 +- .../model/DeleteMarginCallLevelResponse.java | 216 ++ .../model/GetMarginCallLevelResponse.java | 212 ++ .../rest/model/SetMarginCallLevelRequest.java | 250 +++ .../model/SetMarginCallLevelResponse.java | 212 ++ .../websocket/stream/JSON.java | 15 + ...ingPortfolioMarginProWebSocketStreams.java | 8 +- .../stream/model/PmProAccountUpdate.java | 547 +++++ .../model/UserDataStreamEventsResponse.java | 92 +- .../CHANGELOG.md | 33 + .../docs/AccountApi.md | 6 +- .../docs/AlgoUpdate.md | 16 + .../docs/AlgoUpdateAo.md | 37 + .../docs/CancelAllUmAlgoOpenOrdersResponse.md | 14 + .../docs/CancelUmAlgoOrderResponse.md | 13 + .../docs/Executionreport.md | 5 + .../docs/FuturesTradfiPerpsContractRequest.md | 13 + .../FuturesTradfiPerpsContractResponse.md | 0 .../docs/GetUmIncomeHistoryResponseInner.md | 2 +- .../docs/NewUmAlgoOrderRequest.md | 33 + .../docs/NewUmAlgoOrderResponse.md | 37 + ...QueryAllCurrentUmOpenAlgoOrdersResponse.md | 12 + ...AllCurrentUmOpenAlgoOrdersResponseInner.md | 42 + .../QueryCurrentUmOpenAlgoOrderResponse.md | 42 + .../docs/QueryUmAlgoOrderHistoryResponse.md | 12 + .../QueryUmAlgoOrderHistoryResponseInner.md | 42 + .../docs/TradeApi.md | 499 ++++- .../docs/UserDataStreamEventsResponse.md | 6 + .../docs/rest-api/migration-guide.md | 4 +- .../example_rest.md | 20 +- .../pom.xml | 2 +- .../rest/JSON.java | 33 + .../rest/api/AccountApi.java | 8 +- ...ivativesTradingPortfolioMarginRestApi.java | 299 ++- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/TradeApi.java | 1800 ++++++++++++++--- .../rest/api/UserDataStreamsApi.java | 2 +- .../CancelAllUmAlgoOpenOrdersResponse.java | 249 +++ .../rest/model/CancelUmAlgoOrderResponse.java | 203 ++ .../FuturesTradfiPerpsContractRequest.java | 210 ++ .../FuturesTradfiPerpsContractResponse.java | 8 +- .../GetUmIncomeHistoryResponseInner.java | 16 +- .../rest/model/NewUmAlgoOrderRequest.java | 982 +++++++++ .../rest/model/NewUmAlgoOrderResponse.java | 1143 +++++++++++ ...eryAllCurrentUmOpenAlgoOrdersResponse.java | 193 ++ ...lCurrentUmOpenAlgoOrdersResponseInner.java | 1423 +++++++++++++ .../QueryCurrentUmOpenAlgoOrderResponse.java | 1389 +++++++++++++ .../QueryUmAlgoOrderHistoryResponse.java | 188 ++ .../QueryUmAlgoOrderHistoryResponseInner.java | 1395 +++++++++++++ .../websocket/stream/JSON.java | 16 + ...radingPortfolioMarginWebSocketStreams.java | 8 +- .../websocket/stream/model/AlgoUpdate.java | 356 ++++ .../websocket/stream/model/AlgoUpdateAo.java | 1296 ++++++++++++ .../stream/model/Executionreport.java | 234 ++- .../model/UserDataStreamEventsResponse.java | 110 +- .../CHANGELOG.md | 25 + .../docs/Interval.md | 2 + .../docs/MarketApi.md | 4 +- .../docs/rest-api/migration-guide.md | 4 +- .../example_rest.md | 4 +- .../derivatives-trading-usds-futures/pom.xml | 2 +- .../rest/JSON.java | 3 - .../rest/api/AccountApi.java | 2 +- .../rest/api/ConvertApi.java | 2 +- .../DerivativesTradingUsdsFuturesRestApi.java | 28 +- .../rest/api/MarketDataApi.java | 10 +- .../rest/api/PortfolioMarginEndpointsApi.java | 2 +- .../rest/api/TradeApi.java | 50 +- .../rest/api/UserDataStreamsApi.java | 2 +- .../rest/model/Interval.java | 2 + .../websocket/api/api/AccountApi.java | 4 + ...vativesTradingUsdsFuturesWebSocketApi.java | 12 +- .../websocket/api/api/MarketDataApi.java | 4 + .../websocket/api/api/TradeApi.java | 4 + .../websocket/api/api/UserDataStreamsApi.java | 4 + ...vesTradingUsdsFuturesWebSocketStreams.java | 16 +- .../websocket/stream/api/MarketApi.java | 14 +- .../websocket/stream/api/PublicApi.java | 6 +- clients/dual-investment/CHANGELOG.md | 1 + clients/fiat/CHANGELOG.md | 1 + clients/gift-card/CHANGELOG.md | 1 + clients/margin-trading/CHANGELOG.md | 1 + clients/mining/CHANGELOG.md | 1 + clients/nft/CHANGELOG.md | 1 + clients/pay/CHANGELOG.md | 19 + ...istoryResponseDataInnerFundsDetailInner.md | 2 +- ...taInnerFundsDetailInnerWalletAssetCost.md} | 2 +- clients/pay/docs/rest-api/migration-guide.md | 4 +- clients/pay/pom.xml | 2 +- .../connector/client/pay/rest/JSON.java | 2 +- .../connector/client/pay/rest/api/PayApi.java | 2 +- ...toryResponseDataInnerFundsDetailInner.java | 55 +- ...InnerFundsDetailInnerWalletAssetCost.java} | 66 +- clients/rebate/CHANGELOG.md | 1 + clients/simple-earn/CHANGELOG.md | 1 + clients/spot/CHANGELOG.md | 13 + .../spot/docs/ReferencePriceResponseResult.md | 2 + clients/spot/docs/rest-api/migration-guide.md | 4 +- clients/spot/pom.xml | 2 +- .../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/websocket/api/api/AccountApi.java | 4 + .../spot/websocket/api/api/AuthApi.java | 4 + .../spot/websocket/api/api/GeneralApi.java | 4 + .../spot/websocket/api/api/MarketApi.java | 4 + .../websocket/api/api/SpotWebSocketApi.java | 12 +- .../spot/websocket/api/api/TradeApi.java | 4 + .../websocket/api/api/UserDataStreamApi.java | 4 + .../model/ReferencePriceResponseResult.java | 89 +- .../stream/api/SpotWebSocketStreams.java | 8 +- .../stream/api/WebSocketStreamsApi.java | 6 +- clients/staking/CHANGELOG.md | 25 + clients/staking/docs/EthStakingApi.md | 12 +- clients/staking/docs/RedeemEthResponse.md | 1 + clients/staking/docs/RedeemSolResponse.md | 1 + clients/staking/docs/SolStakingApi.md | 12 +- .../docs/SubscribeEthStakingResponse.md | 1 + .../docs/SubscribeSolStakingResponse.md | 1 + .../staking/docs/rest-api/migration-guide.md | 4 +- clients/staking/pom.xml | 2 +- .../staking/rest/api/EthStakingApi.java | 42 +- .../staking/rest/api/OnChainYieldsApi.java | 2 +- .../staking/rest/api/SoftStakingApi.java | 2 +- .../staking/rest/api/SolStakingApi.java | 42 +- .../staking/rest/api/StakingRestApi.java | 24 +- .../staking/rest/model/RedeemEthResponse.java | 36 +- .../staking/rest/model/RedeemSolResponse.java | 36 +- .../model/SubscribeEthStakingResponse.java | 37 +- .../model/SubscribeSolStakingResponse.java | 36 +- .../staking/rest/api/EthStakingApiTest.java | 14 +- .../staking/rest/api/SolStakingApiTest.java | 14 +- clients/sub-account/CHANGELOG.md | 1 + clients/vip-loan/CHANGELOG.md | 1 + clients/wallet/CHANGELOG.md | 1 + examples/c2c/pom.xml | 2 +- .../derivatives-trading-coin-futures/pom.xml | 2 +- examples/derivatives-trading-options/pom.xml | 2 +- .../account/AccountFundingFlowExample.java | 2 +- .../rest/trade/AccountTradeListExample.java | 3 +- .../pom.xml | 2 +- .../account/DeleteMarginCallLevelExample.java | 53 + .../account/GetMarginCallLevelExample.java | 52 + .../account/SetMarginCallLevelExample.java | 56 + .../pom.xml | 2 +- ...UmFuturesOrderDownloadLinkByIdExample.java | 2 +- ...UmFuturesTradeDownloadLinkByIdExample.java | 2 +- ...resTransactionDownloadLinkByIdExample.java | 3 +- .../CancelAllUmAlgoOpenOrdersExample.java | 54 + ...ncelAllUmOpenConditionalOrdersExample.java | 2 +- .../rest/trade/CancelUmAlgoOrderExample.java | 56 + .../CancelUmConditionalOrderExample.java | 2 +- .../FuturesTradfiPerpsContractExample.java | 55 + .../rest/trade/NewUmAlgoOrderExample.java | 92 + .../trade/NewUmConditionalOrderExample.java | 2 +- ...ueryAllCurrentUmOpenAlgoOrdersExample.java | 58 + ...CurrentUmOpenConditionalOrdersExample.java | 2 +- .../QueryAllUmConditionalOrdersExample.java | 2 +- .../QueryCurrentUmOpenAlgoOrderExample.java | 59 + ...yCurrentUmOpenConditionalOrderExample.java | 2 +- .../trade/QueryUmAlgoOrderHistoryExample.java | 62 + ...QueryUmConditionalOrderHistoryExample.java | 2 +- .../trade/QueryUsersCmForceOrdersExample.java | 3 +- .../trade/QueryUsersUmForceOrdersExample.java | 3 +- .../derivatives-trading-usds-futures/pom.xml | 2 +- .../rest/marketdata/BasisExample.java | 2 +- ...usContractKlineCandlestickDataExample.java | 2 +- ...IndexPriceKlineCandlestickDataExample.java | 2 +- .../KlineCandlestickDataExample.java | 2 +- .../MarkPriceKlineCandlestickDataExample.java | 2 +- .../marketdata/OldTradesLookupExample.java | 2 +- .../PremiumIndexKlineDataExample.java | 2 +- .../FuturesTradfiPerpsContractExample.java | 6 +- .../rest/trade/QueryAllAlgoOrdersExample.java | 4 +- .../rest/trade/UsersForceOrdersExample.java | 3 +- ...lMarketLiquidationOrderStreamsExample.java | 2 +- .../LiquidationOrderStreamsExample.java | 2 +- examples/pay/pom.xml | 2 +- examples/spot/pom.xml | 2 +- ...erDataStreamSubscribeSignatureExample.java | 1 + examples/staking/pom.xml | 2 +- .../GetEthRedemptionHistoryExample.java | 4 +- .../GetEthStakingHistoryExample.java | 4 +- .../GetSolRedemptionHistoryExample.java | 4 +- .../GetSolStakingHistoryExample.java | 4 +- 268 files changed, 17227 insertions(+), 1679 deletions(-) delete mode 100644 clients/c2c/docs/GetC2CTradeHistoryResponseDataInner.md delete mode 100644 clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/model/GetC2CTradeHistoryResponseDataInner.java create mode 100644 clients/derivatives-trading-options/docs/SelfTradePreventionMode.md create mode 100644 clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/SelfTradePreventionMode.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/docs/DeleteMarginCallLevelResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin-pro/docs/GetMarginCallLevelResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin-pro/docs/PmProAccountUpdate.md create mode 100644 clients/derivatives-trading-portfolio-margin-pro/docs/SetMarginCallLevelRequest.md create mode 100644 clients/derivatives-trading-portfolio-margin-pro/docs/SetMarginCallLevelResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/DeleteMarginCallLevelResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/GetMarginCallLevelResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SetMarginCallLevelRequest.java create mode 100644 clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SetMarginCallLevelResponse.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/PmProAccountUpdate.java create mode 100644 clients/derivatives-trading-portfolio-margin/docs/AlgoUpdate.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/AlgoUpdateAo.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/CancelAllUmAlgoOpenOrdersResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/CancelUmAlgoOrderResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/FuturesTradfiPerpsContractRequest.md rename clients/{derivatives-trading-usds-futures => derivatives-trading-portfolio-margin}/docs/FuturesTradfiPerpsContractResponse.md (100%) create mode 100644 clients/derivatives-trading-portfolio-margin/docs/NewUmAlgoOrderRequest.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/NewUmAlgoOrderResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/QueryAllCurrentUmOpenAlgoOrdersResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/QueryAllCurrentUmOpenAlgoOrdersResponseInner.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/QueryCurrentUmOpenAlgoOrderResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/QueryUmAlgoOrderHistoryResponse.md create mode 100644 clients/derivatives-trading-portfolio-margin/docs/QueryUmAlgoOrderHistoryResponseInner.md create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmAlgoOpenOrdersResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmAlgoOrderResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FuturesTradfiPerpsContractRequest.java rename clients/{derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures => derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin}/rest/model/FuturesTradfiPerpsContractResponse.java (96%) create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmAlgoOrderRequest.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmAlgoOrderResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenAlgoOrdersResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenAlgoOrdersResponseInner.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenAlgoOrderResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmAlgoOrderHistoryResponse.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmAlgoOrderHistoryResponseInner.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AlgoUpdate.java create mode 100644 clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AlgoUpdateAo.java rename clients/pay/docs/{GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.md => GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.md} (96%) rename clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/{GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.java => GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.java} (87%) create mode 100644 examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/DeleteMarginCallLevelExample.java create mode 100644 examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetMarginCallLevelExample.java create mode 100644 examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SetMarginCallLevelExample.java create mode 100644 examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmAlgoOpenOrdersExample.java create mode 100644 examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmAlgoOrderExample.java create mode 100644 examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/FuturesTradfiPerpsContractExample.java create mode 100644 examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/NewUmAlgoOrderExample.java create mode 100644 examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenAlgoOrdersExample.java create mode 100644 examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenAlgoOrderExample.java create mode 100644 examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmAlgoOrderHistoryExample.java diff --git a/MIGRATION.md b/MIGRATION.md index 057de289c..351b2505a 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -37,7 +37,7 @@ For Spot (Spot package): io.github.binance binance-spot - 10.0.0 + 10.1.1 ``` diff --git a/README.md b/README.md index ccc66043f..6c1fe7a69 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Each connector is published as a separate maven dependency. For example: io.github.binance binance-spot - 10.0.0 + 10.1.1 ``` diff --git a/clients/algo/CHANGELOG.md b/clients/algo/CHANGELOG.md index 6829f672b..9a88c2fba 100644 --- a/clients/algo/CHANGELOG.md +++ b/clients/algo/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 1.2.2 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 1.2.1 - 2025-08-07 diff --git a/clients/alpha/CHANGELOG.md b/clients/alpha/CHANGELOG.md index b9d294822..88ff42e69 100644 --- a/clients/alpha/CHANGELOG.md +++ b/clients/alpha/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 1.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 1.0.0 - 2026-01-20 diff --git a/clients/c2c/CHANGELOG.md b/clients/c2c/CHANGELOG.md index 83f70de10..51dbca7ca 100644 --- a/clients/c2c/CHANGELOG.md +++ b/clients/c2c/CHANGELOG.md @@ -1,6 +1,36 @@ # Changelog +## 3.0.0 - 2026-05-04 + +### Changed (1) + +- Modified response for `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`): + - property `unitPrice` added + - property `payMethodName` added + - property `fiatSymbol` added + - property `fiat` added + - property `commission` added + - property `takerCommissionRate` added + - property `orderStatus` added + - property `takerAmount` added + - property `additionalKycVerify` added + - property `counterPartNickName` added + - property `createTime` added + - property `advNo` added + - property `asset` added + - property `totalPrice` added + - property `tradeType` added + - property `takerCommission` added + - property `amount` added + - property `orderNumber` added + - property `code` deleted + - property `data` deleted + - property `message` deleted + - property `success` deleted + - property `total` deleted + ## 2.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 2.0.0 - 2025-12-16 diff --git a/clients/c2c/docs/GetC2CTradeHistoryResponse.md b/clients/c2c/docs/GetC2CTradeHistoryResponse.md index 2c587a1af..45bac4d5f 100644 --- a/clients/c2c/docs/GetC2CTradeHistoryResponse.md +++ b/clients/c2c/docs/GetC2CTradeHistoryResponse.md @@ -7,11 +7,24 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**code** | **String** | | [optional] | -|**message** | **String** | | [optional] | -|**data** | [**List<GetC2CTradeHistoryResponseDataInner>**](GetC2CTradeHistoryResponseDataInner.md) | | [optional] | -|**total** | **Long** | | [optional] | -|**success** | **Boolean** | | [optional] | +|**orderNumber** | **String** | | [optional] | +|**advNo** | **String** | | [optional] | +|**tradeType** | **String** | | [optional] | +|**asset** | **String** | | [optional] | +|**fiat** | **String** | | [optional] | +|**fiatSymbol** | **String** | | [optional] | +|**amount** | **String** | | [optional] | +|**totalPrice** | **String** | | [optional] | +|**unitPrice** | **String** | | [optional] | +|**orderStatus** | **String** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**commission** | **String** | | [optional] | +|**takerCommissionRate** | **String** | | [optional] | +|**takerCommission** | **String** | | [optional] | +|**takerAmount** | **String** | | [optional] | +|**counterPartNickName** | **String** | | [optional] | +|**payMethodName** | **String** | | [optional] | +|**additionalKycVerify** | **Long** | | [optional] | diff --git a/clients/c2c/docs/GetC2CTradeHistoryResponseDataInner.md b/clients/c2c/docs/GetC2CTradeHistoryResponseDataInner.md deleted file mode 100644 index 95598dd5a..000000000 --- a/clients/c2c/docs/GetC2CTradeHistoryResponseDataInner.md +++ /dev/null @@ -1,26 +0,0 @@ - - -# GetC2CTradeHistoryResponseDataInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**orderNumber** | **String** | | [optional] | -|**advNo** | **String** | | [optional] | -|**tradeType** | **String** | | [optional] | -|**asset** | **String** | | [optional] | -|**fiat** | **String** | | [optional] | -|**fiatSymbol** | **String** | | [optional] | -|**amount** | **String** | | [optional] | -|**totalPrice** | **String** | | [optional] | -|**unitPrice** | **String** | | [optional] | -|**orderStatus** | **String** | | [optional] | -|**createTime** | **Long** | | [optional] | -|**commission** | **String** | | [optional] | -|**counterPartNickName** | **String** | | [optional] | -|**advertisementRole** | **String** | | [optional] | - - - diff --git a/clients/c2c/docs/rest-api/migration-guide.md b/clients/c2c/docs/rest-api/migration-guide.md index 677a4771e..69d880075 100644 --- a/clients/c2c/docs/rest-api/migration-guide.md +++ b/clients/c2c/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-c2c - 2.0.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-c2c - 2.0.0 + 3.0.0 ``` diff --git a/clients/c2c/pom.xml b/clients/c2c/pom.xml index edcb47d08..59cbf7362 100644 --- a/clients/c2c/pom.xml +++ b/clients/c2c/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-c2c c2c - 2.0.1 + 3.0.0 jar diff --git a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/JSON.java b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/JSON.java index 4e1edb98c..7d015c495 100644 --- a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/JSON.java +++ b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/JSON.java @@ -111,9 +111,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.c2c.rest.model.GetC2CTradeHistoryResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.c2c.rest.model.GetC2CTradeHistoryResponseDataInner - .CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2CApi.java b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2CApi.java index 8b6da60a1..cf8a1bdac 100644 --- a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2CApi.java +++ b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2CApi.java @@ -42,7 +42,7 @@ public class C2CApi { private static final String USER_AGENT = String.format( - "binance-c2c/2.0.0 (Java/%s; %s; %s)", + "binance-c2c/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/c2c/src/main/java/com/binance/connector/client/c2c/rest/model/GetC2CTradeHistoryResponse.java b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/model/GetC2CTradeHistoryResponse.java index cac1c24e2..5a7449e7a 100644 --- a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/model/GetC2CTradeHistoryResponse.java +++ b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/model/GetC2CTradeHistoryResponse.java @@ -14,7 +14,6 @@ import com.binance.connector.client.c2c.rest.JSON; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -23,18 +22,13 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; import java.util.HashSet; -import java.util.List; import java.util.Objects; -import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; /** GetC2CTradeHistoryResponse */ @@ -42,142 +36,461 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class GetC2CTradeHistoryResponse { - public static final String SERIALIZED_NAME_CODE = "code"; + public static final String SERIALIZED_NAME_ORDER_NUMBER = "orderNumber"; - @SerializedName(SERIALIZED_NAME_CODE) + @SerializedName(SERIALIZED_NAME_ORDER_NUMBER) @jakarta.annotation.Nullable - private String code; + private String orderNumber; - public static final String SERIALIZED_NAME_MESSAGE = "message"; + public static final String SERIALIZED_NAME_ADV_NO = "advNo"; - @SerializedName(SERIALIZED_NAME_MESSAGE) + @SerializedName(SERIALIZED_NAME_ADV_NO) @jakarta.annotation.Nullable - private String message; + private String advNo; - public static final String SERIALIZED_NAME_DATA = "data"; + public static final String SERIALIZED_NAME_TRADE_TYPE = "tradeType"; - @SerializedName(SERIALIZED_NAME_DATA) + @SerializedName(SERIALIZED_NAME_TRADE_TYPE) @jakarta.annotation.Nullable - private List<@Valid GetC2CTradeHistoryResponseDataInner> data; + private String tradeType; - public static final String SERIALIZED_NAME_TOTAL = "total"; + public static final String SERIALIZED_NAME_ASSET = "asset"; - @SerializedName(SERIALIZED_NAME_TOTAL) + @SerializedName(SERIALIZED_NAME_ASSET) @jakarta.annotation.Nullable - private Long total; + private String asset; - public static final String SERIALIZED_NAME_SUCCESS = "success"; + public static final String SERIALIZED_NAME_FIAT = "fiat"; - @SerializedName(SERIALIZED_NAME_SUCCESS) + @SerializedName(SERIALIZED_NAME_FIAT) @jakarta.annotation.Nullable - private Boolean success; + private String fiat; + + public static final String SERIALIZED_NAME_FIAT_SYMBOL = "fiatSymbol"; + + @SerializedName(SERIALIZED_NAME_FIAT_SYMBOL) + @jakarta.annotation.Nullable + private String fiatSymbol; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nullable + private String amount; + + public static final String SERIALIZED_NAME_TOTAL_PRICE = "totalPrice"; + + @SerializedName(SERIALIZED_NAME_TOTAL_PRICE) + @jakarta.annotation.Nullable + private String totalPrice; + + public static final String SERIALIZED_NAME_UNIT_PRICE = "unitPrice"; + + @SerializedName(SERIALIZED_NAME_UNIT_PRICE) + @jakarta.annotation.Nullable + private String unitPrice; + + public static final String SERIALIZED_NAME_ORDER_STATUS = "orderStatus"; + + @SerializedName(SERIALIZED_NAME_ORDER_STATUS) + @jakarta.annotation.Nullable + private String orderStatus; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_COMMISSION = "commission"; + + @SerializedName(SERIALIZED_NAME_COMMISSION) + @jakarta.annotation.Nullable + private String commission; + + public static final String SERIALIZED_NAME_TAKER_COMMISSION_RATE = "takerCommissionRate"; + + @SerializedName(SERIALIZED_NAME_TAKER_COMMISSION_RATE) + @jakarta.annotation.Nullable + private String takerCommissionRate; + + public static final String SERIALIZED_NAME_TAKER_COMMISSION = "takerCommission"; + + @SerializedName(SERIALIZED_NAME_TAKER_COMMISSION) + @jakarta.annotation.Nullable + private String takerCommission; + + public static final String SERIALIZED_NAME_TAKER_AMOUNT = "takerAmount"; + + @SerializedName(SERIALIZED_NAME_TAKER_AMOUNT) + @jakarta.annotation.Nullable + private String takerAmount; + + public static final String SERIALIZED_NAME_COUNTER_PART_NICK_NAME = "counterPartNickName"; + + @SerializedName(SERIALIZED_NAME_COUNTER_PART_NICK_NAME) + @jakarta.annotation.Nullable + private String counterPartNickName; + + public static final String SERIALIZED_NAME_PAY_METHOD_NAME = "payMethodName"; + + @SerializedName(SERIALIZED_NAME_PAY_METHOD_NAME) + @jakarta.annotation.Nullable + private String payMethodName; + + public static final String SERIALIZED_NAME_ADDITIONAL_KYC_VERIFY = "additionalKycVerify"; + + @SerializedName(SERIALIZED_NAME_ADDITIONAL_KYC_VERIFY) + @jakarta.annotation.Nullable + private Long additionalKycVerify; public GetC2CTradeHistoryResponse() {} - public GetC2CTradeHistoryResponse code(@jakarta.annotation.Nullable String code) { - this.code = code; + public GetC2CTradeHistoryResponse orderNumber(@jakarta.annotation.Nullable String orderNumber) { + this.orderNumber = orderNumber; return this; } /** - * Get code + * Get orderNumber * - * @return code + * @return orderNumber */ @jakarta.annotation.Nullable - public String getCode() { - return code; + public String getOrderNumber() { + return orderNumber; } - public void setCode(@jakarta.annotation.Nullable String code) { - this.code = code; + public void setOrderNumber(@jakarta.annotation.Nullable String orderNumber) { + this.orderNumber = orderNumber; } - public GetC2CTradeHistoryResponse message(@jakarta.annotation.Nullable String message) { - this.message = message; + public GetC2CTradeHistoryResponse advNo(@jakarta.annotation.Nullable String advNo) { + this.advNo = advNo; return this; } /** - * Get message + * Get advNo * - * @return message + * @return advNo */ @jakarta.annotation.Nullable - public String getMessage() { - return message; + public String getAdvNo() { + return advNo; } - public void setMessage(@jakarta.annotation.Nullable String message) { - this.message = message; + public void setAdvNo(@jakarta.annotation.Nullable String advNo) { + this.advNo = advNo; } - public GetC2CTradeHistoryResponse data( - @jakarta.annotation.Nullable List<@Valid GetC2CTradeHistoryResponseDataInner> data) { - this.data = data; + public GetC2CTradeHistoryResponse tradeType(@jakarta.annotation.Nullable String tradeType) { + this.tradeType = tradeType; return this; } - public GetC2CTradeHistoryResponse addDataItem(GetC2CTradeHistoryResponseDataInner dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); + /** + * Get tradeType + * + * @return tradeType + */ + @jakarta.annotation.Nullable + public String getTradeType() { + return tradeType; + } + + public void setTradeType(@jakarta.annotation.Nullable String tradeType) { + this.tradeType = tradeType; + } + + public GetC2CTradeHistoryResponse asset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + public GetC2CTradeHistoryResponse fiat(@jakarta.annotation.Nullable String fiat) { + this.fiat = fiat; + return this; + } + + /** + * Get fiat + * + * @return fiat + */ + @jakarta.annotation.Nullable + public String getFiat() { + return fiat; + } + + public void setFiat(@jakarta.annotation.Nullable String fiat) { + this.fiat = fiat; + } + + public GetC2CTradeHistoryResponse fiatSymbol(@jakarta.annotation.Nullable String fiatSymbol) { + this.fiatSymbol = fiatSymbol; + return this; + } + + /** + * Get fiatSymbol + * + * @return fiatSymbol + */ + @jakarta.annotation.Nullable + public String getFiatSymbol() { + return fiatSymbol; + } + + public void setFiatSymbol(@jakarta.annotation.Nullable String fiatSymbol) { + this.fiatSymbol = fiatSymbol; + } + + public GetC2CTradeHistoryResponse amount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nullable + public String getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + } + + public GetC2CTradeHistoryResponse totalPrice(@jakarta.annotation.Nullable String totalPrice) { + this.totalPrice = totalPrice; + return this; + } + + /** + * Get totalPrice + * + * @return totalPrice + */ + @jakarta.annotation.Nullable + public String getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(@jakarta.annotation.Nullable String totalPrice) { + this.totalPrice = totalPrice; + } + + public GetC2CTradeHistoryResponse unitPrice(@jakarta.annotation.Nullable String unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + /** + * Get unitPrice + * + * @return unitPrice + */ + @jakarta.annotation.Nullable + public String getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(@jakarta.annotation.Nullable String unitPrice) { + this.unitPrice = unitPrice; + } + + public GetC2CTradeHistoryResponse orderStatus(@jakarta.annotation.Nullable String orderStatus) { + this.orderStatus = orderStatus; + return this; + } + + /** + * Get orderStatus + * + * @return orderStatus + */ + @jakarta.annotation.Nullable + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(@jakarta.annotation.Nullable String orderStatus) { + this.orderStatus = orderStatus; + } + + public GetC2CTradeHistoryResponse createTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public GetC2CTradeHistoryResponse commission(@jakarta.annotation.Nullable String commission) { + this.commission = commission; + return this; + } + + /** + * Get commission + * + * @return commission + */ + @jakarta.annotation.Nullable + public String getCommission() { + return commission; + } + + public void setCommission(@jakarta.annotation.Nullable String commission) { + this.commission = commission; + } + + public GetC2CTradeHistoryResponse takerCommissionRate( + @jakarta.annotation.Nullable String takerCommissionRate) { + this.takerCommissionRate = takerCommissionRate; + return this; + } + + /** + * Get takerCommissionRate + * + * @return takerCommissionRate + */ + @jakarta.annotation.Nullable + public String getTakerCommissionRate() { + return takerCommissionRate; + } + + public void setTakerCommissionRate(@jakarta.annotation.Nullable String takerCommissionRate) { + this.takerCommissionRate = takerCommissionRate; + } + + public GetC2CTradeHistoryResponse takerCommission( + @jakarta.annotation.Nullable String takerCommission) { + this.takerCommission = takerCommission; + return this; + } + + /** + * Get takerCommission + * + * @return takerCommission + */ + @jakarta.annotation.Nullable + public String getTakerCommission() { + return takerCommission; + } + + public void setTakerCommission(@jakarta.annotation.Nullable String takerCommission) { + this.takerCommission = takerCommission; + } + + public GetC2CTradeHistoryResponse takerAmount(@jakarta.annotation.Nullable String takerAmount) { + this.takerAmount = takerAmount; + return this; + } + + /** + * Get takerAmount + * + * @return takerAmount + */ + @jakarta.annotation.Nullable + public String getTakerAmount() { + return takerAmount; + } + + public void setTakerAmount(@jakarta.annotation.Nullable String takerAmount) { + this.takerAmount = takerAmount; + } + + public GetC2CTradeHistoryResponse counterPartNickName( + @jakarta.annotation.Nullable String counterPartNickName) { + this.counterPartNickName = counterPartNickName; return this; } /** - * Get data + * Get counterPartNickName * - * @return data + * @return counterPartNickName */ @jakarta.annotation.Nullable - @Valid - public List<@Valid GetC2CTradeHistoryResponseDataInner> getData() { - return data; + public String getCounterPartNickName() { + return counterPartNickName; } - public void setData( - @jakarta.annotation.Nullable List<@Valid GetC2CTradeHistoryResponseDataInner> data) { - this.data = data; + public void setCounterPartNickName(@jakarta.annotation.Nullable String counterPartNickName) { + this.counterPartNickName = counterPartNickName; } - public GetC2CTradeHistoryResponse total(@jakarta.annotation.Nullable Long total) { - this.total = total; + public GetC2CTradeHistoryResponse payMethodName( + @jakarta.annotation.Nullable String payMethodName) { + this.payMethodName = payMethodName; return this; } /** - * Get total + * Get payMethodName * - * @return total + * @return payMethodName */ @jakarta.annotation.Nullable - public Long getTotal() { - return total; + public String getPayMethodName() { + return payMethodName; } - public void setTotal(@jakarta.annotation.Nullable Long total) { - this.total = total; + public void setPayMethodName(@jakarta.annotation.Nullable String payMethodName) { + this.payMethodName = payMethodName; } - public GetC2CTradeHistoryResponse success(@jakarta.annotation.Nullable Boolean success) { - this.success = success; + public GetC2CTradeHistoryResponse additionalKycVerify( + @jakarta.annotation.Nullable Long additionalKycVerify) { + this.additionalKycVerify = additionalKycVerify; return this; } /** - * Get success + * Get additionalKycVerify * - * @return success + * @return additionalKycVerify */ @jakarta.annotation.Nullable - public Boolean getSuccess() { - return success; + public Long getAdditionalKycVerify() { + return additionalKycVerify; } - public void setSuccess(@jakarta.annotation.Nullable Boolean success) { - this.success = success; + public void setAdditionalKycVerify(@jakarta.annotation.Nullable Long additionalKycVerify) { + this.additionalKycVerify = additionalKycVerify; } @Override @@ -189,27 +502,80 @@ public boolean equals(Object o) { return false; } GetC2CTradeHistoryResponse getC2CTradeHistoryResponse = (GetC2CTradeHistoryResponse) o; - return Objects.equals(this.code, getC2CTradeHistoryResponse.code) - && Objects.equals(this.message, getC2CTradeHistoryResponse.message) - && Objects.equals(this.data, getC2CTradeHistoryResponse.data) - && Objects.equals(this.total, getC2CTradeHistoryResponse.total) - && Objects.equals(this.success, getC2CTradeHistoryResponse.success); + return Objects.equals(this.orderNumber, getC2CTradeHistoryResponse.orderNumber) + && Objects.equals(this.advNo, getC2CTradeHistoryResponse.advNo) + && Objects.equals(this.tradeType, getC2CTradeHistoryResponse.tradeType) + && Objects.equals(this.asset, getC2CTradeHistoryResponse.asset) + && Objects.equals(this.fiat, getC2CTradeHistoryResponse.fiat) + && Objects.equals(this.fiatSymbol, getC2CTradeHistoryResponse.fiatSymbol) + && Objects.equals(this.amount, getC2CTradeHistoryResponse.amount) + && Objects.equals(this.totalPrice, getC2CTradeHistoryResponse.totalPrice) + && Objects.equals(this.unitPrice, getC2CTradeHistoryResponse.unitPrice) + && Objects.equals(this.orderStatus, getC2CTradeHistoryResponse.orderStatus) + && Objects.equals(this.createTime, getC2CTradeHistoryResponse.createTime) + && Objects.equals(this.commission, getC2CTradeHistoryResponse.commission) + && Objects.equals( + this.takerCommissionRate, getC2CTradeHistoryResponse.takerCommissionRate) + && Objects.equals(this.takerCommission, getC2CTradeHistoryResponse.takerCommission) + && Objects.equals(this.takerAmount, getC2CTradeHistoryResponse.takerAmount) + && Objects.equals( + this.counterPartNickName, getC2CTradeHistoryResponse.counterPartNickName) + && Objects.equals(this.payMethodName, getC2CTradeHistoryResponse.payMethodName) + && Objects.equals( + this.additionalKycVerify, getC2CTradeHistoryResponse.additionalKycVerify); } @Override public int hashCode() { - return Objects.hash(code, message, data, total, success); + return Objects.hash( + orderNumber, + advNo, + tradeType, + asset, + fiat, + fiatSymbol, + amount, + totalPrice, + unitPrice, + orderStatus, + createTime, + commission, + takerCommissionRate, + takerCommission, + takerAmount, + counterPartNickName, + payMethodName, + additionalKycVerify); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetC2CTradeHistoryResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" total: ").append(toIndentedString(total)).append("\n"); - sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" orderNumber: ").append(toIndentedString(orderNumber)).append("\n"); + sb.append(" advNo: ").append(toIndentedString(advNo)).append("\n"); + sb.append(" tradeType: ").append(toIndentedString(tradeType)).append("\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" fiat: ").append(toIndentedString(fiat)).append("\n"); + sb.append(" fiatSymbol: ").append(toIndentedString(fiatSymbol)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); + sb.append(" unitPrice: ").append(toIndentedString(unitPrice)).append("\n"); + sb.append(" orderStatus: ").append(toIndentedString(orderStatus)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" commission: ").append(toIndentedString(commission)).append("\n"); + sb.append(" takerCommissionRate: ") + .append(toIndentedString(takerCommissionRate)) + .append("\n"); + sb.append(" takerCommission: ").append(toIndentedString(takerCommission)).append("\n"); + sb.append(" takerAmount: ").append(toIndentedString(takerAmount)).append("\n"); + sb.append(" counterPartNickName: ") + .append(toIndentedString(counterPartNickName)) + .append("\n"); + sb.append(" payMethodName: ").append(toIndentedString(payMethodName)).append("\n"); + sb.append(" additionalKycVerify: ") + .append(toIndentedString(additionalKycVerify)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -217,29 +583,84 @@ 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 messageValue = getMessage(); - String messageValueAsString = ""; - messageValueAsString = messageValue.toString(); - sb.append("message=").append(urlEncode(messageValueAsString)).append(""); - Object dataValue = getData(); - String dataValueAsString = ""; - dataValueAsString = - (String) - ((Collection) dataValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("data=").append(urlEncode(dataValueAsString)).append(""); - Object totalValue = getTotal(); - String totalValueAsString = ""; - totalValueAsString = totalValue.toString(); - sb.append("total=").append(urlEncode(totalValueAsString)).append(""); - Object successValue = getSuccess(); - String successValueAsString = ""; - successValueAsString = successValue.toString(); - sb.append("success=").append(urlEncode(successValueAsString)).append(""); + Object orderNumberValue = getOrderNumber(); + String orderNumberValueAsString = ""; + orderNumberValueAsString = orderNumberValue.toString(); + sb.append("orderNumber=").append(urlEncode(orderNumberValueAsString)).append(""); + Object advNoValue = getAdvNo(); + String advNoValueAsString = ""; + advNoValueAsString = advNoValue.toString(); + sb.append("advNo=").append(urlEncode(advNoValueAsString)).append(""); + Object tradeTypeValue = getTradeType(); + String tradeTypeValueAsString = ""; + tradeTypeValueAsString = tradeTypeValue.toString(); + sb.append("tradeType=").append(urlEncode(tradeTypeValueAsString)).append(""); + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object fiatValue = getFiat(); + String fiatValueAsString = ""; + fiatValueAsString = fiatValue.toString(); + sb.append("fiat=").append(urlEncode(fiatValueAsString)).append(""); + Object fiatSymbolValue = getFiatSymbol(); + String fiatSymbolValueAsString = ""; + fiatSymbolValueAsString = fiatSymbolValue.toString(); + sb.append("fiatSymbol=").append(urlEncode(fiatSymbolValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object totalPriceValue = getTotalPrice(); + String totalPriceValueAsString = ""; + totalPriceValueAsString = totalPriceValue.toString(); + sb.append("totalPrice=").append(urlEncode(totalPriceValueAsString)).append(""); + Object unitPriceValue = getUnitPrice(); + String unitPriceValueAsString = ""; + unitPriceValueAsString = unitPriceValue.toString(); + sb.append("unitPrice=").append(urlEncode(unitPriceValueAsString)).append(""); + Object orderStatusValue = getOrderStatus(); + String orderStatusValueAsString = ""; + orderStatusValueAsString = orderStatusValue.toString(); + sb.append("orderStatus=").append(urlEncode(orderStatusValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object commissionValue = getCommission(); + String commissionValueAsString = ""; + commissionValueAsString = commissionValue.toString(); + sb.append("commission=").append(urlEncode(commissionValueAsString)).append(""); + Object takerCommissionRateValue = getTakerCommissionRate(); + String takerCommissionRateValueAsString = ""; + takerCommissionRateValueAsString = takerCommissionRateValue.toString(); + sb.append("takerCommissionRate=") + .append(urlEncode(takerCommissionRateValueAsString)) + .append(""); + Object takerCommissionValue = getTakerCommission(); + String takerCommissionValueAsString = ""; + takerCommissionValueAsString = takerCommissionValue.toString(); + sb.append("takerCommission=").append(urlEncode(takerCommissionValueAsString)).append(""); + Object takerAmountValue = getTakerAmount(); + String takerAmountValueAsString = ""; + takerAmountValueAsString = takerAmountValue.toString(); + sb.append("takerAmount=").append(urlEncode(takerAmountValueAsString)).append(""); + Object counterPartNickNameValue = getCounterPartNickName(); + String counterPartNickNameValueAsString = ""; + counterPartNickNameValueAsString = counterPartNickNameValue.toString(); + sb.append("counterPartNickName=") + .append(urlEncode(counterPartNickNameValueAsString)) + .append(""); + Object payMethodNameValue = getPayMethodName(); + String payMethodNameValueAsString = ""; + payMethodNameValueAsString = payMethodNameValue.toString(); + sb.append("payMethodName=").append(urlEncode(payMethodNameValueAsString)).append(""); + Object additionalKycVerifyValue = getAdditionalKycVerify(); + String additionalKycVerifyValueAsString = ""; + additionalKycVerifyValueAsString = additionalKycVerifyValue.toString(); + sb.append("additionalKycVerify=") + .append(urlEncode(additionalKycVerifyValueAsString)) + .append(""); return sb.toString(); } @@ -268,11 +689,24 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("code"); - openapiFields.add("message"); - openapiFields.add("data"); - openapiFields.add("total"); - openapiFields.add("success"); + openapiFields.add("orderNumber"); + openapiFields.add("advNo"); + openapiFields.add("tradeType"); + openapiFields.add("asset"); + openapiFields.add("fiat"); + openapiFields.add("fiatSymbol"); + openapiFields.add("amount"); + openapiFields.add("totalPrice"); + openapiFields.add("unitPrice"); + openapiFields.add("orderStatus"); + openapiFields.add("createTime"); + openapiFields.add("commission"); + openapiFields.add("takerCommissionRate"); + openapiFields.add("takerCommission"); + openapiFields.add("takerAmount"); + openapiFields.add("counterPartNickName"); + openapiFields.add("payMethodName"); + openapiFields.add("additionalKycVerify"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -296,40 +730,135 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) - && !jsonObj.get("code").isJsonPrimitive()) { + if ((jsonObj.get("orderNumber") != null && !jsonObj.get("orderNumber").isJsonNull()) + && !jsonObj.get("orderNumber").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderNumber` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderNumber").toString())); + } + if ((jsonObj.get("advNo") != null && !jsonObj.get("advNo").isJsonNull()) + && !jsonObj.get("advNo").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `code` to be a primitive type in the JSON string" + "Expected the field `advNo` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("code").toString())); + jsonObj.get("advNo").toString())); + } + if ((jsonObj.get("tradeType") != null && !jsonObj.get("tradeType").isJsonNull()) + && !jsonObj.get("tradeType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tradeType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tradeType").toString())); } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) - && !jsonObj.get("message").isJsonPrimitive()) { + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `message` to be a primitive type in the JSON string" + "Expected the field `asset` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("message").toString())); + jsonObj.get("asset").toString())); } - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); - if (jsonArraydata != null) { - // ensure the json data is an array - if (!jsonObj.get("data").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `data` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("data").toString())); - } - - // validate the optional field `data` (array) - for (int i = 0; i < jsonArraydata.size(); i++) { - GetC2CTradeHistoryResponseDataInner.validateJsonElement(jsonArraydata.get(i)); - } - ; - } + if ((jsonObj.get("fiat") != null && !jsonObj.get("fiat").isJsonNull()) + && !jsonObj.get("fiat").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fiat` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("fiat").toString())); + } + if ((jsonObj.get("fiatSymbol") != null && !jsonObj.get("fiatSymbol").isJsonNull()) + && !jsonObj.get("fiatSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fiatSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("fiatSymbol").toString())); + } + if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) + && !jsonObj.get("amount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amount` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("amount").toString())); + } + if ((jsonObj.get("totalPrice") != null && !jsonObj.get("totalPrice").isJsonNull()) + && !jsonObj.get("totalPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("totalPrice").toString())); + } + if ((jsonObj.get("unitPrice") != null && !jsonObj.get("unitPrice").isJsonNull()) + && !jsonObj.get("unitPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `unitPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("unitPrice").toString())); + } + if ((jsonObj.get("orderStatus") != null && !jsonObj.get("orderStatus").isJsonNull()) + && !jsonObj.get("orderStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderStatus").toString())); + } + if ((jsonObj.get("commission") != null && !jsonObj.get("commission").isJsonNull()) + && !jsonObj.get("commission").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `commission` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("commission").toString())); + } + if ((jsonObj.get("takerCommissionRate") != null + && !jsonObj.get("takerCommissionRate").isJsonNull()) + && !jsonObj.get("takerCommissionRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `takerCommissionRate` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("takerCommissionRate").toString())); + } + if ((jsonObj.get("takerCommission") != null && !jsonObj.get("takerCommission").isJsonNull()) + && !jsonObj.get("takerCommission").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `takerCommission` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("takerCommission").toString())); + } + if ((jsonObj.get("takerAmount") != null && !jsonObj.get("takerAmount").isJsonNull()) + && !jsonObj.get("takerAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `takerAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("takerAmount").toString())); + } + if ((jsonObj.get("counterPartNickName") != null + && !jsonObj.get("counterPartNickName").isJsonNull()) + && !jsonObj.get("counterPartNickName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `counterPartNickName` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("counterPartNickName").toString())); + } + if ((jsonObj.get("payMethodName") != null && !jsonObj.get("payMethodName").isJsonNull()) + && !jsonObj.get("payMethodName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `payMethodName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("payMethodName").toString())); } } diff --git a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/model/GetC2CTradeHistoryResponseDataInner.java b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/model/GetC2CTradeHistoryResponseDataInner.java deleted file mode 100644 index 7f650cf48..000000000 --- a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/model/GetC2CTradeHistoryResponseDataInner.java +++ /dev/null @@ -1,766 +0,0 @@ -/* - * Binance C2C REST API - * OpenAPI Specification for the Binance C2C 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.c2c.rest.model; - -import com.binance.connector.client.c2c.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.*; - -/** GetC2CTradeHistoryResponseDataInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetC2CTradeHistoryResponseDataInner { - public static final String SERIALIZED_NAME_ORDER_NUMBER = "orderNumber"; - - @SerializedName(SERIALIZED_NAME_ORDER_NUMBER) - @jakarta.annotation.Nullable - private String orderNumber; - - public static final String SERIALIZED_NAME_ADV_NO = "advNo"; - - @SerializedName(SERIALIZED_NAME_ADV_NO) - @jakarta.annotation.Nullable - private String advNo; - - public static final String SERIALIZED_NAME_TRADE_TYPE = "tradeType"; - - @SerializedName(SERIALIZED_NAME_TRADE_TYPE) - @jakarta.annotation.Nullable - private String tradeType; - - public static final String SERIALIZED_NAME_ASSET = "asset"; - - @SerializedName(SERIALIZED_NAME_ASSET) - @jakarta.annotation.Nullable - private String asset; - - public static final String SERIALIZED_NAME_FIAT = "fiat"; - - @SerializedName(SERIALIZED_NAME_FIAT) - @jakarta.annotation.Nullable - private String fiat; - - public static final String SERIALIZED_NAME_FIAT_SYMBOL = "fiatSymbol"; - - @SerializedName(SERIALIZED_NAME_FIAT_SYMBOL) - @jakarta.annotation.Nullable - private String fiatSymbol; - - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - - @SerializedName(SERIALIZED_NAME_AMOUNT) - @jakarta.annotation.Nullable - private String amount; - - public static final String SERIALIZED_NAME_TOTAL_PRICE = "totalPrice"; - - @SerializedName(SERIALIZED_NAME_TOTAL_PRICE) - @jakarta.annotation.Nullable - private String totalPrice; - - public static final String SERIALIZED_NAME_UNIT_PRICE = "unitPrice"; - - @SerializedName(SERIALIZED_NAME_UNIT_PRICE) - @jakarta.annotation.Nullable - private String unitPrice; - - public static final String SERIALIZED_NAME_ORDER_STATUS = "orderStatus"; - - @SerializedName(SERIALIZED_NAME_ORDER_STATUS) - @jakarta.annotation.Nullable - private String orderStatus; - - public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; - - @SerializedName(SERIALIZED_NAME_CREATE_TIME) - @jakarta.annotation.Nullable - private Long createTime; - - public static final String SERIALIZED_NAME_COMMISSION = "commission"; - - @SerializedName(SERIALIZED_NAME_COMMISSION) - @jakarta.annotation.Nullable - private String commission; - - public static final String SERIALIZED_NAME_COUNTER_PART_NICK_NAME = "counterPartNickName"; - - @SerializedName(SERIALIZED_NAME_COUNTER_PART_NICK_NAME) - @jakarta.annotation.Nullable - private String counterPartNickName; - - public static final String SERIALIZED_NAME_ADVERTISEMENT_ROLE = "advertisementRole"; - - @SerializedName(SERIALIZED_NAME_ADVERTISEMENT_ROLE) - @jakarta.annotation.Nullable - private String advertisementRole; - - public GetC2CTradeHistoryResponseDataInner() {} - - public GetC2CTradeHistoryResponseDataInner orderNumber( - @jakarta.annotation.Nullable String orderNumber) { - this.orderNumber = orderNumber; - return this; - } - - /** - * Get orderNumber - * - * @return orderNumber - */ - @jakarta.annotation.Nullable - public String getOrderNumber() { - return orderNumber; - } - - public void setOrderNumber(@jakarta.annotation.Nullable String orderNumber) { - this.orderNumber = orderNumber; - } - - public GetC2CTradeHistoryResponseDataInner advNo(@jakarta.annotation.Nullable String advNo) { - this.advNo = advNo; - return this; - } - - /** - * Get advNo - * - * @return advNo - */ - @jakarta.annotation.Nullable - public String getAdvNo() { - return advNo; - } - - public void setAdvNo(@jakarta.annotation.Nullable String advNo) { - this.advNo = advNo; - } - - public GetC2CTradeHistoryResponseDataInner tradeType( - @jakarta.annotation.Nullable String tradeType) { - this.tradeType = tradeType; - return this; - } - - /** - * Get tradeType - * - * @return tradeType - */ - @jakarta.annotation.Nullable - public String getTradeType() { - return tradeType; - } - - public void setTradeType(@jakarta.annotation.Nullable String tradeType) { - this.tradeType = tradeType; - } - - public GetC2CTradeHistoryResponseDataInner asset(@jakarta.annotation.Nullable String asset) { - this.asset = asset; - return this; - } - - /** - * Get asset - * - * @return asset - */ - @jakarta.annotation.Nullable - public String getAsset() { - return asset; - } - - public void setAsset(@jakarta.annotation.Nullable String asset) { - this.asset = asset; - } - - public GetC2CTradeHistoryResponseDataInner fiat(@jakarta.annotation.Nullable String fiat) { - this.fiat = fiat; - return this; - } - - /** - * Get fiat - * - * @return fiat - */ - @jakarta.annotation.Nullable - public String getFiat() { - return fiat; - } - - public void setFiat(@jakarta.annotation.Nullable String fiat) { - this.fiat = fiat; - } - - public GetC2CTradeHistoryResponseDataInner fiatSymbol( - @jakarta.annotation.Nullable String fiatSymbol) { - this.fiatSymbol = fiatSymbol; - return this; - } - - /** - * Get fiatSymbol - * - * @return fiatSymbol - */ - @jakarta.annotation.Nullable - public String getFiatSymbol() { - return fiatSymbol; - } - - public void setFiatSymbol(@jakarta.annotation.Nullable String fiatSymbol) { - this.fiatSymbol = fiatSymbol; - } - - public GetC2CTradeHistoryResponseDataInner amount(@jakarta.annotation.Nullable String amount) { - this.amount = amount; - return this; - } - - /** - * Get amount - * - * @return amount - */ - @jakarta.annotation.Nullable - public String getAmount() { - return amount; - } - - public void setAmount(@jakarta.annotation.Nullable String amount) { - this.amount = amount; - } - - public GetC2CTradeHistoryResponseDataInner totalPrice( - @jakarta.annotation.Nullable String totalPrice) { - this.totalPrice = totalPrice; - return this; - } - - /** - * Get totalPrice - * - * @return totalPrice - */ - @jakarta.annotation.Nullable - public String getTotalPrice() { - return totalPrice; - } - - public void setTotalPrice(@jakarta.annotation.Nullable String totalPrice) { - this.totalPrice = totalPrice; - } - - public GetC2CTradeHistoryResponseDataInner unitPrice( - @jakarta.annotation.Nullable String unitPrice) { - this.unitPrice = unitPrice; - return this; - } - - /** - * Get unitPrice - * - * @return unitPrice - */ - @jakarta.annotation.Nullable - public String getUnitPrice() { - return unitPrice; - } - - public void setUnitPrice(@jakarta.annotation.Nullable String unitPrice) { - this.unitPrice = unitPrice; - } - - public GetC2CTradeHistoryResponseDataInner orderStatus( - @jakarta.annotation.Nullable String orderStatus) { - this.orderStatus = orderStatus; - return this; - } - - /** - * Get orderStatus - * - * @return orderStatus - */ - @jakarta.annotation.Nullable - public String getOrderStatus() { - return orderStatus; - } - - public void setOrderStatus(@jakarta.annotation.Nullable String orderStatus) { - this.orderStatus = orderStatus; - } - - public GetC2CTradeHistoryResponseDataInner createTime( - @jakarta.annotation.Nullable Long createTime) { - this.createTime = createTime; - return this; - } - - /** - * Get createTime - * - * @return createTime - */ - @jakarta.annotation.Nullable - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { - this.createTime = createTime; - } - - public GetC2CTradeHistoryResponseDataInner commission( - @jakarta.annotation.Nullable String commission) { - this.commission = commission; - return this; - } - - /** - * Get commission - * - * @return commission - */ - @jakarta.annotation.Nullable - public String getCommission() { - return commission; - } - - public void setCommission(@jakarta.annotation.Nullable String commission) { - this.commission = commission; - } - - public GetC2CTradeHistoryResponseDataInner counterPartNickName( - @jakarta.annotation.Nullable String counterPartNickName) { - this.counterPartNickName = counterPartNickName; - return this; - } - - /** - * Get counterPartNickName - * - * @return counterPartNickName - */ - @jakarta.annotation.Nullable - public String getCounterPartNickName() { - return counterPartNickName; - } - - public void setCounterPartNickName(@jakarta.annotation.Nullable String counterPartNickName) { - this.counterPartNickName = counterPartNickName; - } - - public GetC2CTradeHistoryResponseDataInner advertisementRole( - @jakarta.annotation.Nullable String advertisementRole) { - this.advertisementRole = advertisementRole; - return this; - } - - /** - * Get advertisementRole - * - * @return advertisementRole - */ - @jakarta.annotation.Nullable - public String getAdvertisementRole() { - return advertisementRole; - } - - public void setAdvertisementRole(@jakarta.annotation.Nullable String advertisementRole) { - this.advertisementRole = advertisementRole; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetC2CTradeHistoryResponseDataInner getC2CTradeHistoryResponseDataInner = - (GetC2CTradeHistoryResponseDataInner) o; - return Objects.equals(this.orderNumber, getC2CTradeHistoryResponseDataInner.orderNumber) - && Objects.equals(this.advNo, getC2CTradeHistoryResponseDataInner.advNo) - && Objects.equals(this.tradeType, getC2CTradeHistoryResponseDataInner.tradeType) - && Objects.equals(this.asset, getC2CTradeHistoryResponseDataInner.asset) - && Objects.equals(this.fiat, getC2CTradeHistoryResponseDataInner.fiat) - && Objects.equals(this.fiatSymbol, getC2CTradeHistoryResponseDataInner.fiatSymbol) - && Objects.equals(this.amount, getC2CTradeHistoryResponseDataInner.amount) - && Objects.equals(this.totalPrice, getC2CTradeHistoryResponseDataInner.totalPrice) - && Objects.equals(this.unitPrice, getC2CTradeHistoryResponseDataInner.unitPrice) - && Objects.equals(this.orderStatus, getC2CTradeHistoryResponseDataInner.orderStatus) - && Objects.equals(this.createTime, getC2CTradeHistoryResponseDataInner.createTime) - && Objects.equals(this.commission, getC2CTradeHistoryResponseDataInner.commission) - && Objects.equals( - this.counterPartNickName, - getC2CTradeHistoryResponseDataInner.counterPartNickName) - && Objects.equals( - this.advertisementRole, - getC2CTradeHistoryResponseDataInner.advertisementRole); - } - - @Override - public int hashCode() { - return Objects.hash( - orderNumber, - advNo, - tradeType, - asset, - fiat, - fiatSymbol, - amount, - totalPrice, - unitPrice, - orderStatus, - createTime, - commission, - counterPartNickName, - advertisementRole); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetC2CTradeHistoryResponseDataInner {\n"); - sb.append(" orderNumber: ").append(toIndentedString(orderNumber)).append("\n"); - sb.append(" advNo: ").append(toIndentedString(advNo)).append("\n"); - sb.append(" tradeType: ").append(toIndentedString(tradeType)).append("\n"); - sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); - sb.append(" fiat: ").append(toIndentedString(fiat)).append("\n"); - sb.append(" fiatSymbol: ").append(toIndentedString(fiatSymbol)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); - sb.append(" unitPrice: ").append(toIndentedString(unitPrice)).append("\n"); - sb.append(" orderStatus: ").append(toIndentedString(orderStatus)).append("\n"); - sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); - sb.append(" commission: ").append(toIndentedString(commission)).append("\n"); - sb.append(" counterPartNickName: ") - .append(toIndentedString(counterPartNickName)) - .append("\n"); - sb.append(" advertisementRole: ").append(toIndentedString(advertisementRole)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object orderNumberValue = getOrderNumber(); - String orderNumberValueAsString = ""; - orderNumberValueAsString = orderNumberValue.toString(); - sb.append("orderNumber=").append(urlEncode(orderNumberValueAsString)).append(""); - Object advNoValue = getAdvNo(); - String advNoValueAsString = ""; - advNoValueAsString = advNoValue.toString(); - sb.append("advNo=").append(urlEncode(advNoValueAsString)).append(""); - Object tradeTypeValue = getTradeType(); - String tradeTypeValueAsString = ""; - tradeTypeValueAsString = tradeTypeValue.toString(); - sb.append("tradeType=").append(urlEncode(tradeTypeValueAsString)).append(""); - Object assetValue = getAsset(); - String assetValueAsString = ""; - assetValueAsString = assetValue.toString(); - sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); - Object fiatValue = getFiat(); - String fiatValueAsString = ""; - fiatValueAsString = fiatValue.toString(); - sb.append("fiat=").append(urlEncode(fiatValueAsString)).append(""); - Object fiatSymbolValue = getFiatSymbol(); - String fiatSymbolValueAsString = ""; - fiatSymbolValueAsString = fiatSymbolValue.toString(); - sb.append("fiatSymbol=").append(urlEncode(fiatSymbolValueAsString)).append(""); - Object amountValue = getAmount(); - String amountValueAsString = ""; - amountValueAsString = amountValue.toString(); - sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); - Object totalPriceValue = getTotalPrice(); - String totalPriceValueAsString = ""; - totalPriceValueAsString = totalPriceValue.toString(); - sb.append("totalPrice=").append(urlEncode(totalPriceValueAsString)).append(""); - Object unitPriceValue = getUnitPrice(); - String unitPriceValueAsString = ""; - unitPriceValueAsString = unitPriceValue.toString(); - sb.append("unitPrice=").append(urlEncode(unitPriceValueAsString)).append(""); - Object orderStatusValue = getOrderStatus(); - String orderStatusValueAsString = ""; - orderStatusValueAsString = orderStatusValue.toString(); - sb.append("orderStatus=").append(urlEncode(orderStatusValueAsString)).append(""); - Object createTimeValue = getCreateTime(); - String createTimeValueAsString = ""; - createTimeValueAsString = createTimeValue.toString(); - sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); - Object commissionValue = getCommission(); - String commissionValueAsString = ""; - commissionValueAsString = commissionValue.toString(); - sb.append("commission=").append(urlEncode(commissionValueAsString)).append(""); - Object counterPartNickNameValue = getCounterPartNickName(); - String counterPartNickNameValueAsString = ""; - counterPartNickNameValueAsString = counterPartNickNameValue.toString(); - sb.append("counterPartNickName=") - .append(urlEncode(counterPartNickNameValueAsString)) - .append(""); - Object advertisementRoleValue = getAdvertisementRole(); - String advertisementRoleValueAsString = ""; - advertisementRoleValueAsString = advertisementRoleValue.toString(); - sb.append("advertisementRole=") - .append(urlEncode(advertisementRoleValueAsString)) - .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("orderNumber"); - openapiFields.add("advNo"); - openapiFields.add("tradeType"); - openapiFields.add("asset"); - openapiFields.add("fiat"); - openapiFields.add("fiatSymbol"); - openapiFields.add("amount"); - openapiFields.add("totalPrice"); - openapiFields.add("unitPrice"); - openapiFields.add("orderStatus"); - openapiFields.add("createTime"); - openapiFields.add("commission"); - openapiFields.add("counterPartNickName"); - openapiFields.add("advertisementRole"); - - // 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 - * GetC2CTradeHistoryResponseDataInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetC2CTradeHistoryResponseDataInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetC2CTradeHistoryResponseDataInner is" - + " not found in the empty JSON string", - GetC2CTradeHistoryResponseDataInner.openapiRequiredFields - .toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("orderNumber") != null && !jsonObj.get("orderNumber").isJsonNull()) - && !jsonObj.get("orderNumber").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `orderNumber` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("orderNumber").toString())); - } - if ((jsonObj.get("advNo") != null && !jsonObj.get("advNo").isJsonNull()) - && !jsonObj.get("advNo").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `advNo` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("advNo").toString())); - } - if ((jsonObj.get("tradeType") != null && !jsonObj.get("tradeType").isJsonNull()) - && !jsonObj.get("tradeType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `tradeType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("tradeType").toString())); - } - if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) - && !jsonObj.get("asset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `asset` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("asset").toString())); - } - if ((jsonObj.get("fiat") != null && !jsonObj.get("fiat").isJsonNull()) - && !jsonObj.get("fiat").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fiat` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("fiat").toString())); - } - if ((jsonObj.get("fiatSymbol") != null && !jsonObj.get("fiatSymbol").isJsonNull()) - && !jsonObj.get("fiatSymbol").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fiatSymbol` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("fiatSymbol").toString())); - } - if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) - && !jsonObj.get("amount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `amount` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("amount").toString())); - } - if ((jsonObj.get("totalPrice") != null && !jsonObj.get("totalPrice").isJsonNull()) - && !jsonObj.get("totalPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `totalPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("totalPrice").toString())); - } - if ((jsonObj.get("unitPrice") != null && !jsonObj.get("unitPrice").isJsonNull()) - && !jsonObj.get("unitPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `unitPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("unitPrice").toString())); - } - if ((jsonObj.get("orderStatus") != null && !jsonObj.get("orderStatus").isJsonNull()) - && !jsonObj.get("orderStatus").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `orderStatus` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("orderStatus").toString())); - } - if ((jsonObj.get("commission") != null && !jsonObj.get("commission").isJsonNull()) - && !jsonObj.get("commission").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `commission` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("commission").toString())); - } - if ((jsonObj.get("counterPartNickName") != null - && !jsonObj.get("counterPartNickName").isJsonNull()) - && !jsonObj.get("counterPartNickName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `counterPartNickName` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("counterPartNickName").toString())); - } - if ((jsonObj.get("advertisementRole") != null - && !jsonObj.get("advertisementRole").isJsonNull()) - && !jsonObj.get("advertisementRole").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `advertisementRole` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("advertisementRole").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetC2CTradeHistoryResponseDataInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetC2CTradeHistoryResponseDataInner' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetC2CTradeHistoryResponseDataInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetC2CTradeHistoryResponseDataInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetC2CTradeHistoryResponseDataInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetC2CTradeHistoryResponseDataInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetC2CTradeHistoryResponseDataInner - * @throws IOException if the JSON string is invalid with respect to - * GetC2CTradeHistoryResponseDataInner - */ - public static GetC2CTradeHistoryResponseDataInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, GetC2CTradeHistoryResponseDataInner.class); - } - - /** - * Convert an instance of GetC2CTradeHistoryResponseDataInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/convert/CHANGELOG.md b/clients/convert/CHANGELOG.md index fb6021aeb..d7c47c3bb 100644 --- a/clients/convert/CHANGELOG.md +++ b/clients/convert/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 2.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`.| ## 2.0.0 - 2026-02-12 diff --git a/clients/copy-trading/CHANGELOG.md b/clients/copy-trading/CHANGELOG.md index 51ad84c67..3a330d7d4 100644 --- a/clients/copy-trading/CHANGELOG.md +++ b/clients/copy-trading/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 1.2.2 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`.| ## 1.2.1 - 2025-08-07 diff --git a/clients/crypto-loan/CHANGELOG.md b/clients/crypto-loan/CHANGELOG.md index 1bd6e0e72..cd0a584bc 100644 --- a/clients/crypto-loan/CHANGELOG.md +++ b/clients/crypto-loan/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 4.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 4.0.0 - 2026-02-12 diff --git a/clients/derivatives-trading-coin-futures/CHANGELOG.md b/clients/derivatives-trading-coin-futures/CHANGELOG.md index fa69f8f8c..621b4e9d7 100644 --- a/clients/derivatives-trading-coin-futures/CHANGELOG.md +++ b/clients/derivatives-trading-coin-futures/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog +## 7.1.1 - 2026-05-04 + +- Added stop method for WebSocket + ## 7.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 7.0.0 - 2026-03-18 diff --git a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md index 09f20692a..f68bb4b70 100644 --- a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-coin-futures - 7.0.0 + 7.1.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-coin-futures - 7.0.0 + 7.1.1 ``` diff --git a/clients/derivatives-trading-coin-futures/pom.xml b/clients/derivatives-trading-coin-futures/pom.xml index e20dbb1ec..b6cf2fcbb 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 - 7.0.1 + 7.1.1 jar diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java index 8f816ee9c..88c2fc814 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/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/7.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java index 2aebbfa47..a471b4715 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/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/7.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java index 5fc706b67..6c966cc42 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/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/7.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java index ea2707996..6773cc585 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 @@ -79,7 +79,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/7.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java index 3bb5a1265..ea0950725 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 @@ -43,7 +43,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/7.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/AccountApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/AccountApi.java index 067691ea9..2cb2721c7 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/AccountApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/AccountApi.java @@ -38,6 +38,10 @@ public AccountApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * Account Information(USER_DATA) Get current account information. User in single-asset/ * multi-assets mode will see different value, see comments in response section for detail. 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 3fe38ddd3..6c4145ce5 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java @@ -34,9 +34,11 @@ public class DerivativesTradingCoinFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/7.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private final ConnectionInterface connection; + private AccountApi accountApi; private TradeApi tradeApi; private UserDataStreamsApi userDataStreamsApi; @@ -62,6 +64,14 @@ public DerivativesTradingCoinFuturesWebSocketApi(ConnectionInterface connection) this.accountApi = new AccountApi(connection); this.tradeApi = new TradeApi(connection); this.userDataStreamsApi = new UserDataStreamsApi(connection); + + this.connection = connection; + } + + public void stop() throws Exception { + if (connection != null && connection.isConnected()) { + connection.stop(); + } } public CompletableFuture accountInformation( diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/TradeApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/TradeApi.java index 8a5c6f2d4..99d23f967 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/TradeApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/TradeApi.java @@ -44,6 +44,10 @@ public TradeApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * Cancel Order (TRADE) Cancel an active order. * Either `orderId` or * `origClientOrderId` must be sent. Weight: 1 diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/UserDataStreamsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/UserDataStreamsApi.java index 7b4e81e6d..5d4e29406 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/UserDataStreamsApi.java @@ -40,6 +40,10 @@ public UserDataStreamsApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * Close User Data Stream (USER_STREAM) Close out a user data stream. Weight: 1 * 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 d48ea6082..2fadcbb4d 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java @@ -58,7 +58,7 @@ public class DerivativesTradingCoinFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/7.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; @@ -83,6 +83,12 @@ public DerivativesTradingCoinFuturesWebSocketStreams(StreamConnectionInterface c this.websocketMarketStreamsApi = new WebsocketMarketStreamsApi(connection); } + public void stop() throws Exception { + if (connection != null && connection.isConnected()) { + connection.stop(); + } + } + public StreamBlockingQueueWrapper aggregateTradeStreams( AggregateTradeStreamsRequest aggregateTradeStreamsRequest) throws ApiException { return websocketMarketStreamsApi.aggregateTradeStreams(aggregateTradeStreamsRequest); diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApi.java index 84acac394..1a92d9f68 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApi.java @@ -75,7 +75,7 @@ public class WebsocketMarketStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/7.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private StreamConnectionInterface connection; @@ -97,6 +97,10 @@ public WebsocketMarketStreamsApi(StreamConnectionInterface connection) { this.connection = connection; } + public StreamConnectionInterface getConnection() { + return connection; + } + /** * Aggregate Trade Streams The Aggregate Trade Streams push market trade information that is * aggregated for fills with same price and taking side every 100 milliseconds. Update Speed: diff --git a/clients/derivatives-trading-options/CHANGELOG.md b/clients/derivatives-trading-options/CHANGELOG.md index 45046b978..1fed22f65 100644 --- a/clients/derivatives-trading-options/CHANGELOG.md +++ b/clients/derivatives-trading-options/CHANGELOG.md @@ -1,6 +1,47 @@ # Changelog +## 8.0.0 - 2026-05-04 + +- Added stop method for WebSocket + +### Changed (9) + +#### REST API + +- Added parameter `selfTradePreventionMode` + - affected methods: + - `newOrder()` (`POST /eapi/v1/order`) +- Modified parameter `orders`: + - items: property `selfTradePreventionMode` added + - items: item property `selfTradePreventionMode` added + - affected methods: + - `placeMultipleOrders()` (`POST /eapi/v1/batchOrders`) +- Modified response for `cancelMultipleOptionOrders()` (`DELETE /eapi/v1/batchOrders`): + - items: property `selfTradePreventionMode` added + - items: item property `selfTradePreventionMode` added + +- Modified response for `placeMultipleOrders()` (`POST /eapi/v1/batchOrders`): + - items: property `selfTradePreventionMode` added + - items: item property `selfTradePreventionMode` added + +- Modified response for `optionMarginAccountInformation()` (`GET /eapi/v1/marginAccount`): + - property `tradeGroupId` added + +- Modified response for `queryCurrentOpenOptionOrders()` (`GET /eapi/v1/openOrders`): + - items: property `selfTradePreventionMode` added + - items: item property `selfTradePreventionMode` added + +- Modified response for `cancelOptionOrder()` (`DELETE /eapi/v1/order`): + - property `selfTradePreventionMode` added + +- Modified response for `querySingleOrder()` (`GET /eapi/v1/order`): + - property `selfTradePreventionMode` added + +- Modified response for `newOrder()` (`POST /eapi/v1/order`): + - property `selfTradePreventionMode` added + ## 7.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 6.0.0 - 2026-03-18 diff --git a/clients/derivatives-trading-options/docs/AccountApi.md b/clients/derivatives-trading-options/docs/AccountApi.md index 9924fcab3..d469deb46 100644 --- a/clients/derivatives-trading-options/docs/AccountApi.md +++ b/clients/derivatives-trading-options/docs/AccountApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://eapi.binance.com* Account Funding Flow (USER_DATA) -Query account funding flows. Weight: 1 +Query account funding flows. * Only support querying data in the past 3 months Weight: 1 ### Example ```java diff --git a/clients/derivatives-trading-options/docs/CancelMultipleOptionOrdersResponseInner.md b/clients/derivatives-trading-options/docs/CancelMultipleOptionOrdersResponseInner.md index 80bd030f2..6d52edd15 100644 --- a/clients/derivatives-trading-options/docs/CancelMultipleOptionOrdersResponseInner.md +++ b/clients/derivatives-trading-options/docs/CancelMultipleOptionOrdersResponseInner.md @@ -27,6 +27,7 @@ |**optionSide** | **String** | | [optional] | |**quoteAsset** | **String** | | [optional] | |**mmp** | **Boolean** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/CancelOptionOrderResponse.md b/clients/derivatives-trading-options/docs/CancelOptionOrderResponse.md index 0465da729..bc71699be 100644 --- a/clients/derivatives-trading-options/docs/CancelOptionOrderResponse.md +++ b/clients/derivatives-trading-options/docs/CancelOptionOrderResponse.md @@ -27,6 +27,7 @@ |**optionSide** | **String** | | [optional] | |**quoteAsset** | **String** | | [optional] | |**mmp** | **Boolean** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/NewOrderRequest.md b/clients/derivatives-trading-options/docs/NewOrderRequest.md index 7d28f8a4f..98448f056 100644 --- a/clients/derivatives-trading-options/docs/NewOrderRequest.md +++ b/clients/derivatives-trading-options/docs/NewOrderRequest.md @@ -18,6 +18,7 @@ |**newOrderRespType** | **NewOrderRespType** | | [optional] | |**clientOrderId** | **String** | | [optional] | |**isMmp** | **Boolean** | | [optional] | +|**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/NewOrderResponse.md b/clients/derivatives-trading-options/docs/NewOrderResponse.md index e28463f1e..cf1358189 100644 --- a/clients/derivatives-trading-options/docs/NewOrderResponse.md +++ b/clients/derivatives-trading-options/docs/NewOrderResponse.md @@ -27,6 +27,7 @@ |**optionSide** | **String** | | [optional] | |**quoteAsset** | **String** | | [optional] | |**mmp** | **Boolean** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponse.md b/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponse.md index f168b3a14..81ae6922f 100644 --- a/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponse.md +++ b/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponse.md @@ -14,6 +14,7 @@ |**canDeposit** | **Boolean** | | [optional] | |**canWithdraw** | **Boolean** | | [optional] | |**reduceOnly** | **Boolean** | | [optional] | +|**tradeGroupId** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/OrderTradeUpdateO.md b/clients/derivatives-trading-options/docs/OrderTradeUpdateO.md index 794d0c420..a742fc02f 100644 --- a/clients/derivatives-trading-options/docs/OrderTradeUpdateO.md +++ b/clients/derivatives-trading-options/docs/OrderTradeUpdateO.md @@ -31,6 +31,7 @@ |**R** | **Boolean** | | [optional] | |**ot** | **String** | | [optional] | |**rp** | **String** | | [optional] | +|**V** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/OrdersInner.md b/clients/derivatives-trading-options/docs/OrdersInner.md index be2cf5bb9..a73d964ed 100644 --- a/clients/derivatives-trading-options/docs/OrdersInner.md +++ b/clients/derivatives-trading-options/docs/OrdersInner.md @@ -18,6 +18,7 @@ |**newOrderRespType** | [**NewOrderRespTypeEnum**](#NewOrderRespTypeEnum) | | [optional] | |**clientOrderId** | **String** | | [optional] | |**isMmp** | **String** | | [optional] | +|**selfTradePreventionMode** | [**SelfTradePreventionModeEnum**](#SelfTradePreventionModeEnum) | | [optional] | @@ -58,3 +59,13 @@ +## Enum: SelfTradePreventionModeEnum + +| Name | Value | +|---- | -----| +| EXPIRE_TAKER | "EXPIRE_TAKER" | +| EXPIRE_BOTH | "EXPIRE_BOTH" | +| EXPIRE_MAKER | "EXPIRE_MAKER" | + + + diff --git a/clients/derivatives-trading-options/docs/PlaceMultipleOrdersResponseInner.md b/clients/derivatives-trading-options/docs/PlaceMultipleOrdersResponseInner.md index bd13fc4d0..9a5670bd6 100644 --- a/clients/derivatives-trading-options/docs/PlaceMultipleOrdersResponseInner.md +++ b/clients/derivatives-trading-options/docs/PlaceMultipleOrdersResponseInner.md @@ -27,6 +27,7 @@ |**optionSide** | **String** | | [optional] | |**quoteAsset** | **String** | | [optional] | |**mmp** | **Boolean** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/QueryCurrentOpenOptionOrdersResponseInner.md b/clients/derivatives-trading-options/docs/QueryCurrentOpenOptionOrdersResponseInner.md index 94c7e4f50..6eff7fe9b 100644 --- a/clients/derivatives-trading-options/docs/QueryCurrentOpenOptionOrdersResponseInner.md +++ b/clients/derivatives-trading-options/docs/QueryCurrentOpenOptionOrdersResponseInner.md @@ -26,6 +26,7 @@ |**optionSide** | **String** | | [optional] | |**quoteAsset** | **String** | | [optional] | |**mmp** | **Boolean** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/QuerySingleOrderResponse.md b/clients/derivatives-trading-options/docs/QuerySingleOrderResponse.md index d2e6861a0..642ac14da 100644 --- a/clients/derivatives-trading-options/docs/QuerySingleOrderResponse.md +++ b/clients/derivatives-trading-options/docs/QuerySingleOrderResponse.md @@ -26,6 +26,7 @@ |**optionSide** | **String** | | [optional] | |**quoteAsset** | **String** | | [optional] | |**mmp** | **Boolean** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/SelfTradePreventionMode.md b/clients/derivatives-trading-options/docs/SelfTradePreventionMode.md new file mode 100644 index 000000000..c01165439 --- /dev/null +++ b/clients/derivatives-trading-options/docs/SelfTradePreventionMode.md @@ -0,0 +1,15 @@ + + +# SelfTradePreventionMode + +## Enum + + +* `EXPIRE_TAKER` (value: `"EXPIRE_TAKER"`) + +* `EXPIRE_BOTH` (value: `"EXPIRE_BOTH"`) + +* `EXPIRE_MAKER` (value: `"EXPIRE_MAKER"`) + + + diff --git a/clients/derivatives-trading-options/docs/TradeApi.md b/clients/derivatives-trading-options/docs/TradeApi.md index ce7a9fbfe..125870874 100644 --- a/clients/derivatives-trading-options/docs/TradeApi.md +++ b/clients/derivatives-trading-options/docs/TradeApi.md @@ -25,7 +25,7 @@ All URIs are relative to *https://eapi.binance.com* Account Trade List (USER_DATA) -Get trades for a specific account and symbol. Weight: 5 +Get trades for a specific account and symbol. * Only support querying trades in the past 3 months Weight: 5 ### Example ```java diff --git a/clients/derivatives-trading-options/docs/rest-api/migration-guide.md b/clients/derivatives-trading-options/docs/rest-api/migration-guide.md index ebb8c3759..127f82b4e 100644 --- a/clients/derivatives-trading-options/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-options/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-options - 7.0.0 + 8.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-options - 7.0.0 + 8.0.0 ``` diff --git a/clients/derivatives-trading-options/example_rest.md b/clients/derivatives-trading-options/example_rest.md index 6fcff9841..1c55c5eb3 100644 --- a/clients/derivatives-trading-options/example_rest.md +++ b/clients/derivatives-trading-options/example_rest.md @@ -62,7 +62,7 @@ ## Trade -[GET /eapi/v1/userTrades](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) - accountTradeList - [AccountTradeListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/AccountTradeListExample.java#L47) +[GET /eapi/v1/userTrades](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) - accountTradeList - [AccountTradeListExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/AccountTradeListExample.java#L48) [DELETE /eapi/v1/allOpenOrdersByUnderlying](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) - cancelAllOptionOrdersByUnderlying - [CancelAllOptionOrdersByUnderlyingExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersByUnderlyingExample.java#L47) diff --git a/clients/derivatives-trading-options/pom.xml b/clients/derivatives-trading-options/pom.xml index ec681af29..c7a619521 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 - 7.0.1 + 8.0.0 jar 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 7c92e20e7..09c1a8c47 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 @@ -43,7 +43,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -237,7 +237,8 @@ private okhttp3.Call accountFundingFlowValidateBeforeCall( } /** - * Account Funding Flow (USER_DATA) Query account funding flows. Weight: 1 + * Account Funding Flow (USER_DATA) Query account funding flows. * Only support querying data in + * the past 3 months Weight: 1 * * @param currency Asset type, only support USDT as of now (required) * @param recordId Return the recordId and subsequent data, the latest data is returned by diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java index 0f2862793..d1fa8477f 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java @@ -79,7 +79,8 @@ public DerivativesTradingOptionsRestApi(ApiClient apiClient) { } /** - * Account Funding Flow (USER_DATA) Query account funding flows. Weight: 1 + * Account Funding Flow (USER_DATA) Query account funding flows. * Only support querying data in + * the past 3 months Weight: 1 * * @param currency Asset type, only support USDT as of now (required) * @param recordId Return the recordId and subsequent data, the latest data is returned by @@ -777,7 +778,8 @@ public ApiResponse setMarketMakerProtect } /** - * Account Trade List (USER_DATA) Get trades for a specific account and symbol. Weight: 5 + * Account Trade List (USER_DATA) Get trades for a specific account and symbol. * Only support + * querying trades in the past 3 months Weight: 5 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (optional) * @param fromId Trade id to fetch from. Default gets most recent trades, e.g 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 bb69a8c61..58d61eec5 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 @@ -52,7 +52,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/8.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 d8b75e879..9f2025775 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java @@ -52,7 +52,7 @@ public class MarketMakerBlockTradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/8.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 43d553228..eb53a4e9f 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java @@ -53,7 +53,7 @@ public class MarketMakerEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/8.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 7e9e930d5..baa466b24 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 @@ -61,7 +61,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -244,7 +244,8 @@ private okhttp3.Call accountTradeListValidateBeforeCall( } /** - * Account Trade List (USER_DATA) Get trades for a specific account and symbol. Weight: 5 + * Account Trade List (USER_DATA) Get trades for a specific account and symbol. * Only support + * querying trades in the past 3 months Weight: 5 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (optional) * @param fromId Trade id to fetch from. Default gets most recent trades, e.g @@ -997,6 +998,11 @@ private okhttp3.Call newOrderCall(NewOrderRequest newOrderRequest) throws ApiExc localVarFormParams.put("isMmp", newOrderRequest.getIsMmp()); } + if (newOrderRequest.getSelfTradePreventionMode() != null) { + localVarFormParams.put( + "selfTradePreventionMode", newOrderRequest.getSelfTradePreventionMode()); + } + if (newOrderRequest.getRecvWindow() != null) { localVarFormParams.put("recvWindow", newOrderRequest.getRecvWindow()); } 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 77dde7f58..299d48144 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/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelMultipleOptionOrdersResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelMultipleOptionOrdersResponseInner.java index 5c1a8976c..c8896a061 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelMultipleOptionOrdersResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelMultipleOptionOrdersResponseInner.java @@ -156,6 +156,13 @@ public class CancelMultipleOptionOrdersResponseInner { @jakarta.annotation.Nullable private Boolean mmp; + 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 CancelMultipleOptionOrdersResponseInner() {} public CancelMultipleOptionOrdersResponseInner orderId( @@ -555,6 +562,27 @@ public void setMmp(@jakarta.annotation.Nullable Boolean mmp) { this.mmp = mmp; } + public CancelMultipleOptionOrdersResponseInner 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) { @@ -594,7 +622,10 @@ public boolean equals(Object o) { this.optionSide, cancelMultipleOptionOrdersResponseInner.optionSide) && Objects.equals( this.quoteAsset, cancelMultipleOptionOrdersResponseInner.quoteAsset) - && Objects.equals(this.mmp, cancelMultipleOptionOrdersResponseInner.mmp); + && Objects.equals(this.mmp, cancelMultipleOptionOrdersResponseInner.mmp) + && Objects.equals( + this.selfTradePreventionMode, + cancelMultipleOptionOrdersResponseInner.selfTradePreventionMode); } @Override @@ -619,7 +650,8 @@ public int hashCode() { quantityScale, optionSide, quoteAsset, - mmp); + mmp, + selfTradePreventionMode); } @Override @@ -646,6 +678,9 @@ public String toString() { sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -733,6 +768,12 @@ public String toUrlQueryString() { String mmpValueAsString = ""; mmpValueAsString = mmpValue.toString(); sb.append("mmp=").append(urlEncode(mmpValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); return sb.toString(); } @@ -781,6 +822,7 @@ private String toIndentedString(Object o) { openapiFields.add("optionSide"); openapiFields.add("quoteAsset"); openapiFields.add("mmp"); + openapiFields.add("selfTradePreventionMode"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -911,6 +953,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quoteAsset").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 { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelOptionOrderResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelOptionOrderResponse.java index c24d7a506..6734c7765 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelOptionOrderResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelOptionOrderResponse.java @@ -156,6 +156,13 @@ public class CancelOptionOrderResponse { @jakarta.annotation.Nullable private Boolean mmp; + 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 CancelOptionOrderResponse() {} public CancelOptionOrderResponse orderId(@jakarta.annotation.Nullable Long orderId) { @@ -540,6 +547,27 @@ public void setMmp(@jakarta.annotation.Nullable Boolean mmp) { this.mmp = mmp; } + public CancelOptionOrderResponse 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) { @@ -568,7 +596,10 @@ public boolean equals(Object o) { && Objects.equals(this.quantityScale, cancelOptionOrderResponse.quantityScale) && Objects.equals(this.optionSide, cancelOptionOrderResponse.optionSide) && Objects.equals(this.quoteAsset, cancelOptionOrderResponse.quoteAsset) - && Objects.equals(this.mmp, cancelOptionOrderResponse.mmp); + && Objects.equals(this.mmp, cancelOptionOrderResponse.mmp) + && Objects.equals( + this.selfTradePreventionMode, + cancelOptionOrderResponse.selfTradePreventionMode); } @Override @@ -593,7 +624,8 @@ public int hashCode() { quantityScale, optionSide, quoteAsset, - mmp); + mmp, + selfTradePreventionMode); } @Override @@ -620,6 +652,9 @@ public String toString() { sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -707,6 +742,12 @@ public String toUrlQueryString() { String mmpValueAsString = ""; mmpValueAsString = mmpValue.toString(); sb.append("mmp=").append(urlEncode(mmpValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); return sb.toString(); } @@ -755,6 +796,7 @@ private String toIndentedString(Object o) { openapiFields.add("optionSide"); openapiFields.add("quoteAsset"); openapiFields.add("mmp"); + openapiFields.add("selfTradePreventionMode"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -882,6 +924,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quoteAsset").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 { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderRequest.java index d3f8d11a7..5660106b8 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderRequest.java @@ -103,6 +103,13 @@ public class NewOrderRequest { @jakarta.annotation.Nullable private Boolean isMmp; + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private SelfTradePreventionMode selfTradePreventionMode; + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -332,6 +339,28 @@ public void setIsMmp(@jakarta.annotation.Nullable Boolean isMmp) { this.isMmp = isMmp; } + public NewOrderRequest selfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + @Valid + public SelfTradePreventionMode getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + public NewOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -371,6 +400,8 @@ public boolean equals(Object o) { && Objects.equals(this.newOrderRespType, newOrderRequest.newOrderRespType) && Objects.equals(this.clientOrderId, newOrderRequest.clientOrderId) && Objects.equals(this.isMmp, newOrderRequest.isMmp) + && Objects.equals( + this.selfTradePreventionMode, newOrderRequest.selfTradePreventionMode) && Objects.equals(this.recvWindow, newOrderRequest.recvWindow); } @@ -388,6 +419,7 @@ public int hashCode() { newOrderRespType, clientOrderId, isMmp, + selfTradePreventionMode, recvWindow); } @@ -406,6 +438,9 @@ public String toString() { sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); sb.append(" isMmp: ").append(toIndentedString(isMmp)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -458,6 +493,12 @@ public String toUrlQueryString() { String isMmpValueAsString = ""; isMmpValueAsString = isMmpValue.toString(); sb.append("isMmp=").append(urlEncode(isMmpValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); Object recvWindowValue = getRecvWindow(); String recvWindowValueAsString = ""; recvWindowValueAsString = recvWindowValue.toString(); @@ -501,6 +542,7 @@ private String toIndentedString(Object o) { openapiFields.add("newOrderRespType"); openapiFields.add("clientOrderId"); openapiFields.add("isMmp"); + openapiFields.add("selfTradePreventionMode"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -567,6 +609,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("clientOrderId").toString())); } + // validate the optional field `selfTradePreventionMode` + if (jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { + SelfTradePreventionMode.validateJsonElement(jsonObj.get("selfTradePreventionMode")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderResponse.java index 7aa7e8f2b..f07a7b166 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderResponse.java @@ -156,6 +156,13 @@ public class NewOrderResponse { @jakarta.annotation.Nullable private Boolean mmp; + 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 NewOrderResponse() {} public NewOrderResponse orderId(@jakarta.annotation.Nullable Long orderId) { @@ -538,6 +545,27 @@ public void setMmp(@jakarta.annotation.Nullable Boolean mmp) { this.mmp = mmp; } + public NewOrderResponse 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) { @@ -566,7 +594,9 @@ public boolean equals(Object o) { && Objects.equals(this.quantityScale, newOrderResponse.quantityScale) && Objects.equals(this.optionSide, newOrderResponse.optionSide) && Objects.equals(this.quoteAsset, newOrderResponse.quoteAsset) - && Objects.equals(this.mmp, newOrderResponse.mmp); + && Objects.equals(this.mmp, newOrderResponse.mmp) + && Objects.equals( + this.selfTradePreventionMode, newOrderResponse.selfTradePreventionMode); } @Override @@ -591,7 +621,8 @@ public int hashCode() { quantityScale, optionSide, quoteAsset, - mmp); + mmp, + selfTradePreventionMode); } @Override @@ -618,6 +649,9 @@ public String toString() { sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -705,6 +739,12 @@ public String toUrlQueryString() { String mmpValueAsString = ""; mmpValueAsString = mmpValue.toString(); sb.append("mmp=").append(urlEncode(mmpValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); return sb.toString(); } @@ -753,6 +793,7 @@ private String toIndentedString(Object o) { openapiFields.add("optionSide"); openapiFields.add("quoteAsset"); openapiFields.add("mmp"); + openapiFields.add("selfTradePreventionMode"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -880,6 +921,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quoteAsset").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 { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponse.java index 71a3f4a0a..844e56abc 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponse.java @@ -84,6 +84,12 @@ public class OptionMarginAccountInformationResponse { @jakarta.annotation.Nullable private Boolean reduceOnly; + public static final String SERIALIZED_NAME_TRADE_GROUP_ID = "tradeGroupId"; + + @SerializedName(SERIALIZED_NAME_TRADE_GROUP_ID) + @jakarta.annotation.Nullable + private Long tradeGroupId; + public OptionMarginAccountInformationResponse() {} public OptionMarginAccountInformationResponse asset( @@ -251,6 +257,26 @@ public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; } + public OptionMarginAccountInformationResponse tradeGroupId( + @jakarta.annotation.Nullable Long tradeGroupId) { + this.tradeGroupId = tradeGroupId; + return this; + } + + /** + * Get tradeGroupId + * + * @return tradeGroupId + */ + @jakarta.annotation.Nullable + public Long getTradeGroupId() { + return tradeGroupId; + } + + public void setTradeGroupId(@jakarta.annotation.Nullable Long tradeGroupId) { + this.tradeGroupId = tradeGroupId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -270,12 +296,15 @@ public boolean equals(Object o) { && Objects.equals( this.canWithdraw, optionMarginAccountInformationResponse.canWithdraw) && Objects.equals( - this.reduceOnly, optionMarginAccountInformationResponse.reduceOnly); + this.reduceOnly, optionMarginAccountInformationResponse.reduceOnly) + && Objects.equals( + this.tradeGroupId, optionMarginAccountInformationResponse.tradeGroupId); } @Override public int hashCode() { - return Objects.hash(asset, greek, time, canTrade, canDeposit, canWithdraw, reduceOnly); + return Objects.hash( + asset, greek, time, canTrade, canDeposit, canWithdraw, reduceOnly, tradeGroupId); } @Override @@ -289,6 +318,7 @@ public String toString() { sb.append(" canDeposit: ").append(toIndentedString(canDeposit)).append("\n"); sb.append(" canWithdraw: ").append(toIndentedString(canWithdraw)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" tradeGroupId: ").append(toIndentedString(tradeGroupId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -330,6 +360,10 @@ public String toUrlQueryString() { String reduceOnlyValueAsString = ""; reduceOnlyValueAsString = reduceOnlyValue.toString(); sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object tradeGroupIdValue = getTradeGroupId(); + String tradeGroupIdValueAsString = ""; + tradeGroupIdValueAsString = tradeGroupIdValue.toString(); + sb.append("tradeGroupId=").append(urlEncode(tradeGroupIdValueAsString)).append(""); return sb.toString(); } @@ -365,6 +399,7 @@ private String toIndentedString(Object o) { openapiFields.add("canDeposit"); openapiFields.add("canWithdraw"); openapiFields.add("reduceOnly"); + openapiFields.add("tradeGroupId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java index 593f46bf0..4c88c11f3 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java @@ -309,6 +309,68 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @jakarta.annotation.Nullable private String isMmp; + /** 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 OrdersInner() {} public OrdersInner symbol(@jakarta.annotation.Nullable String symbol) { @@ -522,6 +584,27 @@ public void setIsMmp(@jakarta.annotation.Nullable String isMmp) { this.isMmp = isMmp; } + public OrdersInner 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; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -541,7 +624,9 @@ public boolean equals(Object o) { && Objects.equals(this.postOnly, ordersInner.postOnly) && Objects.equals(this.newOrderRespType, ordersInner.newOrderRespType) && Objects.equals(this.clientOrderId, ordersInner.clientOrderId) - && Objects.equals(this.isMmp, ordersInner.isMmp); + && Objects.equals(this.isMmp, ordersInner.isMmp) + && Objects.equals( + this.selfTradePreventionMode, ordersInner.selfTradePreventionMode); } @Override @@ -557,7 +642,8 @@ public int hashCode() { postOnly, newOrderRespType, clientOrderId, - isMmp); + isMmp, + selfTradePreventionMode); } @Override @@ -575,6 +661,9 @@ public String toString() { sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); sb.append(" isMmp: ").append(toIndentedString(isMmp)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -626,6 +715,12 @@ public String toUrlQueryString() { String isMmpValueAsString = ""; isMmpValueAsString = isMmpValue.toString(); sb.append("isMmp=").append(urlEncode(isMmpValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); return sb.toString(); } @@ -665,6 +760,7 @@ private String toIndentedString(Object o) { openapiFields.add("newOrderRespType"); openapiFields.add("clientOrderId"); openapiFields.add("isMmp"); + openapiFields.add("selfTradePreventionMode"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -794,6 +890,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("isMmp").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())); + } + // 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-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/PlaceMultipleOrdersResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/PlaceMultipleOrdersResponseInner.java index 6e3607605..dd784208a 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/PlaceMultipleOrdersResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/PlaceMultipleOrdersResponseInner.java @@ -156,6 +156,13 @@ public class PlaceMultipleOrdersResponseInner { @jakarta.annotation.Nullable private Boolean mmp; + 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 PlaceMultipleOrdersResponseInner() {} public PlaceMultipleOrdersResponseInner orderId(@jakarta.annotation.Nullable Long orderId) { @@ -548,6 +555,27 @@ public void setMmp(@jakarta.annotation.Nullable Boolean mmp) { this.mmp = mmp; } + public PlaceMultipleOrdersResponseInner 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) { @@ -579,7 +607,10 @@ public boolean equals(Object o) { this.quantityScale, placeMultipleOrdersResponseInner.quantityScale) && Objects.equals(this.optionSide, placeMultipleOrdersResponseInner.optionSide) && Objects.equals(this.quoteAsset, placeMultipleOrdersResponseInner.quoteAsset) - && Objects.equals(this.mmp, placeMultipleOrdersResponseInner.mmp); + && Objects.equals(this.mmp, placeMultipleOrdersResponseInner.mmp) + && Objects.equals( + this.selfTradePreventionMode, + placeMultipleOrdersResponseInner.selfTradePreventionMode); } @Override @@ -604,7 +635,8 @@ public int hashCode() { quantityScale, optionSide, quoteAsset, - mmp); + mmp, + selfTradePreventionMode); } @Override @@ -631,6 +663,9 @@ public String toString() { sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -718,6 +753,12 @@ public String toUrlQueryString() { String mmpValueAsString = ""; mmpValueAsString = mmpValue.toString(); sb.append("mmp=").append(urlEncode(mmpValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); return sb.toString(); } @@ -766,6 +807,7 @@ private String toIndentedString(Object o) { openapiFields.add("optionSide"); openapiFields.add("quoteAsset"); openapiFields.add("mmp"); + openapiFields.add("selfTradePreventionMode"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -894,6 +936,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quoteAsset").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 { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryCurrentOpenOptionOrdersResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryCurrentOpenOptionOrdersResponseInner.java index 843d45ca4..ad45b7a93 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryCurrentOpenOptionOrdersResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryCurrentOpenOptionOrdersResponseInner.java @@ -150,6 +150,13 @@ public class QueryCurrentOpenOptionOrdersResponseInner { @jakarta.annotation.Nullable private Boolean mmp; + 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 QueryCurrentOpenOptionOrdersResponseInner() {} public QueryCurrentOpenOptionOrdersResponseInner orderId( @@ -531,6 +538,27 @@ public void setMmp(@jakarta.annotation.Nullable Boolean mmp) { this.mmp = mmp; } + public QueryCurrentOpenOptionOrdersResponseInner 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) { @@ -569,7 +597,10 @@ public boolean equals(Object o) { this.optionSide, queryCurrentOpenOptionOrdersResponseInner.optionSide) && Objects.equals( this.quoteAsset, queryCurrentOpenOptionOrdersResponseInner.quoteAsset) - && Objects.equals(this.mmp, queryCurrentOpenOptionOrdersResponseInner.mmp); + && Objects.equals(this.mmp, queryCurrentOpenOptionOrdersResponseInner.mmp) + && Objects.equals( + this.selfTradePreventionMode, + queryCurrentOpenOptionOrdersResponseInner.selfTradePreventionMode); } @Override @@ -593,7 +624,8 @@ public int hashCode() { quantityScale, optionSide, quoteAsset, - mmp); + mmp, + selfTradePreventionMode); } @Override @@ -619,6 +651,9 @@ public String toString() { sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -702,6 +737,12 @@ public String toUrlQueryString() { String mmpValueAsString = ""; mmpValueAsString = mmpValue.toString(); sb.append("mmp=").append(urlEncode(mmpValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); return sb.toString(); } @@ -749,6 +790,7 @@ private String toIndentedString(Object o) { openapiFields.add("optionSide"); openapiFields.add("quoteAsset"); openapiFields.add("mmp"); + openapiFields.add("selfTradePreventionMode"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -871,6 +913,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quoteAsset").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 { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QuerySingleOrderResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QuerySingleOrderResponse.java index 204a442c7..ad38aad1e 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QuerySingleOrderResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QuerySingleOrderResponse.java @@ -150,6 +150,13 @@ public class QuerySingleOrderResponse { @jakarta.annotation.Nullable private Boolean mmp; + 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 QuerySingleOrderResponse() {} public QuerySingleOrderResponse orderId(@jakarta.annotation.Nullable Long orderId) { @@ -514,6 +521,27 @@ public void setMmp(@jakarta.annotation.Nullable Boolean mmp) { this.mmp = mmp; } + public QuerySingleOrderResponse 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) { @@ -541,7 +569,10 @@ public boolean equals(Object o) { && Objects.equals(this.quantityScale, querySingleOrderResponse.quantityScale) && Objects.equals(this.optionSide, querySingleOrderResponse.optionSide) && Objects.equals(this.quoteAsset, querySingleOrderResponse.quoteAsset) - && Objects.equals(this.mmp, querySingleOrderResponse.mmp); + && Objects.equals(this.mmp, querySingleOrderResponse.mmp) + && Objects.equals( + this.selfTradePreventionMode, + querySingleOrderResponse.selfTradePreventionMode); } @Override @@ -565,7 +596,8 @@ public int hashCode() { quantityScale, optionSide, quoteAsset, - mmp); + mmp, + selfTradePreventionMode); } @Override @@ -591,6 +623,9 @@ public String toString() { sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -674,6 +709,12 @@ public String toUrlQueryString() { String mmpValueAsString = ""; mmpValueAsString = mmpValue.toString(); sb.append("mmp=").append(urlEncode(mmpValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); return sb.toString(); } @@ -721,6 +762,7 @@ private String toIndentedString(Object o) { openapiFields.add("optionSide"); openapiFields.add("quoteAsset"); openapiFields.add("mmp"); + openapiFields.add("selfTradePreventionMode"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -840,6 +882,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quoteAsset").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 { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/SelfTradePreventionMode.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/SelfTradePreventionMode.java new file mode 100644 index 000000000..4308b0ce7 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/SelfTradePreventionMode.java @@ -0,0 +1,75 @@ +/* + * Binance Derivatives Trading Options REST API + * OpenAPI Specification for the Binance Derivatives Trading Options REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.rest.model; + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets selfTradePreventionMode */ +@JsonAdapter(SelfTradePreventionMode.Adapter.class) +public enum SelfTradePreventionMode { + EXPIRE_TAKER("EXPIRE_TAKER"), + + EXPIRE_BOTH("EXPIRE_BOTH"), + + EXPIRE_MAKER("EXPIRE_MAKER"); + + private String value; + + SelfTradePreventionMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SelfTradePreventionMode fromValue(String value) { + for (SelfTradePreventionMode b : SelfTradePreventionMode.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 SelfTradePreventionMode enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SelfTradePreventionMode read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SelfTradePreventionMode.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SelfTradePreventionMode.fromValue(value); + } +} 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 9edfc81d2..32aac0b83 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 @@ -40,7 +40,7 @@ public class DerivativesTradingOptionsWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private WebSocketClientConfiguration clientConfiguration; @@ -69,6 +69,20 @@ public StreamConnectionInterface getConnection() { return connection; } + public void stop() throws Exception { + if (connection != null && connection.isConnected()) { + connection.stop(); + } + + if (marketApi != null && marketApi.getConnection().isConnected()) { + marketApi.getConnection().stop(); + } + + if (publicApi != null && publicApi.getConnection().isConnected()) { + publicApi.getConnection().stop(); + } + } + public MarketApi getMarketApi() { if (marketApi == null) { WebSocketClientConfiguration configuration = diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApi.java index 1b394335c..d9c8efc56 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApi.java @@ -47,7 +47,7 @@ public class MarketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private StreamConnectionInterface connection; @@ -69,6 +69,10 @@ public MarketApi(StreamConnectionInterface connection) { this.connection = connection; } + public StreamConnectionInterface getConnection() { + return connection; + } + /** * Index Price Streams Underlying(e.g ETHUSDT) index stream. Update Speed: 1000ms * diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApi.java index 0485f5b4d..8ffd35bc7 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApi.java @@ -47,7 +47,7 @@ public class PublicApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private StreamConnectionInterface connection; @@ -69,6 +69,10 @@ public PublicApi(StreamConnectionInterface connection) { this.connection = connection; } + public StreamConnectionInterface getConnection() { + return connection; + } + /** * Diff Book Depth Streams Bids and asks, pushed every 500 milliseconds, 100 milliseconds (if * existing) Update Speed: 100ms or 500ms diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateO.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateO.java index 8c4c08303..e9bb42a17 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateO.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateO.java @@ -183,6 +183,12 @@ public class OrderTradeUpdateO extends BaseDTO { @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 OrderTradeUpdateO() {} public OrderTradeUpdateO sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { @@ -641,6 +647,25 @@ 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; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -673,7 +698,8 @@ public boolean equals(Object o) { && Objects.equals(this.mLowerCase, orderTradeUpdateO.mLowerCase) && Objects.equals(this.R, orderTradeUpdateO.R) && Objects.equals(this.ot, orderTradeUpdateO.ot) - && Objects.equals(this.rp, orderTradeUpdateO.rp); + && Objects.equals(this.rp, orderTradeUpdateO.rp) + && Objects.equals(this.V, orderTradeUpdateO.V); } @Override @@ -702,7 +728,8 @@ public int hashCode() { mLowerCase, R, ot, - rp); + rp, + V); } @Override @@ -733,6 +760,7 @@ public String toString() { sb.append(" R: ").append(toIndentedString(R)).append("\n"); sb.append(" ot: ").append(toIndentedString(ot)).append("\n"); sb.append(" rp: ").append(toIndentedString(rp)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); sb.append("}"); return sb.toString(); } @@ -861,6 +889,11 @@ public String toUrlQueryString() { String rpValueAsString = rpValue.toString(); valMap.put("rp", rpValueAsString); } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -968,6 +1001,10 @@ public Map toMap() { if (rpValue != null) { valMap.put("rp", rpValue); } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -1018,6 +1055,7 @@ private String toIndentedString(Object o) { openapiFields.add("R"); openapiFields.add("ot"); openapiFields.add("rp"); + openapiFields.add("V"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1205,6 +1243,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " 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())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md index bc24d81b5..6b615e57b 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md @@ -1,6 +1,19 @@ # Changelog +## 7.0.0 - 2026-05-04 + +- Added stop method for WebSocket + +### Added (3) + +#### REST API + +- `deleteMarginCallLevel()` (`DELETE /sapi/v1/portfolio/margin-call-level`) +- `getMarginCallLevel()` (`GET /sapi/v1/portfolio/margin-call-level`) +- `setMarginCallLevel()` (`POST /sapi/v1/portfolio/margin-call-level`) + ## 6.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 6.0.0 - 2026-02-12 diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md b/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md index bcfd1841a..deef6ea16 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md @@ -6,10 +6,12 @@ All URIs are relative to *https://api.binance.com* |------------- | ------------- | -------------| | [**bnbTransfer**](AccountApi.md#bnbTransfer) | **POST** /sapi/v1/portfolio/bnb-transfer | BNB transfer(USER_DATA) | | [**changeAutoRepayFuturesStatus**](AccountApi.md#changeAutoRepayFuturesStatus) | **POST** /sapi/v1/portfolio/repay-futures-switch | Change Auto-repay-futures Status(TRADE) | +| [**deleteMarginCallLevel**](AccountApi.md#deleteMarginCallLevel) | **DELETE** /sapi/v1/portfolio/margin-call-level | Delete Margin Call Level (USER_DATA) | | [**fundAutoCollection**](AccountApi.md#fundAutoCollection) | **POST** /sapi/v1/portfolio/auto-collection | Fund Auto-collection(USER_DATA) | | [**fundCollectionByAsset**](AccountApi.md#fundCollectionByAsset) | **POST** /sapi/v1/portfolio/asset-collection | Fund Collection by Asset(USER_DATA) | | [**getAutoRepayFuturesStatus**](AccountApi.md#getAutoRepayFuturesStatus) | **GET** /sapi/v1/portfolio/repay-futures-switch | Get Auto-repay-futures Status(USER_DATA) | | [**getDeltaModeStatus**](AccountApi.md#getDeltaModeStatus) | **GET** /sapi/v1/portfolio/delta-mode | Get Delta Mode Status(USER_DATA) | +| [**getMarginCallLevel**](AccountApi.md#getMarginCallLevel) | **GET** /sapi/v1/portfolio/margin-call-level | Get Margin Call Level (USER_DATA) | | [**getPortfolioMarginProAccountBalance**](AccountApi.md#getPortfolioMarginProAccountBalance) | **GET** /sapi/v1/portfolio/balance | Get Portfolio Margin Pro Account Balance(USER_DATA) | | [**getPortfolioMarginProAccountInfo**](AccountApi.md#getPortfolioMarginProAccountInfo) | **GET** /sapi/v1/portfolio/account | Get Portfolio Margin Pro Account Info(USER_DATA) | | [**getPortfolioMarginProSpanAccountInfo**](AccountApi.md#getPortfolioMarginProSpanAccountInfo) | **GET** /sapi/v2/portfolio/account | Get Portfolio Margin Pro SPAN Account Info(USER_DATA) | @@ -19,6 +21,7 @@ All URIs are relative to *https://api.binance.com* | [**queryPortfolioMarginProBankruptcyLoanRepayHistory**](AccountApi.md#queryPortfolioMarginProBankruptcyLoanRepayHistory) | **GET** /sapi/v1/portfolio/pmloan-history | Query Portfolio Margin Pro Bankruptcy Loan Repay History(USER_DATA) | | [**queryPortfolioMarginProNegativeBalanceInterestHistory**](AccountApi.md#queryPortfolioMarginProNegativeBalanceInterestHistory) | **GET** /sapi/v1/portfolio/interest-history | Query Portfolio Margin Pro Negative Balance Interest History(USER_DATA) | | [**repayFuturesNegativeBalance**](AccountApi.md#repayFuturesNegativeBalance) | **POST** /sapi/v1/portfolio/repay-futures-negative-balance | Repay futures Negative Balance(USER_DATA) | +| [**setMarginCallLevel**](AccountApi.md#setMarginCallLevel) | **POST** /sapi/v1/portfolio/margin-call-level | Set Margin Call Level (USER_DATA) | | [**switchDeltaMode**](AccountApi.md#switchDeltaMode) | **POST** /sapi/v1/portfolio/delta-mode | Switch Delta Mode(TRADE) | | [**transferLdusdtRwusdForPortfolioMargin**](AccountApi.md#transferLdusdtRwusdForPortfolioMargin) | **POST** /sapi/v1/portfolio/earn-asset-transfer | Transfer LDUSDT/RWUSD for Portfolio Margin(TRADE) | @@ -147,6 +150,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Change Auto-repay-futures Status | - | + +# **deleteMarginCallLevel** +> DeleteMarginCallLevelResponse deleteMarginCallLevel(recvWindow) + +Delete Margin Call Level (USER_DATA) + +Delete the margin call level for a Portfolio Margin account. Weight: 1500 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + AccountApi apiInstance = new AccountApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + DeleteMarginCallLevelResponse result = apiInstance.deleteMarginCallLevel(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#deleteMarginCallLevel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**DeleteMarginCallLevelResponse**](DeleteMarginCallLevelResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete Margin Call Level | - | + # **fundAutoCollection** > FundAutoCollectionResponse fundAutoCollection(fundAutoCollectionRequest) @@ -395,6 +460,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Get Delta Mode Status | - | + +# **getMarginCallLevel** +> GetMarginCallLevelResponse getMarginCallLevel(recvWindow) + +Get Margin Call Level (USER_DATA) + +Get the margin call level for a Portfolio Margin account. Weight: 1500 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + AccountApi apiInstance = new AccountApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + GetMarginCallLevelResponse result = apiInstance.getMarginCallLevel(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#getMarginCallLevel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetMarginCallLevelResponse**](GetMarginCallLevelResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Margin Call Level | - | + # **getPortfolioMarginProAccountBalance** > GetPortfolioMarginProAccountBalanceResponse getPortfolioMarginProAccountBalance(asset, recvWindow) @@ -975,6 +1102,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Repay futures Negative Balance | - | + +# **setMarginCallLevel** +> SetMarginCallLevelResponse setMarginCallLevel(setMarginCallLevelRequest) + +Set Margin Call Level (USER_DATA) + +Set the margin call level for a Portfolio Margin account. When the account's uniMMR drops to the specified level, a notification will be sent via email and SMS. Weight: 1500 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + AccountApi apiInstance = new AccountApi(defaultClient); + SetMarginCallLevelRequest setMarginCallLevelRequest = new SetMarginCallLevelRequest(); // SetMarginCallLevelRequest | + try { + SetMarginCallLevelResponse result = apiInstance.setMarginCallLevel(setMarginCallLevelRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#setMarginCallLevel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **setMarginCallLevelRequest** | [**SetMarginCallLevelRequest**](SetMarginCallLevelRequest.md)| | | + +### Return type + +[**SetMarginCallLevelResponse**](SetMarginCallLevelResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Set Margin Call Level | - | + # **switchDeltaMode** > SwitchDeltaModeResponse switchDeltaMode(switchDeltaModeRequest) diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/DeleteMarginCallLevelResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/DeleteMarginCallLevelResponse.md new file mode 100644 index 000000000..b6399f91c --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/DeleteMarginCallLevelResponse.md @@ -0,0 +1,13 @@ + + +# DeleteMarginCallLevelResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**msg** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/GetMarginCallLevelResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/GetMarginCallLevelResponse.md new file mode 100644 index 000000000..bf77842ea --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/GetMarginCallLevelResponse.md @@ -0,0 +1,13 @@ + + +# GetMarginCallLevelResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**marginCallLevel** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/PmProAccountUpdate.md b/clients/derivatives-trading-portfolio-margin-pro/docs/PmProAccountUpdate.md new file mode 100644 index 000000000..4cfec8d90 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/PmProAccountUpdate.md @@ -0,0 +1,20 @@ + + +# PmProAccountUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**uLowerCase** | **String** | | [optional] | +|**eq** | **String** | | [optional] | +|**ae** | **String** | | [optional] | +|**im** | **String** | | [optional] | +|**mm** | **String** | | [optional] | +|**avb** | **String** | | [optional] | +|**vmw** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/SetMarginCallLevelRequest.md b/clients/derivatives-trading-portfolio-margin-pro/docs/SetMarginCallLevelRequest.md new file mode 100644 index 000000000..c4b0b9e13 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/SetMarginCallLevelRequest.md @@ -0,0 +1,14 @@ + + +# SetMarginCallLevelRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**marginCallLevel** | **Double** | | | +|**recvWindow** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/SetMarginCallLevelResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/SetMarginCallLevelResponse.md new file mode 100644 index 000000000..896b6875a --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/SetMarginCallLevelResponse.md @@ -0,0 +1,13 @@ + + +# SetMarginCallLevelResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**marginCallLevel** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/UserDataStreamEventsResponse.md index fd03c6619..0cee9edca 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/UserDataStreamEventsResponse.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/UserDataStreamEventsResponse.md @@ -9,9 +9,13 @@ |------------ | ------------- | ------------- | -------------| |**E** | **Long** | | [optional] | |**uLowerCase** | **String** | | [optional] | -|**sLowerCase** | **String** | | [optional] | |**eq** | **String** | | [optional] | |**ae** | **String** | | [optional] | +|**im** | **String** | | [optional] | +|**mm** | **String** | | [optional] | +|**avb** | **String** | | [optional] | +|**vmw** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | |**mLowerCase** | **String** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md b/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md index 863683980..63ce35f67 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-portfolio-margin-pro - 6.0.0 + 7.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin-pro - 6.0.0 + 7.0.0 ``` diff --git a/clients/derivatives-trading-portfolio-margin-pro/example_rest.md b/clients/derivatives-trading-portfolio-margin-pro/example_rest.md index a102016e7..f4982b278 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/example_rest.md +++ b/clients/derivatives-trading-portfolio-margin-pro/example_rest.md @@ -4,6 +4,8 @@ [POST /sapi/v1/portfolio/repay-futures-switch](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) - changeAutoRepayFuturesStatus - [ChangeAutoRepayFuturesStatusExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/ChangeAutoRepayFuturesStatusExample.java#L48) +[DELETE /sapi/v1/portfolio/margin-call-level](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Delete-Margin-Call-Level) - deleteMarginCallLevel - [DeleteMarginCallLevelExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/DeleteMarginCallLevelExample.java#L47) + [POST /sapi/v1/portfolio/auto-collection](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) - fundAutoCollection - [FundAutoCollectionExample.java:50](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/FundAutoCollectionExample.java#L50) [POST /sapi/v1/portfolio/asset-collection](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) - fundCollectionByAsset - [FundCollectionByAssetExample.java:49](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/FundCollectionByAssetExample.java#L49) @@ -12,6 +14,8 @@ [GET /sapi/v1/portfolio/delta-mode](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) - getDeltaModeStatus - [GetDeltaModeStatusExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetDeltaModeStatusExample.java#L47) +[GET /sapi/v1/portfolio/margin-call-level](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Margin-Call-Level) - getMarginCallLevel - [GetMarginCallLevelExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetMarginCallLevelExample.java#L47) + [GET /sapi/v1/portfolio/balance](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) - getPortfolioMarginProAccountBalance - [GetPortfolioMarginProAccountBalanceExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetPortfolioMarginProAccountBalanceExample.java#L47) [GET /sapi/v1/portfolio/account](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info) - getPortfolioMarginProAccountInfo - [GetPortfolioMarginProAccountInfoExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetPortfolioMarginProAccountInfoExample.java#L47) @@ -30,6 +34,8 @@ [POST /sapi/v1/portfolio/repay-futures-negative-balance](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) - repayFuturesNegativeBalance - [RepayFuturesNegativeBalanceExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/RepayFuturesNegativeBalanceExample.java#L48) +[POST /sapi/v1/portfolio/margin-call-level](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Set-Margin-Call-Level) - setMarginCallLevel - [SetMarginCallLevelExample.java:49](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SetMarginCallLevelExample.java#L49) + [POST /sapi/v1/portfolio/delta-mode](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) - switchDeltaMode - [SwitchDeltaModeExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SwitchDeltaModeExample.java#L48) [POST /sapi/v1/portfolio/earn-asset-transfer](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) - transferLdusdtRwusdForPortfolioMargin - [TransferLdusdtRwusdForPortfolioMarginExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtRwusdForPortfolioMarginExample.java#L48) diff --git a/clients/derivatives-trading-portfolio-margin-pro/pom.xml b/clients/derivatives-trading-portfolio-margin-pro/pom.xml index b95f0c724..b45902c9b 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 - 6.0.1 + 7.0.0 jar diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java index a8e0ff920..ddab52b93 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java @@ -120,6 +120,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .ChangeAutoRepayFuturesStatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model + .DeleteMarginCallLevelResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .FundAutoCollectionRequest.CustomTypeAdapterFactory()); @@ -138,6 +141,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .GetDeltaModeStatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model + .GetMarginCallLevelResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .GetPortfolioMarginAssetLeverageResponse.CustomTypeAdapterFactory()); @@ -221,6 +227,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .RepayFuturesNegativeBalanceResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model + .SetMarginCallLevelRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model + .SetMarginCallLevelResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .SwitchDeltaModeRequest.CustomTypeAdapterFactory()); 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 8e5ea78b9..4d04bac09 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 @@ -24,12 +24,14 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.BnbTransferResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.ChangeAutoRepayFuturesStatusRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.ChangeAutoRepayFuturesStatusResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.DeleteMarginCallLevelResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundAutoCollectionRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundAutoCollectionResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundCollectionByAssetRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundCollectionByAssetResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetAutoRepayFuturesStatusResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetDeltaModeStatusResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetMarginCallLevelResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountBalanceResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountInfoResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProSpanAccountInfoResponse; @@ -41,6 +43,8 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SetMarginCallLevelRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SetMarginCallLevelResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginRequest; @@ -68,7 +72,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -397,6 +401,140 @@ public ApiResponse changeAutoRepayFuturesS return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for deleteMarginCallLevel + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Delete Margin Call Level -
+ * + * @see Delete + * Margin Call Level (USER_DATA) Documentation + */ + private okhttp3.Call deleteMarginCallLevelCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/portfolio/margin-call-level"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteMarginCallLevelValidateBeforeCall(Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("deleteMarginCallLevel", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return deleteMarginCallLevelCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Delete Margin Call Level (USER_DATA) Delete the margin call level for a Portfolio Margin + * account. Weight: 1500 + * + * @param recvWindow (optional) + * @return ApiResponse<DeleteMarginCallLevelResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Delete Margin Call Level -
+ * + * @see Delete + * Margin Call Level (USER_DATA) Documentation + */ + public ApiResponse deleteMarginCallLevel(Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = deleteMarginCallLevelValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for fundAutoCollection * @@ -944,6 +1082,139 @@ public ApiResponse getDeltaModeStatus(Long recvWindo return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for getMarginCallLevel + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Margin Call Level -
+ * + * @see Get + * Margin Call Level (USER_DATA) Documentation + */ + private okhttp3.Call getMarginCallLevelCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/portfolio/margin-call-level"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMarginCallLevelValidateBeforeCall(Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("getMarginCallLevel", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getMarginCallLevelCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Margin Call Level (USER_DATA) Get the margin call level for a Portfolio Margin account. + * Weight: 1500 + * + * @param recvWindow (optional) + * @return ApiResponse<GetMarginCallLevelResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Margin Call Level -
+ * + * @see Get + * Margin Call Level (USER_DATA) Documentation + */ + public ApiResponse getMarginCallLevel(Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = getMarginCallLevelValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for getPortfolioMarginProAccountBalance * @@ -2320,6 +2591,152 @@ public ApiResponse repayFuturesNegativeBala return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for setMarginCallLevel + * + * @param setMarginCallLevelRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Margin Call Level -
+ * + * @see Set + * Margin Call Level (USER_DATA) Documentation + */ + private okhttp3.Call setMarginCallLevelCall(SetMarginCallLevelRequest setMarginCallLevelRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/portfolio/margin-call-level"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (setMarginCallLevelRequest.getMarginCallLevel() != null) { + localVarFormParams.put( + "marginCallLevel", + DecimalFormatter.getFormatter() + .format(setMarginCallLevelRequest.getMarginCallLevel())); + } + + if (setMarginCallLevelRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", setMarginCallLevelRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setMarginCallLevelValidateBeforeCall( + SetMarginCallLevelRequest setMarginCallLevelRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {setMarginCallLevelRequest}; + Method method = + this.getClass() + .getMethod("setMarginCallLevel", SetMarginCallLevelRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return setMarginCallLevelCall(setMarginCallLevelRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Set Margin Call Level (USER_DATA) Set the margin call level for a Portfolio Margin account. + * When the account's uniMMR drops to the specified level, a notification will be sent via + * email and SMS. Weight: 1500 + * + * @param setMarginCallLevelRequest (required) + * @return ApiResponse<SetMarginCallLevelResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Margin Call Level -
+ * + * @see Set + * Margin Call Level (USER_DATA) Documentation + */ + public ApiResponse setMarginCallLevel( + @Valid @NotNull SetMarginCallLevelRequest setMarginCallLevelRequest) + throws ApiException { + okhttp3.Call localVarCall = setMarginCallLevelValidateBeforeCall(setMarginCallLevelRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for switchDeltaMode * diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java index 9c5f197e5..a2eca42e3 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java @@ -9,12 +9,14 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.BnbTransferResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.ChangeAutoRepayFuturesStatusRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.ChangeAutoRepayFuturesStatusResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.DeleteMarginCallLevelResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundAutoCollectionRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundAutoCollectionResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundCollectionByAssetRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundCollectionByAssetResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetAutoRepayFuturesStatusResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetDeltaModeStatusResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetMarginCallLevelResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginAssetLeverageResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountBalanceResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountInfoResponse; @@ -30,6 +32,8 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SetMarginCallLevelRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SetMarginCallLevelResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginRequest; @@ -97,6 +101,30 @@ public ApiResponse changeAutoRepayFuturesS return accountApi.changeAutoRepayFuturesStatus(changeAutoRepayFuturesStatusRequest); } + /** + * Delete Margin Call Level (USER_DATA) Delete the margin call level for a Portfolio Margin + * account. Weight: 1500 + * + * @param recvWindow (optional) + * @return ApiResponse<DeleteMarginCallLevelResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Delete Margin Call Level -
+ * + * @see Delete + * Margin Call Level (USER_DATA) Documentation + */ + public ApiResponse deleteMarginCallLevel(Long recvWindow) + throws ApiException { + return accountApi.deleteMarginCallLevel(recvWindow); + } + /** * Fund Auto-collection(USER_DATA) Transfers all assets from Futures Account to Margin account * * The BNB would not be collected from UM-PM account to the Portfolio Margin account. * You can @@ -192,6 +220,30 @@ public ApiResponse getDeltaModeStatus(Long recvWindo return accountApi.getDeltaModeStatus(recvWindow); } + /** + * Get Margin Call Level (USER_DATA) Get the margin call level for a Portfolio Margin account. + * Weight: 1500 + * + * @param recvWindow (optional) + * @return ApiResponse<GetMarginCallLevelResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Margin Call Level -
+ * + * @see Get + * Margin Call Level (USER_DATA) Documentation + */ + public ApiResponse getMarginCallLevel(Long recvWindow) + throws ApiException { + return accountApi.getMarginCallLevel(recvWindow); + } + /** * Get Portfolio Margin Pro Account Balance(USER_DATA) Query Portfolio Margin Pro account * balance Weight: 20 @@ -438,6 +490,31 @@ public ApiResponse repayFuturesNegativeBala return accountApi.repayFuturesNegativeBalance(repayFuturesNegativeBalanceRequest); } + /** + * Set Margin Call Level (USER_DATA) Set the margin call level for a Portfolio Margin account. + * When the account's uniMMR drops to the specified level, a notification will be sent via + * email and SMS. Weight: 1500 + * + * @param setMarginCallLevelRequest (required) + * @return ApiResponse<SetMarginCallLevelResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Margin Call Level -
+ * + * @see Set + * Margin Call Level (USER_DATA) Documentation + */ + public ApiResponse setMarginCallLevel( + SetMarginCallLevelRequest setMarginCallLevelRequest) throws ApiException { + return accountApi.setMarginCallLevel(setMarginCallLevelRequest); + } + /** * Switch Delta Mode(TRADE) Switch the Delta mode for existing PM PRO / PM RETAIL accounts. * Weight: 1500 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 5f1bbeb32..5b7821d26 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/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/DeleteMarginCallLevelResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/DeleteMarginCallLevelResponse.java new file mode 100644 index 000000000..b8801997e --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/DeleteMarginCallLevelResponse.java @@ -0,0 +1,216 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** DeleteMarginCallLevelResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DeleteMarginCallLevelResponse { + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public DeleteMarginCallLevelResponse() {} + + public DeleteMarginCallLevelResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteMarginCallLevelResponse deleteMarginCallLevelResponse = + (DeleteMarginCallLevelResponse) o; + return Objects.equals(this.msg, deleteMarginCallLevelResponse.msg); + } + + @Override + public int hashCode() { + return Objects.hash(msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteMarginCallLevelResponse {\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DeleteMarginCallLevelResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteMarginCallLevelResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteMarginCallLevelResponse is not" + + " found in the empty JSON string", + DeleteMarginCallLevelResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteMarginCallLevelResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteMarginCallLevelResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteMarginCallLevelResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteMarginCallLevelResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteMarginCallLevelResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteMarginCallLevelResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteMarginCallLevelResponse + * @throws IOException if the JSON string is invalid with respect to + * DeleteMarginCallLevelResponse + */ + public static DeleteMarginCallLevelResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteMarginCallLevelResponse.class); + } + + /** + * Convert an instance of DeleteMarginCallLevelResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/GetMarginCallLevelResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/GetMarginCallLevelResponse.java new file mode 100644 index 000000000..2aa4d7780 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/GetMarginCallLevelResponse.java @@ -0,0 +1,212 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetMarginCallLevelResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetMarginCallLevelResponse { + public static final String SERIALIZED_NAME_MARGIN_CALL_LEVEL = "marginCallLevel"; + + @SerializedName(SERIALIZED_NAME_MARGIN_CALL_LEVEL) + @jakarta.annotation.Nullable + private String marginCallLevel; + + public GetMarginCallLevelResponse() {} + + public GetMarginCallLevelResponse marginCallLevel( + @jakarta.annotation.Nullable String marginCallLevel) { + this.marginCallLevel = marginCallLevel; + return this; + } + + /** + * Get marginCallLevel + * + * @return marginCallLevel + */ + @jakarta.annotation.Nullable + public String getMarginCallLevel() { + return marginCallLevel; + } + + public void setMarginCallLevel(@jakarta.annotation.Nullable String marginCallLevel) { + this.marginCallLevel = marginCallLevel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMarginCallLevelResponse getMarginCallLevelResponse = (GetMarginCallLevelResponse) o; + return Objects.equals(this.marginCallLevel, getMarginCallLevelResponse.marginCallLevel); + } + + @Override + public int hashCode() { + return Objects.hash(marginCallLevel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMarginCallLevelResponse {\n"); + sb.append(" marginCallLevel: ").append(toIndentedString(marginCallLevel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object marginCallLevelValue = getMarginCallLevel(); + String marginCallLevelValueAsString = ""; + marginCallLevelValueAsString = marginCallLevelValue.toString(); + sb.append("marginCallLevel=").append(urlEncode(marginCallLevelValueAsString)).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("marginCallLevel"); + + // 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 GetMarginCallLevelResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetMarginCallLevelResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetMarginCallLevelResponse is not" + + " found in the empty JSON string", + GetMarginCallLevelResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("marginCallLevel") != null && !jsonObj.get("marginCallLevel").isJsonNull()) + && !jsonObj.get("marginCallLevel").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `marginCallLevel` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("marginCallLevel").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMarginCallLevelResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMarginCallLevelResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetMarginCallLevelResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMarginCallLevelResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMarginCallLevelResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetMarginCallLevelResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMarginCallLevelResponse + * @throws IOException if the JSON string is invalid with respect to GetMarginCallLevelResponse + */ + public static GetMarginCallLevelResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMarginCallLevelResponse.class); + } + + /** + * Convert an instance of GetMarginCallLevelResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SetMarginCallLevelRequest.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SetMarginCallLevelRequest.java new file mode 100644 index 000000000..5efedc70c --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SetMarginCallLevelRequest.java @@ -0,0 +1,250 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** SetMarginCallLevelRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SetMarginCallLevelRequest { + public static final String SERIALIZED_NAME_MARGIN_CALL_LEVEL = "marginCallLevel"; + + @SerializedName(SERIALIZED_NAME_MARGIN_CALL_LEVEL) + @jakarta.annotation.Nonnull + private Double marginCallLevel; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public SetMarginCallLevelRequest() {} + + public SetMarginCallLevelRequest marginCallLevel( + @jakarta.annotation.Nonnull Double marginCallLevel) { + this.marginCallLevel = marginCallLevel; + return this; + } + + /** + * Get marginCallLevel + * + * @return marginCallLevel + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getMarginCallLevel() { + return marginCallLevel; + } + + public void setMarginCallLevel(@jakarta.annotation.Nonnull Double marginCallLevel) { + this.marginCallLevel = marginCallLevel; + } + + public SetMarginCallLevelRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetMarginCallLevelRequest setMarginCallLevelRequest = (SetMarginCallLevelRequest) o; + return Objects.equals(this.marginCallLevel, setMarginCallLevelRequest.marginCallLevel) + && Objects.equals(this.recvWindow, setMarginCallLevelRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(marginCallLevel, recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetMarginCallLevelRequest {\n"); + sb.append(" marginCallLevel: ").append(toIndentedString(marginCallLevel)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object marginCallLevelValue = getMarginCallLevel(); + String marginCallLevelValueAsString = ""; + marginCallLevelValueAsString = marginCallLevelValue.toString(); + sb.append("marginCallLevel=").append(urlEncode(marginCallLevelValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("marginCallLevel"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("marginCallLevel"); + } + + /** + * 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 SetMarginCallLevelRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetMarginCallLevelRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SetMarginCallLevelRequest is not found" + + " in the empty JSON string", + SetMarginCallLevelRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetMarginCallLevelRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetMarginCallLevelRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetMarginCallLevelRequest' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SetMarginCallLevelRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SetMarginCallLevelRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetMarginCallLevelRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SetMarginCallLevelRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetMarginCallLevelRequest + * @throws IOException if the JSON string is invalid with respect to SetMarginCallLevelRequest + */ + public static SetMarginCallLevelRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetMarginCallLevelRequest.class); + } + + /** + * Convert an instance of SetMarginCallLevelRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SetMarginCallLevelResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SetMarginCallLevelResponse.java new file mode 100644 index 000000000..250c6f405 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SetMarginCallLevelResponse.java @@ -0,0 +1,212 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** SetMarginCallLevelResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SetMarginCallLevelResponse { + public static final String SERIALIZED_NAME_MARGIN_CALL_LEVEL = "marginCallLevel"; + + @SerializedName(SERIALIZED_NAME_MARGIN_CALL_LEVEL) + @jakarta.annotation.Nullable + private String marginCallLevel; + + public SetMarginCallLevelResponse() {} + + public SetMarginCallLevelResponse marginCallLevel( + @jakarta.annotation.Nullable String marginCallLevel) { + this.marginCallLevel = marginCallLevel; + return this; + } + + /** + * Get marginCallLevel + * + * @return marginCallLevel + */ + @jakarta.annotation.Nullable + public String getMarginCallLevel() { + return marginCallLevel; + } + + public void setMarginCallLevel(@jakarta.annotation.Nullable String marginCallLevel) { + this.marginCallLevel = marginCallLevel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetMarginCallLevelResponse setMarginCallLevelResponse = (SetMarginCallLevelResponse) o; + return Objects.equals(this.marginCallLevel, setMarginCallLevelResponse.marginCallLevel); + } + + @Override + public int hashCode() { + return Objects.hash(marginCallLevel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetMarginCallLevelResponse {\n"); + sb.append(" marginCallLevel: ").append(toIndentedString(marginCallLevel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object marginCallLevelValue = getMarginCallLevel(); + String marginCallLevelValueAsString = ""; + marginCallLevelValueAsString = marginCallLevelValue.toString(); + sb.append("marginCallLevel=").append(urlEncode(marginCallLevelValueAsString)).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("marginCallLevel"); + + // 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 SetMarginCallLevelResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetMarginCallLevelResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SetMarginCallLevelResponse is not" + + " found in the empty JSON string", + SetMarginCallLevelResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("marginCallLevel") != null && !jsonObj.get("marginCallLevel").isJsonNull()) + && !jsonObj.get("marginCallLevel").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `marginCallLevel` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("marginCallLevel").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetMarginCallLevelResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetMarginCallLevelResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SetMarginCallLevelResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SetMarginCallLevelResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetMarginCallLevelResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SetMarginCallLevelResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetMarginCallLevelResponse + * @throws IOException if the JSON string is invalid with respect to SetMarginCallLevelResponse + */ + public static SetMarginCallLevelResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetMarginCallLevelResponse.class); + } + + /** + * Convert an instance of SetMarginCallLevelResponse 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/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 index 924cafbc7..c46ea32d2 100644 --- 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 @@ -80,12 +80,24 @@ public static GsonBuilder createGson() { getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put( + "PM_PRO_ACCOUNT_UPDATE", + com.binance.connector.client + .derivatives_trading_portfolio_margin_pro + .websocket.stream.model.PmProAccountUpdate + .class); classByDiscriminatorValue.put( "riskLevelChange", com.binance.connector.client .derivatives_trading_portfolio_margin_pro .websocket.stream.model.Risklevelchange .class); + classByDiscriminatorValue.put( + "pmProAccountUpdate", + com.binance.connector.client + .derivatives_trading_portfolio_margin_pro + .websocket.stream.model.PmProAccountUpdate + .class); classByDiscriminatorValue.put( "risklevelchange", com.binance.connector.client @@ -152,6 +164,9 @@ 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_portfolio_margin_pro.websocket + .stream.model.PmProAccountUpdate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.websocket .stream.model.Risklevelchange.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java index ede9037fb..c7cb24912 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java @@ -19,7 +19,7 @@ public class DerivativesTradingPortfolioMarginProWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; @@ -41,6 +41,12 @@ public DerivativesTradingPortfolioMarginProWebSocketStreams( this.connection = connection; } + public void stop() throws Exception { + if (connection != null && connection.isConnected()) { + connection.stop(); + } + } + /** * Subscribes to the user data WebSocket stream using the provided listen key. * diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/PmProAccountUpdate.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/PmProAccountUpdate.java new file mode 100644 index 000000000..cdb427478 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/model/PmProAccountUpdate.java @@ -0,0 +1,547 @@ +/* + * 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.*; + +/** PmProAccountUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PmProAccountUpdate 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_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_IM = "im"; + + @SerializedName(SERIALIZED_NAME_IM) + @jakarta.annotation.Nullable + private String im; + + public static final String SERIALIZED_NAME_MM = "mm"; + + @SerializedName(SERIALIZED_NAME_MM) + @jakarta.annotation.Nullable + private String mm; + + public static final String SERIALIZED_NAME_AVB = "avb"; + + @SerializedName(SERIALIZED_NAME_AVB) + @jakarta.annotation.Nullable + private String avb; + + public static final String SERIALIZED_NAME_VMW = "vmw"; + + @SerializedName(SERIALIZED_NAME_VMW) + @jakarta.annotation.Nullable + private String vmw; + + public PmProAccountUpdate() {} + + public PmProAccountUpdate 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 PmProAccountUpdate 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 PmProAccountUpdate 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 PmProAccountUpdate 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 PmProAccountUpdate im(@jakarta.annotation.Nullable String im) { + this.im = im; + return this; + } + + /** + * Get im + * + * @return im + */ + @jakarta.annotation.Nullable + public String getIm() { + return im; + } + + public void setIm(@jakarta.annotation.Nullable String im) { + this.im = im; + } + + public PmProAccountUpdate 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; + } + + public PmProAccountUpdate avb(@jakarta.annotation.Nullable String avb) { + this.avb = avb; + return this; + } + + /** + * Get avb + * + * @return avb + */ + @jakarta.annotation.Nullable + public String getAvb() { + return avb; + } + + public void setAvb(@jakarta.annotation.Nullable String avb) { + this.avb = avb; + } + + public PmProAccountUpdate vmw(@jakarta.annotation.Nullable String vmw) { + this.vmw = vmw; + return this; + } + + /** + * Get vmw + * + * @return vmw + */ + @jakarta.annotation.Nullable + public String getVmw() { + return vmw; + } + + public void setVmw(@jakarta.annotation.Nullable String vmw) { + this.vmw = vmw; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PmProAccountUpdate pmProAccountUpdate = (PmProAccountUpdate) o; + return Objects.equals(this.E, pmProAccountUpdate.E) + && Objects.equals(this.uLowerCase, pmProAccountUpdate.uLowerCase) + && Objects.equals(this.eq, pmProAccountUpdate.eq) + && Objects.equals(this.ae, pmProAccountUpdate.ae) + && Objects.equals(this.im, pmProAccountUpdate.im) + && Objects.equals(this.mm, pmProAccountUpdate.mm) + && Objects.equals(this.avb, pmProAccountUpdate.avb) + && Objects.equals(this.vmw, pmProAccountUpdate.vmw); + } + + @Override + public int hashCode() { + return Objects.hash(E, uLowerCase, eq, ae, im, mm, avb, vmw); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PmProAccountUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" eq: ").append(toIndentedString(eq)).append("\n"); + sb.append(" ae: ").append(toIndentedString(ae)).append("\n"); + sb.append(" im: ").append(toIndentedString(im)).append("\n"); + sb.append(" mm: ").append(toIndentedString(mm)).append("\n"); + sb.append(" avb: ").append(toIndentedString(avb)).append("\n"); + sb.append(" vmw: ").append(toIndentedString(vmw)).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 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 imValue = getIm(); + if (imValue != null) { + String imValueAsString = imValue.toString(); + valMap.put("im", imValueAsString); + } + String mmValue = getMm(); + if (mmValue != null) { + String mmValueAsString = mmValue.toString(); + valMap.put("mm", mmValueAsString); + } + String avbValue = getAvb(); + if (avbValue != null) { + String avbValueAsString = avbValue.toString(); + valMap.put("avb", avbValueAsString); + } + String vmwValue = getVmw(); + if (vmwValue != null) { + String vmwValueAsString = vmwValue.toString(); + valMap.put("vmw", vmwValueAsString); + } + + 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 eqValue = getEq(); + if (eqValue != null) { + valMap.put("eq", eqValue); + } + Object aeValue = getAe(); + if (aeValue != null) { + valMap.put("ae", aeValue); + } + Object imValue = getIm(); + if (imValue != null) { + valMap.put("im", imValue); + } + Object mmValue = getMm(); + if (mmValue != null) { + valMap.put("mm", mmValue); + } + Object avbValue = getAvb(); + if (avbValue != null) { + valMap.put("avb", avbValue); + } + Object vmwValue = getVmw(); + if (vmwValue != null) { + valMap.put("vmw", vmwValue); + } + + 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("eq"); + openapiFields.add("ae"); + openapiFields.add("im"); + openapiFields.add("mm"); + openapiFields.add("avb"); + openapiFields.add("vmw"); + + // 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 PmProAccountUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PmProAccountUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PmProAccountUpdate is not found in the" + + " empty JSON string", + PmProAccountUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PmProAccountUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PmProAccountUpdate` 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("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("im") != null && !jsonObj.get("im").isJsonNull()) + && !jsonObj.get("im").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `im` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("im").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())); + } + if ((jsonObj.get("avb") != null && !jsonObj.get("avb").isJsonNull()) + && !jsonObj.get("avb").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `avb` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("avb").toString())); + } + if ((jsonObj.get("vmw") != null && !jsonObj.get("vmw").isJsonNull()) + && !jsonObj.get("vmw").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `vmw` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("vmw").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PmProAccountUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PmProAccountUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PmProAccountUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PmProAccountUpdate value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PmProAccountUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PmProAccountUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of PmProAccountUpdate + * @throws IOException if the JSON string is invalid with respect to PmProAccountUpdate + */ + public static PmProAccountUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PmProAccountUpdate.class); + } + + /** + * Convert an instance of PmProAccountUpdate 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 index 2ec0cb50f..184224a5d 100644 --- 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 @@ -47,6 +47,8 @@ public TypeAdapter create(Gson gson, TypeToken type) { // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterPmProAccountUpdate = + gson.getDelegateAdapter(this, TypeToken.get(PmProAccountUpdate.class)); final TypeAdapter adapterRisklevelchange = gson.getDelegateAdapter(this, TypeToken.get(Risklevelchange.class)); @@ -60,6 +62,14 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) return; } + // check if the actual instance is of the type `PmProAccountUpdate` + if (value.getActualInstance() instanceof PmProAccountUpdate) { + JsonElement element = + adapterPmProAccountUpdate.toJsonTree( + (PmProAccountUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } // check if the actual instance is of the type `Risklevelchange` if (value.getActualInstance() instanceof Risklevelchange) { JsonElement element = @@ -70,7 +80,7 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) } throw new IOException( "Failed to serialize as the type doesn't match oneOf schemas:" - + " Risklevelchange"); + + " PmProAccountUpdate, Risklevelchange"); } @Override @@ -92,12 +102,24 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { } else { // look up the discriminator value in the field `e` switch (jsonObject.get("e").getAsString()) { + case "PM_PRO_ACCOUNT_UPDATE": + deserialized = + adapterPmProAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; case "riskLevelChange": deserialized = adapterRisklevelchange.fromJsonTree(jsonObject); newUserDataStreamEventsResponse.setActualInstance( deserialized); return newUserDataStreamEventsResponse; + case "pmProAccountUpdate": + deserialized = + adapterPmProAccountUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; case "risklevelchange": deserialized = adapterRisklevelchange.fromJsonTree(jsonObject); @@ -112,7 +134,9 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { String.format( "Failed to lookup discriminator value `%s`" + " for UserDataStreamEventsResponse." - + " Possible values: riskLevelChange" + + " Possible values:" + + " PM_PRO_ACCOUNT_UPDATE" + + " riskLevelChange pmProAccountUpdate" + " risklevelchange. Falling back to" + " String.", jsonObject.get("e").getAsString())); @@ -123,6 +147,27 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; + // deserialize PmProAccountUpdate + try { + // validate the JSON object to see if any exception is thrown + PmProAccountUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterPmProAccountUpdate; + match++; + log.log( + Level.FINER, + "Input data matches schema 'PmProAccountUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PmProAccountUpdate failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'PmProAccountUpdate'", + e); + } // deserialize Risklevelchange try { // validate the JSON object to see if any exception is thrown @@ -175,6 +220,7 @@ public UserDataStreamEventsResponse(Object o) { } static { + schemas.put("PmProAccountUpdate", PmProAccountUpdate.class); schemas.put("Risklevelchange", Risklevelchange.class); } @@ -185,24 +231,30 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: Risklevelchange + * against the oneOf child schemas: PmProAccountUpdate, Risklevelchange * *

It could be an instance of the 'oneOf' schemas. */ @Override public void setActualInstance(Object instance) { + if (instance instanceof PmProAccountUpdate) { + super.setActualInstance(instance); + return; + } + if (instance instanceof Risklevelchange) { super.setActualInstance(instance); return; } - throw new RuntimeException("Invalid instance type. Must be Risklevelchange"); + throw new RuntimeException( + "Invalid instance type. Must be PmProAccountUpdate, Risklevelchange"); } /** - * Get the actual instance, which can be the following: Risklevelchange + * Get the actual instance, which can be the following: PmProAccountUpdate, Risklevelchange * - * @return The actual instance (Risklevelchange) + * @return The actual instance (PmProAccountUpdate, Risklevelchange) */ @SuppressWarnings("unchecked") @Override @@ -210,6 +262,17 @@ public Object getActualInstance() { return super.getActualInstance(); } + /** + * Get the actual instance of `PmProAccountUpdate`. If the actual instance is not + * `PmProAccountUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `PmProAccountUpdate` + * @throws ClassCastException if the instance is not `PmProAccountUpdate` + */ + public PmProAccountUpdate getPmProAccountUpdate() throws ClassCastException { + return (PmProAccountUpdate) super.getActualInstance(); + } + /** * Get the actual instance of `Risklevelchange`. If the actual instance is not * `Risklevelchange`, the ClassCastException will be thrown. @@ -232,6 +295,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate oneOf schemas one by one int validCount = 0; ArrayList errorMessages = new ArrayList<>(); + // validate the json string with PmProAccountUpdate + try { + PmProAccountUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PmProAccountUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } // validate the json string with Risklevelchange try { Risklevelchange.validateJsonElement(jsonElement); @@ -247,9 +321,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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", + + " schemas: PmProAccountUpdate, Risklevelchange. %d class(es)" + + " match the result, expected 1. Detailed failure message for" + + " oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md index c1b86053f..c225b8dad 100644 --- a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md @@ -1,6 +1,39 @@ # Changelog +## 6.0.0 - 2026-05-04 + +- Added stop method for WebSocket + +### Added (7) + +#### REST API + +- `cancelAllUmAlgoOpenOrders()` (`DELETE /papi/v1/um/algo/allOpenOrders`) +- `cancelUmAlgoOrder()` (`DELETE /papi/v1/um/algo/order`) +- `futuresTradfiPerpsContract()` (`POST /papi/v1/um/stock/contract`) +- `newUmAlgoOrder()` (`POST /papi/v1/um/algo/order`) +- `queryAllCurrentUmOpenAlgoOrders()` (`GET /papi/v1/um/algo/openAlgoOrders`) +- `queryCurrentUmOpenAlgoOrder()` (`GET /papi/v1/um/algo/algoOrder`) +- `queryUmAlgoOrderHistory()` (`GET /papi/v1/um/algo/allAlgoOrders`) + +### Changed (8) + +#### REST API + +- Modified response for `getUmIncomeHistory()` (`GET /papi/v1/um/income`): + - items.`tranId`: type `string` → `integer` + - items.`tranId`: type `string` → `integer` + +- Marked `cancelAllUmOpenConditionalOrders()` (`DELETE /papi/v1/um/conditional/allOpenOrders`) as deprecated. +- Marked `cancelUmConditionalOrder()` (`DELETE /papi/v1/um/conditional/order`) as deprecated. +- Marked `newUmConditionalOrder()` (`POST /papi/v1/um/conditional/order`) as deprecated. +- Marked `queryAllCurrentUmOpenConditionalOrders()` (`GET /papi/v1/um/conditional/openOrders`) as deprecated. +- Marked `queryAllUmConditionalOrders()` (`GET /papi/v1/um/conditional/allOrders`) as deprecated. +- Marked `queryCurrentUmOpenConditionalOrder()` (`GET /papi/v1/um/conditional/openOrder`) as deprecated. +- Marked `queryUmConditionalOrderHistory()` (`GET /papi/v1/um/conditional/orderHistory`) as deprecated. + ## 5.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 5.0.0 - 2026-02-12 diff --git a/clients/derivatives-trading-portfolio-margin/docs/AccountApi.md b/clients/derivatives-trading-portfolio-margin/docs/AccountApi.md index 11f9234c4..62fc74aec 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/AccountApi.md +++ b/clients/derivatives-trading-portfolio-margin/docs/AccountApi.md @@ -1458,7 +1458,7 @@ No authorization required Get UM Futures Order Download Link by Id(USER_DATA) -Get UM futures order download link by Id * Download link expiration: 24h Weight: 10 +Get UM futures order download link by Id * Download link expiration: 7 days Weight: 10 ### Example ```java @@ -1522,7 +1522,7 @@ No authorization required Get UM Futures Trade Download Link by Id(USER_DATA) -Get UM futures trade download link by Id * Download link expiration: 24h Weight: 10 +Get UM futures trade download link by Id * Download link expiration: 7 days Weight: 10 ### Example ```java @@ -1586,7 +1586,7 @@ No authorization required Get UM Futures Transaction Download Link by Id(USER_DATA) -Get UM futures Transaction download link by Id * Download link expiration: 24h Weight: 10 +Get UM futures Transaction download link by Id * Download link expiration: 7 days Weight: 10 ### Example ```java diff --git a/clients/derivatives-trading-portfolio-margin/docs/AlgoUpdate.md b/clients/derivatives-trading-portfolio-margin/docs/AlgoUpdate.md new file mode 100644 index 000000000..13642fb2a --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/AlgoUpdate.md @@ -0,0 +1,16 @@ + + +# AlgoUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**T** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | +|**fs** | **String** | | [optional] | +|**ao** | [**AlgoUpdateAo**](AlgoUpdateAo.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/AlgoUpdateAo.md b/clients/derivatives-trading-portfolio-margin/docs/AlgoUpdateAo.md new file mode 100644 index 000000000..96b4f98e6 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/AlgoUpdateAo.md @@ -0,0 +1,37 @@ + + +# AlgoUpdateAo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**caid** | **String** | | [optional] | +|**aid** | **Long** | | [optional] | +|**at** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**ps** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**ai** | **String** | | [optional] | +|**ap** | **String** | | [optional] | +|**aq** | **String** | | [optional] | +|**act** | **String** | | [optional] | +|**tp** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**V** | **String** | | [optional] | +|**wt** | **String** | | [optional] | +|**pm** | **String** | | [optional] | +|**cp** | **Boolean** | | [optional] | +|**pP** | **Boolean** | | [optional] | +|**R** | **Boolean** | | [optional] | +|**tt** | **Long** | | [optional] | +|**gtd** | **Long** | | [optional] | +|**rm** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/CancelAllUmAlgoOpenOrdersResponse.md b/clients/derivatives-trading-portfolio-margin/docs/CancelAllUmAlgoOpenOrdersResponse.md new file mode 100644 index 000000000..a8fa790e1 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/CancelAllUmAlgoOpenOrdersResponse.md @@ -0,0 +1,14 @@ + + +# CancelAllUmAlgoOpenOrdersResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Long** | | [optional] | +|**msg** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/CancelUmAlgoOrderResponse.md b/clients/derivatives-trading-portfolio-margin/docs/CancelUmAlgoOrderResponse.md new file mode 100644 index 000000000..86196f30c --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/CancelUmAlgoOrderResponse.md @@ -0,0 +1,13 @@ + + +# CancelUmAlgoOrderResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**complete** | **Boolean** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md b/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md index 2aa03c5f9..c26e1d3a2 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md +++ b/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md @@ -48,6 +48,11 @@ |**U** | **Long** | | [optional] | |**A** | **String** | | [optional] | |**B** | **String** | | [optional] | +|**cs** | **String** | | [optional] | +|**pl** | **String** | | [optional] | +|**pL** | **String** | | [optional] | +|**pY** | **String** | | [optional] | +|**eR** | **String** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin/docs/FuturesTradfiPerpsContractRequest.md b/clients/derivatives-trading-portfolio-margin/docs/FuturesTradfiPerpsContractRequest.md new file mode 100644 index 000000000..b4754deb3 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/FuturesTradfiPerpsContractRequest.md @@ -0,0 +1,13 @@ + + +# FuturesTradfiPerpsContractRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**recvWindow** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/FuturesTradfiPerpsContractResponse.md b/clients/derivatives-trading-portfolio-margin/docs/FuturesTradfiPerpsContractResponse.md similarity index 100% rename from clients/derivatives-trading-usds-futures/docs/FuturesTradfiPerpsContractResponse.md rename to clients/derivatives-trading-portfolio-margin/docs/FuturesTradfiPerpsContractResponse.md diff --git a/clients/derivatives-trading-portfolio-margin/docs/GetUmIncomeHistoryResponseInner.md b/clients/derivatives-trading-portfolio-margin/docs/GetUmIncomeHistoryResponseInner.md index 3ea3ca912..a5c7604e1 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/GetUmIncomeHistoryResponseInner.md +++ b/clients/derivatives-trading-portfolio-margin/docs/GetUmIncomeHistoryResponseInner.md @@ -13,7 +13,7 @@ |**asset** | **String** | | [optional] | |**info** | **String** | | [optional] | |**time** | **Long** | | [optional] | -|**tranId** | **String** | | [optional] | +|**tranId** | **Long** | | [optional] | |**tradeId** | **String** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin/docs/NewUmAlgoOrderRequest.md b/clients/derivatives-trading-portfolio-margin/docs/NewUmAlgoOrderRequest.md new file mode 100644 index 000000000..390b9669c --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/NewUmAlgoOrderRequest.md @@ -0,0 +1,33 @@ + + +# NewUmAlgoOrderRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoType** | **String** | | | +|**symbol** | **String** | | | +|**side** | **Side** | | | +|**positionSide** | **PositionSide** | | [optional] | +|**type** | **Type** | | | +|**timeInForce** | **TimeInForce** | | [optional] | +|**quantity** | **Double** | | [optional] | +|**price** | **Double** | | [optional] | +|**triggerPrice** | **Double** | | [optional] | +|**workingType** | **WorkingType** | | [optional] | +|**priceMatch** | **PriceMatch** | | [optional] | +|**closePosition** | **String** | | [optional] | +|**priceProtect** | **String** | | [optional] | +|**reduceOnly** | **String** | | [optional] | +|**activatePrice** | **Double** | | [optional] | +|**callbackRate** | **Double** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**newOrderRespType** | **NewOrderRespType** | | [optional] | +|**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | +|**recvWindow** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/NewUmAlgoOrderResponse.md b/clients/derivatives-trading-portfolio-margin/docs/NewUmAlgoOrderResponse.md new file mode 100644 index 000000000..6f62a5d8d --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/NewUmAlgoOrderResponse.md @@ -0,0 +1,37 @@ + + +# NewUmAlgoOrderResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**algoType** | **String** | | [optional] | +|**orderType** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**positionSide** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**quantity** | **String** | | [optional] | +|**algoStatus** | **String** | | [optional] | +|**triggerPrice** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**icebergQuantity** | **String** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**workingType** | **String** | | [optional] | +|**priceMatch** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | +|**priceProtect** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | +|**activatePrice** | **String** | | [optional] | +|**callbackRate** | **String** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**triggerTime** | **Long** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryAllCurrentUmOpenAlgoOrdersResponse.md b/clients/derivatives-trading-portfolio-margin/docs/QueryAllCurrentUmOpenAlgoOrdersResponse.md new file mode 100644 index 000000000..44a7f846a --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/QueryAllCurrentUmOpenAlgoOrdersResponse.md @@ -0,0 +1,12 @@ + + +# QueryAllCurrentUmOpenAlgoOrdersResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryAllCurrentUmOpenAlgoOrdersResponseInner.md b/clients/derivatives-trading-portfolio-margin/docs/QueryAllCurrentUmOpenAlgoOrdersResponseInner.md new file mode 100644 index 000000000..4e0ce07fb --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/QueryAllCurrentUmOpenAlgoOrdersResponseInner.md @@ -0,0 +1,42 @@ + + +# QueryAllCurrentUmOpenAlgoOrdersResponseInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**algoType** | **String** | | [optional] | +|**orderType** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**positionSide** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**quantity** | **String** | | [optional] | +|**algoStatus** | **String** | | [optional] | +|**actualOrderId** | **String** | | [optional] | +|**actualPrice** | **String** | | [optional] | +|**triggerPrice** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**icebergQuantity** | **String** | | [optional] | +|**tpTriggerPrice** | **String** | | [optional] | +|**tpPrice** | **String** | | [optional] | +|**slTriggerPrice** | **String** | | [optional] | +|**slPrice** | **String** | | [optional] | +|**tpOrderType** | **String** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**workingType** | **String** | | [optional] | +|**priceMatch** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | +|**priceProtect** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**triggerTime** | **Long** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryCurrentUmOpenAlgoOrderResponse.md b/clients/derivatives-trading-portfolio-margin/docs/QueryCurrentUmOpenAlgoOrderResponse.md new file mode 100644 index 000000000..bcc5fc434 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/QueryCurrentUmOpenAlgoOrderResponse.md @@ -0,0 +1,42 @@ + + +# QueryCurrentUmOpenAlgoOrderResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**algoType** | **String** | | [optional] | +|**orderType** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**positionSide** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**quantity** | **String** | | [optional] | +|**algoStatus** | **String** | | [optional] | +|**actualOrderId** | **String** | | [optional] | +|**actualPrice** | **String** | | [optional] | +|**triggerPrice** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**icebergQuantity** | **String** | | [optional] | +|**tpTriggerPrice** | **String** | | [optional] | +|**tpPrice** | **String** | | [optional] | +|**slTriggerPrice** | **String** | | [optional] | +|**slPrice** | **String** | | [optional] | +|**tpOrderType** | **String** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**workingType** | **String** | | [optional] | +|**priceMatch** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | +|**priceProtect** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**triggerTime** | **Long** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryUmAlgoOrderHistoryResponse.md b/clients/derivatives-trading-portfolio-margin/docs/QueryUmAlgoOrderHistoryResponse.md new file mode 100644 index 000000000..493da0caa --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/QueryUmAlgoOrderHistoryResponse.md @@ -0,0 +1,12 @@ + + +# QueryUmAlgoOrderHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryUmAlgoOrderHistoryResponseInner.md b/clients/derivatives-trading-portfolio-margin/docs/QueryUmAlgoOrderHistoryResponseInner.md new file mode 100644 index 000000000..897481a41 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/QueryUmAlgoOrderHistoryResponseInner.md @@ -0,0 +1,42 @@ + + +# QueryUmAlgoOrderHistoryResponseInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**algoType** | **String** | | [optional] | +|**orderType** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**positionSide** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**quantity** | **String** | | [optional] | +|**algoStatus** | **String** | | [optional] | +|**actualOrderId** | **String** | | [optional] | +|**actualPrice** | **String** | | [optional] | +|**triggerPrice** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**icebergQuantity** | **String** | | [optional] | +|**tpTriggerPrice** | **String** | | [optional] | +|**tpPrice** | **String** | | [optional] | +|**slTriggerPrice** | **String** | | [optional] | +|**slPrice** | **String** | | [optional] | +|**tpOrderType** | **String** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**workingType** | **String** | | [optional] | +|**priceMatch** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | +|**priceProtect** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**triggerTime** | **Long** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md b/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md index 4163aa9ce..c599671ef 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md +++ b/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md @@ -6,17 +6,20 @@ All URIs are relative to *https://papi.binance.com* |------------- | ------------- | -------------| | [**cancelAllCmOpenConditionalOrders**](TradeApi.md#cancelAllCmOpenConditionalOrders) | **DELETE** /papi/v1/cm/conditional/allOpenOrders | Cancel All CM Open Conditional Orders(TRADE) | | [**cancelAllCmOpenOrders**](TradeApi.md#cancelAllCmOpenOrders) | **DELETE** /papi/v1/cm/allOpenOrders | Cancel All CM Open Orders(TRADE) | -| [**cancelAllUmOpenConditionalOrders**](TradeApi.md#cancelAllUmOpenConditionalOrders) | **DELETE** /papi/v1/um/conditional/allOpenOrders | Cancel All UM Open Conditional Orders (TRADE) | +| [**cancelAllUmAlgoOpenOrders**](TradeApi.md#cancelAllUmAlgoOpenOrders) | **DELETE** /papi/v1/um/algo/allOpenOrders | Cancel All UM Algo Open Orders (TRADE) | +| [**cancelAllUmOpenConditionalOrders**](TradeApi.md#cancelAllUmOpenConditionalOrders) | **DELETE** /papi/v1/um/conditional/allOpenOrders | Cancel All UM Open Conditional Orders | | [**cancelAllUmOpenOrders**](TradeApi.md#cancelAllUmOpenOrders) | **DELETE** /papi/v1/um/allOpenOrders | Cancel All UM Open Orders(TRADE) | | [**cancelCmConditionalOrder**](TradeApi.md#cancelCmConditionalOrder) | **DELETE** /papi/v1/cm/conditional/order | Cancel CM Conditional Order(TRADE) | | [**cancelCmOrder**](TradeApi.md#cancelCmOrder) | **DELETE** /papi/v1/cm/order | Cancel CM Order(TRADE) | | [**cancelMarginAccountAllOpenOrdersOnASymbol**](TradeApi.md#cancelMarginAccountAllOpenOrdersOnASymbol) | **DELETE** /papi/v1/margin/allOpenOrders | Cancel Margin Account All Open Orders on a Symbol(TRADE) | | [**cancelMarginAccountOcoOrders**](TradeApi.md#cancelMarginAccountOcoOrders) | **DELETE** /papi/v1/margin/orderList | Cancel Margin Account OCO Orders(TRADE) | | [**cancelMarginAccountOrder**](TradeApi.md#cancelMarginAccountOrder) | **DELETE** /papi/v1/margin/order | Cancel Margin Account Order(TRADE) | -| [**cancelUmConditionalOrder**](TradeApi.md#cancelUmConditionalOrder) | **DELETE** /papi/v1/um/conditional/order | Cancel UM Conditional Order(TRADE) | +| [**cancelUmAlgoOrder**](TradeApi.md#cancelUmAlgoOrder) | **DELETE** /papi/v1/um/algo/order | Cancel UM Algo Order (TRADE) | +| [**cancelUmConditionalOrder**](TradeApi.md#cancelUmConditionalOrder) | **DELETE** /papi/v1/um/conditional/order | Cancel UM Conditional Order | | [**cancelUmOrder**](TradeApi.md#cancelUmOrder) | **DELETE** /papi/v1/um/order | Cancel UM Order(TRADE) | | [**cmAccountTradeList**](TradeApi.md#cmAccountTradeList) | **GET** /papi/v1/cm/userTrades | CM Account Trade List(USER_DATA) | | [**cmPositionAdlQuantileEstimation**](TradeApi.md#cmPositionAdlQuantileEstimation) | **GET** /papi/v1/cm/adlQuantile | CM Position ADL Quantile Estimation(USER_DATA) | +| [**futuresTradfiPerpsContract**](TradeApi.md#futuresTradfiPerpsContract) | **POST** /papi/v1/um/stock/contract | Futures TradFi Perps Contract(USER_DATA) | | [**getUmFuturesBnbBurnStatus**](TradeApi.md#getUmFuturesBnbBurnStatus) | **GET** /papi/v1/um/feeBurn | Get UM Futures BNB Burn Status (USER_DATA) | | [**marginAccountBorrow**](TradeApi.md#marginAccountBorrow) | **POST** /papi/v1/marginLoan | Margin Account Borrow(MARGIN) | | [**marginAccountNewOco**](TradeApi.md#marginAccountNewOco) | **POST** /papi/v1/margin/order/oco | Margin Account New OCO(TRADE) | @@ -28,16 +31,18 @@ All URIs are relative to *https://papi.binance.com* | [**newCmConditionalOrder**](TradeApi.md#newCmConditionalOrder) | **POST** /papi/v1/cm/conditional/order | New CM Conditional Order(TRADE) | | [**newCmOrder**](TradeApi.md#newCmOrder) | **POST** /papi/v1/cm/order | New CM Order(TRADE) | | [**newMarginOrder**](TradeApi.md#newMarginOrder) | **POST** /papi/v1/margin/order | New Margin Order(TRADE) | -| [**newUmConditionalOrder**](TradeApi.md#newUmConditionalOrder) | **POST** /papi/v1/um/conditional/order | New UM Conditional Order (TRADE) | +| [**newUmAlgoOrder**](TradeApi.md#newUmAlgoOrder) | **POST** /papi/v1/um/algo/order | New UM Algo Order (TRADE) | +| [**newUmConditionalOrder**](TradeApi.md#newUmConditionalOrder) | **POST** /papi/v1/um/conditional/order | New UM Conditional Order | | [**newUmOrder**](TradeApi.md#newUmOrder) | **POST** /papi/v1/um/order | New UM Order (TRADE) | | [**queryAllCmConditionalOrders**](TradeApi.md#queryAllCmConditionalOrders) | **GET** /papi/v1/cm/conditional/allOrders | Query All CM Conditional Orders(USER_DATA) | | [**queryAllCmOrders**](TradeApi.md#queryAllCmOrders) | **GET** /papi/v1/cm/allOrders | Query All CM Orders (USER_DATA) | | [**queryAllCurrentCmOpenConditionalOrders**](TradeApi.md#queryAllCurrentCmOpenConditionalOrders) | **GET** /papi/v1/cm/conditional/openOrders | Query All Current CM Open Conditional Orders (USER_DATA) | | [**queryAllCurrentCmOpenOrders**](TradeApi.md#queryAllCurrentCmOpenOrders) | **GET** /papi/v1/cm/openOrders | Query All Current CM Open Orders(USER_DATA) | -| [**queryAllCurrentUmOpenConditionalOrders**](TradeApi.md#queryAllCurrentUmOpenConditionalOrders) | **GET** /papi/v1/um/conditional/openOrders | Query All Current UM Open Conditional Orders(USER_DATA) | +| [**queryAllCurrentUmOpenAlgoOrders**](TradeApi.md#queryAllCurrentUmOpenAlgoOrders) | **GET** /papi/v1/um/algo/openAlgoOrders | Query All Current UM Open Algo Orders (USER_DATA) | +| [**queryAllCurrentUmOpenConditionalOrders**](TradeApi.md#queryAllCurrentUmOpenConditionalOrders) | **GET** /papi/v1/um/conditional/openOrders | Query All Current UM Open Conditional Orders | | [**queryAllCurrentUmOpenOrders**](TradeApi.md#queryAllCurrentUmOpenOrders) | **GET** /papi/v1/um/openOrders | Query All Current UM Open Orders(USER_DATA) | | [**queryAllMarginAccountOrders**](TradeApi.md#queryAllMarginAccountOrders) | **GET** /papi/v1/margin/allOrders | Query All Margin Account Orders (USER_DATA) | -| [**queryAllUmConditionalOrders**](TradeApi.md#queryAllUmConditionalOrders) | **GET** /papi/v1/um/conditional/allOrders | Query All UM Conditional Orders(USER_DATA) | +| [**queryAllUmConditionalOrders**](TradeApi.md#queryAllUmConditionalOrders) | **GET** /papi/v1/um/conditional/allOrders | Query All UM Conditional Orders | | [**queryAllUmOrders**](TradeApi.md#queryAllUmOrders) | **GET** /papi/v1/um/allOrders | Query All UM Orders(USER_DATA) | | [**queryCmConditionalOrderHistory**](TradeApi.md#queryCmConditionalOrderHistory) | **GET** /papi/v1/cm/conditional/orderHistory | Query CM Conditional Order History(USER_DATA) | | [**queryCmModifyOrderHistory**](TradeApi.md#queryCmModifyOrderHistory) | **GET** /papi/v1/cm/orderAmendment | Query CM Modify Order History(TRADE) | @@ -45,13 +50,15 @@ All URIs are relative to *https://papi.binance.com* | [**queryCurrentCmOpenConditionalOrder**](TradeApi.md#queryCurrentCmOpenConditionalOrder) | **GET** /papi/v1/cm/conditional/openOrder | Query Current CM Open Conditional Order(USER_DATA) | | [**queryCurrentCmOpenOrder**](TradeApi.md#queryCurrentCmOpenOrder) | **GET** /papi/v1/cm/openOrder | Query Current CM Open Order (USER_DATA) | | [**queryCurrentMarginOpenOrder**](TradeApi.md#queryCurrentMarginOpenOrder) | **GET** /papi/v1/margin/openOrders | Query Current Margin Open Order (USER_DATA) | -| [**queryCurrentUmOpenConditionalOrder**](TradeApi.md#queryCurrentUmOpenConditionalOrder) | **GET** /papi/v1/um/conditional/openOrder | Query Current UM Open Conditional Order(USER_DATA) | +| [**queryCurrentUmOpenAlgoOrder**](TradeApi.md#queryCurrentUmOpenAlgoOrder) | **GET** /papi/v1/um/algo/algoOrder | Query Current UM Open Algo Order (USER_DATA) | +| [**queryCurrentUmOpenConditionalOrder**](TradeApi.md#queryCurrentUmOpenConditionalOrder) | **GET** /papi/v1/um/conditional/openOrder | Query Current UM Open Conditional Order | | [**queryCurrentUmOpenOrder**](TradeApi.md#queryCurrentUmOpenOrder) | **GET** /papi/v1/um/openOrder | Query Current UM Open Order(USER_DATA) | | [**queryMarginAccountOrder**](TradeApi.md#queryMarginAccountOrder) | **GET** /papi/v1/margin/order | Query Margin Account Order (USER_DATA) | | [**queryMarginAccountsAllOco**](TradeApi.md#queryMarginAccountsAllOco) | **GET** /papi/v1/margin/allOrderList | Query Margin Account's all OCO (USER_DATA) | | [**queryMarginAccountsOco**](TradeApi.md#queryMarginAccountsOco) | **GET** /papi/v1/margin/orderList | Query Margin Account's OCO (USER_DATA) | | [**queryMarginAccountsOpenOco**](TradeApi.md#queryMarginAccountsOpenOco) | **GET** /papi/v1/margin/openOrderList | Query Margin Account's Open OCO (USER_DATA) | -| [**queryUmConditionalOrderHistory**](TradeApi.md#queryUmConditionalOrderHistory) | **GET** /papi/v1/um/conditional/orderHistory | Query UM Conditional Order History(USER_DATA) | +| [**queryUmAlgoOrderHistory**](TradeApi.md#queryUmAlgoOrderHistory) | **GET** /papi/v1/um/algo/allAlgoOrders | Query UM Algo Order History (USER_DATA) | +| [**queryUmConditionalOrderHistory**](TradeApi.md#queryUmConditionalOrderHistory) | **GET** /papi/v1/um/conditional/orderHistory | Query UM Conditional Order History | | [**queryUmModifyOrderHistory**](TradeApi.md#queryUmModifyOrderHistory) | **GET** /papi/v1/um/orderAmendment | Query UM Modify Order History(TRADE) | | [**queryUmOrder**](TradeApi.md#queryUmOrder) | **GET** /papi/v1/um/order | Query UM Order (USER_DATA) | | [**queryUsersCmForceOrders**](TradeApi.md#queryUsersCmForceOrders) | **GET** /papi/v1/cm/forceOrders | Query User's CM Force Orders(USER_DATA) | @@ -190,11 +197,75 @@ No authorization required |-------------|-------------|------------------| | **200** | Cancel All CM Open Orders | - | + +# **cancelAllUmAlgoOpenOrders** +> CancelAllUmAlgoOpenOrdersResponse cancelAllUmAlgoOpenOrders(symbol, recvWindow) + +Cancel All UM Algo Open Orders (TRADE) + +Cancel All UM Algo Open Orders Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://papi.binance.com"); + + TradeApi apiInstance = new TradeApi(defaultClient); + String symbol = "symbol_example"; // String | + Long recvWindow = 56L; // Long | + try { + CancelAllUmAlgoOpenOrdersResponse result = apiInstance.cancelAllUmAlgoOpenOrders(symbol, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#cancelAllUmAlgoOpenOrders"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **symbol** | **String**| | | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**CancelAllUmAlgoOpenOrdersResponse**](CancelAllUmAlgoOpenOrdersResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Cancel All UM Algo Open Orders | - | + # **cancelAllUmOpenConditionalOrders** > CancelAllUmOpenConditionalOrdersResponse cancelAllUmOpenConditionalOrders(symbol, recvWindow) -Cancel All UM Open Conditional Orders (TRADE) +Cancel All UM Open Conditional Orders Cancel All UM Open Conditional Orders Weight: 1 @@ -658,11 +729,77 @@ No authorization required |-------------|-------------|------------------| | **200** | Cancel Margin Account Order | - | + +# **cancelUmAlgoOrder** +> CancelUmAlgoOrderResponse cancelUmAlgoOrder(algoId, clientAlgoId, recvWindow) + +Cancel UM Algo Order (TRADE) + +Cancel an active UM algo order. * Either `algoId` or `clientAlgoId` must be sent. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://papi.binance.com"); + + TradeApi apiInstance = new TradeApi(defaultClient); + Long algoId = 56L; // Long | + String clientAlgoId = "clientAlgoId_example"; // String | + Long recvWindow = 56L; // Long | + try { + CancelUmAlgoOrderResponse result = apiInstance.cancelUmAlgoOrder(algoId, clientAlgoId, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#cancelUmAlgoOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **algoId** | **Long**| | [optional] | +| **clientAlgoId** | **String**| | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**CancelUmAlgoOrderResponse**](CancelUmAlgoOrderResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Cancel UM Algo Order | - | + # **cancelUmConditionalOrder** > CancelUmConditionalOrderResponse cancelUmConditionalOrder(symbol, strategyId, newClientStrategyId, recvWindow) -Cancel UM Conditional Order(TRADE) +Cancel UM Conditional Order Cancel UM Conditional Order * Either `strategyId` or `newClientStrategyId` must be sent. Weight: 1 @@ -932,6 +1069,68 @@ No authorization required |-------------|-------------|------------------| | **200** | CM Position ADL Quantile Estimation | - | + +# **futuresTradfiPerpsContract** +> FuturesTradfiPerpsContractResponse futuresTradfiPerpsContract(futuresTradfiPerpsContractRequest) + +Futures TradFi Perps Contract(USER_DATA) + +Sign TradFi-Perps agreement contract Weight: 5 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://papi.binance.com"); + + TradeApi apiInstance = new TradeApi(defaultClient); + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest = new FuturesTradfiPerpsContractRequest(); // FuturesTradfiPerpsContractRequest | + try { + FuturesTradfiPerpsContractResponse result = apiInstance.futuresTradfiPerpsContract(futuresTradfiPerpsContractRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#futuresTradfiPerpsContract"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **futuresTradfiPerpsContractRequest** | [**FuturesTradfiPerpsContractRequest**](FuturesTradfiPerpsContractRequest.md)| | | + +### Return type + +[**FuturesTradfiPerpsContractResponse**](FuturesTradfiPerpsContractResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Futures TradFi Perps Contract | - | + # **getUmFuturesBnbBurnStatus** > GetUmFuturesBnbBurnStatusResponse getUmFuturesBnbBurnStatus(recvWindow) @@ -1626,11 +1825,73 @@ No authorization required |-------------|-------------|------------------| | **200** | New Margin Order | - | + +# **newUmAlgoOrder** +> NewUmAlgoOrderResponse newUmAlgoOrder(newUmAlgoOrderRequest) + +New UM Algo Order (TRADE) + +Place new UM conditional order * Algo order with type `STOP`, parameter `timeInForce` can be sent ( default `GTC`). * Algo order with type `TAKE_PROFIT`, parameter `timeInForce` can be sent ( default `GTC`). * Condition orders will be triggered when: * If parameter`priceProtect`is sent as true: * when price reaches the `triggerPrice` , the difference rate between \"MARK_PRICE\" and \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the symbol * \"triggerProtect\" of a symbol can be got from `GET /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after order placed <= `activatePrice`, and the latest price >= the lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed >= `activatePrice`, and the latest price <= the highest price * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error code. ``{\"code\": -2021, \"msg\": \"Order would immediately trigger.\"}`` means that the parameters you send do not meet the following requirements: * BUY: `activatePrice` should be smaller than latest price. * SELL: `activatePrice` should be larger than latest price. * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with `closePosition`=`true`: * Follow the same rules for condition orders. * If triggered, **close all** current long position( if `SELL`) or current short position( if `BUY`). * Cannot be used with `quantity` paremeter * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with `BUY` orders in `LONG` position side. and cannot be used with `SELL` orders in `SHORT` position side * `selfTradePreventionMode` is only effective when `timeInForce` set to `IOC` or `GTC` or `GTD`. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://papi.binance.com"); + + TradeApi apiInstance = new TradeApi(defaultClient); + NewUmAlgoOrderRequest newUmAlgoOrderRequest = new NewUmAlgoOrderRequest(); // NewUmAlgoOrderRequest | + try { + NewUmAlgoOrderResponse result = apiInstance.newUmAlgoOrder(newUmAlgoOrderRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#newUmAlgoOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **newUmAlgoOrderRequest** | [**NewUmAlgoOrderRequest**](NewUmAlgoOrderRequest.md)| | | + +### Return type + +[**NewUmAlgoOrderResponse**](NewUmAlgoOrderResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | New UM Algo Order | - | + # **newUmConditionalOrder** > NewUmConditionalOrderResponse newUmConditionalOrder(newUmConditionalOrderRequest) -New UM Conditional Order (TRADE) +New UM Conditional Order Place new UM conditional order * Order with type `STOP/TAKE_PROFIT`, parameter `timeInForce` can be sent ( default `GTC`). * Condition orders will be triggered when: * `STOP`, `STOP_MARKET`: * BUY: \"MARK_PRICE\" >= `stopPrice` * SELL: \"MARK_PRICE\" <= `stopPrice` * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: * BUY: \"MARK_PRICE\" <= `stopPrice` * SELL: \"MARK_PRICE\" >= `stopPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest mark price after order placed `<= `activationPrice`, and the latest mark price >`= the lowest mark price * (1 + `callbackRate`) * SELL: the highest mark price after order placed >= `activationPrice`, and the latest mark price <= the highest mark price * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error code. `{\"code\": -2021, \"msg\": \"Order would immediately trigger.\"}` means that the parameters you send do not meet the following requirements: * BUY: `activationPrice` should be smaller than latest mark price. * SELL: `activationPrice` should be larger than latest mark price. * Condition orders will be triggered when: * If parameter`priceProtect`is sent as true: * when price reaches the `stopPrice` ,the difference rate between \"MARK_PRICE\" and \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the symbol * \"triggerProtect\" of a symbol can be got from `GET /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `stopPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `stopPrice` * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `stopPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `stopPrice` * `selfTradePreventionMode` is only effective when `timeInForce` set to `IOC` or `GTC` or `GTD`. * In extreme market conditions, timeInForce `GTD` order auto cancel time might be delayed comparing to `goodTillDate` Weight: 1 @@ -2026,11 +2287,79 @@ No authorization required |-------------|-------------|------------------| | **200** | All Current CM Open Orders | - | + +# **queryAllCurrentUmOpenAlgoOrders** +> QueryAllCurrentUmOpenAlgoOrdersResponse queryAllCurrentUmOpenAlgoOrders(algoType, symbol, algoId, recvWindow) + +Query All Current UM Open Algo Orders (USER_DATA) + +Get all UM open algo orders on a symbol. * If the symbol is not sent, orders for all symbols will be returned in an array. Weight: 1 for a single symbol; 40 when the symbol parameter is omitted Careful when accessing this with no symbol. + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://papi.binance.com"); + + TradeApi apiInstance = new TradeApi(defaultClient); + String algoType = "algoType_example"; // String | + String symbol = "symbol_example"; // String | + Long algoId = 56L; // Long | + Long recvWindow = 56L; // Long | + try { + QueryAllCurrentUmOpenAlgoOrdersResponse result = apiInstance.queryAllCurrentUmOpenAlgoOrders(algoType, symbol, algoId, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#queryAllCurrentUmOpenAlgoOrders"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **algoType** | **String**| | [optional] | +| **symbol** | **String**| | [optional] | +| **algoId** | **Long**| | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**QueryAllCurrentUmOpenAlgoOrdersResponse**](QueryAllCurrentUmOpenAlgoOrdersResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | All Current UM Open Algo Orders | - | + # **queryAllCurrentUmOpenConditionalOrders** > QueryAllCurrentUmOpenConditionalOrdersResponse queryAllCurrentUmOpenConditionalOrders(symbol, recvWindow) -Query All Current UM Open Conditional Orders(USER_DATA) +Query All Current UM Open Conditional Orders Get all open conditional orders on a symbol. * If the symbol is not sent, orders for all symbols will be returned in an array. Weight: 1 for a single symbol; 40 when the symbol parameter is omitted Careful when accessing this with no symbol. @@ -2230,7 +2559,7 @@ No authorization required # **queryAllUmConditionalOrders** > QueryAllUmConditionalOrdersResponse queryAllUmConditionalOrders(symbol, strategyId, startTime, endTime, limit, recvWindow) -Query All UM Conditional Orders(USER_DATA) +Query All UM Conditional Orders Query All UM Conditional Orders * These orders will not be found: * order strategyStatus is `CANCELED` or `EXPIRED`, **AND** * order has NO filled trade, **AND** * created time + 7 days < current time * The query time period must be less than 7 days( default as the recent 7 days). Weight: 1 for a single symbol; 40 when the symbol parameter is omitted @@ -2780,11 +3109,77 @@ No authorization required |-------------|-------------|------------------| | **200** | Current Margin Open Order | - | + +# **queryCurrentUmOpenAlgoOrder** +> QueryCurrentUmOpenAlgoOrderResponse queryCurrentUmOpenAlgoOrder(algoId, clientAlgoId, recvWindow) + +Query Current UM Open Algo Order (USER_DATA) + +Check an UM algo order's status. * These orders will not be found: * order status is `CANCELED` or `EXPIRED` **AND** order has NO filled trade **AND** created time + 3 days < current time * order create time + 90 days < current time * Either `algoId` or `clientAlgoId` must be sent. * `algoId` is self-increment for each specific `symbol` Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://papi.binance.com"); + + TradeApi apiInstance = new TradeApi(defaultClient); + Long algoId = 56L; // Long | + String clientAlgoId = "clientAlgoId_example"; // String | + Long recvWindow = 56L; // Long | + try { + QueryCurrentUmOpenAlgoOrderResponse result = apiInstance.queryCurrentUmOpenAlgoOrder(algoId, clientAlgoId, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#queryCurrentUmOpenAlgoOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **algoId** | **Long**| | [optional] | +| **clientAlgoId** | **String**| | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**QueryCurrentUmOpenAlgoOrderResponse**](QueryCurrentUmOpenAlgoOrderResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Current UM Open Algo Order | - | + # **queryCurrentUmOpenConditionalOrder** > QueryCurrentUmOpenConditionalOrderResponse queryCurrentUmOpenConditionalOrder(symbol, strategyId, newClientStrategyId, recvWindow) -Query Current UM Open Conditional Order(USER_DATA) +Query Current UM Open Conditional Order Query Current UM Open Conditional Order * Either `strategyId` or `newClientStrategyId` must be sent. * If the queried order has been `CANCELED`, `TRIGGERED` or `EXPIRED`, the error message \"Order does not exist\" will be returned. Weight: 1 @@ -3182,11 +3577,83 @@ No authorization required |-------------|-------------|------------------| | **200** | Margin Account's Open OCO | - | + +# **queryUmAlgoOrderHistory** +> QueryUmAlgoOrderHistoryResponse queryUmAlgoOrderHistory(symbol, algoId, startTime, endTime, limit, recvWindow) + +Query UM Algo Order History (USER_DATA) + +Get all algo orders; ACTIVE, CANCELED, TRIGGERED or FINISHED . * If `algoId` is set, it will get orders >= that `algoId`. Otherwise most recent orders are returned. * The query time period must be less then 7 days( default as the recent 7 days). Weight: 5 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://papi.binance.com"); + + TradeApi apiInstance = new TradeApi(defaultClient); + String symbol = "symbol_example"; // String | + Long algoId = 56L; // Long | + Long startTime = 56L; // Long | Timestamp in ms to get funding from INCLUSIVE. + Long endTime = 56L; // Long | Timestamp in ms to get funding until INCLUSIVE. + Long limit = 56L; // Long | Default 100; max 1000 + Long recvWindow = 56L; // Long | + try { + QueryUmAlgoOrderHistoryResponse result = apiInstance.queryUmAlgoOrderHistory(symbol, algoId, startTime, endTime, limit, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#queryUmAlgoOrderHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **symbol** | **String**| | | +| **algoId** | **Long**| | [optional] | +| **startTime** | **Long**| Timestamp in ms to get funding from INCLUSIVE. | [optional] | +| **endTime** | **Long**| Timestamp in ms to get funding until INCLUSIVE. | [optional] | +| **limit** | **Long**| Default 100; max 1000 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**QueryUmAlgoOrderHistoryResponse**](QueryUmAlgoOrderHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UM Algo Order History | - | + # **queryUmConditionalOrderHistory** > QueryUmConditionalOrderHistoryResponse queryUmConditionalOrderHistory(symbol, strategyId, newClientStrategyId, recvWindow) -Query UM Conditional Order History(USER_DATA) +Query UM Conditional Order History Query UM Conditional Order History * Either `strategyId` or `newClientStrategyId` must be sent. * `NEW` orders will not be found. * These orders will not be found: * order status is `CANCELED` or `EXPIRED`, **AND** * order has NO filled trade, **AND** * created time + 7 days < current time Weight: 1 @@ -3398,7 +3865,7 @@ No authorization required Query User's CM Force Orders(USER_DATA) -Query User's CM Force Orders * If \"autoCloseType\" is not sent, orders with both of the types will be returned * If \"startTime\" is not sent, data within 7 days before \"endTime\" can be queried Weight: 20 with symbol, 50 without symbol +Query User's CM Force Orders * If \"autoCloseType\" is not sent, orders with both of the types will be returned * If \"startTime\" is not sent, data within 7 days before \"endTime\" can be queried * Only support querying data in the past 90 days Weight: 20 with symbol, 50 without symbol ### Example ```java @@ -3540,7 +4007,7 @@ No authorization required Query User's UM Force Orders (USER_DATA) -Query User's UM Force Orders * If `autoCloseType` is not sent, orders with both of the types will be returned * If `startTime` is not sent, data within 7 days before `endTime` can be queried Weight: 20 with symbol, 50 without symbol +Query User's UM Force Orders * If `autoCloseType` is not sent, orders with both of the types will be returned * If `startTime` is not sent, data within 7 days before `endTime` can be queried * Only support querying data in the past 90 days Weight: 20 with symbol, 50 without symbol ### Example ```java diff --git a/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md index d9b7f16f9..0564213b0 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md +++ b/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md @@ -10,6 +10,7 @@ |**T** | **Long** | | [optional] | |**E** | **Long** | | [optional] | |**fs** | **String** | | [optional] | +|**ao** | [**AlgoUpdateAo**](AlgoUpdateAo.md) | | [optional] | |**so** | [**ConditionalOrderTradeUpdateSo**](ConditionalOrderTradeUpdateSo.md) | | [optional] | |**ac** | [**AccountConfigUpdateAc**](AccountConfigUpdateAc.md) | | [optional] | |**iLowerCase** | **Long** | | [optional] | @@ -52,6 +53,11 @@ |**W** | **Long** | | [optional] | |**V** | **String** | | [optional] | |**A** | **String** | | [optional] | +|**cs** | **String** | | [optional] | +|**pl** | **String** | | [optional] | +|**pL** | **String** | | [optional] | +|**pY** | **String** | | [optional] | +|**eR** | **String** | | [optional] | |**eq** | **String** | | [optional] | |**ae** | **String** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md b/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md index 6f2ae7547..1ffdf921a 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-portfolio-margin - 5.0.0 + 6.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin - 5.0.0 + 6.0.0 ``` diff --git a/clients/derivatives-trading-portfolio-margin/example_rest.md b/clients/derivatives-trading-portfolio-margin/example_rest.md index 7c7a21032..225062f51 100644 --- a/clients/derivatives-trading-portfolio-margin/example_rest.md +++ b/clients/derivatives-trading-portfolio-margin/example_rest.md @@ -48,7 +48,7 @@ [GET /papi/v1/um/trade/asyn/id](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) - getUmFuturesTradeDownloadLinkById - [GetUmFuturesTradeDownloadLinkByIdExample.java:47](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesTradeDownloadLinkByIdExample.java#L47) -[GET /papi/v1/um/income/asyn/id](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) - getUmFuturesTransactionDownloadLinkById - [GetUmFuturesTransactionDownloadLinkByIdExample.java:47](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesTransactionDownloadLinkByIdExample.java#L47) +[GET /papi/v1/um/income/asyn/id](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) - getUmFuturesTransactionDownloadLinkById - [GetUmFuturesTransactionDownloadLinkByIdExample.java:48](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesTransactionDownloadLinkByIdExample.java#L48) [GET /papi/v1/um/income](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) - getUmIncomeHistory - [GetUmIncomeHistoryExample.java:50](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmIncomeHistoryExample.java#L50) @@ -94,6 +94,8 @@ [DELETE /papi/v1/cm/allOpenOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) - cancelAllCmOpenOrders - [CancelAllCmOpenOrdersExample.java:47](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllCmOpenOrdersExample.java#L47) +[DELETE /papi/v1/um/algo/allOpenOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Algo-Open-Orders) - cancelAllUmAlgoOpenOrders - [CancelAllUmAlgoOpenOrdersExample.java:47](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmAlgoOpenOrdersExample.java#L47) + [DELETE /papi/v1/um/conditional/allOpenOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) - cancelAllUmOpenConditionalOrders - [CancelAllUmOpenConditionalOrdersExample.java:47](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmOpenConditionalOrdersExample.java#L47) [DELETE /papi/v1/um/allOpenOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) - cancelAllUmOpenOrders - [CancelAllUmOpenOrdersExample.java:47](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmOpenOrdersExample.java#L47) @@ -108,6 +110,8 @@ [DELETE /papi/v1/margin/order](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) - cancelMarginAccountOrder - [CancelMarginAccountOrderExample.java:48](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelMarginAccountOrderExample.java#L48) +[DELETE /papi/v1/um/algo/order](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Algo-Order) - cancelUmAlgoOrder - [CancelUmAlgoOrderExample.java:48](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmAlgoOrderExample.java#L48) + [DELETE /papi/v1/um/conditional/order](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) - cancelUmConditionalOrder - [CancelUmConditionalOrderExample.java:48](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmConditionalOrderExample.java#L48) [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) @@ -116,6 +120,8 @@ [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) +[POST /papi/v1/um/stock/contract](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Futures-TradFi-Perps-Contract) - futuresTradfiPerpsContract - [FuturesTradfiPerpsContractExample.java:48](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/FuturesTradfiPerpsContractExample.java#L48) + [GET /papi/v1/um/feeBurn](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) - getUmFuturesBnbBurnStatus - [GetUmFuturesBnbBurnStatusExample.java:48](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/GetUmFuturesBnbBurnStatusExample.java#L48) [POST /papi/v1/marginLoan](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) - marginAccountBorrow - [MarginAccountBorrowExample.java:48](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountBorrowExample.java#L48) @@ -138,6 +144,8 @@ [POST /papi/v1/margin/order](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) - newMarginOrder - [NewMarginOrderExample.java:50](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/NewMarginOrderExample.java#L50) +[POST /papi/v1/um/algo/order](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Algo-Order) - newUmAlgoOrder - [NewUmAlgoOrderExample.java:82](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/NewUmAlgoOrderExample.java#L82) + [POST /papi/v1/um/conditional/order](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) - newUmConditionalOrder - [NewUmConditionalOrderExample.java:80](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/NewUmConditionalOrderExample.java#L80) [POST /papi/v1/um/order](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order) - newUmOrder - [NewUmOrderExample.java:56](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/NewUmOrderExample.java#L56) @@ -150,6 +158,8 @@ [GET /papi/v1/cm/openOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) - queryAllCurrentCmOpenOrders - [QueryAllCurrentCmOpenOrdersExample.java:49](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentCmOpenOrdersExample.java#L49) +[GET /papi/v1/um/algo/openAlgoOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Algo-Orders) - queryAllCurrentUmOpenAlgoOrders - [QueryAllCurrentUmOpenAlgoOrdersExample.java:49](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenAlgoOrdersExample.java#L49) + [GET /papi/v1/um/conditional/openOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders) - queryAllCurrentUmOpenConditionalOrders - [QueryAllCurrentUmOpenConditionalOrdersExample.java:49](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenConditionalOrdersExample.java#L49) [GET /papi/v1/um/openOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) - queryAllCurrentUmOpenOrders - [QueryAllCurrentUmOpenOrdersExample.java:49](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenOrdersExample.java#L49) @@ -172,6 +182,8 @@ [GET /papi/v1/margin/openOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) - queryCurrentMarginOpenOrder - [QueryCurrentMarginOpenOrderExample.java:47](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentMarginOpenOrderExample.java#L47) +[GET /papi/v1/um/algo/algoOrder](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Algo-Order) - queryCurrentUmOpenAlgoOrder - [QueryCurrentUmOpenAlgoOrderExample.java:51](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenAlgoOrderExample.java#L51) + [GET /papi/v1/um/conditional/openOrder](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) - queryCurrentUmOpenConditionalOrder - [QueryCurrentUmOpenConditionalOrderExample.java:50](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenConditionalOrderExample.java#L50) [GET /papi/v1/um/openOrder](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) - queryCurrentUmOpenOrder - [QueryCurrentUmOpenOrderExample.java:49](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenOrderExample.java#L49) @@ -184,17 +196,19 @@ [GET /papi/v1/margin/openOrderList](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) - queryMarginAccountsOpenOco - [QueryMarginAccountsOpenOcoExample.java:47](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryMarginAccountsOpenOcoExample.java#L47) +[GET /papi/v1/um/algo/allAlgoOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Algo-Order-History) - queryUmAlgoOrderHistory - [QueryUmAlgoOrderHistoryExample.java:50](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmAlgoOrderHistoryExample.java#L50) + [GET /papi/v1/um/conditional/orderHistory](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) - queryUmConditionalOrderHistory - [QueryUmConditionalOrderHistoryExample.java:51](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmConditionalOrderHistoryExample.java#L51) [GET /papi/v1/um/orderAmendment](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) - queryUmModifyOrderHistory - [QueryUmModifyOrderHistoryExample.java:49](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmModifyOrderHistoryExample.java#L49) [GET /papi/v1/um/order](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) - queryUmOrder - [QueryUmOrderExample.java:50](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmOrderExample.java#L50) -[GET /papi/v1/cm/forceOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) - queryUsersCmForceOrders - [QueryUsersCmForceOrdersExample.java:50](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersCmForceOrdersExample.java#L50) +[GET /papi/v1/cm/forceOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) - queryUsersCmForceOrders - [QueryUsersCmForceOrdersExample.java:51](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersCmForceOrdersExample.java#L51) [GET /papi/v1/margin/forceOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) - queryUsersMarginForceOrders - [QueryUsersMarginForceOrdersExample.java:47](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersMarginForceOrdersExample.java#L47) -[GET /papi/v1/um/forceOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) - queryUsersUmForceOrders - [QueryUsersUmForceOrdersExample.java:50](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersUmForceOrdersExample.java#L50) +[GET /papi/v1/um/forceOrders](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) - queryUsersUmForceOrders - [QueryUsersUmForceOrdersExample.java:51](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersUmForceOrdersExample.java#L51) [POST /papi/v1/um/feeBurn](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) - toggleBnbBurnOnUmFuturesTrade - [ToggleBnbBurnOnUmFuturesTradeExample.java:50](/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/ToggleBnbBurnOnUmFuturesTradeExample.java#L50) diff --git a/clients/derivatives-trading-portfolio-margin/pom.xml b/clients/derivatives-trading-portfolio-margin/pom.xml index c9822cbb9..41d46e62f 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 - 5.0.1 + 6.0.0 jar diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/JSON.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/JSON.java index 5164dd27b..ac1fca2c1 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/JSON.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/JSON.java @@ -135,6 +135,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .CancelAllCmOpenOrdersResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .CancelAllUmAlgoOpenOrdersResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .CancelAllUmOpenConditionalOrdersResponse.CustomTypeAdapterFactory()); @@ -177,6 +180,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .CancelMarginAccountOrderResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .CancelUmAlgoOrderResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .CancelUmConditionalOrderResponse.CustomTypeAdapterFactory()); @@ -251,6 +257,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .FundCollectionByAssetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .FuturesTradfiPerpsContractRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .FuturesTradfiPerpsContractResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .GetAutoRepayFuturesStatusResponse.CustomTypeAdapterFactory()); @@ -404,6 +416,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .NewMarginOrderResponseFillsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .NewUmAlgoOrderRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .NewUmAlgoOrderResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .NewUmConditionalOrderRequest.CustomTypeAdapterFactory()); @@ -454,6 +472,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .QueryAllCurrentCmOpenOrdersResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .QueryAllCurrentUmOpenAlgoOrdersResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .QueryAllCurrentUmOpenAlgoOrdersResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .QueryAllCurrentUmOpenConditionalOrdersResponse.CustomTypeAdapterFactory()); @@ -524,6 +548,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .QueryCurrentMarginOpenOrderResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .QueryCurrentUmOpenAlgoOrderResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .QueryCurrentUmOpenConditionalOrderResponse.CustomTypeAdapterFactory()); @@ -582,6 +609,12 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .QueryPortfolioMarginNegativeBalanceInterestHistoryResponseInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .QueryUmAlgoOrderHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .QueryUmAlgoOrderHistoryResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .QueryUmConditionalOrderHistoryResponse.CustomTypeAdapterFactory()); 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 7027c10bb..6063ef9ad 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/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -3542,7 +3542,7 @@ private okhttp3.Call getUmFuturesOrderDownloadLinkByIdValidateBeforeCall( /** * Get UM Futures Order Download Link by Id(USER_DATA) Get UM futures order download link by Id - * * Download link expiration: 24h Weight: 10 + * * Download link expiration: 7 days Weight: 10 * * @param downloadId get by download id api (required) * @param recvWindow (optional) @@ -3687,7 +3687,7 @@ private okhttp3.Call getUmFuturesTradeDownloadLinkByIdValidateBeforeCall( /** * Get UM Futures Trade Download Link by Id(USER_DATA) Get UM futures trade download link by Id - * * Download link expiration: 24h Weight: 10 + * * Download link expiration: 7 days Weight: 10 * * @param downloadId get by download id api (required) * @param recvWindow (optional) @@ -3834,7 +3834,7 @@ private okhttp3.Call getUmFuturesTransactionDownloadLinkByIdValidateBeforeCall( /** * Get UM Futures Transaction Download Link by Id(USER_DATA) Get UM futures Transaction download - * link by Id * Download link expiration: 24h Weight: 10 + * link by Id * Download link expiration: 7 days Weight: 10 * * @param downloadId get by download id api (required) * @param recvWindow (optional) 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 ce267f705..31f4ab679 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 @@ -12,6 +12,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.BnbTransferResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllCmOpenConditionalOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllCmOpenOrdersResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllUmAlgoOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllUmOpenConditionalOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllUmOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelCmConditionalOrderResponse; @@ -19,6 +20,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelMarginAccountAllOpenOrdersOnASymbolResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelMarginAccountOcoOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelMarginAccountOrderResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelUmAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelUmConditionalOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelUmOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.ChangeAutoRepayFuturesStatusRequest; @@ -38,6 +40,8 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.FundAutoCollectionResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.FundCollectionByAssetRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.FundCollectionByAssetResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.FuturesTradfiPerpsContractRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.FuturesTradfiPerpsContractResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.GetAutoRepayFuturesStatusResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.GetCmAccountDetailResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.GetCmCurrentPositionModeResponse; @@ -76,6 +80,8 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewCmOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewMarginOrderRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewMarginOrderResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmConditionalOrderRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmConditionalOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmOrderRequest; @@ -85,6 +91,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCmOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentCmOpenConditionalOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentCmOpenOrdersResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentUmOpenAlgoOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentUmOpenConditionalOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentUmOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllMarginAccountOrdersResponse; @@ -97,6 +104,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentCmOpenConditionalOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentCmOpenOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentMarginOpenOrderResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentUmOpenAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentUmOpenConditionalOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentUmOpenOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryMarginAccountOrderResponse; @@ -107,6 +115,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryMarginMaxWithdrawResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryMarginRepayRecordResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryPortfolioMarginNegativeBalanceInterestHistoryResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryUmAlgoOrderHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryUmConditionalOrderHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryUmModifyOrderHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryUmOrderResponse; @@ -739,7 +748,7 @@ public ApiResponse getUmCurrentPositionMode(Lo /** * Get UM Futures Order Download Link by Id(USER_DATA) Get UM futures order download link by Id - * * Download link expiration: 24h Weight: 10 + * * Download link expiration: 7 days Weight: 10 * * @param downloadId get by download id api (required) * @param recvWindow (optional) @@ -764,7 +773,7 @@ public ApiResponse getUmFuturesOrderD /** * Get UM Futures Trade Download Link by Id(USER_DATA) Get UM futures trade download link by Id - * * Download link expiration: 24h Weight: 10 + * * Download link expiration: 7 days Weight: 10 * * @param downloadId get by download id api (required) * @param recvWindow (optional) @@ -789,7 +798,7 @@ public ApiResponse getUmFuturesTradeD /** * Get UM Futures Transaction Download Link by Id(USER_DATA) Get UM futures Transaction download - * link by Id * Download link expiration: 24h Weight: 10 + * link by Id * Download link expiration: 7 days Weight: 10 * * @param downloadId get by download id api (required) * @param recvWindow (optional) @@ -1384,7 +1393,31 @@ public ApiResponse cancelAllCmOpenOrders( } /** - * Cancel All UM Open Conditional Orders (TRADE) Cancel All UM Open Conditional Orders Weight: 1 + * Cancel All UM Algo Open Orders (TRADE) Cancel All UM Algo Open Orders Weight: 1 + * + * @param symbol (required) + * @param recvWindow (optional) + * @return ApiResponse<CancelAllUmAlgoOpenOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel All UM Algo Open Orders -
+ * + * @see Cancel + * All UM Algo Open Orders (TRADE) Documentation + */ + public ApiResponse cancelAllUmAlgoOpenOrders( + String symbol, Long recvWindow) throws ApiException { + return tradeApi.cancelAllUmAlgoOpenOrders(symbol, recvWindow); + } + + /** + * Cancel All UM Open Conditional Orders Cancel All UM Open Conditional Orders Weight: 1 * * @param symbol (required) * @param recvWindow (optional) @@ -1398,9 +1431,10 @@ public ApiResponse cancelAllCmOpenOrders( * 200 Cancel All UM Open Conditional Orders - * * + * @deprecated * @see Cancel - * All UM Open Conditional Orders (TRADE) Documentation + * All UM Open Conditional Orders Documentation */ public ApiResponse cancelAllUmOpenConditionalOrders( String symbol, Long recvWindow) throws ApiException { @@ -1587,8 +1621,34 @@ public ApiResponse cancelMarginAccountOrder( } /** - * Cancel UM Conditional Order(TRADE) Cancel UM Conditional Order * Either - * `strategyId` or `newClientStrategyId` must be sent. Weight: 1 + * Cancel UM Algo Order (TRADE) Cancel an active UM algo order. * Either `algoId` or + * `clientAlgoId` must be sent. Weight: 1 + * + * @param algoId (optional) + * @param clientAlgoId (optional) + * @param recvWindow (optional) + * @return ApiResponse<CancelUmAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel UM Algo Order -
+ * + * @see Cancel + * UM Algo Order (TRADE) Documentation + */ + public ApiResponse cancelUmAlgoOrder( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { + return tradeApi.cancelUmAlgoOrder(algoId, clientAlgoId, recvWindow); + } + + /** + * Cancel UM Conditional Order Cancel UM Conditional Order * Either `strategyId` or + * `newClientStrategyId` must be sent. Weight: 1 * * @param symbol (required) * @param strategyId (optional) @@ -1604,9 +1664,10 @@ public ApiResponse cancelMarginAccountOrder( * 200 Cancel UM Conditional Order - * * + * @deprecated * @see Cancel - * UM Conditional Order(TRADE) Documentation + * UM Conditional Order Documentation */ public ApiResponse cancelUmConditionalOrder( String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) @@ -1720,6 +1781,30 @@ public ApiResponse cmPositionAdlQuantil return tradeApi.cmPositionAdlQuantileEstimation(symbol, recvWindow); } + /** + * Futures TradFi Perps Contract(USER_DATA) Sign TradFi-Perps agreement contract Weight: 5 + * + * @param futuresTradfiPerpsContractRequest (required) + * @return ApiResponse<FuturesTradfiPerpsContractResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Futures TradFi Perps Contract -
+ * + * @see Futures + * TradFi Perps Contract(USER_DATA) Documentation + */ + public ApiResponse futuresTradfiPerpsContract( + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) + throws ApiException { + return tradeApi.futuresTradfiPerpsContract(futuresTradfiPerpsContractRequest); + } + /** * Get UM Futures BNB Burn Status (USER_DATA) Get user's BNB Fee Discount for UM Futures * (Fee Discount On or Fee Discount Off ) Weight: 30 @@ -2045,7 +2130,62 @@ public ApiResponse newMarginOrder( } /** - * New UM Conditional Order (TRADE) Place new UM conditional order * Order with type + * New UM Algo Order (TRADE) Place new UM conditional order * Algo order with type + * `STOP`, parameter `timeInForce` can be sent ( default `GTC`). * + * Algo order with type `TAKE_PROFIT`, parameter `timeInForce` can be sent ( + * default `GTC`). * Condition orders will be triggered when: * If + * parameter`priceProtect`is sent as true: * when price reaches the + * `triggerPrice` , the difference rate between \"MARK_PRICE\" and + * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the + * symbol * \"triggerProtect\" of a symbol can be got from `GET + * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after + * order placed <= `activatePrice`, and the latest price >= the lowest + * price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activatePrice`, and the latest price <= the highest price * (1 + * - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * code. ``{\"code\": -2021, \"msg\": \"Order would + * immediately trigger.\"}`` means that the parameters you send do not meet the + * following requirements: * BUY: `activatePrice` should be smaller than latest price. + * * SELL: `activatePrice` should be larger than latest price. * + * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with + * `closePosition`=`true`: * Follow the same rules for condition + * orders. * If triggered, **close all** current long position( if `SELL`) or current + * short position( if `BUY`). * Cannot be used with `quantity` paremeter * + * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with + * `BUY` orders in `LONG` position side. and cannot be used with + * `SELL` orders in `SHORT` position side * + * `selfTradePreventionMode` is only effective when `timeInForce` set to + * `IOC` or `GTC` or `GTD`. Weight: 1 + * + * @param newUmAlgoOrderRequest (required) + * @return ApiResponse<NewUmAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 New UM Algo Order -
+ * + * @see New + * UM Algo Order (TRADE) Documentation + */ + public ApiResponse newUmAlgoOrder( + NewUmAlgoOrderRequest newUmAlgoOrderRequest) throws ApiException { + return tradeApi.newUmAlgoOrder(newUmAlgoOrderRequest); + } + + /** + * New UM Conditional Order Place new UM conditional order * Order with type * `STOP/TAKE_PROFIT`, parameter `timeInForce` can be sent ( default * `GTC`). * Condition orders will be triggered when: * `STOP`, * `STOP_MARKET`: * BUY: \"MARK_PRICE\" >= `stopPrice` * @@ -2088,9 +2228,10 @@ public ApiResponse newMarginOrder( * 200 New UM Conditional Order - * * + * @deprecated * @see New - * UM Conditional Order (TRADE) Documentation + * UM Conditional Order Documentation */ public ApiResponse newUmConditionalOrder( NewUmConditionalOrderRequest newUmConditionalOrderRequest) throws ApiException { @@ -2264,10 +2405,39 @@ public ApiResponse queryAllCurrentCmOpenOrd } /** - * Query All Current UM Open Conditional Orders(USER_DATA) Get all open conditional orders on a - * symbol. * If the symbol is not sent, orders for all symbols will be returned in an array. - * Weight: 1 for a single symbol; 40 when the symbol parameter is omitted Careful when accessing - * this with no symbol. + * Query All Current UM Open Algo Orders (USER_DATA) Get all UM open algo orders on a symbol. * + * If the symbol is not sent, orders for all symbols will be returned in an array. Weight: 1 for + * a single symbol; 40 when the symbol parameter is omitted Careful when accessing this with no + * symbol. + * + * @param algoType (optional) + * @param symbol (optional) + * @param algoId (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryAllCurrentUmOpenAlgoOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 All Current UM Open Algo Orders -
+ * + * @see Query + * All Current UM Open Algo Orders (USER_DATA) Documentation + */ + public ApiResponse queryAllCurrentUmOpenAlgoOrders( + String algoType, String symbol, Long algoId, Long recvWindow) throws ApiException { + return tradeApi.queryAllCurrentUmOpenAlgoOrders(algoType, symbol, algoId, recvWindow); + } + + /** + * Query All Current UM Open Conditional Orders Get all open conditional orders on a symbol. * + * If the symbol is not sent, orders for all symbols will be returned in an array. Weight: 1 for + * a single symbol; 40 when the symbol parameter is omitted Careful when accessing this with no + * symbol. * * @param symbol (optional) * @param recvWindow (optional) @@ -2281,9 +2451,10 @@ public ApiResponse queryAllCurrentCmOpenOrd * 200 All Current UM Open Conditional Orders - * * + * @deprecated * @see Query - * All Current UM Open Conditional Orders(USER_DATA) Documentation + * All Current UM Open Conditional Orders Documentation */ public ApiResponse queryAllCurrentUmOpenConditionalOrders(String symbol, Long recvWindow) @@ -2348,11 +2519,11 @@ public ApiResponse queryAllMarginAccountOrd } /** - * Query All UM Conditional Orders(USER_DATA) Query All UM Conditional Orders * These orders - * will not be found: * order strategyStatus is `CANCELED` or `EXPIRED`, - * **AND** * order has NO filled trade, **AND** * created time + 7 days < current time * The - * query time period must be less than 7 days( default as the recent 7 days). Weight: 1 for a - * single symbol; 40 when the symbol parameter is omitted + * Query All UM Conditional Orders Query All UM Conditional Orders * These orders will not be + * found: * order strategyStatus is `CANCELED` or `EXPIRED`, **AND** * order + * has NO filled trade, **AND** * created time + 7 days < current time * The query time + * period must be less than 7 days( default as the recent 7 days). Weight: 1 for a single + * symbol; 40 when the symbol parameter is omitted * * @param symbol (optional) * @param strategyId (optional) @@ -2370,9 +2541,10 @@ public ApiResponse queryAllMarginAccountOrd * 200 All UM Conditional Orders - * * + * @deprecated * @see Query - * All UM Conditional Orders(USER_DATA) Documentation + * All UM Conditional Orders Documentation */ public ApiResponse queryAllUmConditionalOrders( String symbol, @@ -2608,10 +2780,40 @@ public ApiResponse queryCurrentMarginOpenOr } /** - * Query Current UM Open Conditional Order(USER_DATA) Query Current UM Open Conditional Order * - * Either `strategyId` or `newClientStrategyId` must be sent. * If the - * queried order has been `CANCELED`, `TRIGGERED` or `EXPIRED`, - * the error message \"Order does not exist\" will be returned. Weight: 1 + * Query Current UM Open Algo Order (USER_DATA) Check an UM algo order's status. * These + * orders will not be found: * order status is `CANCELED` or `EXPIRED` + * **AND** order has NO filled trade **AND** created time + 3 days < current time * order + * create time + 90 days < current time * Either `algoId` or + * `clientAlgoId` must be sent. * `algoId` is self-increment for each + * specific `symbol` Weight: 1 + * + * @param algoId (optional) + * @param clientAlgoId (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryCurrentUmOpenAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Current UM Open Algo Order -
+ * + * @see Query + * Current UM Open Algo Order (USER_DATA) Documentation + */ + public ApiResponse queryCurrentUmOpenAlgoOrder( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { + return tradeApi.queryCurrentUmOpenAlgoOrder(algoId, clientAlgoId, recvWindow); + } + + /** + * Query Current UM Open Conditional Order Query Current UM Open Conditional Order * Either + * `strategyId` or `newClientStrategyId` must be sent. * If the queried + * order has been `CANCELED`, `TRIGGERED` or `EXPIRED`, the error + * message \"Order does not exist\" will be returned. Weight: 1 * * @param symbol (required) * @param strategyId (optional) @@ -2627,9 +2829,10 @@ public ApiResponse queryCurrentMarginOpenOr * 200 Current UM Open Conditional Order - * * + * @deprecated * @see Query - * Current UM Open Conditional Order(USER_DATA) Documentation + * Current UM Open Conditional Order Documentation */ public ApiResponse queryCurrentUmOpenConditionalOrder( @@ -2776,7 +2979,40 @@ public ApiResponse queryMarginAccountsOpenOc } /** - * Query UM Conditional Order History(USER_DATA) Query UM Conditional Order History * Either + * Query UM Algo Order History (USER_DATA) Get all algo orders; ACTIVE, CANCELED, TRIGGERED or + * FINISHED . * If `algoId` is set, it will get orders >= that + * `algoId`. Otherwise most recent orders are returned. * The query time period must + * be less then 7 days( default as the recent 7 days). Weight: 5 + * + * @param symbol (required) + * @param algoId (optional) + * @param startTime Timestamp in ms to get funding from INCLUSIVE. (optional) + * @param endTime Timestamp in ms to get funding until INCLUSIVE. (optional) + * @param limit Default 100; max 1000 (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryUmAlgoOrderHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 UM Algo Order History -
+ * + * @see Query + * UM Algo Order History (USER_DATA) Documentation + */ + public ApiResponse queryUmAlgoOrderHistory( + String symbol, Long algoId, Long startTime, Long endTime, Long limit, Long recvWindow) + throws ApiException { + return tradeApi.queryUmAlgoOrderHistory( + symbol, algoId, startTime, endTime, limit, recvWindow); + } + + /** + * Query UM Conditional Order History Query UM Conditional Order History * Either * `strategyId` or `newClientStrategyId` must be sent. * `NEW` * orders will not be found. * These orders will not be found: * order status is * `CANCELED` or `EXPIRED`, **AND** * order has NO filled trade, **AND** * @@ -2796,9 +3032,10 @@ public ApiResponse queryMarginAccountsOpenOc * 200 UM Conditional Order History - * * + * @deprecated * @see Query - * UM Conditional Order History(USER_DATA) Documentation + * UM Conditional Order History Documentation */ public ApiResponse queryUmConditionalOrderHistory( String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) @@ -2880,7 +3117,8 @@ public ApiResponse queryUmOrder( * Query User's CM Force Orders(USER_DATA) Query User's CM Force Orders * If * \"autoCloseType\" is not sent, orders with both of the types will be returned * If * \"startTime\" is not sent, data within 7 days before \"endTime\" can be - * queried Weight: 20 with symbol, 50 without symbol + * queried * Only support querying data in the past 90 days Weight: 20 with symbol, 50 without + * symbol * * @param symbol (optional) * @param autoCloseType `LIQUIDATION` for liquidation orders, `ADL` for ADL @@ -2948,7 +3186,8 @@ public ApiResponse queryUsersMarginForceOrd * Query User's UM Force Orders (USER_DATA) Query User's UM Force Orders * If * `autoCloseType` is not sent, orders with both of the types will be returned * If * `startTime` is not sent, data within 7 days before `endTime` can be - * queried Weight: 20 with symbol, 50 without symbol + * queried * Only support querying data in the past 90 days Weight: 20 with symbol, 50 without + * symbol * * @param symbol (optional) * @param autoCloseType `LIQUIDATION` for liquidation orders, `ADL` for ADL 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 11117ab70..ae2175602 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/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/6.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 9600decf6..3f1ce669b 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 @@ -23,6 +23,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.AutoCloseType; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllCmOpenConditionalOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllCmOpenOrdersResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllUmAlgoOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllUmOpenConditionalOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllUmOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelCmConditionalOrderResponse; @@ -30,10 +31,13 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelMarginAccountAllOpenOrdersOnASymbolResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelMarginAccountOcoOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelMarginAccountOrderResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelUmAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelUmConditionalOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelUmOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CmAccountTradeListResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CmPositionAdlQuantileEstimationResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.FuturesTradfiPerpsContractRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.FuturesTradfiPerpsContractResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.GetUmFuturesBnbBurnStatusResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.MarginAccountBorrowRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.MarginAccountBorrowResponse; @@ -54,6 +58,8 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewCmOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewMarginOrderRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewMarginOrderResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmConditionalOrderRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmConditionalOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.NewUmOrderRequest; @@ -62,6 +68,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCmOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentCmOpenConditionalOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentCmOpenOrdersResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentUmOpenAlgoOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentUmOpenConditionalOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentUmOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllMarginAccountOrdersResponse; @@ -73,12 +80,14 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentCmOpenConditionalOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentCmOpenOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentMarginOpenOrderResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentUmOpenAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentUmOpenConditionalOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentUmOpenOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryMarginAccountOrderResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryMarginAccountsAllOcoResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryMarginAccountsOcoResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryMarginAccountsOpenOcoResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryUmAlgoOrderHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryUmConditionalOrderHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryUmModifyOrderHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryUmOrderResponse; @@ -112,7 +121,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -434,6 +443,148 @@ public ApiResponse cancelAllCmOpenOrders( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for cancelAllUmAlgoOpenOrders + * + * @param symbol (required) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel All UM Algo Open Orders -
+ * + * @see Cancel + * All UM Algo Open Orders (TRADE) Documentation + */ + private okhttp3.Call cancelAllUmAlgoOpenOrdersCall(String symbol, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/papi/v1/um/algo/allOpenOrders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelAllUmAlgoOpenOrdersValidateBeforeCall(String symbol, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol, recvWindow}; + Method method = + this.getClass() + .getMethod("cancelAllUmAlgoOpenOrders", String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return cancelAllUmAlgoOpenOrdersCall(symbol, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Cancel All UM Algo Open Orders (TRADE) Cancel All UM Algo Open Orders Weight: 1 + * + * @param symbol (required) + * @param recvWindow (optional) + * @return ApiResponse<CancelAllUmAlgoOpenOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel All UM Algo Open Orders -
+ * + * @see Cancel + * All UM Algo Open Orders (TRADE) Documentation + */ + public ApiResponse cancelAllUmAlgoOpenOrders( + @NotNull String symbol, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = cancelAllUmAlgoOpenOrdersValidateBeforeCall(symbol, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for cancelAllUmOpenConditionalOrders * @@ -448,10 +599,12 @@ public ApiResponse cancelAllCmOpenOrders( * 200 Cancel All UM Open Conditional Orders - * * + * @deprecated * @see Cancel - * All UM Open Conditional Orders (TRADE) Documentation + * All UM Open Conditional Orders Documentation */ + @Deprecated private okhttp3.Call cancelAllUmOpenConditionalOrdersCall(String symbol, Long recvWindow) throws ApiException { String basePath = null; @@ -516,6 +669,7 @@ private okhttp3.Call cancelAllUmOpenConditionalOrdersCall(String symbol, Long re localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call cancelAllUmOpenConditionalOrdersValidateBeforeCall( String symbol, Long recvWindow) throws ApiException { @@ -551,7 +705,7 @@ private okhttp3.Call cancelAllUmOpenConditionalOrdersValidateBeforeCall( } /** - * Cancel All UM Open Conditional Orders (TRADE) Cancel All UM Open Conditional Orders Weight: 1 + * Cancel All UM Open Conditional Orders Cancel All UM Open Conditional Orders Weight: 1 * * @param symbol (required) * @param recvWindow (optional) @@ -565,10 +719,12 @@ private okhttp3.Call cancelAllUmOpenConditionalOrdersValidateBeforeCall( * 200 Cancel All UM Open Conditional Orders - * * + * @deprecated * @see Cancel - * All UM Open Conditional Orders (TRADE) Documentation + * All UM Open Conditional Orders Documentation */ + @Deprecated public ApiResponse cancelAllUmOpenConditionalOrders( @NotNull String symbol, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = @@ -1586,6 +1742,157 @@ public ApiResponse cancelMarginAccountOrder( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for cancelUmAlgoOrder + * + * @param algoId (optional) + * @param clientAlgoId (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel UM Algo Order -
+ * + * @see Cancel + * UM Algo Order (TRADE) Documentation + */ + private okhttp3.Call cancelUmAlgoOrderCall(Long algoId, String clientAlgoId, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/papi/v1/um/algo/order"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (algoId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoId", algoId)); + } + + if (clientAlgoId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("clientAlgoId", clientAlgoId)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelUmAlgoOrderValidateBeforeCall( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {algoId, clientAlgoId, recvWindow}; + Method method = + this.getClass() + .getMethod("cancelUmAlgoOrder", Long.class, String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return cancelUmAlgoOrderCall(algoId, clientAlgoId, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Cancel UM Algo Order (TRADE) Cancel an active UM algo order. * Either `algoId` or + * `clientAlgoId` must be sent. Weight: 1 + * + * @param algoId (optional) + * @param clientAlgoId (optional) + * @param recvWindow (optional) + * @return ApiResponse<CancelUmAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel UM Algo Order -
+ * + * @see Cancel + * UM Algo Order (TRADE) Documentation + */ + public ApiResponse cancelUmAlgoOrder( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + cancelUmAlgoOrderValidateBeforeCall(algoId, clientAlgoId, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for cancelUmConditionalOrder * @@ -1602,10 +1909,12 @@ public ApiResponse cancelMarginAccountOrder( * 200 Cancel UM Conditional Order - * * + * @deprecated * @see Cancel - * UM Conditional Order(TRADE) Documentation + * UM Conditional Order Documentation */ + @Deprecated private okhttp3.Call cancelUmConditionalOrderCall( String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) throws ApiException { @@ -1680,6 +1989,7 @@ private okhttp3.Call cancelUmConditionalOrderCall( localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call cancelUmConditionalOrderValidateBeforeCall( String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) @@ -1721,8 +2031,8 @@ private okhttp3.Call cancelUmConditionalOrderValidateBeforeCall( } /** - * Cancel UM Conditional Order(TRADE) Cancel UM Conditional Order * Either - * `strategyId` or `newClientStrategyId` must be sent. Weight: 1 + * Cancel UM Conditional Order Cancel UM Conditional Order * Either `strategyId` or + * `newClientStrategyId` must be sent. Weight: 1 * * @param symbol (required) * @param strategyId (optional) @@ -1738,10 +2048,12 @@ private okhttp3.Call cancelUmConditionalOrderValidateBeforeCall( * 200 Cancel UM Conditional Order - * * + * @deprecated * @see Cancel - * UM Conditional Order(TRADE) Documentation + * UM Conditional Order Documentation */ + @Deprecated public ApiResponse cancelUmConditionalOrder( @NotNull String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) throws ApiException { @@ -2284,23 +2596,25 @@ public ApiResponse cmPositionAdlQuantil } /** - * Build call for getUmFuturesBnbBurnStatus + * Build call for futuresTradfiPerpsContract * - * @param recvWindow (optional) + * @param futuresTradfiPerpsContractRequest (required) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get UM Futures BNB Burn Status -
200 Futures TradFi Perps Contract -
* * @see Get - * UM Futures BNB Burn Status (USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Futures-TradFi-Perps-Contract">Futures + * TradFi Perps Contract(USER_DATA) Documentation */ - private okhttp3.Call getUmFuturesBnbBurnStatusCall(Long recvWindow) throws ApiException { + private okhttp3.Call futuresTradfiPerpsContractCall( + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -2317,7 +2631,147 @@ private okhttp3.Call getUmFuturesBnbBurnStatusCall(Long recvWindow) throws ApiEx Object localVarPostBody = null; // create path and map variables - String localVarPath = "/papi/v1/um/feeBurn"; + String localVarPath = "/papi/v1/um/stock/contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (futuresTradfiPerpsContractRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", futuresTradfiPerpsContractRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call futuresTradfiPerpsContractValidateBeforeCall( + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {futuresTradfiPerpsContractRequest}; + Method method = + this.getClass() + .getMethod( + "futuresTradfiPerpsContract", + FuturesTradfiPerpsContractRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return futuresTradfiPerpsContractCall(futuresTradfiPerpsContractRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Futures TradFi Perps Contract(USER_DATA) Sign TradFi-Perps agreement contract Weight: 5 + * + * @param futuresTradfiPerpsContractRequest (required) + * @return ApiResponse<FuturesTradfiPerpsContractResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Futures TradFi Perps Contract -
+ * + * @see Futures + * TradFi Perps Contract(USER_DATA) Documentation + */ + public ApiResponse futuresTradfiPerpsContract( + @Valid @NotNull FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) + throws ApiException { + okhttp3.Call localVarCall = + futuresTradfiPerpsContractValidateBeforeCall(futuresTradfiPerpsContractRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getUmFuturesBnbBurnStatus + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get UM Futures BNB Burn Status -
+ * + * @see Get + * UM Futures BNB Burn Status (USER_DATA) Documentation + */ + private okhttp3.Call getUmFuturesBnbBurnStatusCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/papi/v1/um/feeBurn"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4275,24 +4729,24 @@ public ApiResponse newMarginOrder( } /** - * Build call for newUmConditionalOrder + * Build call for newUmAlgoOrder * - * @param newUmConditionalOrderRequest (required) + * @param newUmAlgoOrderRequest (required) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 New UM Conditional Order -
200 New UM Algo Order -
* * @see New - * UM Conditional Order (TRADE) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Algo-Order">New + * UM Algo Order (TRADE) Documentation */ - private okhttp3.Call newUmConditionalOrderCall( - NewUmConditionalOrderRequest newUmConditionalOrderRequest) throws ApiException { + private okhttp3.Call newUmAlgoOrderCall(NewUmAlgoOrderRequest newUmAlgoOrderRequest) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -4309,7 +4763,7 @@ private okhttp3.Call newUmConditionalOrderCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/papi/v1/um/conditional/order"; + String localVarPath = "/papi/v1/um/algo/order"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4317,94 +4771,102 @@ private okhttp3.Call newUmConditionalOrderCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (newUmConditionalOrderRequest.getSymbol() != null) { - localVarFormParams.put("symbol", newUmConditionalOrderRequest.getSymbol()); + if (newUmAlgoOrderRequest.getAlgoType() != null) { + localVarFormParams.put("algoType", newUmAlgoOrderRequest.getAlgoType()); } - if (newUmConditionalOrderRequest.getSide() != null) { - localVarFormParams.put("side", newUmConditionalOrderRequest.getSide()); + if (newUmAlgoOrderRequest.getSymbol() != null) { + localVarFormParams.put("symbol", newUmAlgoOrderRequest.getSymbol()); } - if (newUmConditionalOrderRequest.getPositionSide() != null) { - localVarFormParams.put("positionSide", newUmConditionalOrderRequest.getPositionSide()); + if (newUmAlgoOrderRequest.getSide() != null) { + localVarFormParams.put("side", newUmAlgoOrderRequest.getSide()); } - if (newUmConditionalOrderRequest.getStrategyType() != null) { - localVarFormParams.put("strategyType", newUmConditionalOrderRequest.getStrategyType()); + if (newUmAlgoOrderRequest.getPositionSide() != null) { + localVarFormParams.put("positionSide", newUmAlgoOrderRequest.getPositionSide()); } - if (newUmConditionalOrderRequest.getTimeInForce() != null) { - localVarFormParams.put("timeInForce", newUmConditionalOrderRequest.getTimeInForce()); + if (newUmAlgoOrderRequest.getType() != null) { + localVarFormParams.put("type", newUmAlgoOrderRequest.getType()); } - if (newUmConditionalOrderRequest.getQuantity() != null) { + if (newUmAlgoOrderRequest.getTimeInForce() != null) { + localVarFormParams.put("timeInForce", newUmAlgoOrderRequest.getTimeInForce()); + } + + if (newUmAlgoOrderRequest.getQuantity() != null) { localVarFormParams.put( "quantity", - DecimalFormatter.getFormatter() - .format(newUmConditionalOrderRequest.getQuantity())); + DecimalFormatter.getFormatter().format(newUmAlgoOrderRequest.getQuantity())); } - if (newUmConditionalOrderRequest.getReduceOnly() != null) { - localVarFormParams.put("reduceOnly", newUmConditionalOrderRequest.getReduceOnly()); + if (newUmAlgoOrderRequest.getPrice() != null) { + localVarFormParams.put( + "price", + DecimalFormatter.getFormatter().format(newUmAlgoOrderRequest.getPrice())); } - if (newUmConditionalOrderRequest.getPrice() != null) { + if (newUmAlgoOrderRequest.getTriggerPrice() != null) { localVarFormParams.put( - "price", + "triggerPrice", DecimalFormatter.getFormatter() - .format(newUmConditionalOrderRequest.getPrice())); + .format(newUmAlgoOrderRequest.getTriggerPrice())); } - if (newUmConditionalOrderRequest.getWorkingType() != null) { - localVarFormParams.put("workingType", newUmConditionalOrderRequest.getWorkingType()); + if (newUmAlgoOrderRequest.getWorkingType() != null) { + localVarFormParams.put("workingType", newUmAlgoOrderRequest.getWorkingType()); } - if (newUmConditionalOrderRequest.getPriceProtect() != null) { - localVarFormParams.put("priceProtect", newUmConditionalOrderRequest.getPriceProtect()); + if (newUmAlgoOrderRequest.getPriceMatch() != null) { + localVarFormParams.put("priceMatch", newUmAlgoOrderRequest.getPriceMatch()); } - if (newUmConditionalOrderRequest.getNewClientStrategyId() != null) { - localVarFormParams.put( - "newClientStrategyId", newUmConditionalOrderRequest.getNewClientStrategyId()); + if (newUmAlgoOrderRequest.getClosePosition() != null) { + localVarFormParams.put("closePosition", newUmAlgoOrderRequest.getClosePosition()); } - if (newUmConditionalOrderRequest.getStopPrice() != null) { - localVarFormParams.put( - "stopPrice", - DecimalFormatter.getFormatter() - .format(newUmConditionalOrderRequest.getStopPrice())); + if (newUmAlgoOrderRequest.getPriceProtect() != null) { + localVarFormParams.put("priceProtect", newUmAlgoOrderRequest.getPriceProtect()); } - if (newUmConditionalOrderRequest.getActivationPrice() != null) { + if (newUmAlgoOrderRequest.getReduceOnly() != null) { + localVarFormParams.put("reduceOnly", newUmAlgoOrderRequest.getReduceOnly()); + } + + if (newUmAlgoOrderRequest.getActivatePrice() != null) { localVarFormParams.put( - "activationPrice", + "activatePrice", DecimalFormatter.getFormatter() - .format(newUmConditionalOrderRequest.getActivationPrice())); + .format(newUmAlgoOrderRequest.getActivatePrice())); } - if (newUmConditionalOrderRequest.getCallbackRate() != null) { + if (newUmAlgoOrderRequest.getCallbackRate() != null) { localVarFormParams.put( "callbackRate", DecimalFormatter.getFormatter() - .format(newUmConditionalOrderRequest.getCallbackRate())); + .format(newUmAlgoOrderRequest.getCallbackRate())); } - if (newUmConditionalOrderRequest.getPriceMatch() != null) { - localVarFormParams.put("priceMatch", newUmConditionalOrderRequest.getPriceMatch()); + if (newUmAlgoOrderRequest.getClientAlgoId() != null) { + localVarFormParams.put("clientAlgoId", newUmAlgoOrderRequest.getClientAlgoId()); } - if (newUmConditionalOrderRequest.getSelfTradePreventionMode() != null) { + if (newUmAlgoOrderRequest.getNewOrderRespType() != null) { + localVarFormParams.put("newOrderRespType", newUmAlgoOrderRequest.getNewOrderRespType()); + } + + if (newUmAlgoOrderRequest.getSelfTradePreventionMode() != null) { localVarFormParams.put( - "selfTradePreventionMode", - newUmConditionalOrderRequest.getSelfTradePreventionMode()); + "selfTradePreventionMode", newUmAlgoOrderRequest.getSelfTradePreventionMode()); } - if (newUmConditionalOrderRequest.getGoodTillDate() != null) { - localVarFormParams.put("goodTillDate", newUmConditionalOrderRequest.getGoodTillDate()); + if (newUmAlgoOrderRequest.getGoodTillDate() != null) { + localVarFormParams.put("goodTillDate", newUmAlgoOrderRequest.getGoodTillDate()); } - if (newUmConditionalOrderRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", newUmConditionalOrderRequest.getRecvWindow()); + if (newUmAlgoOrderRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", newUmAlgoOrderRequest.getRecvWindow()); } final String[] localVarAccepts = {"application/json"}; @@ -4438,8 +4900,8 @@ private okhttp3.Call newUmConditionalOrderCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call newUmConditionalOrderValidateBeforeCall( - NewUmConditionalOrderRequest newUmConditionalOrderRequest) throws ApiException { + private okhttp3.Call newUmAlgoOrderValidateBeforeCall( + NewUmAlgoOrderRequest newUmAlgoOrderRequest) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -4449,15 +4911,14 @@ private okhttp3.Call newUmConditionalOrderValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {newUmConditionalOrderRequest}; + Object[] parameterValues = {newUmAlgoOrderRequest}; Method method = - this.getClass() - .getMethod("newUmConditionalOrder", NewUmConditionalOrderRequest.class); + this.getClass().getMethod("newUmAlgoOrder", NewUmAlgoOrderRequest.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return newUmConditionalOrderCall(newUmConditionalOrderRequest); + return newUmAlgoOrderCall(newUmAlgoOrderRequest); } else { throw new ConstraintViolationException((Set) violations); } @@ -4471,81 +4932,84 @@ private okhttp3.Call newUmConditionalOrderValidateBeforeCall( } /** - * New UM Conditional Order (TRADE) Place new UM conditional order * Order with type - * `STOP/TAKE_PROFIT`, parameter `timeInForce` can be sent ( default - * `GTC`). * Condition orders will be triggered when: * `STOP`, - * `STOP_MARKET`: * BUY: \"MARK_PRICE\" >= `stopPrice` * - * SELL: \"MARK_PRICE\" <= `stopPrice` * `TAKE_PROFIT`, - * `TAKE_PROFIT_MARKET`: * BUY: \"MARK_PRICE\" <= - * `stopPrice` * SELL: \"MARK_PRICE\" >= `stopPrice` * - * `TRAILING_STOP_MARKET`: * BUY: the lowest mark price after order placed - * `<= `activationPrice`, and the latest mark price >`= the - * lowest mark price * (1 + `callbackRate`) * SELL: the highest mark price after order - * placed >= `activationPrice`, and the latest mark price <= the - * highest mark price * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, - * if you got such error code. `{\"code\": -2021, \"msg\": \"Order - * would immediately trigger.\"}` means that the parameters you send do not meet the - * following requirements: * BUY: `activationPrice` should be smaller than latest mark - * price. * SELL: `activationPrice` should be larger than latest mark price. * - * Condition orders will be triggered when: * If parameter`priceProtect`is sent as - * true: * when price reaches the `stopPrice` ,the difference rate between - * \"MARK_PRICE\" and \"CONTRACT_PRICE\" cannot be larger than the - * \"triggerProtect\" of the symbol * \"triggerProtect\" of a symbol can be - * got from `GET /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * - * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= - * `stopPrice` * SELL: latest price (\"MARK_PRICE\" or - * \"CONTRACT_PRICE\") <= `stopPrice` * `TAKE_PROFIT`, + * New UM Algo Order (TRADE) Place new UM conditional order * Algo order with type + * `STOP`, parameter `timeInForce` can be sent ( default `GTC`). * + * Algo order with type `TAKE_PROFIT`, parameter `timeInForce` can be sent ( + * default `GTC`). * Condition orders will be triggered when: * If + * parameter`priceProtect`is sent as true: * when price reaches the + * `triggerPrice` , the difference rate between \"MARK_PRICE\" and + * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the + * symbol * \"triggerProtect\" of a symbol can be got from `GET + * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or - * \"CONTRACT_PRICE\") <= `stopPrice` * SELL: latest price - * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `stopPrice` * + * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after + * order placed <= `activatePrice`, and the latest price >= the lowest + * price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activatePrice`, and the latest price <= the highest price * (1 + * - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * code. ``{\"code\": -2021, \"msg\": \"Order would + * immediately trigger.\"}`` means that the parameters you send do not meet the + * following requirements: * BUY: `activatePrice` should be smaller than latest price. + * * SELL: `activatePrice` should be larger than latest price. * + * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with + * `closePosition`=`true`: * Follow the same rules for condition + * orders. * If triggered, **close all** current long position( if `SELL`) or current + * short position( if `BUY`). * Cannot be used with `quantity` paremeter * + * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with + * `BUY` orders in `LONG` position side. and cannot be used with + * `SELL` orders in `SHORT` position side * * `selfTradePreventionMode` is only effective when `timeInForce` set to - * `IOC` or `GTC` or `GTD`. * In extreme market conditions, - * timeInForce `GTD` order auto cancel time might be delayed comparing to - * `goodTillDate` Weight: 1 + * `IOC` or `GTC` or `GTD`. Weight: 1 * - * @param newUmConditionalOrderRequest (required) - * @return ApiResponse<NewUmConditionalOrderResponse> + * @param newUmAlgoOrderRequest (required) + * @return ApiResponse<NewUmAlgoOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 New UM Conditional Order -
200 New UM Algo Order -
* * @see New - * UM Conditional Order (TRADE) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Algo-Order">New + * UM Algo Order (TRADE) Documentation */ - public ApiResponse newUmConditionalOrder( - @Valid @NotNull NewUmConditionalOrderRequest newUmConditionalOrderRequest) - throws ApiException { - okhttp3.Call localVarCall = - newUmConditionalOrderValidateBeforeCall(newUmConditionalOrderRequest); + public ApiResponse newUmAlgoOrder( + @Valid @NotNull NewUmAlgoOrderRequest newUmAlgoOrderRequest) throws ApiException { + okhttp3.Call localVarCall = newUmAlgoOrderValidateBeforeCall(newUmAlgoOrderRequest); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for newUmOrder + * Build call for newUmConditionalOrder * - * @param newUmOrderRequest (required) + * @param newUmConditionalOrderRequest (required) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 New UM Order -
200 New UM Conditional Order -
* + * @deprecated * @see New - * UM Order (TRADE) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order">New + * UM Conditional Order Documentation */ - private okhttp3.Call newUmOrderCall(NewUmOrderRequest newUmOrderRequest) throws ApiException { + @Deprecated + private okhttp3.Call newUmConditionalOrderCall( + NewUmConditionalOrderRequest newUmConditionalOrderRequest) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -4562,7 +5026,7 @@ private okhttp3.Call newUmOrderCall(NewUmOrderRequest newUmOrderRequest) throws Object localVarPostBody = null; // create path and map variables - String localVarPath = "/papi/v1/um/order"; + String localVarPath = "/papi/v1/um/conditional/order"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4570,20 +5034,276 @@ private okhttp3.Call newUmOrderCall(NewUmOrderRequest newUmOrderRequest) throws Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (newUmOrderRequest.getSymbol() != null) { - localVarFormParams.put("symbol", newUmOrderRequest.getSymbol()); + if (newUmConditionalOrderRequest.getSymbol() != null) { + localVarFormParams.put("symbol", newUmConditionalOrderRequest.getSymbol()); } - if (newUmOrderRequest.getSide() != null) { - localVarFormParams.put("side", newUmOrderRequest.getSide()); + if (newUmConditionalOrderRequest.getSide() != null) { + localVarFormParams.put("side", newUmConditionalOrderRequest.getSide()); } - if (newUmOrderRequest.getPositionSide() != null) { - localVarFormParams.put("positionSide", newUmOrderRequest.getPositionSide()); + if (newUmConditionalOrderRequest.getPositionSide() != null) { + localVarFormParams.put("positionSide", newUmConditionalOrderRequest.getPositionSide()); } - if (newUmOrderRequest.getType() != null) { - localVarFormParams.put("type", newUmOrderRequest.getType()); + if (newUmConditionalOrderRequest.getStrategyType() != null) { + localVarFormParams.put("strategyType", newUmConditionalOrderRequest.getStrategyType()); + } + + if (newUmConditionalOrderRequest.getTimeInForce() != null) { + localVarFormParams.put("timeInForce", newUmConditionalOrderRequest.getTimeInForce()); + } + + if (newUmConditionalOrderRequest.getQuantity() != null) { + localVarFormParams.put( + "quantity", + DecimalFormatter.getFormatter() + .format(newUmConditionalOrderRequest.getQuantity())); + } + + if (newUmConditionalOrderRequest.getReduceOnly() != null) { + localVarFormParams.put("reduceOnly", newUmConditionalOrderRequest.getReduceOnly()); + } + + if (newUmConditionalOrderRequest.getPrice() != null) { + localVarFormParams.put( + "price", + DecimalFormatter.getFormatter() + .format(newUmConditionalOrderRequest.getPrice())); + } + + if (newUmConditionalOrderRequest.getWorkingType() != null) { + localVarFormParams.put("workingType", newUmConditionalOrderRequest.getWorkingType()); + } + + if (newUmConditionalOrderRequest.getPriceProtect() != null) { + localVarFormParams.put("priceProtect", newUmConditionalOrderRequest.getPriceProtect()); + } + + if (newUmConditionalOrderRequest.getNewClientStrategyId() != null) { + localVarFormParams.put( + "newClientStrategyId", newUmConditionalOrderRequest.getNewClientStrategyId()); + } + + if (newUmConditionalOrderRequest.getStopPrice() != null) { + localVarFormParams.put( + "stopPrice", + DecimalFormatter.getFormatter() + .format(newUmConditionalOrderRequest.getStopPrice())); + } + + if (newUmConditionalOrderRequest.getActivationPrice() != null) { + localVarFormParams.put( + "activationPrice", + DecimalFormatter.getFormatter() + .format(newUmConditionalOrderRequest.getActivationPrice())); + } + + if (newUmConditionalOrderRequest.getCallbackRate() != null) { + localVarFormParams.put( + "callbackRate", + DecimalFormatter.getFormatter() + .format(newUmConditionalOrderRequest.getCallbackRate())); + } + + if (newUmConditionalOrderRequest.getPriceMatch() != null) { + localVarFormParams.put("priceMatch", newUmConditionalOrderRequest.getPriceMatch()); + } + + if (newUmConditionalOrderRequest.getSelfTradePreventionMode() != null) { + localVarFormParams.put( + "selfTradePreventionMode", + newUmConditionalOrderRequest.getSelfTradePreventionMode()); + } + + if (newUmConditionalOrderRequest.getGoodTillDate() != null) { + localVarFormParams.put("goodTillDate", newUmConditionalOrderRequest.getGoodTillDate()); + } + + if (newUmConditionalOrderRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", newUmConditionalOrderRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private okhttp3.Call newUmConditionalOrderValidateBeforeCall( + NewUmConditionalOrderRequest newUmConditionalOrderRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {newUmConditionalOrderRequest}; + Method method = + this.getClass() + .getMethod("newUmConditionalOrder", NewUmConditionalOrderRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return newUmConditionalOrderCall(newUmConditionalOrderRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * New UM Conditional Order Place new UM conditional order * Order with type + * `STOP/TAKE_PROFIT`, parameter `timeInForce` can be sent ( default + * `GTC`). * Condition orders will be triggered when: * `STOP`, + * `STOP_MARKET`: * BUY: \"MARK_PRICE\" >= `stopPrice` * + * SELL: \"MARK_PRICE\" <= `stopPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: \"MARK_PRICE\" <= + * `stopPrice` * SELL: \"MARK_PRICE\" >= `stopPrice` * + * `TRAILING_STOP_MARKET`: * BUY: the lowest mark price after order placed + * `<= `activationPrice`, and the latest mark price >`= the + * lowest mark price * (1 + `callbackRate`) * SELL: the highest mark price after order + * placed >= `activationPrice`, and the latest mark price <= the + * highest mark price * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, + * if you got such error code. `{\"code\": -2021, \"msg\": \"Order + * would immediately trigger.\"}` means that the parameters you send do not meet the + * following requirements: * BUY: `activationPrice` should be smaller than latest mark + * price. * SELL: `activationPrice` should be larger than latest mark price. * + * Condition orders will be triggered when: * If parameter`priceProtect`is sent as + * true: * when price reaches the `stopPrice` ,the difference rate between + * \"MARK_PRICE\" and \"CONTRACT_PRICE\" cannot be larger than the + * \"triggerProtect\" of the symbol * \"triggerProtect\" of a symbol can be + * got from `GET /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * + * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `stopPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `stopPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `stopPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `stopPrice` * + * `selfTradePreventionMode` is only effective when `timeInForce` set to + * `IOC` or `GTC` or `GTD`. * In extreme market conditions, + * timeInForce `GTD` order auto cancel time might be delayed comparing to + * `goodTillDate` Weight: 1 + * + * @param newUmConditionalOrderRequest (required) + * @return ApiResponse<NewUmConditionalOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 New UM Conditional Order -
+ * + * @deprecated + * @see New + * UM Conditional Order Documentation + */ + @Deprecated + public ApiResponse newUmConditionalOrder( + @Valid @NotNull NewUmConditionalOrderRequest newUmConditionalOrderRequest) + throws ApiException { + okhttp3.Call localVarCall = + newUmConditionalOrderValidateBeforeCall(newUmConditionalOrderRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for newUmOrder + * + * @param newUmOrderRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 New UM Order -
+ * + * @see New + * UM Order (TRADE) Documentation + */ + private okhttp3.Call newUmOrderCall(NewUmOrderRequest newUmOrderRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/papi/v1/um/order"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (newUmOrderRequest.getSymbol() != null) { + localVarFormParams.put("symbol", newUmOrderRequest.getSymbol()); + } + + if (newUmOrderRequest.getSide() != null) { + localVarFormParams.put("side", newUmOrderRequest.getSide()); + } + + if (newUmOrderRequest.getPositionSide() != null) { + localVarFormParams.put("positionSide", newUmOrderRequest.getPositionSide()); + } + + if (newUmOrderRequest.getType() != null) { + localVarFormParams.put("type", newUmOrderRequest.getType()); } if (newUmOrderRequest.getTimeInForce() != null) { @@ -5144,15 +5864,166 @@ public ApiResponse queryAllCmOrders( * * * - * + * + *
Response Details
Status Code Description Response Headers
200 All Current CM Open Conditional Orders -
200 All Current CM Open Conditional Orders -
+ * + * @see Query + * All Current CM Open Conditional Orders (USER_DATA) Documentation + */ + private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersCall(String symbol, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/papi/v1/cm/conditional/openOrders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersValidateBeforeCall( + String symbol, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol, recvWindow}; + Method method = + this.getClass() + .getMethod( + "queryAllCurrentCmOpenConditionalOrders", + String.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return queryAllCurrentCmOpenConditionalOrdersCall(symbol, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Query All Current CM Open Conditional Orders (USER_DATA) Get all open conditional orders on a + * symbol. **Careful** when accessing this with no symbol. * If the symbol is not sent, orders + * for all symbols will be returned in an array. Weight: 1 for a single symbol; 40 when the + * symbol parameter is omitted + * + * @param symbol (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryAllCurrentCmOpenConditionalOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 All Current CM Open Conditional Orders -
+ * + * @see Query + * All Current CM Open Conditional Orders (USER_DATA) Documentation + */ + public ApiResponse + queryAllCurrentCmOpenConditionalOrders(String symbol, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + queryAllCurrentCmOpenConditionalOrdersValidateBeforeCall(symbol, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for queryAllCurrentCmOpenOrders + * + * @param symbol (optional) + * @param pair (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * *
Response Details
Status Code Description Response Headers
200 All Current CM Open Orders -
* * @see Query - * All Current CM Open Conditional Orders (USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders">Query + * All Current CM Open Orders(USER_DATA) Documentation */ - private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersCall(String symbol, Long recvWindow) - throws ApiException { + private okhttp3.Call queryAllCurrentCmOpenOrdersCall( + String symbol, String pair, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -5169,7 +6040,7 @@ private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersCall(String symbol, L Object localVarPostBody = null; // create path and map variables - String localVarPath = "/papi/v1/cm/conditional/openOrders"; + String localVarPath = "/papi/v1/cm/openOrders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5181,6 +6052,10 @@ private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersCall(String symbol, L localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); } + if (pair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pair", pair)); + } + if (recvWindow != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } @@ -5216,8 +6091,8 @@ private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersCall(String symbol, L } @SuppressWarnings("rawtypes") - private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersValidateBeforeCall( - String symbol, Long recvWindow) throws ApiException { + private okhttp3.Call queryAllCurrentCmOpenOrdersValidateBeforeCall( + String symbol, String pair, Long recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -5227,18 +6102,19 @@ private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, recvWindow}; + Object[] parameterValues = {symbol, pair, recvWindow}; Method method = this.getClass() .getMethod( - "queryAllCurrentCmOpenConditionalOrders", + "queryAllCurrentCmOpenOrders", + String.class, String.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return queryAllCurrentCmOpenConditionalOrdersCall(symbol, recvWindow); + return queryAllCurrentCmOpenOrdersCall(symbol, pair, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -5252,42 +6128,42 @@ private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersValidateBeforeCall( } /** - * Query All Current CM Open Conditional Orders (USER_DATA) Get all open conditional orders on a - * symbol. **Careful** when accessing this with no symbol. * If the symbol is not sent, orders - * for all symbols will be returned in an array. Weight: 1 for a single symbol; 40 when the - * symbol parameter is omitted + * Query All Current CM Open Orders(USER_DATA) Get all open orders on a symbol. * If the symbol + * is not sent, orders for all symbols will be returned in an array. Weight: 1 for a single + * symbol; 40 when the symbol parameter is omitted Careful when accessing this with no symbol. * * @param symbol (optional) + * @param pair (optional) * @param recvWindow (optional) - * @return ApiResponse<QueryAllCurrentCmOpenConditionalOrdersResponse> + * @return ApiResponse<QueryAllCurrentCmOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 All Current CM Open Conditional Orders -
200 All Current CM Open Orders -
* * @see Query - * All Current CM Open Conditional Orders (USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders">Query + * All Current CM Open Orders(USER_DATA) Documentation */ - public ApiResponse - queryAllCurrentCmOpenConditionalOrders(String symbol, Long recvWindow) - throws ApiException { + public ApiResponse queryAllCurrentCmOpenOrders( + String symbol, String pair, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - queryAllCurrentCmOpenConditionalOrdersValidateBeforeCall(symbol, recvWindow); + queryAllCurrentCmOpenOrdersValidateBeforeCall(symbol, pair, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for queryAllCurrentCmOpenOrders + * Build call for queryAllCurrentUmOpenAlgoOrders * + * @param algoType (optional) * @param symbol (optional) - * @param pair (optional) + * @param algoId (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5295,15 +6171,15 @@ private okhttp3.Call queryAllCurrentCmOpenConditionalOrdersValidateBeforeCall( * * * - * + * *
Response Details
Status Code Description Response Headers
200 All Current CM Open Orders -
200 All Current UM Open Algo Orders -
* * @see Query - * All Current CM Open Orders(USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Algo-Orders">Query + * All Current UM Open Algo Orders (USER_DATA) Documentation */ - private okhttp3.Call queryAllCurrentCmOpenOrdersCall( - String symbol, String pair, Long recvWindow) throws ApiException { + private okhttp3.Call queryAllCurrentUmOpenAlgoOrdersCall( + String algoType, String symbol, Long algoId, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -5320,7 +6196,7 @@ private okhttp3.Call queryAllCurrentCmOpenOrdersCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/papi/v1/cm/openOrders"; + String localVarPath = "/papi/v1/um/algo/openAlgoOrders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5328,12 +6204,16 @@ private okhttp3.Call queryAllCurrentCmOpenOrdersCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (algoType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoType", algoType)); + } + if (symbol != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); } - if (pair != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pair", pair)); + if (algoId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoId", algoId)); } if (recvWindow != null) { @@ -5371,8 +6251,8 @@ private okhttp3.Call queryAllCurrentCmOpenOrdersCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call queryAllCurrentCmOpenOrdersValidateBeforeCall( - String symbol, String pair, Long recvWindow) throws ApiException { + private okhttp3.Call queryAllCurrentUmOpenAlgoOrdersValidateBeforeCall( + String algoType, String symbol, Long algoId, Long recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -5382,19 +6262,20 @@ private okhttp3.Call queryAllCurrentCmOpenOrdersValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, pair, recvWindow}; + Object[] parameterValues = {algoType, symbol, algoId, recvWindow}; Method method = this.getClass() .getMethod( - "queryAllCurrentCmOpenOrders", + "queryAllCurrentUmOpenAlgoOrders", String.class, String.class, + Long.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return queryAllCurrentCmOpenOrdersCall(symbol, pair, recvWindow); + return queryAllCurrentUmOpenAlgoOrdersCall(algoType, symbol, algoId, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -5408,33 +6289,36 @@ private okhttp3.Call queryAllCurrentCmOpenOrdersValidateBeforeCall( } /** - * Query All Current CM Open Orders(USER_DATA) Get all open orders on a symbol. * If the symbol - * is not sent, orders for all symbols will be returned in an array. Weight: 1 for a single - * symbol; 40 when the symbol parameter is omitted Careful when accessing this with no symbol. + * Query All Current UM Open Algo Orders (USER_DATA) Get all UM open algo orders on a symbol. * + * If the symbol is not sent, orders for all symbols will be returned in an array. Weight: 1 for + * a single symbol; 40 when the symbol parameter is omitted Careful when accessing this with no + * symbol. * + * @param algoType (optional) * @param symbol (optional) - * @param pair (optional) + * @param algoId (optional) * @param recvWindow (optional) - * @return ApiResponse<QueryAllCurrentCmOpenOrdersResponse> + * @return ApiResponse<QueryAllCurrentUmOpenAlgoOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 All Current CM Open Orders -
200 All Current UM Open Algo Orders -
* * @see Query - * All Current CM Open Orders(USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Algo-Orders">Query + * All Current UM Open Algo Orders (USER_DATA) Documentation */ - public ApiResponse queryAllCurrentCmOpenOrders( - String symbol, String pair, Long recvWindow) throws ApiException { + public ApiResponse queryAllCurrentUmOpenAlgoOrders( + String algoType, String symbol, Long algoId, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - queryAllCurrentCmOpenOrdersValidateBeforeCall(symbol, pair, recvWindow); + queryAllCurrentUmOpenAlgoOrdersValidateBeforeCall( + algoType, symbol, algoId, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -5452,10 +6336,12 @@ public ApiResponse queryAllCurrentCmOpenOrd * 200 All Current UM Open Conditional Orders - * * + * @deprecated * @see Query - * All Current UM Open Conditional Orders(USER_DATA) Documentation + * All Current UM Open Conditional Orders Documentation */ + @Deprecated private okhttp3.Call queryAllCurrentUmOpenConditionalOrdersCall(String symbol, Long recvWindow) throws ApiException { String basePath = null; @@ -5520,6 +6406,7 @@ private okhttp3.Call queryAllCurrentUmOpenConditionalOrdersCall(String symbol, L localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call queryAllCurrentUmOpenConditionalOrdersValidateBeforeCall( String symbol, Long recvWindow) throws ApiException { @@ -5557,10 +6444,10 @@ private okhttp3.Call queryAllCurrentUmOpenConditionalOrdersValidateBeforeCall( } /** - * Query All Current UM Open Conditional Orders(USER_DATA) Get all open conditional orders on a - * symbol. * If the symbol is not sent, orders for all symbols will be returned in an array. - * Weight: 1 for a single symbol; 40 when the symbol parameter is omitted Careful when accessing - * this with no symbol. + * Query All Current UM Open Conditional Orders Get all open conditional orders on a symbol. * + * If the symbol is not sent, orders for all symbols will be returned in an array. Weight: 1 for + * a single symbol; 40 when the symbol parameter is omitted Careful when accessing this with no + * symbol. * * @param symbol (optional) * @param recvWindow (optional) @@ -5574,10 +6461,12 @@ private okhttp3.Call queryAllCurrentUmOpenConditionalOrdersValidateBeforeCall( * 200 All Current UM Open Conditional Orders - * * + * @deprecated * @see Query - * All Current UM Open Conditional Orders(USER_DATA) Documentation + * All Current UM Open Conditional Orders Documentation */ + @Deprecated public ApiResponse queryAllCurrentUmOpenConditionalOrders(String symbol, Long recvWindow) throws ApiException { @@ -5935,10 +6824,12 @@ public ApiResponse queryAllMarginAccountOrd * 200 All UM Conditional Orders - * * + * @deprecated * @see Query - * All UM Conditional Orders(USER_DATA) Documentation + * All UM Conditional Orders Documentation */ + @Deprecated private okhttp3.Call queryAllUmConditionalOrdersCall( String symbol, Long strategyId, @@ -6025,6 +6916,7 @@ private okhttp3.Call queryAllUmConditionalOrdersCall( localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call queryAllUmConditionalOrdersValidateBeforeCall( String symbol, @@ -6073,11 +6965,11 @@ private okhttp3.Call queryAllUmConditionalOrdersValidateBeforeCall( } /** - * Query All UM Conditional Orders(USER_DATA) Query All UM Conditional Orders * These orders - * will not be found: * order strategyStatus is `CANCELED` or `EXPIRED`, - * **AND** * order has NO filled trade, **AND** * created time + 7 days < current time * The - * query time period must be less than 7 days( default as the recent 7 days). Weight: 1 for a - * single symbol; 40 when the symbol parameter is omitted + * Query All UM Conditional Orders Query All UM Conditional Orders * These orders will not be + * found: * order strategyStatus is `CANCELED` or `EXPIRED`, **AND** * order + * has NO filled trade, **AND** * created time + 7 days < current time * The query time + * period must be less than 7 days( default as the recent 7 days). Weight: 1 for a single + * symbol; 40 when the symbol parameter is omitted * * @param symbol (optional) * @param strategyId (optional) @@ -6095,10 +6987,12 @@ private okhttp3.Call queryAllUmConditionalOrdersValidateBeforeCall( * 200 All UM Conditional Orders - * * + * @deprecated * @see Query - * All UM Conditional Orders(USER_DATA) Documentation + * All UM Conditional Orders Documentation */ + @Deprecated public ApiResponse queryAllUmConditionalOrders( String symbol, Long strategyId, @@ -7023,11 +7917,177 @@ private okhttp3.Call queryCurrentCmOpenConditionalOrderValidateBeforeCall( } /** - * Build call for queryCurrentCmOpenOrder + * Build call for queryCurrentCmOpenOrder + * + * @param symbol (required) + * @param orderId (optional) + * @param origClientOrderId (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Current CM Open Order -
+ * + * @see Query + * Current CM Open Order (USER_DATA) Documentation + */ + private okhttp3.Call queryCurrentCmOpenOrderCall( + String symbol, Long orderId, String origClientOrderId, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/papi/v1/cm/openOrder"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + if (orderId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderId", orderId)); + } + + if (origClientOrderId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("origClientOrderId", origClientOrderId)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryCurrentCmOpenOrderValidateBeforeCall( + String symbol, Long orderId, String origClientOrderId, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol, orderId, origClientOrderId, recvWindow}; + Method method = + this.getClass() + .getMethod( + "queryCurrentCmOpenOrder", + String.class, + Long.class, + String.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return queryCurrentCmOpenOrderCall(symbol, orderId, origClientOrderId, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Query Current CM Open Order (USER_DATA) Query current CM open order * Either + * `orderId` or `origClientOrderId` must be sent. * If the queried order has + * been filled or cancelled, the error message \"Order does not exist\" will be + * returned. Weight: 1 + * + * @param symbol (required) + * @param orderId (optional) + * @param origClientOrderId (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryCurrentCmOpenOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Current CM Open Order -
+ * + * @see Query + * Current CM Open Order (USER_DATA) Documentation + */ + public ApiResponse queryCurrentCmOpenOrder( + @NotNull String symbol, Long orderId, String origClientOrderId, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + queryCurrentCmOpenOrderValidateBeforeCall( + symbol, orderId, origClientOrderId, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for queryCurrentMarginOpenOrder * * @param symbol (required) - * @param orderId (optional) - * @param origClientOrderId (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -7035,15 +8095,14 @@ private okhttp3.Call queryCurrentCmOpenConditionalOrderValidateBeforeCall( * * * - * + * *
Response Details
Status Code Description Response Headers
200 Current CM Open Order -
200 Current Margin Open Order -
* * @see Query - * Current CM Open Order (USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order">Query + * Current Margin Open Order (USER_DATA) Documentation */ - private okhttp3.Call queryCurrentCmOpenOrderCall( - String symbol, Long orderId, String origClientOrderId, Long recvWindow) + private okhttp3.Call queryCurrentMarginOpenOrderCall(String symbol, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -7061,7 +8120,7 @@ private okhttp3.Call queryCurrentCmOpenOrderCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/papi/v1/cm/openOrder"; + String localVarPath = "/papi/v1/margin/openOrders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -7073,15 +8132,6 @@ private okhttp3.Call queryCurrentCmOpenOrderCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); } - if (orderId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderId", orderId)); - } - - if (origClientOrderId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("origClientOrderId", origClientOrderId)); - } - if (recvWindow != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } @@ -7117,9 +8167,8 @@ private okhttp3.Call queryCurrentCmOpenOrderCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call queryCurrentCmOpenOrderValidateBeforeCall( - String symbol, Long orderId, String origClientOrderId, Long recvWindow) - throws ApiException { + private okhttp3.Call queryCurrentMarginOpenOrderValidateBeforeCall( + String symbol, Long recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -7129,20 +8178,15 @@ private okhttp3.Call queryCurrentCmOpenOrderValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, orderId, origClientOrderId, recvWindow}; + Object[] parameterValues = {symbol, recvWindow}; Method method = this.getClass() - .getMethod( - "queryCurrentCmOpenOrder", - String.class, - Long.class, - String.class, - Long.class); + .getMethod("queryCurrentMarginOpenOrder", String.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return queryCurrentCmOpenOrderCall(symbol, orderId, origClientOrderId, recvWindow); + return queryCurrentMarginOpenOrderCall(symbol, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -7156,44 +8200,38 @@ private okhttp3.Call queryCurrentCmOpenOrderValidateBeforeCall( } /** - * Query Current CM Open Order (USER_DATA) Query current CM open order * Either - * `orderId` or `origClientOrderId` must be sent. * If the queried order has - * been filled or cancelled, the error message \"Order does not exist\" will be - * returned. Weight: 1 + * Query Current Margin Open Order (USER_DATA) Query Current Margin Open Order Weight: 5 * * @param symbol (required) - * @param orderId (optional) - * @param origClientOrderId (optional) * @param recvWindow (optional) - * @return ApiResponse<QueryCurrentCmOpenOrderResponse> + * @return ApiResponse<QueryCurrentMarginOpenOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Current CM Open Order -
200 Current Margin Open Order -
* * @see Query - * Current CM Open Order (USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order">Query + * Current Margin Open Order (USER_DATA) Documentation */ - public ApiResponse queryCurrentCmOpenOrder( - @NotNull String symbol, Long orderId, String origClientOrderId, Long recvWindow) - throws ApiException { + public ApiResponse queryCurrentMarginOpenOrder( + @NotNull String symbol, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - queryCurrentCmOpenOrderValidateBeforeCall( - symbol, orderId, origClientOrderId, recvWindow); + queryCurrentMarginOpenOrderValidateBeforeCall(symbol, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for queryCurrentMarginOpenOrder + * Build call for queryCurrentUmOpenAlgoOrder * - * @param symbol (required) + * @param algoId (optional) + * @param clientAlgoId (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -7201,15 +8239,15 @@ public ApiResponse queryCurrentCmOpenOrder( * * * - * + * *
Response Details
Status Code Description Response Headers
200 Current Margin Open Order -
200 Current UM Open Algo Order -
* * @see Query - * Current Margin Open Order (USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Algo-Order">Query + * Current UM Open Algo Order (USER_DATA) Documentation */ - private okhttp3.Call queryCurrentMarginOpenOrderCall(String symbol, Long recvWindow) - throws ApiException { + private okhttp3.Call queryCurrentUmOpenAlgoOrderCall( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -7226,7 +8264,7 @@ private okhttp3.Call queryCurrentMarginOpenOrderCall(String symbol, Long recvWin Object localVarPostBody = null; // create path and map variables - String localVarPath = "/papi/v1/margin/openOrders"; + String localVarPath = "/papi/v1/um/algo/algoOrder"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -7234,8 +8272,13 @@ private okhttp3.Call queryCurrentMarginOpenOrderCall(String symbol, Long recvWin Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (symbol != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + if (algoId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoId", algoId)); + } + + if (clientAlgoId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("clientAlgoId", clientAlgoId)); } if (recvWindow != null) { @@ -7273,8 +8316,8 @@ private okhttp3.Call queryCurrentMarginOpenOrderCall(String symbol, Long recvWin } @SuppressWarnings("rawtypes") - private okhttp3.Call queryCurrentMarginOpenOrderValidateBeforeCall( - String symbol, Long recvWindow) throws ApiException { + private okhttp3.Call queryCurrentUmOpenAlgoOrderValidateBeforeCall( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -7284,15 +8327,19 @@ private okhttp3.Call queryCurrentMarginOpenOrderValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, recvWindow}; + Object[] parameterValues = {algoId, clientAlgoId, recvWindow}; Method method = this.getClass() - .getMethod("queryCurrentMarginOpenOrder", String.class, Long.class); + .getMethod( + "queryCurrentUmOpenAlgoOrder", + Long.class, + String.class, + Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return queryCurrentMarginOpenOrderCall(symbol, recvWindow); + return queryCurrentUmOpenAlgoOrderCall(algoId, clientAlgoId, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -7306,30 +8353,36 @@ private okhttp3.Call queryCurrentMarginOpenOrderValidateBeforeCall( } /** - * Query Current Margin Open Order (USER_DATA) Query Current Margin Open Order Weight: 5 - * - * @param symbol (required) + * Query Current UM Open Algo Order (USER_DATA) Check an UM algo order's status. * These + * orders will not be found: * order status is `CANCELED` or `EXPIRED` + * **AND** order has NO filled trade **AND** created time + 3 days < current time * order + * create time + 90 days < current time * Either `algoId` or + * `clientAlgoId` must be sent. * `algoId` is self-increment for each + * specific `symbol` Weight: 1 + * + * @param algoId (optional) + * @param clientAlgoId (optional) * @param recvWindow (optional) - * @return ApiResponse<QueryCurrentMarginOpenOrderResponse> + * @return ApiResponse<QueryCurrentUmOpenAlgoOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Current Margin Open Order -
200 Current UM Open Algo Order -
* * @see Query - * Current Margin Open Order (USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Algo-Order">Query + * Current UM Open Algo Order (USER_DATA) Documentation */ - public ApiResponse queryCurrentMarginOpenOrder( - @NotNull String symbol, Long recvWindow) throws ApiException { + public ApiResponse queryCurrentUmOpenAlgoOrder( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - queryCurrentMarginOpenOrderValidateBeforeCall(symbol, recvWindow); + queryCurrentUmOpenAlgoOrderValidateBeforeCall(algoId, clientAlgoId, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -7349,10 +8402,12 @@ public ApiResponse queryCurrentMarginOpenOr * 200 Current UM Open Conditional Order - * * + * @deprecated * @see Query - * Current UM Open Conditional Order(USER_DATA) Documentation + * Current UM Open Conditional Order Documentation */ + @Deprecated private okhttp3.Call queryCurrentUmOpenConditionalOrderCall( String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) throws ApiException { @@ -7427,6 +8482,7 @@ private okhttp3.Call queryCurrentUmOpenConditionalOrderCall( localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call queryCurrentUmOpenConditionalOrderValidateBeforeCall( String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) @@ -7468,10 +8524,10 @@ private okhttp3.Call queryCurrentUmOpenConditionalOrderValidateBeforeCall( } /** - * Query Current UM Open Conditional Order(USER_DATA) Query Current UM Open Conditional Order * - * Either `strategyId` or `newClientStrategyId` must be sent. * If the - * queried order has been `CANCELED`, `TRIGGERED` or `EXPIRED`, - * the error message \"Order does not exist\" will be returned. Weight: 1 + * Query Current UM Open Conditional Order Query Current UM Open Conditional Order * Either + * `strategyId` or `newClientStrategyId` must be sent. * If the queried + * order has been `CANCELED`, `TRIGGERED` or `EXPIRED`, the error + * message \"Order does not exist\" will be returned. Weight: 1 * * @param symbol (required) * @param strategyId (optional) @@ -7487,10 +8543,12 @@ private okhttp3.Call queryCurrentUmOpenConditionalOrderValidateBeforeCall( * 200 Current UM Open Conditional Order - * * + * @deprecated * @see Query - * Current UM Open Conditional Order(USER_DATA) Documentation + * Current UM Open Conditional Order Documentation */ + @Deprecated public ApiResponse queryCurrentUmOpenConditionalOrder( @NotNull String symbol, @@ -8300,6 +9358,193 @@ public ApiResponse queryMarginAccountsOpenOc return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for queryUmAlgoOrderHistory + * + * @param symbol (required) + * @param algoId (optional) + * @param startTime Timestamp in ms to get funding from INCLUSIVE. (optional) + * @param endTime Timestamp in ms to get funding until INCLUSIVE. (optional) + * @param limit Default 100; max 1000 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 UM Algo Order History -
+ * + * @see Query + * UM Algo Order History (USER_DATA) Documentation + */ + private okhttp3.Call queryUmAlgoOrderHistoryCall( + String symbol, Long algoId, Long startTime, Long endTime, Long limit, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/papi/v1/um/algo/allAlgoOrders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + if (algoId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoId", algoId)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryUmAlgoOrderHistoryValidateBeforeCall( + String symbol, Long algoId, Long startTime, Long endTime, Long limit, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol, algoId, startTime, endTime, limit, recvWindow}; + Method method = + this.getClass() + .getMethod( + "queryUmAlgoOrderHistory", + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return queryUmAlgoOrderHistoryCall( + symbol, algoId, startTime, endTime, limit, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Query UM Algo Order History (USER_DATA) Get all algo orders; ACTIVE, CANCELED, TRIGGERED or + * FINISHED . * If `algoId` is set, it will get orders >= that + * `algoId`. Otherwise most recent orders are returned. * The query time period must + * be less then 7 days( default as the recent 7 days). Weight: 5 + * + * @param symbol (required) + * @param algoId (optional) + * @param startTime Timestamp in ms to get funding from INCLUSIVE. (optional) + * @param endTime Timestamp in ms to get funding until INCLUSIVE. (optional) + * @param limit Default 100; max 1000 (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryUmAlgoOrderHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 UM Algo Order History -
+ * + * @see Query + * UM Algo Order History (USER_DATA) Documentation + */ + public ApiResponse queryUmAlgoOrderHistory( + @NotNull String symbol, + Long algoId, + Long startTime, + Long endTime, + Long limit, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + queryUmAlgoOrderHistoryValidateBeforeCall( + symbol, algoId, startTime, endTime, limit, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for queryUmConditionalOrderHistory * @@ -8316,10 +9561,12 @@ public ApiResponse queryMarginAccountsOpenOc * 200 UM Conditional Order History - * * + * @deprecated * @see Query - * UM Conditional Order History(USER_DATA) Documentation + * UM Conditional Order History Documentation */ + @Deprecated private okhttp3.Call queryUmConditionalOrderHistoryCall( String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) throws ApiException { @@ -8394,6 +9641,7 @@ private okhttp3.Call queryUmConditionalOrderHistoryCall( localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call queryUmConditionalOrderHistoryValidateBeforeCall( String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) @@ -8435,7 +9683,7 @@ private okhttp3.Call queryUmConditionalOrderHistoryValidateBeforeCall( } /** - * Query UM Conditional Order History(USER_DATA) Query UM Conditional Order History * Either + * Query UM Conditional Order History Query UM Conditional Order History * Either * `strategyId` or `newClientStrategyId` must be sent. * `NEW` * orders will not be found. * These orders will not be found: * order status is * `CANCELED` or `EXPIRED`, **AND** * order has NO filled trade, **AND** * @@ -8455,10 +9703,12 @@ private okhttp3.Call queryUmConditionalOrderHistoryValidateBeforeCall( * 200 UM Conditional Order History - * * + * @deprecated * @see Query - * UM Conditional Order History(USER_DATA) Documentation + * UM Conditional Order History Documentation */ + @Deprecated public ApiResponse queryUmConditionalOrderHistory( @NotNull String symbol, Long strategyId, String newClientStrategyId, Long recvWindow) throws ApiException { @@ -9009,7 +10259,8 @@ private okhttp3.Call queryUsersCmForceOrdersValidateBeforeCall( * Query User's CM Force Orders(USER_DATA) Query User's CM Force Orders * If * \"autoCloseType\" is not sent, orders with both of the types will be returned * If * \"startTime\" is not sent, data within 7 days before \"endTime\" can be - * queried Weight: 20 with symbol, 50 without symbol + * queried * Only support querying data in the past 90 days Weight: 20 with symbol, 50 without + * symbol * * @param symbol (optional) * @param autoCloseType `LIQUIDATION` for liquidation orders, `ADL` for ADL @@ -9384,7 +10635,8 @@ private okhttp3.Call queryUsersUmForceOrdersValidateBeforeCall( * Query User's UM Force Orders (USER_DATA) Query User's UM Force Orders * If * `autoCloseType` is not sent, orders with both of the types will be returned * If * `startTime` is not sent, data within 7 days before `endTime` can be - * queried Weight: 20 with symbol, 50 without symbol + * queried * Only support querying data in the past 90 days Weight: 20 with symbol, 50 without + * symbol * * @param symbol (optional) * @param autoCloseType `LIQUIDATION` for liquidation orders, `ADL` for ADL 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 aad4de960..b45f9b85b 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/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/6.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/model/CancelAllUmAlgoOpenOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmAlgoOpenOrdersResponse.java new file mode 100644 index 000000000..fad8af60e --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmAlgoOpenOrdersResponse.java @@ -0,0 +1,249 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** CancelAllUmAlgoOpenOrdersResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CancelAllUmAlgoOpenOrdersResponse { + 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 CancelAllUmAlgoOpenOrdersResponse() {} + + public CancelAllUmAlgoOpenOrdersResponse 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 CancelAllUmAlgoOpenOrdersResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelAllUmAlgoOpenOrdersResponse cancelAllUmAlgoOpenOrdersResponse = + (CancelAllUmAlgoOpenOrdersResponse) o; + return Objects.equals(this.code, cancelAllUmAlgoOpenOrdersResponse.code) + && Objects.equals(this.msg, cancelAllUmAlgoOpenOrdersResponse.msg); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelAllUmAlgoOpenOrdersResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelAllUmAlgoOpenOrdersResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelAllUmAlgoOpenOrdersResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelAllUmAlgoOpenOrdersResponse is" + + " not found in the empty JSON string", + CancelAllUmAlgoOpenOrdersResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelAllUmAlgoOpenOrdersResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelAllUmAlgoOpenOrdersResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelAllUmAlgoOpenOrdersResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelAllUmAlgoOpenOrdersResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelAllUmAlgoOpenOrdersResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelAllUmAlgoOpenOrdersResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelAllUmAlgoOpenOrdersResponse + * @throws IOException if the JSON string is invalid with respect to + * CancelAllUmAlgoOpenOrdersResponse + */ + public static CancelAllUmAlgoOpenOrdersResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelAllUmAlgoOpenOrdersResponse.class); + } + + /** + * Convert an instance of CancelAllUmAlgoOpenOrdersResponse 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/rest/model/CancelUmAlgoOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmAlgoOrderResponse.java new file mode 100644 index 000000000..17fcce10d --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmAlgoOrderResponse.java @@ -0,0 +1,203 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** CancelUmAlgoOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CancelUmAlgoOrderResponse { + public static final String SERIALIZED_NAME_COMPLETE = "complete"; + + @SerializedName(SERIALIZED_NAME_COMPLETE) + @jakarta.annotation.Nullable + private Boolean complete; + + public CancelUmAlgoOrderResponse() {} + + public CancelUmAlgoOrderResponse complete(@jakarta.annotation.Nullable Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * + * @return complete + */ + @jakarta.annotation.Nullable + public Boolean getComplete() { + return complete; + } + + public void setComplete(@jakarta.annotation.Nullable Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelUmAlgoOrderResponse cancelUmAlgoOrderResponse = (CancelUmAlgoOrderResponse) o; + return Objects.equals(this.complete, cancelUmAlgoOrderResponse.complete); + } + + @Override + public int hashCode() { + return Objects.hash(complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelUmAlgoOrderResponse {\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object completeValue = getComplete(); + String completeValueAsString = ""; + completeValueAsString = completeValue.toString(); + sb.append("complete=").append(urlEncode(completeValueAsString)).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("complete"); + + // 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 CancelUmAlgoOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelUmAlgoOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelUmAlgoOrderResponse is not found" + + " in the empty JSON string", + CancelUmAlgoOrderResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelUmAlgoOrderResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelUmAlgoOrderResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CancelUmAlgoOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelUmAlgoOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelUmAlgoOrderResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelUmAlgoOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelUmAlgoOrderResponse + * @throws IOException if the JSON string is invalid with respect to CancelUmAlgoOrderResponse + */ + public static CancelUmAlgoOrderResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelUmAlgoOrderResponse.class); + } + + /** + * Convert an instance of CancelUmAlgoOrderResponse 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/rest/model/FuturesTradfiPerpsContractRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FuturesTradfiPerpsContractRequest.java new file mode 100644 index 000000000..233a233b3 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FuturesTradfiPerpsContractRequest.java @@ -0,0 +1,210 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** FuturesTradfiPerpsContractRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FuturesTradfiPerpsContractRequest { + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public FuturesTradfiPerpsContractRequest() {} + + public FuturesTradfiPerpsContractRequest recvWindow( + @jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest = + (FuturesTradfiPerpsContractRequest) o; + return Objects.equals(this.recvWindow, futuresTradfiPerpsContractRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesTradfiPerpsContractRequest {\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * FuturesTradfiPerpsContractRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FuturesTradfiPerpsContractRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FuturesTradfiPerpsContractRequest is" + + " not found in the empty JSON string", + FuturesTradfiPerpsContractRequest.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FuturesTradfiPerpsContractRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FuturesTradfiPerpsContractRequest' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(FuturesTradfiPerpsContractRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FuturesTradfiPerpsContractRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FuturesTradfiPerpsContractRequest read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FuturesTradfiPerpsContractRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FuturesTradfiPerpsContractRequest + * @throws IOException if the JSON string is invalid with respect to + * FuturesTradfiPerpsContractRequest + */ + public static FuturesTradfiPerpsContractRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FuturesTradfiPerpsContractRequest.class); + } + + /** + * Convert an instance of FuturesTradfiPerpsContractRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradfiPerpsContractResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FuturesTradfiPerpsContractResponse.java similarity index 96% rename from clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradfiPerpsContractResponse.java rename to clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FuturesTradfiPerpsContractResponse.java index 367c9917f..28729b212 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradfiPerpsContractResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FuturesTradfiPerpsContractResponse.java @@ -1,6 +1,6 @@ /* - * Binance Derivatives Trading USDS Futures REST API - * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API * * The version of the OpenAPI document: 1.0.0 * @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; -import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponseInner.java index 6dae648ef..69c1e5794 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponseInner.java @@ -76,7 +76,7 @@ public class GetUmIncomeHistoryResponseInner { @SerializedName(SERIALIZED_NAME_TRAN_ID) @jakarta.annotation.Nullable - private String tranId; + private Long tranId; public static final String SERIALIZED_NAME_TRADE_ID = "tradeId"; @@ -201,7 +201,7 @@ public void setTime(@jakarta.annotation.Nullable Long time) { this.time = time; } - public GetUmIncomeHistoryResponseInner tranId(@jakarta.annotation.Nullable String tranId) { + public GetUmIncomeHistoryResponseInner tranId(@jakarta.annotation.Nullable Long tranId) { this.tranId = tranId; return this; } @@ -212,11 +212,11 @@ public GetUmIncomeHistoryResponseInner tranId(@jakarta.annotation.Nullable Strin * @return tranId */ @jakarta.annotation.Nullable - public String getTranId() { + public Long getTranId() { return tranId; } - public void setTranId(@jakarta.annotation.Nullable String tranId) { + public void setTranId(@jakarta.annotation.Nullable Long tranId) { this.tranId = tranId; } @@ -415,14 +415,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("info").toString())); } - if ((jsonObj.get("tranId") != null && !jsonObj.get("tranId").isJsonNull()) - && !jsonObj.get("tranId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `tranId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("tranId").toString())); - } if ((jsonObj.get("tradeId") != null && !jsonObj.get("tradeId").isJsonNull()) && !jsonObj.get("tradeId").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmAlgoOrderRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmAlgoOrderRequest.java new file mode 100644 index 000000000..787704a4f --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmAlgoOrderRequest.java @@ -0,0 +1,982 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** NewUmAlgoOrderRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NewUmAlgoOrderRequest { + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nonnull + private String algoType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nonnull + private Side side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private PositionSide positionSide; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nonnull + private Type type; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private TimeInForce timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private Double quantity; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private Double price; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private Double triggerPrice; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private WorkingType workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private PriceMatch priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private String closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private String priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private String reduceOnly; + + public static final String SERIALIZED_NAME_ACTIVATE_PRICE = "activatePrice"; + + @SerializedName(SERIALIZED_NAME_ACTIVATE_PRICE) + @jakarta.annotation.Nullable + private Double activatePrice; + + public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; + + @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) + @jakarta.annotation.Nullable + private Double callbackRate; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_NEW_ORDER_RESP_TYPE = "newOrderRespType"; + + @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESP_TYPE) + @jakarta.annotation.Nullable + private NewOrderRespType newOrderRespType; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private SelfTradePreventionMode selfTradePreventionMode; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public NewUmAlgoOrderRequest() {} + + public NewUmAlgoOrderRequest algoType(@jakarta.annotation.Nonnull String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nonnull + @NotNull + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nonnull String algoType) { + this.algoType = algoType; + } + + public NewUmAlgoOrderRequest symbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nonnull + @NotNull + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + } + + public NewUmAlgoOrderRequest side(@jakarta.annotation.Nonnull Side side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Side getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nonnull Side side) { + this.side = side; + } + + public NewUmAlgoOrderRequest positionSide( + @jakarta.annotation.Nullable PositionSide positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + @Valid + public PositionSide getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable PositionSide positionSide) { + this.positionSide = positionSide; + } + + public NewUmAlgoOrderRequest type(@jakarta.annotation.Nonnull Type type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Type getType() { + return type; + } + + public void setType(@jakarta.annotation.Nonnull Type type) { + this.type = type; + } + + public NewUmAlgoOrderRequest timeInForce(@jakarta.annotation.Nullable TimeInForce timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + @Valid + public TimeInForce getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable TimeInForce timeInForce) { + this.timeInForce = timeInForce; + } + + public NewUmAlgoOrderRequest 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 NewUmAlgoOrderRequest 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 NewUmAlgoOrderRequest triggerPrice(@jakarta.annotation.Nullable Double triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable Double triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public NewUmAlgoOrderRequest workingType(@jakarta.annotation.Nullable WorkingType workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingType getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable WorkingType workingType) { + this.workingType = workingType; + } + + public NewUmAlgoOrderRequest priceMatch(@jakarta.annotation.Nullable PriceMatch priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + @Valid + public PriceMatch getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable PriceMatch priceMatch) { + this.priceMatch = priceMatch; + } + + public NewUmAlgoOrderRequest closePosition(@jakarta.annotation.Nullable String closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public String getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable String closePosition) { + this.closePosition = closePosition; + } + + public NewUmAlgoOrderRequest 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 NewUmAlgoOrderRequest 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 NewUmAlgoOrderRequest activatePrice(@jakarta.annotation.Nullable Double activatePrice) { + this.activatePrice = activatePrice; + return this; + } + + /** + * Get activatePrice + * + * @return activatePrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getActivatePrice() { + return activatePrice; + } + + public void setActivatePrice(@jakarta.annotation.Nullable Double activatePrice) { + this.activatePrice = activatePrice; + } + + public NewUmAlgoOrderRequest 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 NewUmAlgoOrderRequest clientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public NewUmAlgoOrderRequest newOrderRespType( + @jakarta.annotation.Nullable NewOrderRespType newOrderRespType) { + this.newOrderRespType = newOrderRespType; + return this; + } + + /** + * Get newOrderRespType + * + * @return newOrderRespType + */ + @jakarta.annotation.Nullable + @Valid + public NewOrderRespType getNewOrderRespType() { + return newOrderRespType; + } + + public void setNewOrderRespType( + @jakarta.annotation.Nullable NewOrderRespType newOrderRespType) { + this.newOrderRespType = newOrderRespType; + } + + public NewUmAlgoOrderRequest selfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + @Valid + public SelfTradePreventionMode getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public NewUmAlgoOrderRequest 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 NewUmAlgoOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewUmAlgoOrderRequest newUmAlgoOrderRequest = (NewUmAlgoOrderRequest) o; + return Objects.equals(this.algoType, newUmAlgoOrderRequest.algoType) + && Objects.equals(this.symbol, newUmAlgoOrderRequest.symbol) + && Objects.equals(this.side, newUmAlgoOrderRequest.side) + && Objects.equals(this.positionSide, newUmAlgoOrderRequest.positionSide) + && Objects.equals(this.type, newUmAlgoOrderRequest.type) + && Objects.equals(this.timeInForce, newUmAlgoOrderRequest.timeInForce) + && Objects.equals(this.quantity, newUmAlgoOrderRequest.quantity) + && Objects.equals(this.price, newUmAlgoOrderRequest.price) + && Objects.equals(this.triggerPrice, newUmAlgoOrderRequest.triggerPrice) + && Objects.equals(this.workingType, newUmAlgoOrderRequest.workingType) + && Objects.equals(this.priceMatch, newUmAlgoOrderRequest.priceMatch) + && Objects.equals(this.closePosition, newUmAlgoOrderRequest.closePosition) + && Objects.equals(this.priceProtect, newUmAlgoOrderRequest.priceProtect) + && Objects.equals(this.reduceOnly, newUmAlgoOrderRequest.reduceOnly) + && Objects.equals(this.activatePrice, newUmAlgoOrderRequest.activatePrice) + && Objects.equals(this.callbackRate, newUmAlgoOrderRequest.callbackRate) + && Objects.equals(this.clientAlgoId, newUmAlgoOrderRequest.clientAlgoId) + && Objects.equals(this.newOrderRespType, newUmAlgoOrderRequest.newOrderRespType) + && Objects.equals( + this.selfTradePreventionMode, newUmAlgoOrderRequest.selfTradePreventionMode) + && Objects.equals(this.goodTillDate, newUmAlgoOrderRequest.goodTillDate) + && Objects.equals(this.recvWindow, newUmAlgoOrderRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash( + algoType, + symbol, + side, + positionSide, + type, + timeInForce, + quantity, + price, + triggerPrice, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + activatePrice, + callbackRate, + clientAlgoId, + newOrderRespType, + selfTradePreventionMode, + goodTillDate, + recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewUmAlgoOrderRequest {\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" activatePrice: ").append(toIndentedString(activatePrice)).append("\n"); + sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object activatePriceValue = getActivatePrice(); + String activatePriceValueAsString = ""; + activatePriceValueAsString = activatePriceValue.toString(); + sb.append("activatePrice=").append(urlEncode(activatePriceValueAsString)).append(""); + Object callbackRateValue = getCallbackRate(); + String callbackRateValueAsString = ""; + callbackRateValueAsString = callbackRateValue.toString(); + sb.append("callbackRate=").append(urlEncode(callbackRateValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object newOrderRespTypeValue = getNewOrderRespType(); + String newOrderRespTypeValueAsString = ""; + newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); + sb.append("newOrderRespType=").append(urlEncode(newOrderRespTypeValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("type"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("price"); + openapiFields.add("triggerPrice"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("activatePrice"); + openapiFields.add("callbackRate"); + openapiFields.add("clientAlgoId"); + openapiFields.add("newOrderRespType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("goodTillDate"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("algoType"); + openapiRequiredFields.add("symbol"); + openapiRequiredFields.add("side"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewUmAlgoOrderRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewUmAlgoOrderRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NewUmAlgoOrderRequest is not found in" + + " the empty JSON string", + NewUmAlgoOrderRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewUmAlgoOrderRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + // validate the required field `side` + Side.validateJsonElement(jsonObj.get("side")); + // validate the optional field `positionSide` + if (jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) { + PositionSide.validateJsonElement(jsonObj.get("positionSide")); + } + // validate the required field `type` + Type.validateJsonElement(jsonObj.get("type")); + // validate the optional field `timeInForce` + if (jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) { + TimeInForce.validateJsonElement(jsonObj.get("timeInForce")); + } + // validate the optional field `workingType` + if (jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) { + WorkingType.validateJsonElement(jsonObj.get("workingType")); + } + // validate the optional field `priceMatch` + if (jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) { + PriceMatch.validateJsonElement(jsonObj.get("priceMatch")); + } + if ((jsonObj.get("closePosition") != null && !jsonObj.get("closePosition").isJsonNull()) + && !jsonObj.get("closePosition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `closePosition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("closePosition").toString())); + } + if ((jsonObj.get("priceProtect") != null && !jsonObj.get("priceProtect").isJsonNull()) + && !jsonObj.get("priceProtect").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceProtect` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceProtect").toString())); + } + if ((jsonObj.get("reduceOnly") != null && !jsonObj.get("reduceOnly").isJsonNull()) + && !jsonObj.get("reduceOnly").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reduceOnly` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reduceOnly").toString())); + } + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + // validate the optional field `newOrderRespType` + if (jsonObj.get("newOrderRespType") != null + && !jsonObj.get("newOrderRespType").isJsonNull()) { + NewOrderRespType.validateJsonElement(jsonObj.get("newOrderRespType")); + } + // validate the optional field `selfTradePreventionMode` + if (jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { + SelfTradePreventionMode.validateJsonElement(jsonObj.get("selfTradePreventionMode")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewUmAlgoOrderRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewUmAlgoOrderRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NewUmAlgoOrderRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NewUmAlgoOrderRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewUmAlgoOrderRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NewUmAlgoOrderRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewUmAlgoOrderRequest + * @throws IOException if the JSON string is invalid with respect to NewUmAlgoOrderRequest + */ + public static NewUmAlgoOrderRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewUmAlgoOrderRequest.class); + } + + /** + * Convert an instance of NewUmAlgoOrderRequest 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/rest/model/NewUmAlgoOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmAlgoOrderResponse.java new file mode 100644 index 000000000..66a06aa97 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmAlgoOrderResponse.java @@ -0,0 +1,1143 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** NewUmAlgoOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NewUmAlgoOrderResponse { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_ACTIVATE_PRICE = "activatePrice"; + + @SerializedName(SERIALIZED_NAME_ACTIVATE_PRICE) + @jakarta.annotation.Nullable + private String activatePrice; + + public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; + + @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) + @jakarta.annotation.Nullable + private String callbackRate; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public NewUmAlgoOrderResponse() {} + + public NewUmAlgoOrderResponse algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public NewUmAlgoOrderResponse clientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public NewUmAlgoOrderResponse algoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public NewUmAlgoOrderResponse orderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public NewUmAlgoOrderResponse 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 NewUmAlgoOrderResponse 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 NewUmAlgoOrderResponse positionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public NewUmAlgoOrderResponse 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 NewUmAlgoOrderResponse quantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public NewUmAlgoOrderResponse algoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public NewUmAlgoOrderResponse triggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public NewUmAlgoOrderResponse 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 NewUmAlgoOrderResponse icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public NewUmAlgoOrderResponse selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public NewUmAlgoOrderResponse workingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public NewUmAlgoOrderResponse priceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public NewUmAlgoOrderResponse closePosition( + @jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public NewUmAlgoOrderResponse priceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public NewUmAlgoOrderResponse reduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public NewUmAlgoOrderResponse activatePrice(@jakarta.annotation.Nullable String activatePrice) { + this.activatePrice = activatePrice; + return this; + } + + /** + * Get activatePrice + * + * @return activatePrice + */ + @jakarta.annotation.Nullable + public String getActivatePrice() { + return activatePrice; + } + + public void setActivatePrice(@jakarta.annotation.Nullable String activatePrice) { + this.activatePrice = activatePrice; + } + + public NewUmAlgoOrderResponse callbackRate(@jakarta.annotation.Nullable String callbackRate) { + this.callbackRate = callbackRate; + return this; + } + + /** + * Get callbackRate + * + * @return callbackRate + */ + @jakarta.annotation.Nullable + public String getCallbackRate() { + return callbackRate; + } + + public void setCallbackRate(@jakarta.annotation.Nullable String callbackRate) { + this.callbackRate = callbackRate; + } + + public NewUmAlgoOrderResponse createTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public NewUmAlgoOrderResponse updateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public NewUmAlgoOrderResponse triggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public NewUmAlgoOrderResponse 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; + } + NewUmAlgoOrderResponse newUmAlgoOrderResponse = (NewUmAlgoOrderResponse) o; + return Objects.equals(this.algoId, newUmAlgoOrderResponse.algoId) + && Objects.equals(this.clientAlgoId, newUmAlgoOrderResponse.clientAlgoId) + && Objects.equals(this.algoType, newUmAlgoOrderResponse.algoType) + && Objects.equals(this.orderType, newUmAlgoOrderResponse.orderType) + && Objects.equals(this.symbol, newUmAlgoOrderResponse.symbol) + && Objects.equals(this.side, newUmAlgoOrderResponse.side) + && Objects.equals(this.positionSide, newUmAlgoOrderResponse.positionSide) + && Objects.equals(this.timeInForce, newUmAlgoOrderResponse.timeInForce) + && Objects.equals(this.quantity, newUmAlgoOrderResponse.quantity) + && Objects.equals(this.algoStatus, newUmAlgoOrderResponse.algoStatus) + && Objects.equals(this.triggerPrice, newUmAlgoOrderResponse.triggerPrice) + && Objects.equals(this.price, newUmAlgoOrderResponse.price) + && Objects.equals(this.icebergQuantity, newUmAlgoOrderResponse.icebergQuantity) + && Objects.equals( + this.selfTradePreventionMode, + newUmAlgoOrderResponse.selfTradePreventionMode) + && Objects.equals(this.workingType, newUmAlgoOrderResponse.workingType) + && Objects.equals(this.priceMatch, newUmAlgoOrderResponse.priceMatch) + && Objects.equals(this.closePosition, newUmAlgoOrderResponse.closePosition) + && Objects.equals(this.priceProtect, newUmAlgoOrderResponse.priceProtect) + && Objects.equals(this.reduceOnly, newUmAlgoOrderResponse.reduceOnly) + && Objects.equals(this.activatePrice, newUmAlgoOrderResponse.activatePrice) + && Objects.equals(this.callbackRate, newUmAlgoOrderResponse.callbackRate) + && Objects.equals(this.createTime, newUmAlgoOrderResponse.createTime) + && Objects.equals(this.updateTime, newUmAlgoOrderResponse.updateTime) + && Objects.equals(this.triggerTime, newUmAlgoOrderResponse.triggerTime) + && Objects.equals(this.goodTillDate, newUmAlgoOrderResponse.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + triggerPrice, + price, + icebergQuantity, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + activatePrice, + callbackRate, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewUmAlgoOrderResponse {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" activatePrice: ").append(toIndentedString(activatePrice)).append("\n"); + sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoIdValue = getAlgoId(); + String algoIdValueAsString = ""; + algoIdValueAsString = algoIdValue.toString(); + sb.append("algoId=").append(urlEncode(algoIdValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object orderTypeValue = getOrderType(); + String orderTypeValueAsString = ""; + orderTypeValueAsString = orderTypeValue.toString(); + sb.append("orderType=").append(urlEncode(orderTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object algoStatusValue = getAlgoStatus(); + String algoStatusValueAsString = ""; + algoStatusValueAsString = algoStatusValue.toString(); + sb.append("algoStatus=").append(urlEncode(algoStatusValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object icebergQuantityValue = getIcebergQuantity(); + String icebergQuantityValueAsString = ""; + icebergQuantityValueAsString = icebergQuantityValue.toString(); + sb.append("icebergQuantity=").append(urlEncode(icebergQuantityValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object activatePriceValue = getActivatePrice(); + String activatePriceValueAsString = ""; + activatePriceValueAsString = activatePriceValue.toString(); + sb.append("activatePrice=").append(urlEncode(activatePriceValueAsString)).append(""); + Object callbackRateValue = getCallbackRate(); + String callbackRateValueAsString = ""; + callbackRateValueAsString = callbackRateValue.toString(); + sb.append("callbackRate=").append(urlEncode(callbackRateValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object triggerTimeValue = getTriggerTime(); + String triggerTimeValueAsString = ""; + triggerTimeValueAsString = triggerTimeValue.toString(); + sb.append("triggerTime=").append(urlEncode(triggerTimeValueAsString)).append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("activatePrice"); + openapiFields.add("callbackRate"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewUmAlgoOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewUmAlgoOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NewUmAlgoOrderResponse is not found in" + + " the empty JSON string", + NewUmAlgoOrderResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + if ((jsonObj.get("activatePrice") != null && !jsonObj.get("activatePrice").isJsonNull()) + && !jsonObj.get("activatePrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activatePrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("activatePrice").toString())); + } + if ((jsonObj.get("callbackRate") != null && !jsonObj.get("callbackRate").isJsonNull()) + && !jsonObj.get("callbackRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `callbackRate` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("callbackRate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewUmAlgoOrderResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewUmAlgoOrderResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NewUmAlgoOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NewUmAlgoOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewUmAlgoOrderResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NewUmAlgoOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewUmAlgoOrderResponse + * @throws IOException if the JSON string is invalid with respect to NewUmAlgoOrderResponse + */ + public static NewUmAlgoOrderResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewUmAlgoOrderResponse.class); + } + + /** + * Convert an instance of NewUmAlgoOrderResponse 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/rest/model/QueryAllCurrentUmOpenAlgoOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenAlgoOrdersResponse.java new file mode 100644 index 000000000..a30eb4896 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenAlgoOrdersResponse.java @@ -0,0 +1,193 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.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.*; + +/** QueryAllCurrentUmOpenAlgoOrdersResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryAllCurrentUmOpenAlgoOrdersResponse + extends ArrayList { + public QueryAllCurrentUmOpenAlgoOrdersResponse() {} + + @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 QueryAllCurrentUmOpenAlgoOrdersResponse {\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 + * QueryAllCurrentUmOpenAlgoOrdersResponse + */ + 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) { + QueryAllCurrentUmOpenAlgoOrdersResponseInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!QueryAllCurrentUmOpenAlgoOrdersResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " QueryAllCurrentUmOpenAlgoOrdersResponse is not found in the" + + " empty JSON string", + QueryAllCurrentUmOpenAlgoOrdersResponse.openapiRequiredFields + .toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryAllCurrentUmOpenAlgoOrdersResponse.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'QueryAllCurrentUmOpenAlgoOrdersResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QueryAllCurrentUmOpenAlgoOrdersResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, QueryAllCurrentUmOpenAlgoOrdersResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public QueryAllCurrentUmOpenAlgoOrdersResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryAllCurrentUmOpenAlgoOrdersResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryAllCurrentUmOpenAlgoOrdersResponse + * @throws IOException if the JSON string is invalid with respect to + * QueryAllCurrentUmOpenAlgoOrdersResponse + */ + public static QueryAllCurrentUmOpenAlgoOrdersResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, QueryAllCurrentUmOpenAlgoOrdersResponse.class); + } + + /** + * Convert an instance of QueryAllCurrentUmOpenAlgoOrdersResponse 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/rest/model/QueryAllCurrentUmOpenAlgoOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenAlgoOrdersResponseInner.java new file mode 100644 index 000000000..06838759d --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenAlgoOrdersResponseInner.java @@ -0,0 +1,1423 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** QueryAllCurrentUmOpenAlgoOrdersResponseInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryAllCurrentUmOpenAlgoOrdersResponseInner { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_ACTUAL_ORDER_ID = "actualOrderId"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_ORDER_ID) + @jakarta.annotation.Nullable + private String actualOrderId; + + public static final String SERIALIZED_NAME_ACTUAL_PRICE = "actualPrice"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_PRICE) + @jakarta.annotation.Nullable + private String actualPrice; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_TP_TRIGGER_PRICE = "tpTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_TP_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String tpTriggerPrice; + + public static final String SERIALIZED_NAME_TP_PRICE = "tpPrice"; + + @SerializedName(SERIALIZED_NAME_TP_PRICE) + @jakarta.annotation.Nullable + private String tpPrice; + + public static final String SERIALIZED_NAME_SL_TRIGGER_PRICE = "slTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_SL_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String slTriggerPrice; + + public static final String SERIALIZED_NAME_SL_PRICE = "slPrice"; + + @SerializedName(SERIALIZED_NAME_SL_PRICE) + @jakarta.annotation.Nullable + private String slPrice; + + public static final String SERIALIZED_NAME_TP_ORDER_TYPE = "tpOrderType"; + + @SerializedName(SERIALIZED_NAME_TP_ORDER_TYPE) + @jakarta.annotation.Nullable + private String tpOrderType; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner() {} + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner algoId( + @jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner clientAlgoId( + @jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner algoType( + @jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner orderType( + @jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner 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 QueryAllCurrentUmOpenAlgoOrdersResponseInner 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 QueryAllCurrentUmOpenAlgoOrdersResponseInner positionSide( + @jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner 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 QueryAllCurrentUmOpenAlgoOrdersResponseInner quantity( + @jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner algoStatus( + @jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner actualOrderId( + @jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + return this; + } + + /** + * Get actualOrderId + * + * @return actualOrderId + */ + @jakarta.annotation.Nullable + public String getActualOrderId() { + return actualOrderId; + } + + public void setActualOrderId(@jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner actualPrice( + @jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + return this; + } + + /** + * Get actualPrice + * + * @return actualPrice + */ + @jakarta.annotation.Nullable + public String getActualPrice() { + return actualPrice; + } + + public void setActualPrice(@jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner triggerPrice( + @jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner 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 QueryAllCurrentUmOpenAlgoOrdersResponseInner icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner tpTriggerPrice( + @jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + return this; + } + + /** + * Get tpTriggerPrice + * + * @return tpTriggerPrice + */ + @jakarta.annotation.Nullable + public String getTpTriggerPrice() { + return tpTriggerPrice; + } + + public void setTpTriggerPrice(@jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner tpPrice( + @jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + return this; + } + + /** + * Get tpPrice + * + * @return tpPrice + */ + @jakarta.annotation.Nullable + public String getTpPrice() { + return tpPrice; + } + + public void setTpPrice(@jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner slTriggerPrice( + @jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + return this; + } + + /** + * Get slTriggerPrice + * + * @return slTriggerPrice + */ + @jakarta.annotation.Nullable + public String getSlTriggerPrice() { + return slTriggerPrice; + } + + public void setSlTriggerPrice(@jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner slPrice( + @jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + return this; + } + + /** + * Get slPrice + * + * @return slPrice + */ + @jakarta.annotation.Nullable + public String getSlPrice() { + return slPrice; + } + + public void setSlPrice(@jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner tpOrderType( + @jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + return this; + } + + /** + * Get tpOrderType + * + * @return tpOrderType + */ + @jakarta.annotation.Nullable + public String getTpOrderType() { + return tpOrderType; + } + + public void setTpOrderType(@jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner workingType( + @jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner priceMatch( + @jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner closePosition( + @jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner priceProtect( + @jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner reduceOnly( + @jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner createTime( + @jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner updateTime( + @jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner triggerTime( + @jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public QueryAllCurrentUmOpenAlgoOrdersResponseInner 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; + } + QueryAllCurrentUmOpenAlgoOrdersResponseInner queryAllCurrentUmOpenAlgoOrdersResponseInner = + (QueryAllCurrentUmOpenAlgoOrdersResponseInner) o; + return Objects.equals(this.algoId, queryAllCurrentUmOpenAlgoOrdersResponseInner.algoId) + && Objects.equals( + this.clientAlgoId, + queryAllCurrentUmOpenAlgoOrdersResponseInner.clientAlgoId) + && Objects.equals( + this.algoType, queryAllCurrentUmOpenAlgoOrdersResponseInner.algoType) + && Objects.equals( + this.orderType, queryAllCurrentUmOpenAlgoOrdersResponseInner.orderType) + && Objects.equals(this.symbol, queryAllCurrentUmOpenAlgoOrdersResponseInner.symbol) + && Objects.equals(this.side, queryAllCurrentUmOpenAlgoOrdersResponseInner.side) + && Objects.equals( + this.positionSide, + queryAllCurrentUmOpenAlgoOrdersResponseInner.positionSide) + && Objects.equals( + this.timeInForce, queryAllCurrentUmOpenAlgoOrdersResponseInner.timeInForce) + && Objects.equals( + this.quantity, queryAllCurrentUmOpenAlgoOrdersResponseInner.quantity) + && Objects.equals( + this.algoStatus, queryAllCurrentUmOpenAlgoOrdersResponseInner.algoStatus) + && Objects.equals( + this.actualOrderId, + queryAllCurrentUmOpenAlgoOrdersResponseInner.actualOrderId) + && Objects.equals( + this.actualPrice, queryAllCurrentUmOpenAlgoOrdersResponseInner.actualPrice) + && Objects.equals( + this.triggerPrice, + queryAllCurrentUmOpenAlgoOrdersResponseInner.triggerPrice) + && Objects.equals(this.price, queryAllCurrentUmOpenAlgoOrdersResponseInner.price) + && Objects.equals( + this.icebergQuantity, + queryAllCurrentUmOpenAlgoOrdersResponseInner.icebergQuantity) + && Objects.equals( + this.tpTriggerPrice, + queryAllCurrentUmOpenAlgoOrdersResponseInner.tpTriggerPrice) + && Objects.equals( + this.tpPrice, queryAllCurrentUmOpenAlgoOrdersResponseInner.tpPrice) + && Objects.equals( + this.slTriggerPrice, + queryAllCurrentUmOpenAlgoOrdersResponseInner.slTriggerPrice) + && Objects.equals( + this.slPrice, queryAllCurrentUmOpenAlgoOrdersResponseInner.slPrice) + && Objects.equals( + this.tpOrderType, queryAllCurrentUmOpenAlgoOrdersResponseInner.tpOrderType) + && Objects.equals( + this.selfTradePreventionMode, + queryAllCurrentUmOpenAlgoOrdersResponseInner.selfTradePreventionMode) + && Objects.equals( + this.workingType, queryAllCurrentUmOpenAlgoOrdersResponseInner.workingType) + && Objects.equals( + this.priceMatch, queryAllCurrentUmOpenAlgoOrdersResponseInner.priceMatch) + && Objects.equals( + this.closePosition, + queryAllCurrentUmOpenAlgoOrdersResponseInner.closePosition) + && Objects.equals( + this.priceProtect, + queryAllCurrentUmOpenAlgoOrdersResponseInner.priceProtect) + && Objects.equals( + this.reduceOnly, queryAllCurrentUmOpenAlgoOrdersResponseInner.reduceOnly) + && Objects.equals( + this.createTime, queryAllCurrentUmOpenAlgoOrdersResponseInner.createTime) + && Objects.equals( + this.updateTime, queryAllCurrentUmOpenAlgoOrdersResponseInner.updateTime) + && Objects.equals( + this.triggerTime, queryAllCurrentUmOpenAlgoOrdersResponseInner.triggerTime) + && Objects.equals( + this.goodTillDate, + queryAllCurrentUmOpenAlgoOrdersResponseInner.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + actualOrderId, + actualPrice, + triggerPrice, + price, + icebergQuantity, + tpTriggerPrice, + tpPrice, + slTriggerPrice, + slPrice, + tpOrderType, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryAllCurrentUmOpenAlgoOrdersResponseInner {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" actualOrderId: ").append(toIndentedString(actualOrderId)).append("\n"); + sb.append(" actualPrice: ").append(toIndentedString(actualPrice)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" tpTriggerPrice: ").append(toIndentedString(tpTriggerPrice)).append("\n"); + sb.append(" tpPrice: ").append(toIndentedString(tpPrice)).append("\n"); + sb.append(" slTriggerPrice: ").append(toIndentedString(slTriggerPrice)).append("\n"); + sb.append(" slPrice: ").append(toIndentedString(slPrice)).append("\n"); + sb.append(" tpOrderType: ").append(toIndentedString(tpOrderType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoIdValue = getAlgoId(); + String algoIdValueAsString = ""; + algoIdValueAsString = algoIdValue.toString(); + sb.append("algoId=").append(urlEncode(algoIdValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object orderTypeValue = getOrderType(); + String orderTypeValueAsString = ""; + orderTypeValueAsString = orderTypeValue.toString(); + sb.append("orderType=").append(urlEncode(orderTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object algoStatusValue = getAlgoStatus(); + String algoStatusValueAsString = ""; + algoStatusValueAsString = algoStatusValue.toString(); + sb.append("algoStatus=").append(urlEncode(algoStatusValueAsString)).append(""); + Object actualOrderIdValue = getActualOrderId(); + String actualOrderIdValueAsString = ""; + actualOrderIdValueAsString = actualOrderIdValue.toString(); + sb.append("actualOrderId=").append(urlEncode(actualOrderIdValueAsString)).append(""); + Object actualPriceValue = getActualPrice(); + String actualPriceValueAsString = ""; + actualPriceValueAsString = actualPriceValue.toString(); + sb.append("actualPrice=").append(urlEncode(actualPriceValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object icebergQuantityValue = getIcebergQuantity(); + String icebergQuantityValueAsString = ""; + icebergQuantityValueAsString = icebergQuantityValue.toString(); + sb.append("icebergQuantity=").append(urlEncode(icebergQuantityValueAsString)).append(""); + Object tpTriggerPriceValue = getTpTriggerPrice(); + String tpTriggerPriceValueAsString = ""; + tpTriggerPriceValueAsString = tpTriggerPriceValue.toString(); + sb.append("tpTriggerPrice=").append(urlEncode(tpTriggerPriceValueAsString)).append(""); + Object tpPriceValue = getTpPrice(); + String tpPriceValueAsString = ""; + tpPriceValueAsString = tpPriceValue.toString(); + sb.append("tpPrice=").append(urlEncode(tpPriceValueAsString)).append(""); + Object slTriggerPriceValue = getSlTriggerPrice(); + String slTriggerPriceValueAsString = ""; + slTriggerPriceValueAsString = slTriggerPriceValue.toString(); + sb.append("slTriggerPrice=").append(urlEncode(slTriggerPriceValueAsString)).append(""); + Object slPriceValue = getSlPrice(); + String slPriceValueAsString = ""; + slPriceValueAsString = slPriceValue.toString(); + sb.append("slPrice=").append(urlEncode(slPriceValueAsString)).append(""); + Object tpOrderTypeValue = getTpOrderType(); + String tpOrderTypeValueAsString = ""; + tpOrderTypeValueAsString = tpOrderTypeValue.toString(); + sb.append("tpOrderType=").append(urlEncode(tpOrderTypeValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object triggerTimeValue = getTriggerTime(); + String triggerTimeValueAsString = ""; + triggerTimeValueAsString = triggerTimeValue.toString(); + sb.append("triggerTime=").append(urlEncode(triggerTimeValueAsString)).append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("actualOrderId"); + openapiFields.add("actualPrice"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("tpTriggerPrice"); + openapiFields.add("tpPrice"); + openapiFields.add("slTriggerPrice"); + openapiFields.add("slPrice"); + openapiFields.add("tpOrderType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * QueryAllCurrentUmOpenAlgoOrdersResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryAllCurrentUmOpenAlgoOrdersResponseInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " QueryAllCurrentUmOpenAlgoOrdersResponseInner is not found" + + " in the empty JSON string", + QueryAllCurrentUmOpenAlgoOrdersResponseInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("actualOrderId") != null && !jsonObj.get("actualOrderId").isJsonNull()) + && !jsonObj.get("actualOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualOrderId").toString())); + } + if ((jsonObj.get("actualPrice") != null && !jsonObj.get("actualPrice").isJsonNull()) + && !jsonObj.get("actualPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualPrice").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("tpTriggerPrice") != null && !jsonObj.get("tpTriggerPrice").isJsonNull()) + && !jsonObj.get("tpTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpTriggerPrice").toString())); + } + if ((jsonObj.get("tpPrice") != null && !jsonObj.get("tpPrice").isJsonNull()) + && !jsonObj.get("tpPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("tpPrice").toString())); + } + if ((jsonObj.get("slTriggerPrice") != null && !jsonObj.get("slTriggerPrice").isJsonNull()) + && !jsonObj.get("slTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("slTriggerPrice").toString())); + } + if ((jsonObj.get("slPrice") != null && !jsonObj.get("slPrice").isJsonNull()) + && !jsonObj.get("slPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slPrice").toString())); + } + if ((jsonObj.get("tpOrderType") != null && !jsonObj.get("tpOrderType").isJsonNull()) + && !jsonObj.get("tpOrderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpOrderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpOrderType").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryAllCurrentUmOpenAlgoOrdersResponseInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'QueryAllCurrentUmOpenAlgoOrdersResponseInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(QueryAllCurrentUmOpenAlgoOrdersResponseInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, QueryAllCurrentUmOpenAlgoOrdersResponseInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryAllCurrentUmOpenAlgoOrdersResponseInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryAllCurrentUmOpenAlgoOrdersResponseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryAllCurrentUmOpenAlgoOrdersResponseInner + * @throws IOException if the JSON string is invalid with respect to + * QueryAllCurrentUmOpenAlgoOrdersResponseInner + */ + public static QueryAllCurrentUmOpenAlgoOrdersResponseInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, QueryAllCurrentUmOpenAlgoOrdersResponseInner.class); + } + + /** + * Convert an instance of QueryAllCurrentUmOpenAlgoOrdersResponseInner 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/rest/model/QueryCurrentUmOpenAlgoOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenAlgoOrderResponse.java new file mode 100644 index 000000000..f3099b82e --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenAlgoOrderResponse.java @@ -0,0 +1,1389 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** QueryCurrentUmOpenAlgoOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryCurrentUmOpenAlgoOrderResponse { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_ACTUAL_ORDER_ID = "actualOrderId"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_ORDER_ID) + @jakarta.annotation.Nullable + private String actualOrderId; + + public static final String SERIALIZED_NAME_ACTUAL_PRICE = "actualPrice"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_PRICE) + @jakarta.annotation.Nullable + private String actualPrice; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_TP_TRIGGER_PRICE = "tpTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_TP_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String tpTriggerPrice; + + public static final String SERIALIZED_NAME_TP_PRICE = "tpPrice"; + + @SerializedName(SERIALIZED_NAME_TP_PRICE) + @jakarta.annotation.Nullable + private String tpPrice; + + public static final String SERIALIZED_NAME_SL_TRIGGER_PRICE = "slTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_SL_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String slTriggerPrice; + + public static final String SERIALIZED_NAME_SL_PRICE = "slPrice"; + + @SerializedName(SERIALIZED_NAME_SL_PRICE) + @jakarta.annotation.Nullable + private String slPrice; + + public static final String SERIALIZED_NAME_TP_ORDER_TYPE = "tpOrderType"; + + @SerializedName(SERIALIZED_NAME_TP_ORDER_TYPE) + @jakarta.annotation.Nullable + private String tpOrderType; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public QueryCurrentUmOpenAlgoOrderResponse() {} + + public QueryCurrentUmOpenAlgoOrderResponse algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public QueryCurrentUmOpenAlgoOrderResponse clientAlgoId( + @jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public QueryCurrentUmOpenAlgoOrderResponse algoType( + @jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public QueryCurrentUmOpenAlgoOrderResponse orderType( + @jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public QueryCurrentUmOpenAlgoOrderResponse 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 QueryCurrentUmOpenAlgoOrderResponse 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 QueryCurrentUmOpenAlgoOrderResponse positionSide( + @jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public QueryCurrentUmOpenAlgoOrderResponse 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 QueryCurrentUmOpenAlgoOrderResponse quantity( + @jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public QueryCurrentUmOpenAlgoOrderResponse algoStatus( + @jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public QueryCurrentUmOpenAlgoOrderResponse actualOrderId( + @jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + return this; + } + + /** + * Get actualOrderId + * + * @return actualOrderId + */ + @jakarta.annotation.Nullable + public String getActualOrderId() { + return actualOrderId; + } + + public void setActualOrderId(@jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + } + + public QueryCurrentUmOpenAlgoOrderResponse actualPrice( + @jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + return this; + } + + /** + * Get actualPrice + * + * @return actualPrice + */ + @jakarta.annotation.Nullable + public String getActualPrice() { + return actualPrice; + } + + public void setActualPrice(@jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + } + + public QueryCurrentUmOpenAlgoOrderResponse triggerPrice( + @jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public QueryCurrentUmOpenAlgoOrderResponse 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 QueryCurrentUmOpenAlgoOrderResponse icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public QueryCurrentUmOpenAlgoOrderResponse tpTriggerPrice( + @jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + return this; + } + + /** + * Get tpTriggerPrice + * + * @return tpTriggerPrice + */ + @jakarta.annotation.Nullable + public String getTpTriggerPrice() { + return tpTriggerPrice; + } + + public void setTpTriggerPrice(@jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + } + + public QueryCurrentUmOpenAlgoOrderResponse tpPrice( + @jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + return this; + } + + /** + * Get tpPrice + * + * @return tpPrice + */ + @jakarta.annotation.Nullable + public String getTpPrice() { + return tpPrice; + } + + public void setTpPrice(@jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + } + + public QueryCurrentUmOpenAlgoOrderResponse slTriggerPrice( + @jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + return this; + } + + /** + * Get slTriggerPrice + * + * @return slTriggerPrice + */ + @jakarta.annotation.Nullable + public String getSlTriggerPrice() { + return slTriggerPrice; + } + + public void setSlTriggerPrice(@jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + } + + public QueryCurrentUmOpenAlgoOrderResponse slPrice( + @jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + return this; + } + + /** + * Get slPrice + * + * @return slPrice + */ + @jakarta.annotation.Nullable + public String getSlPrice() { + return slPrice; + } + + public void setSlPrice(@jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + } + + public QueryCurrentUmOpenAlgoOrderResponse tpOrderType( + @jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + return this; + } + + /** + * Get tpOrderType + * + * @return tpOrderType + */ + @jakarta.annotation.Nullable + public String getTpOrderType() { + return tpOrderType; + } + + public void setTpOrderType(@jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + } + + public QueryCurrentUmOpenAlgoOrderResponse selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public QueryCurrentUmOpenAlgoOrderResponse workingType( + @jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public QueryCurrentUmOpenAlgoOrderResponse priceMatch( + @jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public QueryCurrentUmOpenAlgoOrderResponse closePosition( + @jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public QueryCurrentUmOpenAlgoOrderResponse priceProtect( + @jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public QueryCurrentUmOpenAlgoOrderResponse reduceOnly( + @jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public QueryCurrentUmOpenAlgoOrderResponse createTime( + @jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public QueryCurrentUmOpenAlgoOrderResponse updateTime( + @jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public QueryCurrentUmOpenAlgoOrderResponse triggerTime( + @jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public QueryCurrentUmOpenAlgoOrderResponse 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; + } + QueryCurrentUmOpenAlgoOrderResponse queryCurrentUmOpenAlgoOrderResponse = + (QueryCurrentUmOpenAlgoOrderResponse) o; + return Objects.equals(this.algoId, queryCurrentUmOpenAlgoOrderResponse.algoId) + && Objects.equals( + this.clientAlgoId, queryCurrentUmOpenAlgoOrderResponse.clientAlgoId) + && Objects.equals(this.algoType, queryCurrentUmOpenAlgoOrderResponse.algoType) + && Objects.equals(this.orderType, queryCurrentUmOpenAlgoOrderResponse.orderType) + && Objects.equals(this.symbol, queryCurrentUmOpenAlgoOrderResponse.symbol) + && Objects.equals(this.side, queryCurrentUmOpenAlgoOrderResponse.side) + && Objects.equals( + this.positionSide, queryCurrentUmOpenAlgoOrderResponse.positionSide) + && Objects.equals(this.timeInForce, queryCurrentUmOpenAlgoOrderResponse.timeInForce) + && Objects.equals(this.quantity, queryCurrentUmOpenAlgoOrderResponse.quantity) + && Objects.equals(this.algoStatus, queryCurrentUmOpenAlgoOrderResponse.algoStatus) + && Objects.equals( + this.actualOrderId, queryCurrentUmOpenAlgoOrderResponse.actualOrderId) + && Objects.equals(this.actualPrice, queryCurrentUmOpenAlgoOrderResponse.actualPrice) + && Objects.equals( + this.triggerPrice, queryCurrentUmOpenAlgoOrderResponse.triggerPrice) + && Objects.equals(this.price, queryCurrentUmOpenAlgoOrderResponse.price) + && Objects.equals( + this.icebergQuantity, queryCurrentUmOpenAlgoOrderResponse.icebergQuantity) + && Objects.equals( + this.tpTriggerPrice, queryCurrentUmOpenAlgoOrderResponse.tpTriggerPrice) + && Objects.equals(this.tpPrice, queryCurrentUmOpenAlgoOrderResponse.tpPrice) + && Objects.equals( + this.slTriggerPrice, queryCurrentUmOpenAlgoOrderResponse.slTriggerPrice) + && Objects.equals(this.slPrice, queryCurrentUmOpenAlgoOrderResponse.slPrice) + && Objects.equals(this.tpOrderType, queryCurrentUmOpenAlgoOrderResponse.tpOrderType) + && Objects.equals( + this.selfTradePreventionMode, + queryCurrentUmOpenAlgoOrderResponse.selfTradePreventionMode) + && Objects.equals(this.workingType, queryCurrentUmOpenAlgoOrderResponse.workingType) + && Objects.equals(this.priceMatch, queryCurrentUmOpenAlgoOrderResponse.priceMatch) + && Objects.equals( + this.closePosition, queryCurrentUmOpenAlgoOrderResponse.closePosition) + && Objects.equals( + this.priceProtect, queryCurrentUmOpenAlgoOrderResponse.priceProtect) + && Objects.equals(this.reduceOnly, queryCurrentUmOpenAlgoOrderResponse.reduceOnly) + && Objects.equals(this.createTime, queryCurrentUmOpenAlgoOrderResponse.createTime) + && Objects.equals(this.updateTime, queryCurrentUmOpenAlgoOrderResponse.updateTime) + && Objects.equals(this.triggerTime, queryCurrentUmOpenAlgoOrderResponse.triggerTime) + && Objects.equals( + this.goodTillDate, queryCurrentUmOpenAlgoOrderResponse.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + actualOrderId, + actualPrice, + triggerPrice, + price, + icebergQuantity, + tpTriggerPrice, + tpPrice, + slTriggerPrice, + slPrice, + tpOrderType, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryCurrentUmOpenAlgoOrderResponse {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" actualOrderId: ").append(toIndentedString(actualOrderId)).append("\n"); + sb.append(" actualPrice: ").append(toIndentedString(actualPrice)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" tpTriggerPrice: ").append(toIndentedString(tpTriggerPrice)).append("\n"); + sb.append(" tpPrice: ").append(toIndentedString(tpPrice)).append("\n"); + sb.append(" slTriggerPrice: ").append(toIndentedString(slTriggerPrice)).append("\n"); + sb.append(" slPrice: ").append(toIndentedString(slPrice)).append("\n"); + sb.append(" tpOrderType: ").append(toIndentedString(tpOrderType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoIdValue = getAlgoId(); + String algoIdValueAsString = ""; + algoIdValueAsString = algoIdValue.toString(); + sb.append("algoId=").append(urlEncode(algoIdValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object orderTypeValue = getOrderType(); + String orderTypeValueAsString = ""; + orderTypeValueAsString = orderTypeValue.toString(); + sb.append("orderType=").append(urlEncode(orderTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object algoStatusValue = getAlgoStatus(); + String algoStatusValueAsString = ""; + algoStatusValueAsString = algoStatusValue.toString(); + sb.append("algoStatus=").append(urlEncode(algoStatusValueAsString)).append(""); + Object actualOrderIdValue = getActualOrderId(); + String actualOrderIdValueAsString = ""; + actualOrderIdValueAsString = actualOrderIdValue.toString(); + sb.append("actualOrderId=").append(urlEncode(actualOrderIdValueAsString)).append(""); + Object actualPriceValue = getActualPrice(); + String actualPriceValueAsString = ""; + actualPriceValueAsString = actualPriceValue.toString(); + sb.append("actualPrice=").append(urlEncode(actualPriceValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object icebergQuantityValue = getIcebergQuantity(); + String icebergQuantityValueAsString = ""; + icebergQuantityValueAsString = icebergQuantityValue.toString(); + sb.append("icebergQuantity=").append(urlEncode(icebergQuantityValueAsString)).append(""); + Object tpTriggerPriceValue = getTpTriggerPrice(); + String tpTriggerPriceValueAsString = ""; + tpTriggerPriceValueAsString = tpTriggerPriceValue.toString(); + sb.append("tpTriggerPrice=").append(urlEncode(tpTriggerPriceValueAsString)).append(""); + Object tpPriceValue = getTpPrice(); + String tpPriceValueAsString = ""; + tpPriceValueAsString = tpPriceValue.toString(); + sb.append("tpPrice=").append(urlEncode(tpPriceValueAsString)).append(""); + Object slTriggerPriceValue = getSlTriggerPrice(); + String slTriggerPriceValueAsString = ""; + slTriggerPriceValueAsString = slTriggerPriceValue.toString(); + sb.append("slTriggerPrice=").append(urlEncode(slTriggerPriceValueAsString)).append(""); + Object slPriceValue = getSlPrice(); + String slPriceValueAsString = ""; + slPriceValueAsString = slPriceValue.toString(); + sb.append("slPrice=").append(urlEncode(slPriceValueAsString)).append(""); + Object tpOrderTypeValue = getTpOrderType(); + String tpOrderTypeValueAsString = ""; + tpOrderTypeValueAsString = tpOrderTypeValue.toString(); + sb.append("tpOrderType=").append(urlEncode(tpOrderTypeValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object triggerTimeValue = getTriggerTime(); + String triggerTimeValueAsString = ""; + triggerTimeValueAsString = triggerTimeValue.toString(); + sb.append("triggerTime=").append(urlEncode(triggerTimeValueAsString)).append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("actualOrderId"); + openapiFields.add("actualPrice"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("tpTriggerPrice"); + openapiFields.add("tpPrice"); + openapiFields.add("slTriggerPrice"); + openapiFields.add("slPrice"); + openapiFields.add("tpOrderType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * QueryCurrentUmOpenAlgoOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryCurrentUmOpenAlgoOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QueryCurrentUmOpenAlgoOrderResponse is" + + " not found in the empty JSON string", + QueryCurrentUmOpenAlgoOrderResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("actualOrderId") != null && !jsonObj.get("actualOrderId").isJsonNull()) + && !jsonObj.get("actualOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualOrderId").toString())); + } + if ((jsonObj.get("actualPrice") != null && !jsonObj.get("actualPrice").isJsonNull()) + && !jsonObj.get("actualPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualPrice").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("tpTriggerPrice") != null && !jsonObj.get("tpTriggerPrice").isJsonNull()) + && !jsonObj.get("tpTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpTriggerPrice").toString())); + } + if ((jsonObj.get("tpPrice") != null && !jsonObj.get("tpPrice").isJsonNull()) + && !jsonObj.get("tpPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("tpPrice").toString())); + } + if ((jsonObj.get("slTriggerPrice") != null && !jsonObj.get("slTriggerPrice").isJsonNull()) + && !jsonObj.get("slTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("slTriggerPrice").toString())); + } + if ((jsonObj.get("slPrice") != null && !jsonObj.get("slPrice").isJsonNull()) + && !jsonObj.get("slPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slPrice").toString())); + } + if ((jsonObj.get("tpOrderType") != null && !jsonObj.get("tpOrderType").isJsonNull()) + && !jsonObj.get("tpOrderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpOrderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpOrderType").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryCurrentUmOpenAlgoOrderResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryCurrentUmOpenAlgoOrderResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QueryCurrentUmOpenAlgoOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryCurrentUmOpenAlgoOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryCurrentUmOpenAlgoOrderResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryCurrentUmOpenAlgoOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryCurrentUmOpenAlgoOrderResponse + * @throws IOException if the JSON string is invalid with respect to + * QueryCurrentUmOpenAlgoOrderResponse + */ + public static QueryCurrentUmOpenAlgoOrderResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, QueryCurrentUmOpenAlgoOrderResponse.class); + } + + /** + * Convert an instance of QueryCurrentUmOpenAlgoOrderResponse 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/rest/model/QueryUmAlgoOrderHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmAlgoOrderHistoryResponse.java new file mode 100644 index 000000000..ddbbf6a5a --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmAlgoOrderHistoryResponse.java @@ -0,0 +1,188 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.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.*; + +/** QueryUmAlgoOrderHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryUmAlgoOrderHistoryResponse + extends ArrayList { + public QueryUmAlgoOrderHistoryResponse() {} + + @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 QueryUmAlgoOrderHistoryResponse {\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 + * QueryUmAlgoOrderHistoryResponse + */ + 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) { + QueryUmAlgoOrderHistoryResponseInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!QueryUmAlgoOrderHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QueryUmAlgoOrderHistoryResponse is not" + + " found in the empty JSON string", + QueryUmAlgoOrderHistoryResponse.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryUmAlgoOrderHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryUmAlgoOrderHistoryResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QueryUmAlgoOrderHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryUmAlgoOrderHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public QueryUmAlgoOrderHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryUmAlgoOrderHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryUmAlgoOrderHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * QueryUmAlgoOrderHistoryResponse + */ + public static QueryUmAlgoOrderHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryUmAlgoOrderHistoryResponse.class); + } + + /** + * Convert an instance of QueryUmAlgoOrderHistoryResponse 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/rest/model/QueryUmAlgoOrderHistoryResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmAlgoOrderHistoryResponseInner.java new file mode 100644 index 000000000..8b55acee6 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmAlgoOrderHistoryResponseInner.java @@ -0,0 +1,1395 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.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.*; + +/** QueryUmAlgoOrderHistoryResponseInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryUmAlgoOrderHistoryResponseInner { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_ACTUAL_ORDER_ID = "actualOrderId"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_ORDER_ID) + @jakarta.annotation.Nullable + private String actualOrderId; + + public static final String SERIALIZED_NAME_ACTUAL_PRICE = "actualPrice"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_PRICE) + @jakarta.annotation.Nullable + private String actualPrice; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_TP_TRIGGER_PRICE = "tpTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_TP_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String tpTriggerPrice; + + public static final String SERIALIZED_NAME_TP_PRICE = "tpPrice"; + + @SerializedName(SERIALIZED_NAME_TP_PRICE) + @jakarta.annotation.Nullable + private String tpPrice; + + public static final String SERIALIZED_NAME_SL_TRIGGER_PRICE = "slTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_SL_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String slTriggerPrice; + + public static final String SERIALIZED_NAME_SL_PRICE = "slPrice"; + + @SerializedName(SERIALIZED_NAME_SL_PRICE) + @jakarta.annotation.Nullable + private String slPrice; + + public static final String SERIALIZED_NAME_TP_ORDER_TYPE = "tpOrderType"; + + @SerializedName(SERIALIZED_NAME_TP_ORDER_TYPE) + @jakarta.annotation.Nullable + private String tpOrderType; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public QueryUmAlgoOrderHistoryResponseInner() {} + + public QueryUmAlgoOrderHistoryResponseInner algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public QueryUmAlgoOrderHistoryResponseInner clientAlgoId( + @jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public QueryUmAlgoOrderHistoryResponseInner algoType( + @jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public QueryUmAlgoOrderHistoryResponseInner orderType( + @jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public QueryUmAlgoOrderHistoryResponseInner 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 QueryUmAlgoOrderHistoryResponseInner 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 QueryUmAlgoOrderHistoryResponseInner positionSide( + @jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public QueryUmAlgoOrderHistoryResponseInner 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 QueryUmAlgoOrderHistoryResponseInner quantity( + @jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public QueryUmAlgoOrderHistoryResponseInner algoStatus( + @jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public QueryUmAlgoOrderHistoryResponseInner actualOrderId( + @jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + return this; + } + + /** + * Get actualOrderId + * + * @return actualOrderId + */ + @jakarta.annotation.Nullable + public String getActualOrderId() { + return actualOrderId; + } + + public void setActualOrderId(@jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + } + + public QueryUmAlgoOrderHistoryResponseInner actualPrice( + @jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + return this; + } + + /** + * Get actualPrice + * + * @return actualPrice + */ + @jakarta.annotation.Nullable + public String getActualPrice() { + return actualPrice; + } + + public void setActualPrice(@jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + } + + public QueryUmAlgoOrderHistoryResponseInner triggerPrice( + @jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public QueryUmAlgoOrderHistoryResponseInner 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 QueryUmAlgoOrderHistoryResponseInner icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public QueryUmAlgoOrderHistoryResponseInner tpTriggerPrice( + @jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + return this; + } + + /** + * Get tpTriggerPrice + * + * @return tpTriggerPrice + */ + @jakarta.annotation.Nullable + public String getTpTriggerPrice() { + return tpTriggerPrice; + } + + public void setTpTriggerPrice(@jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + } + + public QueryUmAlgoOrderHistoryResponseInner tpPrice( + @jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + return this; + } + + /** + * Get tpPrice + * + * @return tpPrice + */ + @jakarta.annotation.Nullable + public String getTpPrice() { + return tpPrice; + } + + public void setTpPrice(@jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + } + + public QueryUmAlgoOrderHistoryResponseInner slTriggerPrice( + @jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + return this; + } + + /** + * Get slTriggerPrice + * + * @return slTriggerPrice + */ + @jakarta.annotation.Nullable + public String getSlTriggerPrice() { + return slTriggerPrice; + } + + public void setSlTriggerPrice(@jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + } + + public QueryUmAlgoOrderHistoryResponseInner slPrice( + @jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + return this; + } + + /** + * Get slPrice + * + * @return slPrice + */ + @jakarta.annotation.Nullable + public String getSlPrice() { + return slPrice; + } + + public void setSlPrice(@jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + } + + public QueryUmAlgoOrderHistoryResponseInner tpOrderType( + @jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + return this; + } + + /** + * Get tpOrderType + * + * @return tpOrderType + */ + @jakarta.annotation.Nullable + public String getTpOrderType() { + return tpOrderType; + } + + public void setTpOrderType(@jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + } + + public QueryUmAlgoOrderHistoryResponseInner selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public QueryUmAlgoOrderHistoryResponseInner workingType( + @jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public QueryUmAlgoOrderHistoryResponseInner priceMatch( + @jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public QueryUmAlgoOrderHistoryResponseInner closePosition( + @jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public QueryUmAlgoOrderHistoryResponseInner priceProtect( + @jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public QueryUmAlgoOrderHistoryResponseInner reduceOnly( + @jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public QueryUmAlgoOrderHistoryResponseInner createTime( + @jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public QueryUmAlgoOrderHistoryResponseInner updateTime( + @jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public QueryUmAlgoOrderHistoryResponseInner triggerTime( + @jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public QueryUmAlgoOrderHistoryResponseInner 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; + } + QueryUmAlgoOrderHistoryResponseInner queryUmAlgoOrderHistoryResponseInner = + (QueryUmAlgoOrderHistoryResponseInner) o; + return Objects.equals(this.algoId, queryUmAlgoOrderHistoryResponseInner.algoId) + && Objects.equals( + this.clientAlgoId, queryUmAlgoOrderHistoryResponseInner.clientAlgoId) + && Objects.equals(this.algoType, queryUmAlgoOrderHistoryResponseInner.algoType) + && Objects.equals(this.orderType, queryUmAlgoOrderHistoryResponseInner.orderType) + && Objects.equals(this.symbol, queryUmAlgoOrderHistoryResponseInner.symbol) + && Objects.equals(this.side, queryUmAlgoOrderHistoryResponseInner.side) + && Objects.equals( + this.positionSide, queryUmAlgoOrderHistoryResponseInner.positionSide) + && Objects.equals( + this.timeInForce, queryUmAlgoOrderHistoryResponseInner.timeInForce) + && Objects.equals(this.quantity, queryUmAlgoOrderHistoryResponseInner.quantity) + && Objects.equals(this.algoStatus, queryUmAlgoOrderHistoryResponseInner.algoStatus) + && Objects.equals( + this.actualOrderId, queryUmAlgoOrderHistoryResponseInner.actualOrderId) + && Objects.equals( + this.actualPrice, queryUmAlgoOrderHistoryResponseInner.actualPrice) + && Objects.equals( + this.triggerPrice, queryUmAlgoOrderHistoryResponseInner.triggerPrice) + && Objects.equals(this.price, queryUmAlgoOrderHistoryResponseInner.price) + && Objects.equals( + this.icebergQuantity, queryUmAlgoOrderHistoryResponseInner.icebergQuantity) + && Objects.equals( + this.tpTriggerPrice, queryUmAlgoOrderHistoryResponseInner.tpTriggerPrice) + && Objects.equals(this.tpPrice, queryUmAlgoOrderHistoryResponseInner.tpPrice) + && Objects.equals( + this.slTriggerPrice, queryUmAlgoOrderHistoryResponseInner.slTriggerPrice) + && Objects.equals(this.slPrice, queryUmAlgoOrderHistoryResponseInner.slPrice) + && Objects.equals( + this.tpOrderType, queryUmAlgoOrderHistoryResponseInner.tpOrderType) + && Objects.equals( + this.selfTradePreventionMode, + queryUmAlgoOrderHistoryResponseInner.selfTradePreventionMode) + && Objects.equals( + this.workingType, queryUmAlgoOrderHistoryResponseInner.workingType) + && Objects.equals(this.priceMatch, queryUmAlgoOrderHistoryResponseInner.priceMatch) + && Objects.equals( + this.closePosition, queryUmAlgoOrderHistoryResponseInner.closePosition) + && Objects.equals( + this.priceProtect, queryUmAlgoOrderHistoryResponseInner.priceProtect) + && Objects.equals(this.reduceOnly, queryUmAlgoOrderHistoryResponseInner.reduceOnly) + && Objects.equals(this.createTime, queryUmAlgoOrderHistoryResponseInner.createTime) + && Objects.equals(this.updateTime, queryUmAlgoOrderHistoryResponseInner.updateTime) + && Objects.equals( + this.triggerTime, queryUmAlgoOrderHistoryResponseInner.triggerTime) + && Objects.equals( + this.goodTillDate, queryUmAlgoOrderHistoryResponseInner.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + actualOrderId, + actualPrice, + triggerPrice, + price, + icebergQuantity, + tpTriggerPrice, + tpPrice, + slTriggerPrice, + slPrice, + tpOrderType, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryUmAlgoOrderHistoryResponseInner {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" actualOrderId: ").append(toIndentedString(actualOrderId)).append("\n"); + sb.append(" actualPrice: ").append(toIndentedString(actualPrice)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" tpTriggerPrice: ").append(toIndentedString(tpTriggerPrice)).append("\n"); + sb.append(" tpPrice: ").append(toIndentedString(tpPrice)).append("\n"); + sb.append(" slTriggerPrice: ").append(toIndentedString(slTriggerPrice)).append("\n"); + sb.append(" slPrice: ").append(toIndentedString(slPrice)).append("\n"); + sb.append(" tpOrderType: ").append(toIndentedString(tpOrderType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoIdValue = getAlgoId(); + String algoIdValueAsString = ""; + algoIdValueAsString = algoIdValue.toString(); + sb.append("algoId=").append(urlEncode(algoIdValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object orderTypeValue = getOrderType(); + String orderTypeValueAsString = ""; + orderTypeValueAsString = orderTypeValue.toString(); + sb.append("orderType=").append(urlEncode(orderTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object algoStatusValue = getAlgoStatus(); + String algoStatusValueAsString = ""; + algoStatusValueAsString = algoStatusValue.toString(); + sb.append("algoStatus=").append(urlEncode(algoStatusValueAsString)).append(""); + Object actualOrderIdValue = getActualOrderId(); + String actualOrderIdValueAsString = ""; + actualOrderIdValueAsString = actualOrderIdValue.toString(); + sb.append("actualOrderId=").append(urlEncode(actualOrderIdValueAsString)).append(""); + Object actualPriceValue = getActualPrice(); + String actualPriceValueAsString = ""; + actualPriceValueAsString = actualPriceValue.toString(); + sb.append("actualPrice=").append(urlEncode(actualPriceValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object icebergQuantityValue = getIcebergQuantity(); + String icebergQuantityValueAsString = ""; + icebergQuantityValueAsString = icebergQuantityValue.toString(); + sb.append("icebergQuantity=").append(urlEncode(icebergQuantityValueAsString)).append(""); + Object tpTriggerPriceValue = getTpTriggerPrice(); + String tpTriggerPriceValueAsString = ""; + tpTriggerPriceValueAsString = tpTriggerPriceValue.toString(); + sb.append("tpTriggerPrice=").append(urlEncode(tpTriggerPriceValueAsString)).append(""); + Object tpPriceValue = getTpPrice(); + String tpPriceValueAsString = ""; + tpPriceValueAsString = tpPriceValue.toString(); + sb.append("tpPrice=").append(urlEncode(tpPriceValueAsString)).append(""); + Object slTriggerPriceValue = getSlTriggerPrice(); + String slTriggerPriceValueAsString = ""; + slTriggerPriceValueAsString = slTriggerPriceValue.toString(); + sb.append("slTriggerPrice=").append(urlEncode(slTriggerPriceValueAsString)).append(""); + Object slPriceValue = getSlPrice(); + String slPriceValueAsString = ""; + slPriceValueAsString = slPriceValue.toString(); + sb.append("slPrice=").append(urlEncode(slPriceValueAsString)).append(""); + Object tpOrderTypeValue = getTpOrderType(); + String tpOrderTypeValueAsString = ""; + tpOrderTypeValueAsString = tpOrderTypeValue.toString(); + sb.append("tpOrderType=").append(urlEncode(tpOrderTypeValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object triggerTimeValue = getTriggerTime(); + String triggerTimeValueAsString = ""; + triggerTimeValueAsString = triggerTimeValue.toString(); + sb.append("triggerTime=").append(urlEncode(triggerTimeValueAsString)).append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("actualOrderId"); + openapiFields.add("actualPrice"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("tpTriggerPrice"); + openapiFields.add("tpPrice"); + openapiFields.add("slTriggerPrice"); + openapiFields.add("slPrice"); + openapiFields.add("tpOrderType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * QueryUmAlgoOrderHistoryResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryUmAlgoOrderHistoryResponseInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QueryUmAlgoOrderHistoryResponseInner" + + " is not found in the empty JSON string", + QueryUmAlgoOrderHistoryResponseInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("actualOrderId") != null && !jsonObj.get("actualOrderId").isJsonNull()) + && !jsonObj.get("actualOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualOrderId").toString())); + } + if ((jsonObj.get("actualPrice") != null && !jsonObj.get("actualPrice").isJsonNull()) + && !jsonObj.get("actualPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualPrice").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("tpTriggerPrice") != null && !jsonObj.get("tpTriggerPrice").isJsonNull()) + && !jsonObj.get("tpTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpTriggerPrice").toString())); + } + if ((jsonObj.get("tpPrice") != null && !jsonObj.get("tpPrice").isJsonNull()) + && !jsonObj.get("tpPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("tpPrice").toString())); + } + if ((jsonObj.get("slTriggerPrice") != null && !jsonObj.get("slTriggerPrice").isJsonNull()) + && !jsonObj.get("slTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("slTriggerPrice").toString())); + } + if ((jsonObj.get("slPrice") != null && !jsonObj.get("slPrice").isJsonNull()) + && !jsonObj.get("slPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slPrice").toString())); + } + if ((jsonObj.get("tpOrderType") != null && !jsonObj.get("tpOrderType").isJsonNull()) + && !jsonObj.get("tpOrderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpOrderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpOrderType").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryUmAlgoOrderHistoryResponseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryUmAlgoOrderHistoryResponseInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QueryUmAlgoOrderHistoryResponseInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, QueryUmAlgoOrderHistoryResponseInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryUmAlgoOrderHistoryResponseInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryUmAlgoOrderHistoryResponseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryUmAlgoOrderHistoryResponseInner + * @throws IOException if the JSON string is invalid with respect to + * QueryUmAlgoOrderHistoryResponseInner + */ + public static QueryUmAlgoOrderHistoryResponseInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, QueryUmAlgoOrderHistoryResponseInner.class); + } + + /** + * Convert an instance of QueryUmAlgoOrderHistoryResponseInner 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/JSON.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/JSON.java index 4bba00222..5f2adc3de 100644 --- 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 @@ -91,6 +91,11 @@ public static GsonBuilder createGson() { .derivatives_trading_portfolio_margin .websocket.stream.model.AccountUpdate .class); + classByDiscriminatorValue.put( + "ALGO_UPDATE", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.AlgoUpdate.class); classByDiscriminatorValue.put( "CONDITIONAL_ORDER_TRADE_UPDATE", com.binance.connector.client @@ -157,6 +162,11 @@ public static GsonBuilder createGson() { .derivatives_trading_portfolio_margin .websocket.stream.model.AccountUpdate .class); + classByDiscriminatorValue.put( + "algoUpdate", + com.binance.connector.client + .derivatives_trading_portfolio_margin + .websocket.stream.model.AlgoUpdate.class); classByDiscriminatorValue.put( "balanceupdate", com.binance.connector.client @@ -289,6 +299,12 @@ private static Class getClassByDiscriminator( 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.AlgoUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket + .stream.model.AlgoUpdateAo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.websocket .stream.model.Balanceupdate.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java index 68fd8b025..43a6a0cfc 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java @@ -19,7 +19,7 @@ public class DerivativesTradingPortfolioMarginWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; @@ -40,6 +40,12 @@ public DerivativesTradingPortfolioMarginWebSocketStreams(StreamConnectionInterfa this.connection = connection; } + public void stop() throws Exception { + if (connection != null && connection.isConnected()) { + connection.stop(); + } + } + /** * Subscribes to the user data WebSocket stream using the provided listen key. * diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AlgoUpdate.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AlgoUpdate.java new file mode 100644 index 000000000..956bab733 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AlgoUpdate.java @@ -0,0 +1,356 @@ +/* + * 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.*; + +/** AlgoUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlgoUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_FS = "fs"; + + @SerializedName(SERIALIZED_NAME_FS) + @jakarta.annotation.Nullable + private String fs; + + public static final String SERIALIZED_NAME_AO = "ao"; + + @SerializedName(SERIALIZED_NAME_AO) + @jakarta.annotation.Nullable + private AlgoUpdateAo ao; + + public AlgoUpdate() {} + + public AlgoUpdate T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public AlgoUpdate E(@jakarta.annotation.Nullable Long E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public Long getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable Long E) { + this.E = E; + } + + public AlgoUpdate 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 AlgoUpdate ao(@jakarta.annotation.Nullable AlgoUpdateAo ao) { + this.ao = ao; + return this; + } + + /** + * Get ao + * + * @return ao + */ + @jakarta.annotation.Nullable + @Valid + public AlgoUpdateAo getAo() { + return ao; + } + + public void setAo(@jakarta.annotation.Nullable AlgoUpdateAo ao) { + this.ao = ao; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlgoUpdate algoUpdate = (AlgoUpdate) o; + return Objects.equals(this.T, algoUpdate.T) + && Objects.equals(this.E, algoUpdate.E) + && Objects.equals(this.fs, algoUpdate.fs) + && Objects.equals(this.ao, algoUpdate.ao); + } + + @Override + public int hashCode() { + return Objects.hash(T, E, fs, ao); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlgoUpdate {\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" fs: ").append(toIndentedString(fs)).append("\n"); + sb.append(" ao: ").append(toIndentedString(ao)).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); + } + AlgoUpdateAo aoValue = getAo(); + if (aoValue != null) { + String aoValueAsString = JSON.getGson().toJson(aoValue); + valMap.put("ao", aoValueAsString); + } + + 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 aoValue = getAo(); + if (aoValue != null) { + valMap.put("ao", aoValue); + } + + 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("ao"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AlgoUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AlgoUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AlgoUpdate is not found in the empty" + + " JSON string", + AlgoUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AlgoUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AlgoUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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 `ao` + if (jsonObj.get("ao") != null && !jsonObj.get("ao").isJsonNull()) { + AlgoUpdateAo.validateJsonElement(jsonObj.get("ao")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AlgoUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AlgoUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AlgoUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AlgoUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AlgoUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AlgoUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of AlgoUpdate + * @throws IOException if the JSON string is invalid with respect to AlgoUpdate + */ + public static AlgoUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AlgoUpdate.class); + } + + /** + * Convert an instance of AlgoUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AlgoUpdateAo.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AlgoUpdateAo.java new file mode 100644 index 000000000..f8fb96571 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/AlgoUpdateAo.java @@ -0,0 +1,1296 @@ +/* + * 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.*; + +/** AlgoUpdateAo */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlgoUpdateAo extends BaseDTO { + public static final String SERIALIZED_NAME_CAID = "caid"; + + @SerializedName(SERIALIZED_NAME_CAID) + @jakarta.annotation.Nullable + private String caid; + + public static final String SERIALIZED_NAME_AID = "aid"; + + @SerializedName(SERIALIZED_NAME_AID) + @jakarta.annotation.Nullable + private Long aid; + + public static final String SERIALIZED_NAME_AT = "at"; + + @SerializedName(SERIALIZED_NAME_AT) + @jakarta.annotation.Nullable + private String at; + + public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; + + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @jakarta.annotation.Nullable + private String oLowerCase; + + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public static final String SERIALIZED_NAME_S = "S"; + + @SerializedName(SERIALIZED_NAME_S) + @jakarta.annotation.Nullable + private String S; + + public static final String SERIALIZED_NAME_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public static final String SERIALIZED_NAME_F_LOWER_CASE = "f"; + + @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) + @jakarta.annotation.Nullable + private String fLowerCase; + + public static final String SERIALIZED_NAME_Q_LOWER_CASE = "q"; + + @SerializedName(SERIALIZED_NAME_Q_LOWER_CASE) + @jakarta.annotation.Nullable + private String qLowerCase; + + public static final String SERIALIZED_NAME_X = "X"; + + @SerializedName(SERIALIZED_NAME_X) + @jakarta.annotation.Nullable + private String X; + + public static final String SERIALIZED_NAME_AI = "ai"; + + @SerializedName(SERIALIZED_NAME_AI) + @jakarta.annotation.Nullable + private String ai; + + public static final String SERIALIZED_NAME_AP = "ap"; + + @SerializedName(SERIALIZED_NAME_AP) + @jakarta.annotation.Nullable + private String ap; + + public static final String SERIALIZED_NAME_AQ = "aq"; + + @SerializedName(SERIALIZED_NAME_AQ) + @jakarta.annotation.Nullable + private String aq; + + public static final String SERIALIZED_NAME_ACT = "act"; + + @SerializedName(SERIALIZED_NAME_ACT) + @jakarta.annotation.Nullable + private String act; + + public static final String SERIALIZED_NAME_TP = "tp"; + + @SerializedName(SERIALIZED_NAME_TP) + @jakarta.annotation.Nullable + private String tp; + + public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; + + @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) + @jakarta.annotation.Nullable + private String pLowerCase; + + public static final String SERIALIZED_NAME_V = "V"; + + @SerializedName(SERIALIZED_NAME_V) + @jakarta.annotation.Nullable + private String V; + + public static final String SERIALIZED_NAME_WT = "wt"; + + @SerializedName(SERIALIZED_NAME_WT) + @jakarta.annotation.Nullable + private String wt; + + public static final String SERIALIZED_NAME_PM = "pm"; + + @SerializedName(SERIALIZED_NAME_PM) + @jakarta.annotation.Nullable + private String pm; + + public static final String SERIALIZED_NAME_CP = "cp"; + + @SerializedName(SERIALIZED_NAME_CP) + @jakarta.annotation.Nullable + private Boolean cp; + + public static final String SERIALIZED_NAME_P_P = "pP"; + + @SerializedName(SERIALIZED_NAME_P_P) + @jakarta.annotation.Nullable + private Boolean pP; + + public static final String SERIALIZED_NAME_R = "R"; + + @SerializedName(SERIALIZED_NAME_R) + @jakarta.annotation.Nullable + private Boolean R; + + public static final String SERIALIZED_NAME_TT = "tt"; + + @SerializedName(SERIALIZED_NAME_TT) + @jakarta.annotation.Nullable + private Long tt; + + public static final String SERIALIZED_NAME_GTD = "gtd"; + + @SerializedName(SERIALIZED_NAME_GTD) + @jakarta.annotation.Nullable + private Long gtd; + + public static final String SERIALIZED_NAME_RM = "rm"; + + @SerializedName(SERIALIZED_NAME_RM) + @jakarta.annotation.Nullable + private String rm; + + public AlgoUpdateAo() {} + + public AlgoUpdateAo caid(@jakarta.annotation.Nullable String caid) { + this.caid = caid; + return this; + } + + /** + * Get caid + * + * @return caid + */ + @jakarta.annotation.Nullable + public String getCaid() { + return caid; + } + + public void setCaid(@jakarta.annotation.Nullable String caid) { + this.caid = caid; + } + + public AlgoUpdateAo aid(@jakarta.annotation.Nullable Long aid) { + this.aid = aid; + return this; + } + + /** + * Get aid + * + * @return aid + */ + @jakarta.annotation.Nullable + public Long getAid() { + return aid; + } + + public void setAid(@jakarta.annotation.Nullable Long aid) { + this.aid = aid; + } + + public AlgoUpdateAo at(@jakarta.annotation.Nullable String at) { + this.at = at; + return this; + } + + /** + * Get at + * + * @return at + */ + @jakarta.annotation.Nullable + public String getAt() { + return at; + } + + public void setAt(@jakarta.annotation.Nullable String at) { + this.at = at; + } + + public AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo ai(@jakarta.annotation.Nullable String ai) { + this.ai = ai; + return this; + } + + /** + * Get ai + * + * @return ai + */ + @jakarta.annotation.Nullable + public String getAi() { + return ai; + } + + public void setAi(@jakarta.annotation.Nullable String ai) { + this.ai = ai; + } + + public AlgoUpdateAo 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 AlgoUpdateAo aq(@jakarta.annotation.Nullable String aq) { + this.aq = aq; + return this; + } + + /** + * Get aq + * + * @return aq + */ + @jakarta.annotation.Nullable + public String getAq() { + return aq; + } + + public void setAq(@jakarta.annotation.Nullable String aq) { + this.aq = aq; + } + + public AlgoUpdateAo act(@jakarta.annotation.Nullable String act) { + this.act = act; + return this; + } + + /** + * Get act + * + * @return act + */ + @jakarta.annotation.Nullable + public String getAct() { + return act; + } + + public void setAct(@jakarta.annotation.Nullable String act) { + this.act = act; + } + + public AlgoUpdateAo tp(@jakarta.annotation.Nullable String tp) { + this.tp = tp; + return this; + } + + /** + * Get tp + * + * @return tp + */ + @jakarta.annotation.Nullable + public String getTp() { + return tp; + } + + public void setTp(@jakarta.annotation.Nullable String tp) { + this.tp = tp; + } + + public AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo 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 AlgoUpdateAo tt(@jakarta.annotation.Nullable Long tt) { + this.tt = tt; + return this; + } + + /** + * Get tt + * + * @return tt + */ + @jakarta.annotation.Nullable + public Long getTt() { + return tt; + } + + public void setTt(@jakarta.annotation.Nullable Long tt) { + this.tt = tt; + } + + public AlgoUpdateAo gtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + return this; + } + + /** + * Get gtd + * + * @return gtd + */ + @jakarta.annotation.Nullable + public Long getGtd() { + return gtd; + } + + public void setGtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + } + + public AlgoUpdateAo rm(@jakarta.annotation.Nullable String rm) { + this.rm = rm; + return this; + } + + /** + * Get rm + * + * @return rm + */ + @jakarta.annotation.Nullable + public String getRm() { + return rm; + } + + public void setRm(@jakarta.annotation.Nullable String rm) { + this.rm = rm; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlgoUpdateAo algoUpdateAo = (AlgoUpdateAo) o; + return Objects.equals(this.caid, algoUpdateAo.caid) + && Objects.equals(this.aid, algoUpdateAo.aid) + && Objects.equals(this.at, algoUpdateAo.at) + && Objects.equals(this.oLowerCase, algoUpdateAo.oLowerCase) + && Objects.equals(this.sLowerCase, algoUpdateAo.sLowerCase) + && Objects.equals(this.S, algoUpdateAo.S) + && Objects.equals(this.ps, algoUpdateAo.ps) + && Objects.equals(this.fLowerCase, algoUpdateAo.fLowerCase) + && Objects.equals(this.qLowerCase, algoUpdateAo.qLowerCase) + && Objects.equals(this.X, algoUpdateAo.X) + && Objects.equals(this.ai, algoUpdateAo.ai) + && Objects.equals(this.ap, algoUpdateAo.ap) + && Objects.equals(this.aq, algoUpdateAo.aq) + && Objects.equals(this.act, algoUpdateAo.act) + && Objects.equals(this.tp, algoUpdateAo.tp) + && Objects.equals(this.pLowerCase, algoUpdateAo.pLowerCase) + && Objects.equals(this.V, algoUpdateAo.V) + && Objects.equals(this.wt, algoUpdateAo.wt) + && Objects.equals(this.pm, algoUpdateAo.pm) + && Objects.equals(this.cp, algoUpdateAo.cp) + && Objects.equals(this.pP, algoUpdateAo.pP) + && Objects.equals(this.R, algoUpdateAo.R) + && Objects.equals(this.tt, algoUpdateAo.tt) + && Objects.equals(this.gtd, algoUpdateAo.gtd) + && Objects.equals(this.rm, algoUpdateAo.rm); + } + + @Override + public int hashCode() { + return Objects.hash( + caid, + aid, + at, + oLowerCase, + sLowerCase, + S, + ps, + fLowerCase, + qLowerCase, + X, + ai, + ap, + aq, + act, + tp, + pLowerCase, + V, + wt, + pm, + cp, + pP, + R, + tt, + gtd, + rm); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlgoUpdateAo {\n"); + sb.append(" caid: ").append(toIndentedString(caid)).append("\n"); + sb.append(" aid: ").append(toIndentedString(aid)).append("\n"); + sb.append(" at: ").append(toIndentedString(at)).append("\n"); + sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" S: ").append(toIndentedString(S)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); + sb.append(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" ai: ").append(toIndentedString(ai)).append("\n"); + sb.append(" ap: ").append(toIndentedString(ap)).append("\n"); + sb.append(" aq: ").append(toIndentedString(aq)).append("\n"); + sb.append(" act: ").append(toIndentedString(act)).append("\n"); + sb.append(" tp: ").append(toIndentedString(tp)).append("\n"); + sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); + sb.append(" wt: ").append(toIndentedString(wt)).append("\n"); + sb.append(" pm: ").append(toIndentedString(pm)).append("\n"); + sb.append(" cp: ").append(toIndentedString(cp)).append("\n"); + sb.append(" pP: ").append(toIndentedString(pP)).append("\n"); + sb.append(" R: ").append(toIndentedString(R)).append("\n"); + sb.append(" tt: ").append(toIndentedString(tt)).append("\n"); + sb.append(" gtd: ").append(toIndentedString(gtd)).append("\n"); + sb.append(" rm: ").append(toIndentedString(rm)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String caidValue = getCaid(); + if (caidValue != null) { + String caidValueAsString = caidValue.toString(); + valMap.put("caid", caidValueAsString); + } + Long aidValue = getAid(); + if (aidValue != null) { + String aidValueAsString = aidValue.toString(); + valMap.put("aid", aidValueAsString); + } + String atValue = getAt(); + if (atValue != null) { + String atValueAsString = atValue.toString(); + valMap.put("at", atValueAsString); + } + String oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + String oLowerCaseValueAsString = oLowerCaseValue.toString(); + valMap.put("oLowerCase", oLowerCaseValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + String SValue = getS(); + if (SValue != null) { + String SValueAsString = SValue.toString(); + valMap.put("S", SValueAsString); + } + String psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + String fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + String fLowerCaseValueAsString = fLowerCaseValue.toString(); + valMap.put("fLowerCase", fLowerCaseValueAsString); + } + String qLowerCaseValue = getqLowerCase(); + if (qLowerCaseValue != null) { + String qLowerCaseValueAsString = qLowerCaseValue.toString(); + valMap.put("qLowerCase", qLowerCaseValueAsString); + } + String XValue = getX(); + if (XValue != null) { + String XValueAsString = XValue.toString(); + valMap.put("X", XValueAsString); + } + String aiValue = getAi(); + if (aiValue != null) { + String aiValueAsString = aiValue.toString(); + valMap.put("ai", aiValueAsString); + } + String apValue = getAp(); + if (apValue != null) { + String apValueAsString = apValue.toString(); + valMap.put("ap", apValueAsString); + } + String aqValue = getAq(); + if (aqValue != null) { + String aqValueAsString = aqValue.toString(); + valMap.put("aq", aqValueAsString); + } + String actValue = getAct(); + if (actValue != null) { + String actValueAsString = actValue.toString(); + valMap.put("act", actValueAsString); + } + String tpValue = getTp(); + if (tpValue != null) { + String tpValueAsString = tpValue.toString(); + valMap.put("tp", tpValueAsString); + } + String pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + String pLowerCaseValueAsString = pLowerCaseValue.toString(); + valMap.put("pLowerCase", pLowerCaseValueAsString); + } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } + String wtValue = getWt(); + if (wtValue != null) { + String wtValueAsString = wtValue.toString(); + valMap.put("wt", wtValueAsString); + } + String pmValue = getPm(); + if (pmValue != null) { + String pmValueAsString = pmValue.toString(); + valMap.put("pm", pmValueAsString); + } + Boolean cpValue = getCp(); + if (cpValue != null) { + String cpValueAsString = cpValue.toString(); + valMap.put("cp", cpValueAsString); + } + Boolean pPValue = getpP(); + if (pPValue != null) { + String pPValueAsString = pPValue.toString(); + valMap.put("pP", pPValueAsString); + } + Boolean RValue = getR(); + if (RValue != null) { + String RValueAsString = RValue.toString(); + valMap.put("R", RValueAsString); + } + Long ttValue = getTt(); + if (ttValue != null) { + String ttValueAsString = ttValue.toString(); + valMap.put("tt", ttValueAsString); + } + Long gtdValue = getGtd(); + if (gtdValue != null) { + String gtdValueAsString = gtdValue.toString(); + valMap.put("gtd", gtdValueAsString); + } + String rmValue = getRm(); + if (rmValue != null) { + String rmValueAsString = rmValue.toString(); + valMap.put("rm", rmValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object caidValue = getCaid(); + if (caidValue != null) { + valMap.put("caid", caidValue); + } + Object aidValue = getAid(); + if (aidValue != null) { + valMap.put("aid", aidValue); + } + Object atValue = getAt(); + if (atValue != null) { + valMap.put("at", atValue); + } + Object oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + valMap.put("oLowerCase", oLowerCaseValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object SValue = getS(); + if (SValue != null) { + valMap.put("S", SValue); + } + Object psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + Object fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + valMap.put("fLowerCase", fLowerCaseValue); + } + Object qLowerCaseValue = getqLowerCase(); + if (qLowerCaseValue != null) { + valMap.put("qLowerCase", qLowerCaseValue); + } + Object XValue = getX(); + if (XValue != null) { + valMap.put("X", XValue); + } + Object aiValue = getAi(); + if (aiValue != null) { + valMap.put("ai", aiValue); + } + Object apValue = getAp(); + if (apValue != null) { + valMap.put("ap", apValue); + } + Object aqValue = getAq(); + if (aqValue != null) { + valMap.put("aq", aqValue); + } + Object actValue = getAct(); + if (actValue != null) { + valMap.put("act", actValue); + } + Object tpValue = getTp(); + if (tpValue != null) { + valMap.put("tp", tpValue); + } + Object pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + valMap.put("pLowerCase", pLowerCaseValue); + } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } + Object wtValue = getWt(); + if (wtValue != null) { + valMap.put("wt", wtValue); + } + Object pmValue = getPm(); + if (pmValue != null) { + valMap.put("pm", pmValue); + } + Object cpValue = getCp(); + if (cpValue != null) { + valMap.put("cp", cpValue); + } + Object pPValue = getpP(); + if (pPValue != null) { + valMap.put("pP", pPValue); + } + Object RValue = getR(); + if (RValue != null) { + valMap.put("R", RValue); + } + Object ttValue = getTt(); + if (ttValue != null) { + valMap.put("tt", ttValue); + } + Object gtdValue = getGtd(); + if (gtdValue != null) { + valMap.put("gtd", gtdValue); + } + Object rmValue = getRm(); + if (rmValue != null) { + valMap.put("rm", rmValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("caid"); + openapiFields.add("aid"); + openapiFields.add("at"); + openapiFields.add("o"); + openapiFields.add("s"); + openapiFields.add("S"); + openapiFields.add("ps"); + openapiFields.add("f"); + openapiFields.add("q"); + openapiFields.add("X"); + openapiFields.add("ai"); + openapiFields.add("ap"); + openapiFields.add("aq"); + openapiFields.add("act"); + openapiFields.add("tp"); + openapiFields.add("p"); + openapiFields.add("V"); + openapiFields.add("wt"); + openapiFields.add("pm"); + openapiFields.add("cp"); + openapiFields.add("pP"); + openapiFields.add("R"); + openapiFields.add("tt"); + openapiFields.add("gtd"); + openapiFields.add("rm"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AlgoUpdateAo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AlgoUpdateAo.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AlgoUpdateAo is not found in the empty" + + " JSON string", + AlgoUpdateAo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AlgoUpdateAo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AlgoUpdateAo` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("caid") != null && !jsonObj.get("caid").isJsonNull()) + && !jsonObj.get("caid").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `caid` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("caid").toString())); + } + if ((jsonObj.get("at") != null && !jsonObj.get("at").isJsonNull()) + && !jsonObj.get("at").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `at` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("at").toString())); + } + if ((jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) + && !jsonObj.get("o").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `o` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("o").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + if ((jsonObj.get("S") != null && !jsonObj.get("S").isJsonNull()) + && !jsonObj.get("S").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `S` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("S").toString())); + } + if ((jsonObj.get("ps") != null && !jsonObj.get("ps").isJsonNull()) + && !jsonObj.get("ps").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ps` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ps").toString())); + } + if ((jsonObj.get("f") != null && !jsonObj.get("f").isJsonNull()) + && !jsonObj.get("f").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `f` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("f").toString())); + } + if ((jsonObj.get("q") != null && !jsonObj.get("q").isJsonNull()) + && !jsonObj.get("q").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `q` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("q").toString())); + } + if ((jsonObj.get("X") != null && !jsonObj.get("X").isJsonNull()) + && !jsonObj.get("X").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `X` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("X").toString())); + } + if ((jsonObj.get("ai") != null && !jsonObj.get("ai").isJsonNull()) + && !jsonObj.get("ai").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ai` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ai").toString())); + } + if ((jsonObj.get("ap") != null && !jsonObj.get("ap").isJsonNull()) + && !jsonObj.get("ap").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ap` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ap").toString())); + } + if ((jsonObj.get("aq") != null && !jsonObj.get("aq").isJsonNull()) + && !jsonObj.get("aq").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `aq` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("aq").toString())); + } + if ((jsonObj.get("act") != null && !jsonObj.get("act").isJsonNull()) + && !jsonObj.get("act").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `act` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("act").toString())); + } + if ((jsonObj.get("tp") != null && !jsonObj.get("tp").isJsonNull()) + && !jsonObj.get("tp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tp` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("tp").toString())); + } + if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) + && !jsonObj.get("p").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `p` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("p").toString())); + } + if ((jsonObj.get("V") != null && !jsonObj.get("V").isJsonNull()) + && !jsonObj.get("V").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `V` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("V").toString())); + } + if ((jsonObj.get("wt") != null && !jsonObj.get("wt").isJsonNull()) + && !jsonObj.get("wt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `wt` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("wt").toString())); + } + if ((jsonObj.get("pm") != null && !jsonObj.get("pm").isJsonNull()) + && !jsonObj.get("pm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pm` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pm").toString())); + } + if ((jsonObj.get("rm") != null && !jsonObj.get("rm").isJsonNull()) + && !jsonObj.get("rm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rm` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("rm").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AlgoUpdateAo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AlgoUpdateAo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AlgoUpdateAo.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AlgoUpdateAo value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AlgoUpdateAo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AlgoUpdateAo given an JSON string + * + * @param jsonString JSON string + * @return An instance of AlgoUpdateAo + * @throws IOException if the JSON string is invalid with respect to AlgoUpdateAo + */ + public static AlgoUpdateAo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AlgoUpdateAo.class); + } + + /** + * Convert an instance of AlgoUpdateAo 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 index 0643340a8..3f668d6b1 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java @@ -285,6 +285,36 @@ public class Executionreport extends BaseDTO { @jakarta.annotation.Nullable private String B; + 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_E_R = "eR"; + + @SerializedName(SERIALIZED_NAME_E_R) + @jakarta.annotation.Nullable + private String eR; + public Executionreport() {} public Executionreport E(@jakarta.annotation.Nullable Long E) { @@ -1066,6 +1096,101 @@ public void setB(@jakarta.annotation.Nullable String B) { this.B = B; } + 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 eR(@jakarta.annotation.Nullable String eR) { + this.eR = eR; + return this; + } + + /** + * Get eR + * + * @return eR + */ + @jakarta.annotation.Nullable + public String geteR() { + return eR; + } + + public void seteR(@jakarta.annotation.Nullable String eR) { + this.eR = eR; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -1115,7 +1240,12 @@ public boolean equals(Object o) { && Objects.equals(this.uLowerCase, executionreport.uLowerCase) && Objects.equals(this.U, executionreport.U) && Objects.equals(this.A, executionreport.A) - && Objects.equals(this.B, executionreport.B); + && Objects.equals(this.B, executionreport.B) + && 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.eR, executionreport.eR); } @Override @@ -1161,7 +1291,12 @@ public int hashCode() { uLowerCase, U, A, - B); + B, + cs, + pl, + pL, + pY, + eR); } @Override @@ -1209,6 +1344,11 @@ public String toString() { 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(" 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(" eR: ").append(toIndentedString(eR)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1422,6 +1562,31 @@ public String toUrlQueryString() { String BValueAsString = BValue.toString(); valMap.put("B", BValueAsString); } + 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 eRValue = geteR(); + if (eRValue != null) { + String eRValueAsString = eRValue.toString(); + valMap.put("eR", eRValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -1597,6 +1762,26 @@ public Map toMap() { if (BValue != null) { valMap.put("B", BValue); } + 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 eRValue = geteR(); + if (eRValue != null) { + valMap.put("eR", eRValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -1664,6 +1849,11 @@ private String toIndentedString(Object o) { openapiFields.add("U"); openapiFields.add("A"); openapiFields.add("B"); + openapiFields.add("Cs"); + openapiFields.add("pl"); + openapiFields.add("pL"); + openapiFields.add("pY"); + openapiFields.add("eR"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1891,6 +2081,46 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " 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("eR") != null && !jsonObj.get("eR").isJsonNull()) + && !jsonObj.get("eR").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eR` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("eR").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-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 index d7eb38636..cc39a8c53 100644 --- 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 @@ -47,6 +47,8 @@ public TypeAdapter create(Gson gson, TypeToken type) { // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAlgoUpdate = + gson.getDelegateAdapter(this, TypeToken.get(AlgoUpdate.class)); final TypeAdapter adapterConditionalOrderTradeUpdate = gson.getDelegateAdapter(this, TypeToken.get(ConditionalOrderTradeUpdate.class)); final TypeAdapter adapterAccountConfigUpdate = @@ -80,6 +82,14 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) return; } + // check if the actual instance is of the type `AlgoUpdate` + if (value.getActualInstance() instanceof AlgoUpdate) { + JsonElement element = + adapterAlgoUpdate.toJsonTree( + (AlgoUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } // check if the actual instance is of the type // `ConditionalOrderTradeUpdate` if (value.getActualInstance() instanceof ConditionalOrderTradeUpdate) { @@ -173,11 +183,11 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) } 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"); + + " AccountConfigUpdate, AccountUpdate, AlgoUpdate," + + " Balanceupdate, ConditionalOrderTradeUpdate," + + " Executionreport, Liabilitychange, Listenkeyexpired," + + " Openorderloss, OrderTradeUpdate," + + " Outboundaccountposition, Risklevelchange"); } @Override @@ -211,6 +221,11 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { newUserDataStreamEventsResponse.setActualInstance( deserialized); return newUserDataStreamEventsResponse; + case "ALGO_UPDATE": + deserialized = adapterAlgoUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; case "CONDITIONAL_ORDER_TRADE_UPDATE": deserialized = adapterConditionalOrderTradeUpdate.fromJsonTree( @@ -279,6 +294,11 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { newUserDataStreamEventsResponse.setActualInstance( deserialized); return newUserDataStreamEventsResponse; + case "algoUpdate": + deserialized = adapterAlgoUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; case "balanceupdate": deserialized = adapterBalanceupdate.fromJsonTree(jsonObject); @@ -345,14 +365,15 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { + " for UserDataStreamEventsResponse." + " Possible values:" + " ACCOUNT_CONFIG_UPDATE" - + " ACCOUNT_UPDATE" + + " ACCOUNT_UPDATE ALGO_UPDATE" + " CONDITIONAL_ORDER_TRADE_UPDATE" + " ORDER_TRADE_UPDATE balanceUpdate" + " executionReport liabilityChange" + " listenKeyExpired openOrderLoss" + " outboundAccountPosition" + " riskLevelChange accountConfigUpdate" - + " accountUpdate balanceupdate" + + " accountUpdate algoUpdate" + + " balanceupdate" + " conditionalOrderTradeUpdate" + " executionreport liabilitychange" + " listenkeyexpired openorderloss" @@ -368,6 +389,24 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; + // deserialize AlgoUpdate + try { + // validate the JSON object to see if any exception is thrown + AlgoUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterAlgoUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'AlgoUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AlgoUpdate failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AlgoUpdate'", + e); + } // deserialize ConditionalOrderTradeUpdate try { // validate the JSON object to see if any exception is thrown @@ -622,6 +661,7 @@ public UserDataStreamEventsResponse(Object o) { } static { + schemas.put("AlgoUpdate", AlgoUpdate.class); schemas.put("ConditionalOrderTradeUpdate", ConditionalOrderTradeUpdate.class); schemas.put("AccountConfigUpdate", AccountConfigUpdate.class); schemas.put("AccountUpdate", AccountUpdate.class); @@ -642,14 +682,19 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: AccountConfigUpdate, AccountUpdate, Balanceupdate, - * ConditionalOrderTradeUpdate, Executionreport, Liabilitychange, Listenkeyexpired, - * Openorderloss, OrderTradeUpdate, Outboundaccountposition, Risklevelchange + * against the oneOf child schemas: AccountConfigUpdate, AccountUpdate, AlgoUpdate, + * 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 AlgoUpdate) { + super.setActualInstance(instance); + return; + } + if (instance instanceof ConditionalOrderTradeUpdate) { super.setActualInstance(instance); return; @@ -706,18 +751,18 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( - "Invalid instance type. Must be AccountConfigUpdate, AccountUpdate, Balanceupdate," - + " ConditionalOrderTradeUpdate, Executionreport, Liabilitychange," - + " Listenkeyexpired, Openorderloss, OrderTradeUpdate, Outboundaccountposition," - + " Risklevelchange"); + "Invalid instance type. Must be AccountConfigUpdate, AccountUpdate, AlgoUpdate," + + " Balanceupdate, ConditionalOrderTradeUpdate, Executionreport," + + " Liabilitychange, Listenkeyexpired, Openorderloss, OrderTradeUpdate," + + " Outboundaccountposition, Risklevelchange"); } /** * Get the actual instance, which can be the following: AccountConfigUpdate, AccountUpdate, - * Balanceupdate, ConditionalOrderTradeUpdate, Executionreport, Liabilitychange, + * AlgoUpdate, Balanceupdate, ConditionalOrderTradeUpdate, Executionreport, Liabilitychange, * Listenkeyexpired, Openorderloss, OrderTradeUpdate, Outboundaccountposition, Risklevelchange * - * @return The actual instance (AccountConfigUpdate, AccountUpdate, Balanceupdate, + * @return The actual instance (AccountConfigUpdate, AccountUpdate, AlgoUpdate, Balanceupdate, * ConditionalOrderTradeUpdate, Executionreport, Liabilitychange, Listenkeyexpired, * Openorderloss, OrderTradeUpdate, Outboundaccountposition, Risklevelchange) */ @@ -727,6 +772,17 @@ public Object getActualInstance() { return super.getActualInstance(); } + /** + * Get the actual instance of `AlgoUpdate`. If the actual instance is not `AlgoUpdate`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `AlgoUpdate` + * @throws ClassCastException if the instance is not `AlgoUpdate` + */ + public AlgoUpdate getAlgoUpdate() throws ClassCastException { + return (AlgoUpdate) super.getActualInstance(); + } + /** * Get the actual instance of `ConditionalOrderTradeUpdate`. If the actual instance is not * `ConditionalOrderTradeUpdate`, the ClassCastException will be thrown. @@ -859,6 +915,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate oneOf schemas one by one int validCount = 0; ArrayList errorMessages = new ArrayList<>(); + // validate the json string with AlgoUpdate + try { + AlgoUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AlgoUpdate failed with `%s`.", e.getMessage())); + // continue to the next one + } // validate the json string with ConditionalOrderTradeUpdate try { ConditionalOrderTradeUpdate.validateJsonElement(jsonElement); @@ -981,12 +1047,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IOException( String.format( "The JSON string is invalid for UserDataStreamEventsResponse with oneOf" - + " schemas: AccountConfigUpdate, AccountUpdate, 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", + + " schemas: AccountConfigUpdate, AccountUpdate, AlgoUpdate," + + " 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())); } } diff --git a/clients/derivatives-trading-usds-futures/CHANGELOG.md b/clients/derivatives-trading-usds-futures/CHANGELOG.md index 88926b849..d55938826 100644 --- a/clients/derivatives-trading-usds-futures/CHANGELOG.md +++ b/clients/derivatives-trading-usds-futures/CHANGELOG.md @@ -1,6 +1,31 @@ # Changelog +## 11.0.0 - 2026-05-04 + +- Added stop method for WebSocket + +### Changed (3) + +#### REST API + +- Deleted parameter `page` + - affected methods: + - `queryAllAlgoOrders()` (`GET /fapi/v1/allAlgoOrders`) +- Modified parameter `interval`: + - enum added: `1s` + - affected methods: + - `continuousContractKlineCandlestickData()` (`GET /fapi/v1/continuousKlines`) + - `indexPriceKlineCandlestickData()` (`GET /fapi/v1/indexPriceKlines`) + - `klineCandlestickData()` (`GET /fapi/v1/klines`) + - `markPriceKlineCandlestickData()` (`GET /fapi/v1/markPriceKlines`) + - `premiumIndexKlineData()` (`GET /fapi/v1/premiumIndexKlines`) +- Modified parameter `limit`: + - required: `true` → `false` + - affected methods: + - `basis()` (`GET /futures/data/basis`) + ## 10.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 10.0.0 - 2026-03-18 diff --git a/clients/derivatives-trading-usds-futures/docs/Interval.md b/clients/derivatives-trading-usds-futures/docs/Interval.md index 2d3269745..a24ddebb9 100644 --- a/clients/derivatives-trading-usds-futures/docs/Interval.md +++ b/clients/derivatives-trading-usds-futures/docs/Interval.md @@ -5,6 +5,8 @@ ## Enum +* `INTERVAL_1s` (value: `"1s"`) + * `INTERVAL_1m` (value: `"1m"`) * `INTERVAL_3m` (value: `"3m"`) diff --git a/clients/derivatives-trading-usds-futures/docs/MarketApi.md b/clients/derivatives-trading-usds-futures/docs/MarketApi.md index ad1bdf4ab..5ec3d72ae 100644 --- a/clients/derivatives-trading-usds-futures/docs/MarketApi.md +++ b/clients/derivatives-trading-usds-futures/docs/MarketApi.md @@ -89,7 +89,7 @@ No authorization required All Market Liquidation Order Streams -The All Liquidation Order Snapshot Streams push force liquidation order information for all symbols in the market. For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. Update Speed: 1000ms +The All Liquidation Order Snapshot Streams push force liquidation order information for all symbols in the market. For each symbol,only the largest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. Update Speed: 1000ms ### Example ```java @@ -647,7 +647,7 @@ No authorization required Liquidation Order Streams -The Liquidation Order Snapshot Streams push force liquidation order information for specific symbol. For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. Update Speed: 1000ms +The Liquidation Order Snapshot Streams push force liquidation order information for specific symbol. For each symbol,only the largest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. Update Speed: 1000ms ### Example ```java diff --git a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md index a3f7d7f49..a02e114bb 100644 --- a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-usds-futures - 10.0.0 + 11.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-usds-futures - 10.0.0 + 11.0.0 ``` diff --git a/clients/derivatives-trading-usds-futures/example_rest.md b/clients/derivatives-trading-usds-futures/example_rest.md index 8558d7d32..bd054e84f 100644 --- a/clients/derivatives-trading-usds-futures/example_rest.md +++ b/clients/derivatives-trading-usds-futures/example_rest.md @@ -156,7 +156,7 @@ [GET /fapi/v1/openOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) - currentAllOpenOrders - [CurrentAllOpenOrdersExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CurrentAllOpenOrdersExample.java#L49) -[POST /fapi/v1/stock/contract](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Futures-TradFi-Perps-Contract) - futuresTradfiPerpsContract - [FuturesTradfiPerpsContractExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java#L48) +[POST /fapi/v1/stock/contract](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Futures-TradFi-Perps-Contract) - futuresTradfiPerpsContract - [FuturesTradfiPerpsContractExample.java:46](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java#L46) [GET /fapi/v1/orderAmendment](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) - getOrderModifyHistory - [GetOrderModifyHistoryExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/GetOrderModifyHistoryExample.java#L49) @@ -190,7 +190,7 @@ [POST /fapi/v1/order/test](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test) - testOrder - [TestOrderExample.java:86](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/TestOrderExample.java#L86) -[GET /fapi/v1/forceOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) - usersForceOrders - [UsersForceOrdersExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/UsersForceOrdersExample.java#L50) +[GET /fapi/v1/forceOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) - usersForceOrders - [UsersForceOrdersExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/UsersForceOrdersExample.java#L51) ## UserDataStreams diff --git a/clients/derivatives-trading-usds-futures/pom.xml b/clients/derivatives-trading-usds-futures/pom.xml index 560a91e2c..1d166599d 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 - 10.0.1 + 11.0.0 jar diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java index 3cf467ca2..1325d2a2c 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 @@ -296,9 +296,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .FuturesTradfiPerpsContractRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_usds_futures.rest.model - .FuturesTradfiPerpsContractResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .FuturesTradingQuantitativeRulesIndicatorsResponse 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 be818150f..930779143 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/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.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 a82611cf9..f246b221b 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/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java index 08635fcff..84cd7ae51 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 @@ -42,7 +42,6 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesAccountBalanceV3Response; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesAccountConfigurationResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradingQuantitativeRulesIndicatorsResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.GetBnbBurnStatusResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.GetCurrentMultiAssetsModeResponse; @@ -827,7 +826,7 @@ public ApiResponse adlRisk(String symbol) throws ApiException { * @param period * \"5m\",\"15m\",\"30m\",\"1h\",\"2h\",\"4h\",\"6h\",\"12h\",\"1d\" * (required) - * @param limit Default 30,Max 500 (required) + * @param limit Default 100; max 1000 (optional) * @param startTime (optional) * @param endTime (optional) * @return ApiResponse<BasisResponse> @@ -1235,7 +1234,7 @@ public ApiResponse multiAssetsModeAssetIndex( * Old Trades Lookup (MARKET_DATA) Get older market historical trades. * Market trades means * trades filled in the order book. Only market trades will be returned, which means the * insurance fund trades and ADL trades won't be returned. * Only supports data from within - * the last three months Weight: 20 + * the last one month Weight: 20 * * @param symbol (required) * @param limit Default 100; max 1000 (optional) @@ -2176,24 +2175,24 @@ public ApiResponse currentAllOpenOrders( * Futures TradFi Perps Contract(USER_DATA) Sign TradFi-Perps agreement contract Weight: 0 * * @param futuresTradfiPerpsContractRequest (required) - * @return ApiResponse<FuturesTradfiPerpsContractResponse> + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Futures TradFi Perps Contract -
200 OK -
* * @see Futures * TradFi Perps Contract(USER_DATA) Documentation */ - public ApiResponse futuresTradfiPerpsContract( + public void futuresTradfiPerpsContract( FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) throws ApiException { - return tradeApi.futuresTradfiPerpsContract(futuresTradfiPerpsContractRequest); + tradeApi.futuresTradfiPerpsContract(futuresTradfiPerpsContractRequest); } /** @@ -2595,7 +2594,6 @@ public ApiResponse queryAlgoOrder( * @param algoId (optional) * @param startTime (optional) * @param endTime (optional) - * @param page (optional) * @param limit Default 100; max 1000 (optional) * @param recvWindow (optional) * @return ApiResponse<QueryAllAlgoOrdersResponse> @@ -2613,16 +2611,9 @@ public ApiResponse queryAlgoOrder( * All Algo Orders (USER_DATA) Documentation */ public ApiResponse queryAllAlgoOrders( - String symbol, - Long algoId, - Long startTime, - Long endTime, - Long page, - Long limit, - Long recvWindow) + String symbol, Long algoId, Long startTime, Long endTime, Long limit, Long recvWindow) throws ApiException { - return tradeApi.queryAllAlgoOrders( - symbol, algoId, startTime, endTime, page, limit, recvWindow); + return tradeApi.queryAllAlgoOrders(symbol, algoId, startTime, endTime, limit, recvWindow); } /** @@ -2749,7 +2740,8 @@ public ApiResponse testOrder(TestOrderRequest testOrderReques * User's Force Orders (USER_DATA) Query user's Force Orders * If * \"autoCloseType\" is not sent, orders with both of the types will be returned * If * \"startTime\" is not sent, data within 7 days before \"endTime\" can be - * queried Weight: 20 with symbol, 50 without symbol + * queried * Only support querying data in the past 90 days Weight: 20 with symbol, 50 without + * symbol * * @param symbol (optional) * @param autoCloseType \"LIQUIDATION\" for liquidation orders, \"ADL\" for 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 5a2740290..c694227f0 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 @@ -77,7 +77,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -255,7 +255,7 @@ public ApiResponse adlRisk(String symbol) throws ApiException { * @param period * \"5m\",\"15m\",\"30m\",\"1h\",\"2h\",\"4h\",\"6h\",\"12h\",\"1d\" * (required) - * @param limit Default 30,Max 500 (required) + * @param limit Default 100; max 1000 (optional) * @param startTime (optional) * @param endTime (optional) * @return Call to execute @@ -412,7 +412,7 @@ private okhttp3.Call basisValidateBeforeCall( * @param period * \"5m\",\"15m\",\"30m\",\"1h\",\"2h\",\"4h\",\"6h\",\"12h\",\"1d\" * (required) - * @param limit Default 30,Max 500 (required) + * @param limit Default 100; max 1000 (optional) * @param startTime (optional) * @param endTime (optional) * @return ApiResponse<BasisResponse> @@ -433,7 +433,7 @@ public ApiResponse basis( @NotNull String pair, @NotNull ContractType contractType, @NotNull Period period, - @NotNull Long limit, + Long limit, Long startTime, Long endTime) throws ApiException { @@ -2594,7 +2594,7 @@ private okhttp3.Call oldTradesLookupValidateBeforeCall(String symbol, Long limit * Old Trades Lookup (MARKET_DATA) Get older market historical trades. * Market trades means * trades filled in the order book. Only market trades will be returned, which means the * insurance fund trades and ADL trades won't be returned. * Only supports data from within - * the last three months Weight: 20 + * the last one month Weight: 20 * * @param symbol (required) * @param limit Default 100; max 1000 (optional) 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 f7e232319..1598f8bb6 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/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.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 8f4aa5654..dcc537113 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 @@ -42,7 +42,6 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CurrentAllAlgoOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CurrentAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.GetOrderModifyHistoryResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.GetPositionMarginChangeHistoryResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ModifyIsolatedPositionMarginRequest; @@ -92,7 +91,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -2356,7 +2355,7 @@ public ApiResponse currentAllOpenOrders( * * * - * + * *
Response Details
Status Code Description Response Headers
200 Futures TradFi Perps Contract -
200 OK -
* * @see * Response Details * Status Code Description Response Headers - * 200 Futures TradFi Perps Contract - + * 200 OK - * * * @see Futures * TradFi Perps Contract(USER_DATA) Documentation */ - public ApiResponse futuresTradfiPerpsContract( + public ApiResponse futuresTradfiPerpsContract( @Valid @NotNull FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) throws ApiException { okhttp3.Call localVarCall = futuresTradfiPerpsContractValidateBeforeCall(futuresTradfiPerpsContractRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + return localVarApiClient.execute(localVarCall); } /** @@ -4571,7 +4568,6 @@ public ApiResponse queryAlgoOrder( * @param algoId (optional) * @param startTime (optional) * @param endTime (optional) - * @param page (optional) * @param limit Default 100; max 1000 (optional) * @param recvWindow (optional) * @return Call to execute @@ -4588,13 +4584,7 @@ public ApiResponse queryAlgoOrder( * All Algo Orders (USER_DATA) Documentation */ private okhttp3.Call queryAllAlgoOrdersCall( - String symbol, - Long algoId, - Long startTime, - Long endTime, - Long page, - Long limit, - Long recvWindow) + String symbol, Long algoId, Long startTime, Long endTime, Long limit, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -4636,10 +4626,6 @@ private okhttp3.Call queryAllAlgoOrdersCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); } - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - if (limit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } @@ -4680,13 +4666,7 @@ private okhttp3.Call queryAllAlgoOrdersCall( @SuppressWarnings("rawtypes") private okhttp3.Call queryAllAlgoOrdersValidateBeforeCall( - String symbol, - Long algoId, - Long startTime, - Long endTime, - Long page, - Long limit, - Long recvWindow) + String symbol, Long algoId, Long startTime, Long endTime, Long limit, Long recvWindow) throws ApiException { try { Validator validator = @@ -4697,9 +4677,7 @@ private okhttp3.Call queryAllAlgoOrdersValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = { - symbol, algoId, startTime, endTime, page, limit, recvWindow - }; + Object[] parameterValues = {symbol, algoId, startTime, endTime, limit, recvWindow}; Method method = this.getClass() .getMethod( @@ -4709,14 +4687,13 @@ private okhttp3.Call queryAllAlgoOrdersValidateBeforeCall( Long.class, Long.class, Long.class, - Long.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { return queryAllAlgoOrdersCall( - symbol, algoId, startTime, endTime, page, limit, recvWindow); + symbol, algoId, startTime, endTime, limit, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -4742,7 +4719,6 @@ private okhttp3.Call queryAllAlgoOrdersValidateBeforeCall( * @param algoId (optional) * @param startTime (optional) * @param endTime (optional) - * @param page (optional) * @param limit Default 100; max 1000 (optional) * @param recvWindow (optional) * @return ApiResponse<QueryAllAlgoOrdersResponse> @@ -4764,13 +4740,12 @@ public ApiResponse queryAllAlgoOrders( Long algoId, Long startTime, Long endTime, - Long page, Long limit, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = queryAllAlgoOrdersValidateBeforeCall( - symbol, algoId, startTime, endTime, page, limit, recvWindow); + symbol, algoId, startTime, endTime, limit, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -5529,7 +5504,8 @@ private okhttp3.Call usersForceOrdersValidateBeforeCall( * User's Force Orders (USER_DATA) Query user's Force Orders * If * \"autoCloseType\" is not sent, orders with both of the types will be returned * If * \"startTime\" is not sent, data within 7 days before \"endTime\" can be - * queried Weight: 20 with symbol, 50 without symbol + * queried * Only support querying data in the past 90 days Weight: 20 with symbol, 50 without + * symbol * * @param symbol (optional) * @param autoCloseType \"LIQUIDATION\" for liquidation orders, \"ADL\" for 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 a1ae77c15..e01a1868f 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/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.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/Interval.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Interval.java index 199485450..52451cdd5 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Interval.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Interval.java @@ -24,6 +24,8 @@ /** Gets or Sets interval */ @JsonAdapter(Interval.Adapter.class) public enum Interval { + INTERVAL_1s("1s"), + INTERVAL_1m("1m"), INTERVAL_3m("3m"), diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/AccountApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/AccountApi.java index 772c7a75d..ef3ac7ed8 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/AccountApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/AccountApi.java @@ -42,6 +42,10 @@ public AccountApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * Account Information(USER_DATA) Get current account information. User in single-asset/ * multi-assets mode will see different value, see comments in response section for detail. 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 3d2e7e850..f715993b9 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 @@ -50,9 +50,11 @@ public class DerivativesTradingUsdsFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private final ConnectionInterface connection; + private AccountApi accountApi; private MarketDataApi marketDataApi; private TradeApi tradeApi; @@ -80,6 +82,14 @@ public DerivativesTradingUsdsFuturesWebSocketApi(ConnectionInterface connection) this.marketDataApi = new MarketDataApi(connection); this.tradeApi = new TradeApi(connection); this.userDataStreamsApi = new UserDataStreamsApi(connection); + + this.connection = connection; + } + + public void stop() throws Exception { + if (connection != null && connection.isConnected()) { + connection.stop(); + } } public CompletableFuture accountInformation( diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApi.java index b8cb57caa..3497c10c9 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApi.java @@ -40,6 +40,10 @@ public MarketDataApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * Order Book Get current order book. Note that this request returns limited market depth. If * you need to continuously monitor order book updates, please consider using Websocket Market diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java index 8b39d256c..caf445ce0 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java @@ -50,6 +50,10 @@ public TradeApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoId` or * `clientAlgoId` must be sent. Weight: 1 diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/UserDataStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/UserDataStreamsApi.java index 80c9c0342..76d015c32 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/UserDataStreamsApi.java @@ -40,6 +40,10 @@ public UserDataStreamsApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * Close User Data Stream (USER_STREAM) Close out a user data stream. Weight: 1 * 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 640a90f8f..d00a9e00d 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 @@ -60,7 +60,7 @@ public class DerivativesTradingUsdsFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private WebSocketClientConfiguration clientConfiguration; @@ -90,6 +90,20 @@ public StreamConnectionInterface getConnection() { return connection; } + public void stop() throws Exception { + if (connection != null && connection.isConnected()) { + connection.stop(); + } + + if (marketApi != null && marketApi.getConnection().isConnected()) { + marketApi.getConnection().stop(); + } + + if (publicApi != null && publicApi.getConnection().isConnected()) { + publicApi.getConnection().stop(); + } + } + public MarketApi getMarketApi() { if (marketApi == null) { WebSocketClientConfiguration configuration = diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/MarketApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/MarketApi.java index ec166bac7..3ab607da0 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/MarketApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/MarketApi.java @@ -67,7 +67,7 @@ public class MarketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private StreamConnectionInterface connection; @@ -89,6 +89,10 @@ public MarketApi(StreamConnectionInterface connection) { this.connection = connection; } + public StreamConnectionInterface getConnection() { + return connection; + } + /** * Aggregate Trade Streams The Aggregate Trade Streams push market trade information that is * aggregated for fills with same price and taking side every 100 milliseconds. Only market @@ -178,7 +182,7 @@ private void aggregateTradeStreamsValidateBeforeCall( /** * All Market Liquidation Order Streams The All Liquidation Order Snapshot Streams push force - * liquidation order information for all symbols in the market. For each symbol,only the latest + * liquidation order information for all symbols in the market. For each symbol,only the largest * one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens * in the interval of 1000ms, no stream will be pushed. Update Speed: 1000ms * @@ -997,9 +1001,9 @@ private void klineCandlestickStreamsValidateBeforeCall( /** * Liquidation Order Streams The Liquidation Order Snapshot Streams push force liquidation order - * information for specific symbol. For each symbol,only the latest one liquidation order within - * 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, - * no stream will be pushed. Update Speed: 1000ms + * information for specific symbol. For each symbol,only the largest one liquidation order + * within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of + * 1000ms, no stream will be pushed. Update Speed: 1000ms * * @param liquidationOrderStreamsRequest (required) * @return LiquidationOrderStreamsResponse diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/PublicApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/PublicApi.java index e3206077a..de933458c 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/PublicApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/PublicApi.java @@ -47,7 +47,7 @@ public class PublicApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/10.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/11.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private StreamConnectionInterface connection; @@ -69,6 +69,10 @@ public PublicApi(StreamConnectionInterface connection) { this.connection = connection; } + public StreamConnectionInterface getConnection() { + return connection; + } + /** * All Book Tickers Stream Pushes any update to the best bid or ask's price or quantity in * real-time for all symbols. Retail Price Improvement(RPI) orders are not visible and excluded diff --git a/clients/dual-investment/CHANGELOG.md b/clients/dual-investment/CHANGELOG.md index d9ff638f1..f66651415 100644 --- a/clients/dual-investment/CHANGELOG.md +++ b/clients/dual-investment/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 2.1.2 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 2.1.1 - 2025-08-07 diff --git a/clients/fiat/CHANGELOG.md b/clients/fiat/CHANGELOG.md index c17a9f507..c0cd54536 100644 --- a/clients/fiat/CHANGELOG.md +++ b/clients/fiat/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 2.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 2.0.0 - 2025-11-10 diff --git a/clients/gift-card/CHANGELOG.md b/clients/gift-card/CHANGELOG.md index 6829f672b..9a88c2fba 100644 --- a/clients/gift-card/CHANGELOG.md +++ b/clients/gift-card/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 1.2.2 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 1.2.1 - 2025-08-07 diff --git a/clients/margin-trading/CHANGELOG.md b/clients/margin-trading/CHANGELOG.md index cd8021ee7..bf1917e13 100644 --- a/clients/margin-trading/CHANGELOG.md +++ b/clients/margin-trading/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 6.1.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 6.1.0 - 2026-02-12 diff --git a/clients/mining/CHANGELOG.md b/clients/mining/CHANGELOG.md index 52b1e513e..631a0e257 100644 --- a/clients/mining/CHANGELOG.md +++ b/clients/mining/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 3.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 3.0.0 - 2026-02-12 diff --git a/clients/nft/CHANGELOG.md b/clients/nft/CHANGELOG.md index 6829f672b..9a88c2fba 100644 --- a/clients/nft/CHANGELOG.md +++ b/clients/nft/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 1.2.2 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 1.2.1 - 2025-08-07 diff --git a/clients/pay/CHANGELOG.md b/clients/pay/CHANGELOG.md index ab7e6578d..dd2d865af 100644 --- a/clients/pay/CHANGELOG.md +++ b/clients/pay/CHANGELOG.md @@ -1,6 +1,25 @@ # Changelog +## 4.0.0 - 2026-05-04 + +### Changed (1) + +- Modified response for `getPayTradeHistory()` (`GET /sapi/v1/pay/transactions`): + - `data`.items.`fundsDetail`.items.`walletAssetCost`: type `array` → `object` + - `data`.items.`fundsDetail`.items.`walletAssetCost`: property `1` added + - `data`.items.`fundsDetail`.items.`walletAssetCost`: property `2` added + - `data`.items.`fundsDetail`.items.`walletAssetCost`: type `array` → `object` + - `data`.items.`fundsDetail`.items.`walletAssetCost`: property `1` added + - `data`.items.`fundsDetail`.items.`walletAssetCost`: property `2` added + - `data`.items.`fundsDetail`.items.`walletAssetCost`: type `array` → `object` + - `data`.items.`fundsDetail`.items.`walletAssetCost`: property `1` added + - `data`.items.`fundsDetail`.items.`walletAssetCost`: property `2` added + - `data`.items.`fundsDetail`.items.`walletAssetCost`: type `array` → `object` + - `data`.items.`fundsDetail`.items.`walletAssetCost`: property `1` added + - `data`.items.`fundsDetail`.items.`walletAssetCost`: property `2` added + ## 3.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 3.0.0 - 2025-09-22 diff --git a/clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInner.md b/clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInner.md index 8c3b811d5..f5ae4c32f 100644 --- a/clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInner.md +++ b/clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInner.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**currency** | **String** | | [optional] | |**amount** | **String** | | [optional] | -|**walletAssetCost** | [**List<GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner>**](GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.md) | | [optional] | +|**walletAssetCost** | [**GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost**](GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.md) | | [optional] | diff --git a/clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.md b/clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.md similarity index 96% rename from clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.md rename to clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.md index e6ec79120..3bbd50551 100644 --- a/clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.md +++ b/clients/pay/docs/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.md @@ -1,6 +1,6 @@ -# GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner +# GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost ## Properties diff --git a/clients/pay/docs/rest-api/migration-guide.md b/clients/pay/docs/rest-api/migration-guide.md index 8d940dd81..929cf858c 100644 --- a/clients/pay/docs/rest-api/migration-guide.md +++ b/clients/pay/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-pay - 3.0.0 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-pay - 3.0.0 + 4.0.0 ``` diff --git a/clients/pay/pom.xml b/clients/pay/pom.xml index 708339281..bda773580 100644 --- a/clients/pay/pom.xml +++ b/clients/pay/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-pay pay - 3.0.1 + 4.0.0 jar diff --git a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/JSON.java b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/JSON.java index a137fae94..8aa448163 100644 --- a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/JSON.java +++ b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/JSON.java @@ -120,7 +120,7 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.pay.rest.model - .GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + .GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.pay.rest.model diff --git a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayApi.java b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayApi.java index adc406824..35aa0fcc0 100644 --- a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayApi.java +++ b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayApi.java @@ -42,7 +42,7 @@ public class PayApi { private static final String USER_AGENT = String.format( - "binance-pay/3.0.0 (Java/%s; %s; %s)", + "binance-pay/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/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInner.java b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInner.java index f2ff17c34..595dda37d 100644 --- a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInner.java +++ b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInner.java @@ -14,7 +14,6 @@ import com.binance.connector.client.pay.rest.JSON; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -29,12 +28,8 @@ 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.*; /** GetPayTradeHistoryResponseDataInnerFundsDetailInner */ @@ -58,8 +53,7 @@ public class GetPayTradeHistoryResponseDataInnerFundsDetailInner { @SerializedName(SERIALIZED_NAME_WALLET_ASSET_COST) @jakarta.annotation.Nullable - private List<@Valid GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner> - walletAssetCost; + private GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost walletAssetCost; public GetPayTradeHistoryResponseDataInnerFundsDetailInner() {} @@ -105,24 +99,12 @@ public void setAmount(@jakarta.annotation.Nullable String amount) { public GetPayTradeHistoryResponseDataInnerFundsDetailInner walletAssetCost( @jakarta.annotation.Nullable - List< - @Valid - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner> + GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost walletAssetCost) { this.walletAssetCost = walletAssetCost; return this; } - public GetPayTradeHistoryResponseDataInnerFundsDetailInner addWalletAssetCostItem( - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner - walletAssetCostItem) { - if (this.walletAssetCost == null) { - this.walletAssetCost = new ArrayList<>(); - } - this.walletAssetCost.add(walletAssetCostItem); - return this; - } - /** * Get walletAssetCost * @@ -130,16 +112,13 @@ public GetPayTradeHistoryResponseDataInnerFundsDetailInner addWalletAssetCostIte */ @jakarta.annotation.Nullable @Valid - public List<@Valid GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner> - getWalletAssetCost() { + public GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost getWalletAssetCost() { return walletAssetCost; } public void setWalletAssetCost( @jakarta.annotation.Nullable - List< - @Valid - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner> + GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost walletAssetCost) { this.walletAssetCost = walletAssetCost; } @@ -193,10 +172,7 @@ public String toUrlQueryString() { sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); Object walletAssetCostValue = getWalletAssetCost(); String walletAssetCostValueAsString = ""; - walletAssetCostValueAsString = - (String) - ((Collection) walletAssetCostValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); + walletAssetCostValueAsString = walletAssetCostValue.toString(); sb.append("walletAssetCost=").append(urlEncode(walletAssetCostValueAsString)).append(""); return sb.toString(); } @@ -272,26 +248,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("amount").toString())); } + // validate the optional field `walletAssetCost` if (jsonObj.get("walletAssetCost") != null && !jsonObj.get("walletAssetCost").isJsonNull()) { - JsonArray jsonArraywalletAssetCost = jsonObj.getAsJsonArray("walletAssetCost"); - if (jsonArraywalletAssetCost != null) { - // ensure the json data is an array - if (!jsonObj.get("walletAssetCost").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `walletAssetCost` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("walletAssetCost").toString())); - } - - // validate the optional field `walletAssetCost` (array) - for (int i = 0; i < jsonArraywalletAssetCost.size(); i++) { - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner - .validateJsonElement(jsonArraywalletAssetCost.get(i)); - } - ; - } + GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.validateJsonElement( + jsonObj.get("walletAssetCost")); } } diff --git a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.java b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.java similarity index 87% rename from clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.java rename to clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.java index c52f2518b..38f6427f2 100644 --- a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.java +++ b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.java @@ -31,11 +31,11 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner */ +/** GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner { +public class GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost { public static final String SERIALIZED_NAME_1 = "1"; @SerializedName(SERIALIZED_NAME_1) @@ -48,9 +48,9 @@ public class GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostI @jakarta.annotation.Nullable private String _2; - public GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner() {} + public GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost() {} - public GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner _1( + public GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost _1( @jakarta.annotation.Nullable String _1) { this._1 = _1; return this; @@ -70,7 +70,7 @@ public void set1(@jakarta.annotation.Nullable String _1) { this._1 = _1; } - public GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner _2( + public GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost _2( @jakarta.annotation.Nullable String _2) { this._2 = _2; return this; @@ -98,15 +98,15 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner - getPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner = - (GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner) o; + GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost + getPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost = + (GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost) o; return Objects.equals( this._1, - getPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner._1) + getPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost._1) && Objects.equals( this._2, - getPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner._2); + getPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost._2); } @Override @@ -117,9 +117,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append( - "class GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner" - + " {\n"); + sb.append("class GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost {\n"); sb.append(" _1: ").append(toIndentedString(_1)).append("\n"); sb.append(" _2: ").append(toIndentedString(_2)).append("\n"); sb.append("}"); @@ -177,19 +175,19 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + * GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + if (!GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost .openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" - + " GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner" + + " GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost" + " is not found in the empty JSON string", - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost .openapiRequiredFields .toString())); } @@ -217,29 +215,28 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner.class + if (!GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.class .isAssignableFrom(type.getRawType())) { return null; // this class only serializes - // 'GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner' and its - // subtypes + // 'GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost' + // and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter< - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner> + final TypeAdapter thisAdapter = gson.getDelegateAdapter( this, TypeToken.get( - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost .class)); return (TypeAdapter) new TypeAdapter< - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner>() { + GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost>() { @Override public void write( JsonWriter out, - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); @@ -247,8 +244,7 @@ public void write( } @Override - public - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + public GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -259,27 +255,25 @@ public void write( } /** - * Create an instance of GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + * Create an instance of GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost * given an JSON string * * @param jsonString JSON string - * @return An instance of - * GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + * @return An instance of GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost * @throws IOException if the JSON string is invalid with respect to - * GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner + * GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost */ - public static GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner fromJson( + public static GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost fromJson( String jsonString) throws IOException { return JSON.getGson() .fromJson( jsonString, - GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner - .class); + GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost.class); } /** - * Convert an instance of - * GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCostInner to an JSON string + * Convert an instance of GetPayTradeHistoryResponseDataInnerFundsDetailInnerWalletAssetCost to + * an JSON string * * @return JSON string */ diff --git a/clients/rebate/CHANGELOG.md b/clients/rebate/CHANGELOG.md index 6829f672b..9a88c2fba 100644 --- a/clients/rebate/CHANGELOG.md +++ b/clients/rebate/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 1.2.2 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 1.2.1 - 2025-08-07 diff --git a/clients/simple-earn/CHANGELOG.md b/clients/simple-earn/CHANGELOG.md index 312e52960..d7d9c7726 100644 --- a/clients/simple-earn/CHANGELOG.md +++ b/clients/simple-earn/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 6.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 6.0.0 - 2026-03-18 diff --git a/clients/spot/CHANGELOG.md b/clients/spot/CHANGELOG.md index e1c53d835..a175d46d5 100644 --- a/clients/spot/CHANGELOG.md +++ b/clients/spot/CHANGELOG.md @@ -1,6 +1,19 @@ # Changelog +## 10.1.1 - 2026-05-04 + +- Added stop method for WebSocket + +### Changed (1) + +#### WebSocket API + +- Modified response for `referencePrice()` (`referencePrice` method): + - `result`: property `code` added + - `result`: property `msg` added + ## 10.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 10.0.0 - 2026-03-18 diff --git a/clients/spot/docs/ReferencePriceResponseResult.md b/clients/spot/docs/ReferencePriceResponseResult.md index 341360c7e..f10750255 100644 --- a/clients/spot/docs/ReferencePriceResponseResult.md +++ b/clients/spot/docs/ReferencePriceResponseResult.md @@ -10,6 +10,8 @@ |**symbol** | **String** | | [optional] | |**referencePrice** | **String** | | [optional] | |**timestamp** | **Long** | | [optional] | +|**code** | **Long** | | [optional] | +|**msg** | **String** | | [optional] | diff --git a/clients/spot/docs/rest-api/migration-guide.md b/clients/spot/docs/rest-api/migration-guide.md index 47cc6e781..a5eb2df6a 100644 --- a/clients/spot/docs/rest-api/migration-guide.md +++ b/clients/spot/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-spot - 10.0.0 + 10.1.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-spot - 10.0.0 + 10.1.1 ``` diff --git a/clients/spot/pom.xml b/clients/spot/pom.xml index 105c620d9..f2385fcb6 100644 --- a/clients/spot/pom.xml +++ b/clients/spot/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-spot spot - 10.0.1 + 10.1.1 jar 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 bae7e0335..490141d15 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 @@ -56,7 +56,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-spot/10.0.0 (Java/%s; %s; %s)", + "binance-spot/10.1.1 (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 fc7d77cbd..39d62a091 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 @@ -48,7 +48,7 @@ public class GeneralApi { private static final String USER_AGENT = String.format( - "binance-spot/10.0.0 (Java/%s; %s; %s)", + "binance-spot/10.1.1 (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 9dd928ea0..52d27d099 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 @@ -61,7 +61,7 @@ public class MarketApi { private static final String USER_AGENT = String.format( - "binance-spot/10.0.0 (Java/%s; %s; %s)", + "binance-spot/10.1.1 (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 2d4f788cd..63d40d266 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 @@ -71,7 +71,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-spot/10.0.0 (Java/%s; %s; %s)", + "binance-spot/10.1.1 (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/websocket/api/api/AccountApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AccountApi.java index 4e5c1510b..e437fab2d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AccountApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AccountApi.java @@ -62,6 +62,10 @@ public AccountApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * WebSocket Account Commission Rates Get current account commission rates. Weight: 20 * diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AuthApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AuthApi.java index a6fe7b9f6..5c87eea81 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AuthApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AuthApi.java @@ -39,6 +39,10 @@ public AuthApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * WebSocket Log in with API key Authenticate WebSocket connection using the provided API key. * After calling `session.logon`, you can omit `apiKey` and diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/GeneralApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/GeneralApi.java index 2be6075be..75aac6848 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/GeneralApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/GeneralApi.java @@ -41,6 +41,10 @@ public GeneralApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * WebSocket Exchange information Query current exchange trading rules, rate limits, and symbol * information. Weight: 20 diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/MarketApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/MarketApi.java index 4deedcb37..8f940766f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/MarketApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/MarketApi.java @@ -62,6 +62,10 @@ public MarketApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * WebSocket Current average price Get current average price for a symbol. Weight: 2 * 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 90f13b412..ef28407d6 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 @@ -118,9 +118,11 @@ public class SpotWebSocketApi { private static final String USER_AGENT = String.format( - "binance-spot/10.0.0 (Java/%s; %s; %s)", + "binance-spot/10.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private final ConnectionInterface connection; + private AccountApi accountApi; private AuthApi authApi; private GeneralApi generalApi; @@ -156,6 +158,14 @@ public SpotWebSocketApi(ConnectionInterface connection) { this.marketApi = new MarketApi(connection); this.tradeApi = new TradeApi(connection); this.userDataStreamApi = new UserDataStreamApi(connection); + + this.connection = connection; + } + + public void stop() throws Exception { + if (connection != null && connection.isConnected()) { + connection.stop(); + } } public CompletableFuture accountCommission( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/TradeApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/TradeApi.java index 96bf66008..bfd92c281 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/TradeApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/TradeApi.java @@ -64,6 +64,10 @@ public TradeApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * WebSocket Cancel open orders Cancel all open orders on a symbol. This includes orders that * are part of an order list. Weight: 1 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 0bbac4fd8..a61a9402d 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 @@ -48,6 +48,10 @@ public UserDataStreamApi(ConnectionInterface connection) { this.connection = connection; } + public ConnectionInterface getConnection() { + return connection; + } + /** * WebSocket Listing all subscriptions Weight: 2 **Data Source**: Memory * diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ReferencePriceResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ReferencePriceResponseResult.java index c8fdb38ac..75468df74 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ReferencePriceResponseResult.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ReferencePriceResponseResult.java @@ -57,6 +57,18 @@ public class ReferencePriceResponseResult extends BaseDTO { @jakarta.annotation.Nullable private Long timestamp; + 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 ReferencePriceResponseResult() {} public ReferencePriceResponseResult symbol(@jakarta.annotation.Nullable String symbol) { @@ -117,6 +129,44 @@ public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { this.timestamp = timestamp; } + public ReferencePriceResponseResult 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 ReferencePriceResponseResult msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -129,12 +179,14 @@ public boolean equals(Object o) { (ReferencePriceResponseResult) o; return Objects.equals(this.symbol, referencePriceResponseResult.symbol) && Objects.equals(this.referencePrice, referencePriceResponseResult.referencePrice) - && Objects.equals(this.timestamp, referencePriceResponseResult.timestamp); + && Objects.equals(this.timestamp, referencePriceResponseResult.timestamp) + && Objects.equals(this.code, referencePriceResponseResult.code) + && Objects.equals(this.msg, referencePriceResponseResult.msg); } @Override public int hashCode() { - return Objects.hash(symbol, referencePrice, timestamp); + return Objects.hash(symbol, referencePrice, timestamp, code, msg); } @Override @@ -144,6 +196,8 @@ public String toString() { sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" referencePrice: ").append(toIndentedString(referencePrice)).append("\n"); sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); sb.append("}"); return sb.toString(); } @@ -167,7 +221,18 @@ public String toUrlQueryString() { String timestampValueAsString = timestampValue.toString(); valMap.put("timestamp", timestampValueAsString); } - + Long codeValue = getCode(); + if (codeValue != null) { + String codeValueAsString = codeValue.toString(); + valMap.put("code", codeValueAsString); + } + String msgValue = getMsg(); + if (msgValue != null) { + String msgValueAsString = msgValue.toString(); + valMap.put("msg", msgValueAsString); + } + + valMap.put("timestamp", getTimestamp()); return asciiEncode( valMap.keySet().stream() .map(key -> key + "=" + valMap.get(key)) @@ -189,6 +254,14 @@ public Map toMap() { if (timestampValue != null) { valMap.put("timestamp", timestampValue); } + Object codeValue = getCode(); + if (codeValue != null) { + valMap.put("code", codeValue); + } + Object msgValue = getMsg(); + if (msgValue != null) { + valMap.put("msg", msgValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -218,6 +291,8 @@ private String toIndentedString(Object o) { openapiFields.add("symbol"); openapiFields.add("referencePrice"); openapiFields.add("timestamp"); + openapiFields.add("code"); + openapiFields.add("msg"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -270,6 +345,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("referencePrice").toString())); } + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 930be17d1..0cf99dc56 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 @@ -40,7 +40,7 @@ public class SpotWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-spot/10.0.0 (Java/%s; %s; %s)", + "binance-spot/10.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; @@ -64,6 +64,12 @@ public SpotWebSocketStreams(StreamConnectionInterface connection) { this.webSocketStreamsApi = new WebSocketStreamsApi(connection); } + public void stop() throws Exception { + if (connection != null && connection.isConnected()) { + connection.stop(); + } + } + public StreamBlockingQueueWrapper aggTrade(AggTradeRequest aggTradeRequest) throws ApiException { return webSocketStreamsApi.aggTrade(aggTradeRequest); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApi.java index 53df8b802..2e5482ff0 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApi.java @@ -64,7 +64,7 @@ public class WebSocketStreamsApi { private static final String USER_AGENT = String.format( - "binance-spot/10.0.0 (Java/%s; %s; %s)", + "binance-spot/10.1.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private StreamConnectionInterface connection; @@ -86,6 +86,10 @@ public WebSocketStreamsApi(StreamConnectionInterface connection) { this.connection = connection; } + public StreamConnectionInterface getConnection() { + return connection; + } + /** * WebSocket Aggregate Trade Streams The Aggregate Trade Streams push trade information that is * aggregated for a single taker order. diff --git a/clients/staking/CHANGELOG.md b/clients/staking/CHANGELOG.md index e13fd3ae1..b41e304b0 100644 --- a/clients/staking/CHANGELOG.md +++ b/clients/staking/CHANGELOG.md @@ -1,6 +1,31 @@ # Changelog +## 5.0.0 - 2026-05-04 + +### Changed (6) + +- Added parameter `purchaseId` + - affected methods: + - `getEthStakingHistory()` (`GET /sapi/v1/eth-staking/eth/history/stakingHistory`) + - `getSolStakingHistory()` (`GET /sapi/v1/sol-staking/sol/history/stakingHistory`) +- Added parameter `redeemId` + - affected methods: + - `getEthRedemptionHistory()` (`GET /sapi/v1/eth-staking/eth/history/redemptionHistory`) + - `getSolRedemptionHistory()` (`GET /sapi/v1/sol-staking/sol/history/redemptionHistory`) +- Modified response for `redeemEth()` (`POST /sapi/v1/eth-staking/eth/redeem`): + - property `redeemId` added + +- Modified response for `redeemSol()` (`POST /sapi/v1/sol-staking/sol/redeem`): + - property `redeemId` added + +- Modified response for `subscribeSolStaking()` (`POST /sapi/v1/sol-staking/sol/stake`): + - property `purchaseId` added + +- Modified response for `subscribeEthStaking()` (`POST /sapi/v2/eth-staking/eth/stake`): + - property `purchaseId` added + ## 4.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 4.0.0 - 2025-12-16 diff --git a/clients/staking/docs/EthStakingApi.md b/clients/staking/docs/EthStakingApi.md index 36a74dc8e..b96359e72 100644 --- a/clients/staking/docs/EthStakingApi.md +++ b/clients/staking/docs/EthStakingApi.md @@ -143,7 +143,7 @@ No authorization required # **getEthRedemptionHistory** -> GetEthRedemptionHistoryResponse getEthRedemptionHistory(startTime, endTime, current, size, recvWindow) +> GetEthRedemptionHistoryResponse getEthRedemptionHistory(redeemId, startTime, endTime, current, size, recvWindow) Get ETH redemption history(USER_DATA) @@ -164,13 +164,14 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); EthStakingApi apiInstance = new EthStakingApi(defaultClient); + Long redeemId = 56L; // Long | Long startTime = 56L; // Long | Long endTime = 56L; // Long | Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 Long size = 56L; // Long | Default:10, Max:100 Long recvWindow = 56L; // Long | try { - GetEthRedemptionHistoryResponse result = apiInstance.getEthRedemptionHistory(startTime, endTime, current, size, recvWindow); + GetEthRedemptionHistoryResponse result = apiInstance.getEthRedemptionHistory(redeemId, startTime, endTime, current, size, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling EthStakingApi#getEthRedemptionHistory"); @@ -187,6 +188,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **redeemId** | **Long**| | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | | **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | @@ -213,7 +215,7 @@ No authorization required # **getEthStakingHistory** -> GetEthStakingHistoryResponse getEthStakingHistory(startTime, endTime, current, size, recvWindow) +> GetEthStakingHistoryResponse getEthStakingHistory(purchaseId, startTime, endTime, current, size, recvWindow) Get ETH staking history(USER_DATA) @@ -234,13 +236,14 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); EthStakingApi apiInstance = new EthStakingApi(defaultClient); + Long purchaseId = 56L; // Long | Long startTime = 56L; // Long | Long endTime = 56L; // Long | Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 Long size = 56L; // Long | Default:10, Max:100 Long recvWindow = 56L; // Long | try { - GetEthStakingHistoryResponse result = apiInstance.getEthStakingHistory(startTime, endTime, current, size, recvWindow); + GetEthStakingHistoryResponse result = apiInstance.getEthStakingHistory(purchaseId, startTime, endTime, current, size, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling EthStakingApi#getEthStakingHistory"); @@ -257,6 +260,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **purchaseId** | **Long**| | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | | **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | diff --git a/clients/staking/docs/RedeemEthResponse.md b/clients/staking/docs/RedeemEthResponse.md index 299164616..38077a238 100644 --- a/clients/staking/docs/RedeemEthResponse.md +++ b/clients/staking/docs/RedeemEthResponse.md @@ -11,6 +11,7 @@ |**ethAmount** | **String** | | [optional] | |**conversionRatio** | **String** | | [optional] | |**arrivalTime** | **Long** | | [optional] | +|**redeemId** | **Long** | | [optional] | diff --git a/clients/staking/docs/RedeemSolResponse.md b/clients/staking/docs/RedeemSolResponse.md index 6a33449ad..631ef075d 100644 --- a/clients/staking/docs/RedeemSolResponse.md +++ b/clients/staking/docs/RedeemSolResponse.md @@ -11,6 +11,7 @@ |**solAmount** | **String** | | [optional] | |**exchangeRate** | **String** | | [optional] | |**arrivalTime** | **Long** | | [optional] | +|**redeemId** | **Long** | | [optional] | diff --git a/clients/staking/docs/SolStakingApi.md b/clients/staking/docs/SolStakingApi.md index 6da60d003..ea6629113 100644 --- a/clients/staking/docs/SolStakingApi.md +++ b/clients/staking/docs/SolStakingApi.md @@ -293,7 +293,7 @@ No authorization required # **getSolRedemptionHistory** -> GetSolRedemptionHistoryResponse getSolRedemptionHistory(startTime, endTime, current, size, recvWindow) +> GetSolRedemptionHistoryResponse getSolRedemptionHistory(redeemId, startTime, endTime, current, size, recvWindow) Get SOL redemption history(USER_DATA) @@ -314,13 +314,14 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); SolStakingApi apiInstance = new SolStakingApi(defaultClient); + Long redeemId = 56L; // Long | Long startTime = 56L; // Long | Long endTime = 56L; // Long | Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 Long size = 56L; // Long | Default:10, Max:100 Long recvWindow = 56L; // Long | try { - GetSolRedemptionHistoryResponse result = apiInstance.getSolRedemptionHistory(startTime, endTime, current, size, recvWindow); + GetSolRedemptionHistoryResponse result = apiInstance.getSolRedemptionHistory(redeemId, startTime, endTime, current, size, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling SolStakingApi#getSolRedemptionHistory"); @@ -337,6 +338,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **redeemId** | **Long**| | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | | **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | @@ -363,7 +365,7 @@ No authorization required # **getSolStakingHistory** -> GetSolStakingHistoryResponse getSolStakingHistory(startTime, endTime, current, size, recvWindow) +> GetSolStakingHistoryResponse getSolStakingHistory(purchaseId, startTime, endTime, current, size, recvWindow) Get SOL staking history(USER_DATA) @@ -384,13 +386,14 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); SolStakingApi apiInstance = new SolStakingApi(defaultClient); + Long purchaseId = 56L; // Long | Long startTime = 56L; // Long | Long endTime = 56L; // Long | Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 Long size = 56L; // Long | Default:10, Max:100 Long recvWindow = 56L; // Long | try { - GetSolStakingHistoryResponse result = apiInstance.getSolStakingHistory(startTime, endTime, current, size, recvWindow); + GetSolStakingHistoryResponse result = apiInstance.getSolStakingHistory(purchaseId, startTime, endTime, current, size, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling SolStakingApi#getSolStakingHistory"); @@ -407,6 +410,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **purchaseId** | **Long**| | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | | **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | diff --git a/clients/staking/docs/SubscribeEthStakingResponse.md b/clients/staking/docs/SubscribeEthStakingResponse.md index ebf584f2f..dc0a28405 100644 --- a/clients/staking/docs/SubscribeEthStakingResponse.md +++ b/clients/staking/docs/SubscribeEthStakingResponse.md @@ -10,6 +10,7 @@ |**success** | **Boolean** | | [optional] | |**wbethAmount** | **String** | | [optional] | |**conversionRatio** | **String** | | [optional] | +|**purchaseId** | **Long** | | [optional] | diff --git a/clients/staking/docs/SubscribeSolStakingResponse.md b/clients/staking/docs/SubscribeSolStakingResponse.md index 9fb54b7f9..7aab3c5c3 100644 --- a/clients/staking/docs/SubscribeSolStakingResponse.md +++ b/clients/staking/docs/SubscribeSolStakingResponse.md @@ -10,6 +10,7 @@ |**success** | **Boolean** | | [optional] | |**bnsolAmount** | **String** | | [optional] | |**exchangeRate** | **String** | | [optional] | +|**purchaseId** | **Long** | | [optional] | diff --git a/clients/staking/docs/rest-api/migration-guide.md b/clients/staking/docs/rest-api/migration-guide.md index 03f59ad8c..cb954ac6b 100644 --- a/clients/staking/docs/rest-api/migration-guide.md +++ b/clients/staking/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-staking - 4.0.0 + 5.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-staking - 4.0.0 + 5.0.0 ``` diff --git a/clients/staking/pom.xml b/clients/staking/pom.xml index 52acd8003..57581c6d6 100644 --- a/clients/staking/pom.xml +++ b/clients/staking/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-staking staking - 4.0.1 + 5.0.0 jar diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java index 462e1a39a..47ed6edf2 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java @@ -57,7 +57,7 @@ public class EthStakingApi { private static final String USER_AGENT = String.format( - "binance-staking/4.0.0 (Java/%s; %s; %s)", + "binance-staking/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -362,6 +362,7 @@ public ApiResponse getCurrentEthStakingQuota( /** * Build call for getEthRedemptionHistory * + * @param redeemId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -381,7 +382,7 @@ public ApiResponse getCurrentEthStakingQuota( * ETH redemption history(USER_DATA) Documentation */ private okhttp3.Call getEthRedemptionHistoryCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long redeemId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -407,6 +408,10 @@ private okhttp3.Call getEthRedemptionHistoryCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (redeemId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("redeemId", redeemId)); + } + if (startTime != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); } @@ -459,7 +464,7 @@ private okhttp3.Call getEthRedemptionHistoryCall( @SuppressWarnings("rawtypes") private okhttp3.Call getEthRedemptionHistoryValidateBeforeCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long redeemId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { try { Validator validator = @@ -470,7 +475,7 @@ private okhttp3.Call getEthRedemptionHistoryValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; + Object[] parameterValues = {redeemId, startTime, endTime, current, size, recvWindow}; Method method = this.getClass() .getMethod( @@ -479,12 +484,14 @@ private okhttp3.Call getEthRedemptionHistoryValidateBeforeCall( Long.class, Long.class, Long.class, + Long.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getEthRedemptionHistoryCall(startTime, endTime, current, size, recvWindow); + return getEthRedemptionHistoryCall( + redeemId, startTime, endTime, current, size, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -506,6 +513,7 @@ private okhttp3.Call getEthRedemptionHistoryValidateBeforeCall( * `endTime` is sent but `startTime` is not sent, the 30 days' data * before `endTime` will be returned. Weight: 150 * + * @param redeemId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -526,11 +534,11 @@ private okhttp3.Call getEthRedemptionHistoryValidateBeforeCall( * ETH redemption history(USER_DATA) Documentation */ public ApiResponse getEthRedemptionHistory( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long redeemId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = getEthRedemptionHistoryValidateBeforeCall( - startTime, endTime, current, size, recvWindow); + redeemId, startTime, endTime, current, size, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -539,6 +547,7 @@ public ApiResponse getEthRedemptionHistory( /** * Build call for getEthStakingHistory * + * @param purchaseId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -558,7 +567,7 @@ public ApiResponse getEthRedemptionHistory( * ETH staking history(USER_DATA) Documentation */ private okhttp3.Call getEthStakingHistoryCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long purchaseId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -584,6 +593,10 @@ private okhttp3.Call getEthStakingHistoryCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (purchaseId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("purchaseId", purchaseId)); + } + if (startTime != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); } @@ -636,7 +649,7 @@ private okhttp3.Call getEthStakingHistoryCall( @SuppressWarnings("rawtypes") private okhttp3.Call getEthStakingHistoryValidateBeforeCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long purchaseId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { try { Validator validator = @@ -647,7 +660,7 @@ private okhttp3.Call getEthStakingHistoryValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; + Object[] parameterValues = {purchaseId, startTime, endTime, current, size, recvWindow}; Method method = this.getClass() .getMethod( @@ -656,12 +669,14 @@ private okhttp3.Call getEthStakingHistoryValidateBeforeCall( Long.class, Long.class, Long.class, + Long.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getEthStakingHistoryCall(startTime, endTime, current, size, recvWindow); + return getEthStakingHistoryCall( + purchaseId, startTime, endTime, current, size, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -683,6 +698,7 @@ private okhttp3.Call getEthStakingHistoryValidateBeforeCall( * `endTime` is sent but `startTime` is not sent, the 30 days' data * before `endTime` will be returned. Weight: 150 * + * @param purchaseId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -703,11 +719,11 @@ private okhttp3.Call getEthStakingHistoryValidateBeforeCall( * ETH staking history(USER_DATA) Documentation */ public ApiResponse getEthStakingHistory( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long purchaseId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = getEthStakingHistoryValidateBeforeCall( - startTime, endTime, current, size, recvWindow); + purchaseId, startTime, endTime, current, size, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java index ee23c446c..cab6c616d 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java @@ -59,7 +59,7 @@ public class OnChainYieldsApi { private static final String USER_AGENT = String.format( - "binance-staking/4.0.0 (Java/%s; %s; %s)", + "binance-staking/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java index 70586f7c4..53219dc12 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java @@ -44,7 +44,7 @@ public class SoftStakingApi { private static final String USER_AGENT = String.format( - "binance-staking/4.0.0 (Java/%s; %s; %s)", + "binance-staking/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java index eca942239..18d77048c 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java @@ -57,7 +57,7 @@ public class SolStakingApi { private static final String USER_AGENT = String.format( - "binance-staking/4.0.0 (Java/%s; %s; %s)", + "binance-staking/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -779,6 +779,7 @@ public ApiResponse getBoostRewardsHistory( /** * Build call for getSolRedemptionHistory * + * @param redeemId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -798,7 +799,7 @@ public ApiResponse getBoostRewardsHistory( * SOL redemption history(USER_DATA) Documentation */ private okhttp3.Call getSolRedemptionHistoryCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long redeemId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -824,6 +825,10 @@ private okhttp3.Call getSolRedemptionHistoryCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (redeemId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("redeemId", redeemId)); + } + if (startTime != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); } @@ -876,7 +881,7 @@ private okhttp3.Call getSolRedemptionHistoryCall( @SuppressWarnings("rawtypes") private okhttp3.Call getSolRedemptionHistoryValidateBeforeCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long redeemId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { try { Validator validator = @@ -887,7 +892,7 @@ private okhttp3.Call getSolRedemptionHistoryValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; + Object[] parameterValues = {redeemId, startTime, endTime, current, size, recvWindow}; Method method = this.getClass() .getMethod( @@ -896,12 +901,14 @@ private okhttp3.Call getSolRedemptionHistoryValidateBeforeCall( Long.class, Long.class, Long.class, + Long.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getSolRedemptionHistoryCall(startTime, endTime, current, size, recvWindow); + return getSolRedemptionHistoryCall( + redeemId, startTime, endTime, current, size, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -923,6 +930,7 @@ private okhttp3.Call getSolRedemptionHistoryValidateBeforeCall( * `endTime` is sent but `startTime` is not sent, the 30 days' data * before `endTime` will be returned. Weight: 150 * + * @param redeemId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -943,11 +951,11 @@ private okhttp3.Call getSolRedemptionHistoryValidateBeforeCall( * SOL redemption history(USER_DATA) Documentation */ public ApiResponse getSolRedemptionHistory( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long redeemId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = getSolRedemptionHistoryValidateBeforeCall( - startTime, endTime, current, size, recvWindow); + redeemId, startTime, endTime, current, size, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -956,6 +964,7 @@ public ApiResponse getSolRedemptionHistory( /** * Build call for getSolStakingHistory * + * @param purchaseId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -975,7 +984,7 @@ public ApiResponse getSolRedemptionHistory( * SOL staking history(USER_DATA) Documentation */ private okhttp3.Call getSolStakingHistoryCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long purchaseId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -1001,6 +1010,10 @@ private okhttp3.Call getSolStakingHistoryCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (purchaseId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("purchaseId", purchaseId)); + } + if (startTime != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); } @@ -1053,7 +1066,7 @@ private okhttp3.Call getSolStakingHistoryCall( @SuppressWarnings("rawtypes") private okhttp3.Call getSolStakingHistoryValidateBeforeCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long purchaseId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { try { Validator validator = @@ -1064,7 +1077,7 @@ private okhttp3.Call getSolStakingHistoryValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; + Object[] parameterValues = {purchaseId, startTime, endTime, current, size, recvWindow}; Method method = this.getClass() .getMethod( @@ -1073,12 +1086,14 @@ private okhttp3.Call getSolStakingHistoryValidateBeforeCall( Long.class, Long.class, Long.class, + Long.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getSolStakingHistoryCall(startTime, endTime, current, size, recvWindow); + return getSolStakingHistoryCall( + purchaseId, startTime, endTime, current, size, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -1100,6 +1115,7 @@ private okhttp3.Call getSolStakingHistoryValidateBeforeCall( * `endTime` is sent but `startTime` is not sent, the 30 days' data * before `endTime` will be returned. Weight: 150 * + * @param purchaseId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -1120,11 +1136,11 @@ private okhttp3.Call getSolStakingHistoryValidateBeforeCall( * SOL staking history(USER_DATA) Documentation */ public ApiResponse getSolStakingHistory( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long purchaseId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = getSolStakingHistoryValidateBeforeCall( - startTime, endTime, current, size, recvWindow); + purchaseId, startTime, endTime, current, size, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/StakingRestApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/StakingRestApi.java index 05649b4b9..8f8ed6921 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/StakingRestApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/StakingRestApi.java @@ -126,6 +126,7 @@ public ApiResponse getCurrentEthStakingQuota( * `endTime` is sent but `startTime` is not sent, the 30 days' data * before `endTime` will be returned. Weight: 150 * + * @param redeemId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -146,9 +147,10 @@ public ApiResponse getCurrentEthStakingQuota( * ETH redemption history(USER_DATA) Documentation */ public ApiResponse getEthRedemptionHistory( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long redeemId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { - return ethStakingApi.getEthRedemptionHistory(startTime, endTime, current, size, recvWindow); + return ethStakingApi.getEthRedemptionHistory( + redeemId, startTime, endTime, current, size, recvWindow); } /** @@ -160,6 +162,7 @@ public ApiResponse getEthRedemptionHistory( * `endTime` is sent but `startTime` is not sent, the 30 days' data * before `endTime` will be returned. Weight: 150 * + * @param purchaseId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -180,9 +183,10 @@ public ApiResponse getEthRedemptionHistory( * ETH staking history(USER_DATA) Documentation */ public ApiResponse getEthStakingHistory( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long purchaseId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { - return ethStakingApi.getEthStakingHistory(startTime, endTime, current, size, recvWindow); + return ethStakingApi.getEthStakingHistory( + purchaseId, startTime, endTime, current, size, recvWindow); } /** @@ -1006,6 +1010,7 @@ public ApiResponse getBoostRewardsHistory( * `endTime` is sent but `startTime` is not sent, the 30 days' data * before `endTime` will be returned. Weight: 150 * + * @param redeemId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -1026,9 +1031,10 @@ public ApiResponse getBoostRewardsHistory( * SOL redemption history(USER_DATA) Documentation */ public ApiResponse getSolRedemptionHistory( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long redeemId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { - return solStakingApi.getSolRedemptionHistory(startTime, endTime, current, size, recvWindow); + return solStakingApi.getSolRedemptionHistory( + redeemId, startTime, endTime, current, size, recvWindow); } /** @@ -1040,6 +1046,7 @@ public ApiResponse getSolRedemptionHistory( * `endTime` is sent but `startTime` is not sent, the 30 days' data * before `endTime` will be returned. Weight: 150 * + * @param purchaseId (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -1060,9 +1067,10 @@ public ApiResponse getSolRedemptionHistory( * SOL staking history(USER_DATA) Documentation */ public ApiResponse getSolStakingHistory( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) + Long purchaseId, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { - return solStakingApi.getSolStakingHistory(startTime, endTime, current, size, recvWindow); + return solStakingApi.getSolStakingHistory( + purchaseId, startTime, endTime, current, size, recvWindow); } /** diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/RedeemEthResponse.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/RedeemEthResponse.java index 3d9f9030e..3f42e5002 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/RedeemEthResponse.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/RedeemEthResponse.java @@ -60,6 +60,12 @@ public class RedeemEthResponse { @jakarta.annotation.Nullable private Long arrivalTime; + public static final String SERIALIZED_NAME_REDEEM_ID = "redeemId"; + + @SerializedName(SERIALIZED_NAME_REDEEM_ID) + @jakarta.annotation.Nullable + private Long redeemId; + public RedeemEthResponse() {} public RedeemEthResponse success(@jakarta.annotation.Nullable Boolean success) { @@ -138,6 +144,25 @@ public void setArrivalTime(@jakarta.annotation.Nullable Long arrivalTime) { this.arrivalTime = arrivalTime; } + public RedeemEthResponse redeemId(@jakarta.annotation.Nullable Long redeemId) { + this.redeemId = redeemId; + return this; + } + + /** + * Get redeemId + * + * @return redeemId + */ + @jakarta.annotation.Nullable + public Long getRedeemId() { + return redeemId; + } + + public void setRedeemId(@jakarta.annotation.Nullable Long redeemId) { + this.redeemId = redeemId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -150,12 +175,13 @@ public boolean equals(Object o) { return Objects.equals(this.success, redeemEthResponse.success) && Objects.equals(this.ethAmount, redeemEthResponse.ethAmount) && Objects.equals(this.conversionRatio, redeemEthResponse.conversionRatio) - && Objects.equals(this.arrivalTime, redeemEthResponse.arrivalTime); + && Objects.equals(this.arrivalTime, redeemEthResponse.arrivalTime) + && Objects.equals(this.redeemId, redeemEthResponse.redeemId); } @Override public int hashCode() { - return Objects.hash(success, ethAmount, conversionRatio, arrivalTime); + return Objects.hash(success, ethAmount, conversionRatio, arrivalTime, redeemId); } @Override @@ -166,6 +192,7 @@ public String toString() { sb.append(" ethAmount: ").append(toIndentedString(ethAmount)).append("\n"); sb.append(" conversionRatio: ").append(toIndentedString(conversionRatio)).append("\n"); sb.append(" arrivalTime: ").append(toIndentedString(arrivalTime)).append("\n"); + sb.append(" redeemId: ").append(toIndentedString(redeemId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -189,6 +216,10 @@ public String toUrlQueryString() { String arrivalTimeValueAsString = ""; arrivalTimeValueAsString = arrivalTimeValue.toString(); sb.append("arrivalTime=").append(urlEncode(arrivalTimeValueAsString)).append(""); + Object redeemIdValue = getRedeemId(); + String redeemIdValueAsString = ""; + redeemIdValueAsString = redeemIdValue.toString(); + sb.append("redeemId=").append(urlEncode(redeemIdValueAsString)).append(""); return sb.toString(); } @@ -221,6 +252,7 @@ private String toIndentedString(Object o) { openapiFields.add("ethAmount"); openapiFields.add("conversionRatio"); openapiFields.add("arrivalTime"); + openapiFields.add("redeemId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/RedeemSolResponse.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/RedeemSolResponse.java index 311ee3b35..906354cce 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/RedeemSolResponse.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/RedeemSolResponse.java @@ -60,6 +60,12 @@ public class RedeemSolResponse { @jakarta.annotation.Nullable private Long arrivalTime; + public static final String SERIALIZED_NAME_REDEEM_ID = "redeemId"; + + @SerializedName(SERIALIZED_NAME_REDEEM_ID) + @jakarta.annotation.Nullable + private Long redeemId; + public RedeemSolResponse() {} public RedeemSolResponse success(@jakarta.annotation.Nullable Boolean success) { @@ -138,6 +144,25 @@ public void setArrivalTime(@jakarta.annotation.Nullable Long arrivalTime) { this.arrivalTime = arrivalTime; } + public RedeemSolResponse redeemId(@jakarta.annotation.Nullable Long redeemId) { + this.redeemId = redeemId; + return this; + } + + /** + * Get redeemId + * + * @return redeemId + */ + @jakarta.annotation.Nullable + public Long getRedeemId() { + return redeemId; + } + + public void setRedeemId(@jakarta.annotation.Nullable Long redeemId) { + this.redeemId = redeemId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -150,12 +175,13 @@ public boolean equals(Object o) { return Objects.equals(this.success, redeemSolResponse.success) && Objects.equals(this.solAmount, redeemSolResponse.solAmount) && Objects.equals(this.exchangeRate, redeemSolResponse.exchangeRate) - && Objects.equals(this.arrivalTime, redeemSolResponse.arrivalTime); + && Objects.equals(this.arrivalTime, redeemSolResponse.arrivalTime) + && Objects.equals(this.redeemId, redeemSolResponse.redeemId); } @Override public int hashCode() { - return Objects.hash(success, solAmount, exchangeRate, arrivalTime); + return Objects.hash(success, solAmount, exchangeRate, arrivalTime, redeemId); } @Override @@ -166,6 +192,7 @@ public String toString() { sb.append(" solAmount: ").append(toIndentedString(solAmount)).append("\n"); sb.append(" exchangeRate: ").append(toIndentedString(exchangeRate)).append("\n"); sb.append(" arrivalTime: ").append(toIndentedString(arrivalTime)).append("\n"); + sb.append(" redeemId: ").append(toIndentedString(redeemId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -189,6 +216,10 @@ public String toUrlQueryString() { String arrivalTimeValueAsString = ""; arrivalTimeValueAsString = arrivalTimeValue.toString(); sb.append("arrivalTime=").append(urlEncode(arrivalTimeValueAsString)).append(""); + Object redeemIdValue = getRedeemId(); + String redeemIdValueAsString = ""; + redeemIdValueAsString = redeemIdValue.toString(); + sb.append("redeemId=").append(urlEncode(redeemIdValueAsString)).append(""); return sb.toString(); } @@ -221,6 +252,7 @@ private String toIndentedString(Object o) { openapiFields.add("solAmount"); openapiFields.add("exchangeRate"); openapiFields.add("arrivalTime"); + openapiFields.add("redeemId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SubscribeEthStakingResponse.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SubscribeEthStakingResponse.java index 8d3e5827e..8a4cbe48c 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SubscribeEthStakingResponse.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SubscribeEthStakingResponse.java @@ -54,6 +54,12 @@ public class SubscribeEthStakingResponse { @jakarta.annotation.Nullable private String conversionRatio; + public static final String SERIALIZED_NAME_PURCHASE_ID = "purchaseId"; + + @SerializedName(SERIALIZED_NAME_PURCHASE_ID) + @jakarta.annotation.Nullable + private Long purchaseId; + public SubscribeEthStakingResponse() {} public SubscribeEthStakingResponse success(@jakarta.annotation.Nullable Boolean success) { @@ -115,6 +121,25 @@ public void setConversionRatio(@jakarta.annotation.Nullable String conversionRat this.conversionRatio = conversionRatio; } + public SubscribeEthStakingResponse purchaseId(@jakarta.annotation.Nullable Long purchaseId) { + this.purchaseId = purchaseId; + return this; + } + + /** + * Get purchaseId + * + * @return purchaseId + */ + @jakarta.annotation.Nullable + public Long getPurchaseId() { + return purchaseId; + } + + public void setPurchaseId(@jakarta.annotation.Nullable Long purchaseId) { + this.purchaseId = purchaseId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -126,13 +151,13 @@ public boolean equals(Object o) { SubscribeEthStakingResponse subscribeEthStakingResponse = (SubscribeEthStakingResponse) o; return Objects.equals(this.success, subscribeEthStakingResponse.success) && Objects.equals(this.wbethAmount, subscribeEthStakingResponse.wbethAmount) - && Objects.equals( - this.conversionRatio, subscribeEthStakingResponse.conversionRatio); + && Objects.equals(this.conversionRatio, subscribeEthStakingResponse.conversionRatio) + && Objects.equals(this.purchaseId, subscribeEthStakingResponse.purchaseId); } @Override public int hashCode() { - return Objects.hash(success, wbethAmount, conversionRatio); + return Objects.hash(success, wbethAmount, conversionRatio, purchaseId); } @Override @@ -142,6 +167,7 @@ public String toString() { sb.append(" success: ").append(toIndentedString(success)).append("\n"); sb.append(" wbethAmount: ").append(toIndentedString(wbethAmount)).append("\n"); sb.append(" conversionRatio: ").append(toIndentedString(conversionRatio)).append("\n"); + sb.append(" purchaseId: ").append(toIndentedString(purchaseId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -161,6 +187,10 @@ public String toUrlQueryString() { String conversionRatioValueAsString = ""; conversionRatioValueAsString = conversionRatioValue.toString(); sb.append("conversionRatio=").append(urlEncode(conversionRatioValueAsString)).append(""); + Object purchaseIdValue = getPurchaseId(); + String purchaseIdValueAsString = ""; + purchaseIdValueAsString = purchaseIdValue.toString(); + sb.append("purchaseId=").append(urlEncode(purchaseIdValueAsString)).append(""); return sb.toString(); } @@ -192,6 +222,7 @@ private String toIndentedString(Object o) { openapiFields.add("success"); openapiFields.add("wbethAmount"); openapiFields.add("conversionRatio"); + openapiFields.add("purchaseId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SubscribeSolStakingResponse.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SubscribeSolStakingResponse.java index 61e9fa9ca..8f560e635 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SubscribeSolStakingResponse.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SubscribeSolStakingResponse.java @@ -54,6 +54,12 @@ public class SubscribeSolStakingResponse { @jakarta.annotation.Nullable private String exchangeRate; + public static final String SERIALIZED_NAME_PURCHASE_ID = "purchaseId"; + + @SerializedName(SERIALIZED_NAME_PURCHASE_ID) + @jakarta.annotation.Nullable + private Long purchaseId; + public SubscribeSolStakingResponse() {} public SubscribeSolStakingResponse success(@jakarta.annotation.Nullable Boolean success) { @@ -115,6 +121,25 @@ public void setExchangeRate(@jakarta.annotation.Nullable String exchangeRate) { this.exchangeRate = exchangeRate; } + public SubscribeSolStakingResponse purchaseId(@jakarta.annotation.Nullable Long purchaseId) { + this.purchaseId = purchaseId; + return this; + } + + /** + * Get purchaseId + * + * @return purchaseId + */ + @jakarta.annotation.Nullable + public Long getPurchaseId() { + return purchaseId; + } + + public void setPurchaseId(@jakarta.annotation.Nullable Long purchaseId) { + this.purchaseId = purchaseId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -126,12 +151,13 @@ public boolean equals(Object o) { SubscribeSolStakingResponse subscribeSolStakingResponse = (SubscribeSolStakingResponse) o; return Objects.equals(this.success, subscribeSolStakingResponse.success) && Objects.equals(this.bnsolAmount, subscribeSolStakingResponse.bnsolAmount) - && Objects.equals(this.exchangeRate, subscribeSolStakingResponse.exchangeRate); + && Objects.equals(this.exchangeRate, subscribeSolStakingResponse.exchangeRate) + && Objects.equals(this.purchaseId, subscribeSolStakingResponse.purchaseId); } @Override public int hashCode() { - return Objects.hash(success, bnsolAmount, exchangeRate); + return Objects.hash(success, bnsolAmount, exchangeRate, purchaseId); } @Override @@ -141,6 +167,7 @@ public String toString() { sb.append(" success: ").append(toIndentedString(success)).append("\n"); sb.append(" bnsolAmount: ").append(toIndentedString(bnsolAmount)).append("\n"); sb.append(" exchangeRate: ").append(toIndentedString(exchangeRate)).append("\n"); + sb.append(" purchaseId: ").append(toIndentedString(purchaseId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -160,6 +187,10 @@ public String toUrlQueryString() { String exchangeRateValueAsString = ""; exchangeRateValueAsString = exchangeRateValue.toString(); sb.append("exchangeRate=").append(urlEncode(exchangeRateValueAsString)).append(""); + Object purchaseIdValue = getPurchaseId(); + String purchaseIdValueAsString = ""; + purchaseIdValueAsString = purchaseIdValue.toString(); + sb.append("purchaseId=").append(urlEncode(purchaseIdValueAsString)).append(""); return sb.toString(); } @@ -191,6 +222,7 @@ private String toIndentedString(Object o) { openapiFields.add("success"); openapiFields.add("bnsolAmount"); openapiFields.add("exchangeRate"); + openapiFields.add("purchaseId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/staking/src/test/java/com/binance/connector/client/staking/rest/api/EthStakingApiTest.java b/clients/staking/src/test/java/com/binance/connector/client/staking/rest/api/EthStakingApiTest.java index e8b5c31cf..121e4e28e 100644 --- a/clients/staking/src/test/java/com/binance/connector/client/staking/rest/api/EthStakingApiTest.java +++ b/clients/staking/src/test/java/com/binance/connector/client/staking/rest/api/EthStakingApiTest.java @@ -162,13 +162,14 @@ public void getCurrentEthStakingQuotaTest() throws ApiException, CryptoException */ @Test public void getEthRedemptionHistoryTest() throws ApiException, CryptoException { + Long redeemId = 123L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long current = 1L; Long size = 10L; Long recvWindow = 5000L; ApiResponse response = - api.getEthRedemptionHistory(startTime, endTime, current, size, recvWindow); + api.getEthRedemptionHistory(redeemId, startTime, endTime, current, size, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -181,10 +182,10 @@ public void getEthRedemptionHistoryTest() throws ApiException, CryptoException { Request actualRequest = captorValue.request(); assertEquals( - "startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + "redeemId=123&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "2ecc0415a3bdb2963e8030cdf6cf00de6f49d21b71ff939dda42e5756eb8ba66", + "90b22be90fad28e8f5f7cd6af50eb4c523db9c1363ee49915fad9713c0656f0d", actualRequest.url().queryParameter("signature")); assertEquals( "/sapi/v1/eth-staking/eth/history/redemptionHistory", @@ -206,13 +207,14 @@ public void getEthRedemptionHistoryTest() throws ApiException, CryptoException { */ @Test public void getEthStakingHistoryTest() throws ApiException, CryptoException { + Long purchaseId = 123L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long current = 1L; Long size = 10L; Long recvWindow = 5000L; ApiResponse response = - api.getEthStakingHistory(startTime, endTime, current, size, recvWindow); + api.getEthStakingHistory(purchaseId, startTime, endTime, current, size, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -225,10 +227,10 @@ public void getEthStakingHistoryTest() throws ApiException, CryptoException { Request actualRequest = captorValue.request(); assertEquals( - "startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + "purchaseId=123&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "2ecc0415a3bdb2963e8030cdf6cf00de6f49d21b71ff939dda42e5756eb8ba66", + "35f8697a0b1f039ff660d5b47cb802e92c651d0f135334ec523e176dad5b714b", actualRequest.url().queryParameter("signature")); assertEquals( "/sapi/v1/eth-staking/eth/history/stakingHistory", diff --git a/clients/staking/src/test/java/com/binance/connector/client/staking/rest/api/SolStakingApiTest.java b/clients/staking/src/test/java/com/binance/connector/client/staking/rest/api/SolStakingApiTest.java index 610d86726..1c1dd985e 100644 --- a/clients/staking/src/test/java/com/binance/connector/client/staking/rest/api/SolStakingApiTest.java +++ b/clients/staking/src/test/java/com/binance/connector/client/staking/rest/api/SolStakingApiTest.java @@ -267,13 +267,14 @@ public void getBoostRewardsHistoryTest() throws ApiException, CryptoException { */ @Test public void getSolRedemptionHistoryTest() throws ApiException, CryptoException { + Long redeemId = 123L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long current = 1L; Long size = 10L; Long recvWindow = 5000L; ApiResponse response = - api.getSolRedemptionHistory(startTime, endTime, current, size, recvWindow); + api.getSolRedemptionHistory(redeemId, startTime, endTime, current, size, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -286,10 +287,10 @@ public void getSolRedemptionHistoryTest() throws ApiException, CryptoException { Request actualRequest = captorValue.request(); assertEquals( - "startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + "redeemId=123&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "2ecc0415a3bdb2963e8030cdf6cf00de6f49d21b71ff939dda42e5756eb8ba66", + "90b22be90fad28e8f5f7cd6af50eb4c523db9c1363ee49915fad9713c0656f0d", actualRequest.url().queryParameter("signature")); assertEquals( "/sapi/v1/sol-staking/sol/history/redemptionHistory", @@ -311,13 +312,14 @@ public void getSolRedemptionHistoryTest() throws ApiException, CryptoException { */ @Test public void getSolStakingHistoryTest() throws ApiException, CryptoException { + Long purchaseId = 123L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long current = 1L; Long size = 10L; Long recvWindow = 5000L; ApiResponse response = - api.getSolStakingHistory(startTime, endTime, current, size, recvWindow); + api.getSolStakingHistory(purchaseId, startTime, endTime, current, size, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -330,10 +332,10 @@ public void getSolStakingHistoryTest() throws ApiException, CryptoException { Request actualRequest = captorValue.request(); assertEquals( - "startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + "purchaseId=123&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "2ecc0415a3bdb2963e8030cdf6cf00de6f49d21b71ff939dda42e5756eb8ba66", + "35f8697a0b1f039ff660d5b47cb802e92c651d0f135334ec523e176dad5b714b", actualRequest.url().queryParameter("signature")); assertEquals( "/sapi/v1/sol-staking/sol/history/stakingHistory", diff --git a/clients/sub-account/CHANGELOG.md b/clients/sub-account/CHANGELOG.md index b6b212a0e..ff366f74a 100644 --- a/clients/sub-account/CHANGELOG.md +++ b/clients/sub-account/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 5.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 5.0.0 - 2026-02-12 diff --git a/clients/vip-loan/CHANGELOG.md b/clients/vip-loan/CHANGELOG.md index 4722f3f8f..1a5726041 100644 --- a/clients/vip-loan/CHANGELOG.md +++ b/clients/vip-loan/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 3.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 3.0.0 - 2026-02-12 diff --git a/clients/wallet/CHANGELOG.md b/clients/wallet/CHANGELOG.md index 9e53d51b2..3725565e8 100644 --- a/clients/wallet/CHANGELOG.md +++ b/clients/wallet/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 4.0.1 - 2026-04-30 + - Update `binance/common` module to version `2.4.2`. ## 4.0.0 - 2026-02-12 diff --git a/examples/c2c/pom.xml b/examples/c2c/pom.xml index 6f81014f5..324214289 100644 --- a/examples/c2c/pom.xml +++ b/examples/c2c/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-c2c - 2.0.0 + 3.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-coin-futures/pom.xml b/examples/derivatives-trading-coin-futures/pom.xml index 60afb9631..dae0c09e0 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 - 7.0.0 + 7.1.1 \ No newline at end of file diff --git a/examples/derivatives-trading-options/pom.xml b/examples/derivatives-trading-options/pom.xml index e2b9ad966..be5fa05ec 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 - 7.0.0 + 8.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/AccountFundingFlowExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/AccountFundingFlowExample.java index cbe34e19f..4adff7118 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/AccountFundingFlowExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/AccountFundingFlowExample.java @@ -40,7 +40,7 @@ public DerivativesTradingOptionsRestApi getApi() { /** * Account Funding Flow (USER_DATA) * - *

Query account funding flows. Weight: 1 + *

Query account funding flows. * Only support querying data in the past 3 months Weight: 1 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/AccountTradeListExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/AccountTradeListExample.java index 75882ab00..249b98333 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/AccountTradeListExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/AccountTradeListExample.java @@ -40,7 +40,8 @@ public DerivativesTradingOptionsRestApi getApi() { /** * Account Trade List (USER_DATA) * - *

Get trades for a specific account and symbol. Weight: 5 + *

Get trades for a specific account and symbol. * Only support querying trades in the past 3 + * months Weight: 5 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-portfolio-margin-pro/pom.xml b/examples/derivatives-trading-portfolio-margin-pro/pom.xml index 387d0231a..989bc6477 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 - 6.0.0 + 7.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/DeleteMarginCallLevelExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/DeleteMarginCallLevelExample.java new file mode 100644 index 000000000..5c0dea514 --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/DeleteMarginCallLevelExample.java @@ -0,0 +1,53 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.account; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.DerivativesTradingPortfolioMarginProRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.DerivativesTradingPortfolioMarginProRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.DeleteMarginCallLevelResponse; + +/** API examples for AccountApi */ +public class DeleteMarginCallLevelExample { + private DerivativesTradingPortfolioMarginProRestApi api; + + public DerivativesTradingPortfolioMarginProRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginProRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginProRestApi(clientConfiguration); + } + return api; + } + + /** + * Delete Margin Call Level (USER_DATA) + * + *

Delete the margin call level for a Portfolio Margin account. Weight: 1500 + * + * @throws ApiException if the Api call fails + */ + public void deleteMarginCallLevelExample() throws ApiException { + Long recvWindow = 5000L; + ApiResponse response = + getApi().deleteMarginCallLevel(recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetMarginCallLevelExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetMarginCallLevelExample.java new file mode 100644 index 000000000..7af0b7853 --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetMarginCallLevelExample.java @@ -0,0 +1,52 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.account; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.DerivativesTradingPortfolioMarginProRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.DerivativesTradingPortfolioMarginProRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetMarginCallLevelResponse; + +/** API examples for AccountApi */ +public class GetMarginCallLevelExample { + private DerivativesTradingPortfolioMarginProRestApi api; + + public DerivativesTradingPortfolioMarginProRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginProRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginProRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Margin Call Level (USER_DATA) + * + *

Get the margin call level for a Portfolio Margin account. Weight: 1500 + * + * @throws ApiException if the Api call fails + */ + public void getMarginCallLevelExample() throws ApiException { + Long recvWindow = 5000L; + ApiResponse response = getApi().getMarginCallLevel(recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SetMarginCallLevelExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SetMarginCallLevelExample.java new file mode 100644 index 000000000..aa55c618e --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SetMarginCallLevelExample.java @@ -0,0 +1,56 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.account; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.DerivativesTradingPortfolioMarginProRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.DerivativesTradingPortfolioMarginProRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SetMarginCallLevelRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SetMarginCallLevelResponse; + +/** API examples for AccountApi */ +public class SetMarginCallLevelExample { + private DerivativesTradingPortfolioMarginProRestApi api; + + public DerivativesTradingPortfolioMarginProRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginProRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginProRestApi(clientConfiguration); + } + return api; + } + + /** + * Set Margin Call Level (USER_DATA) + * + *

Set the margin call level for a Portfolio Margin account. When the account's uniMMR + * drops to the specified level, a notification will be sent via email and SMS. Weight: 1500 + * + * @throws ApiException if the Api call fails + */ + public void setMarginCallLevelExample() throws ApiException { + SetMarginCallLevelRequest setMarginCallLevelRequest = new SetMarginCallLevelRequest(); + setMarginCallLevelRequest.marginCallLevel(5000.0d); + ApiResponse response = + getApi().setMarginCallLevel(setMarginCallLevelRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin/pom.xml b/examples/derivatives-trading-portfolio-margin/pom.xml index ec286a86d..57b31138a 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 - 5.0.0 + 6.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/account/GetUmFuturesOrderDownloadLinkByIdExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesOrderDownloadLinkByIdExample.java index 9653447c9..5504117db 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesOrderDownloadLinkByIdExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesOrderDownloadLinkByIdExample.java @@ -40,7 +40,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { /** * Get UM Futures Order Download Link by Id(USER_DATA) * - *

Get UM futures order download link by Id * Download link expiration: 24h Weight: 10 + *

Get UM futures order download link by Id * Download link expiration: 7 days Weight: 10 * * @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/account/GetUmFuturesTradeDownloadLinkByIdExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesTradeDownloadLinkByIdExample.java index 20adde2de..a86000f6a 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesTradeDownloadLinkByIdExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesTradeDownloadLinkByIdExample.java @@ -40,7 +40,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { /** * Get UM Futures Trade Download Link by Id(USER_DATA) * - *

Get UM futures trade download link by Id * Download link expiration: 24h Weight: 10 + *

Get UM futures trade download link by Id * Download link expiration: 7 days Weight: 10 * * @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/account/GetUmFuturesTransactionDownloadLinkByIdExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesTransactionDownloadLinkByIdExample.java index 79cb64701..14387a6c7 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesTransactionDownloadLinkByIdExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/GetUmFuturesTransactionDownloadLinkByIdExample.java @@ -40,7 +40,8 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { /** * Get UM Futures Transaction Download Link by Id(USER_DATA) * - *

Get UM futures Transaction download link by Id * Download link expiration: 24h Weight: 10 + *

Get UM futures Transaction download link by Id * Download link expiration: 7 days Weight: + * 10 * * @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/CancelAllUmAlgoOpenOrdersExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmAlgoOpenOrdersExample.java new file mode 100644 index 000000000..6a0ed5ab7 --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmAlgoOpenOrdersExample.java @@ -0,0 +1,54 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.DerivativesTradingPortfolioMarginRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.DerivativesTradingPortfolioMarginRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelAllUmAlgoOpenOrdersResponse; + +/** API examples for TradeApi */ +public class CancelAllUmAlgoOpenOrdersExample { + private DerivativesTradingPortfolioMarginRestApi api; + + public DerivativesTradingPortfolioMarginRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginRestApi(clientConfiguration); + } + return api; + } + + /** + * Cancel All UM Algo Open Orders (TRADE) + * + *

Cancel All UM Algo Open Orders Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void cancelAllUmAlgoOpenOrdersExample() throws ApiException { + String symbol = ""; + Long recvWindow = 5000L; + ApiResponse response = + getApi().cancelAllUmAlgoOpenOrders(symbol, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmOpenConditionalOrdersExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmOpenConditionalOrdersExample.java index dad39adf3..11a8c80fe 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmOpenConditionalOrdersExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelAllUmOpenConditionalOrdersExample.java @@ -38,7 +38,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { } /** - * Cancel All UM Open Conditional Orders (TRADE) + * Cancel All UM Open Conditional Orders * *

Cancel All UM Open Conditional Orders Weight: 1 * diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmAlgoOrderExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmAlgoOrderExample.java new file mode 100644 index 000000000..bac58279a --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmAlgoOrderExample.java @@ -0,0 +1,56 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.DerivativesTradingPortfolioMarginRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.DerivativesTradingPortfolioMarginRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.CancelUmAlgoOrderResponse; + +/** API examples for TradeApi */ +public class CancelUmAlgoOrderExample { + private DerivativesTradingPortfolioMarginRestApi api; + + public DerivativesTradingPortfolioMarginRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginRestApi(clientConfiguration); + } + return api; + } + + /** + * Cancel UM Algo Order (TRADE) + * + *

Cancel an active UM algo order. * Either `algoId` or `clientAlgoId` + * must be sent. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void cancelUmAlgoOrderExample() throws ApiException { + Long algoId = 1L; + String clientAlgoId = "1"; + Long recvWindow = 5000L; + ApiResponse response = + getApi().cancelUmAlgoOrder(algoId, clientAlgoId, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmConditionalOrderExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmConditionalOrderExample.java index 8630f8fc1..de31759d5 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmConditionalOrderExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/CancelUmConditionalOrderExample.java @@ -38,7 +38,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { } /** - * Cancel UM Conditional Order(TRADE) + * Cancel UM Conditional Order * *

Cancel UM Conditional Order * Either `strategyId` or * `newClientStrategyId` must be sent. Weight: 1 diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/FuturesTradfiPerpsContractExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/FuturesTradfiPerpsContractExample.java new file mode 100644 index 000000000..181cbb42d --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/FuturesTradfiPerpsContractExample.java @@ -0,0 +1,55 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.DerivativesTradingPortfolioMarginRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.DerivativesTradingPortfolioMarginRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.FuturesTradfiPerpsContractRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.FuturesTradfiPerpsContractResponse; + +/** API examples for TradeApi */ +public class FuturesTradfiPerpsContractExample { + private DerivativesTradingPortfolioMarginRestApi api; + + public DerivativesTradingPortfolioMarginRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginRestApi(clientConfiguration); + } + return api; + } + + /** + * Futures TradFi Perps Contract(USER_DATA) + * + *

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

Place new UM conditional order * Algo order with type `STOP`, parameter + * `timeInForce` can be sent ( default `GTC`). * Algo order with type + * `TAKE_PROFIT`, parameter `timeInForce` can be sent ( default + * `GTC`). * Condition orders will be triggered when: * If + * parameter`priceProtect`is sent as true: * when price reaches the + * `triggerPrice` , the difference rate between \"MARK_PRICE\" and + * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the + * symbol * \"triggerProtect\" of a symbol can be got from `GET + * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after + * order placed <= `activatePrice`, and the latest price >= the lowest + * price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activatePrice`, and the latest price <= the highest price * (1 + * - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * code. ``{\"code\": -2021, \"msg\": \"Order would + * immediately trigger.\"}`` means that the parameters you send do not meet the + * following requirements: * BUY: `activatePrice` should be smaller than latest price. + * * SELL: `activatePrice` should be larger than latest price. * + * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with + * `closePosition`=`true`: * Follow the same rules for condition + * orders. * If triggered, **close all** current long position( if `SELL`) or current + * short position( if `BUY`). * Cannot be used with `quantity` paremeter * + * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with + * `BUY` orders in `LONG` position side. and cannot be used with + * `SELL` orders in `SHORT` position side * + * `selfTradePreventionMode` is only effective when `timeInForce` set to + * `IOC` or `GTC` or `GTD`. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void newUmAlgoOrderExample() throws ApiException { + NewUmAlgoOrderRequest newUmAlgoOrderRequest = new NewUmAlgoOrderRequest(); + newUmAlgoOrderRequest.algoType(""); + newUmAlgoOrderRequest.symbol(""); + newUmAlgoOrderRequest.side(Side.BUY); + newUmAlgoOrderRequest.type(Type.LIMIT); + ApiResponse response = + getApi().newUmAlgoOrder(newUmAlgoOrderRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/NewUmConditionalOrderExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/NewUmConditionalOrderExample.java index 36dc7a7a1..d4a812c4d 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/NewUmConditionalOrderExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/NewUmConditionalOrderExample.java @@ -41,7 +41,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { } /** - * New UM Conditional Order (TRADE) + * New UM Conditional Order * *

Place new UM conditional order * Order with type `STOP/TAKE_PROFIT`, parameter * `timeInForce` can be sent ( default `GTC`). * Condition orders will be diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenAlgoOrdersExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenAlgoOrdersExample.java new file mode 100644 index 000000000..aca4e49dc --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenAlgoOrdersExample.java @@ -0,0 +1,58 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.DerivativesTradingPortfolioMarginRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.DerivativesTradingPortfolioMarginRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryAllCurrentUmOpenAlgoOrdersResponse; + +/** API examples for TradeApi */ +public class QueryAllCurrentUmOpenAlgoOrdersExample { + private DerivativesTradingPortfolioMarginRestApi api; + + public DerivativesTradingPortfolioMarginRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginRestApi(clientConfiguration); + } + return api; + } + + /** + * Query All Current UM Open Algo Orders (USER_DATA) + * + *

Get all UM open algo orders on a symbol. * If the symbol is not sent, orders for all + * symbols will be returned in an array. Weight: 1 for a single symbol; 40 when the symbol + * parameter is omitted Careful when accessing this with no symbol. + * + * @throws ApiException if the Api call fails + */ + public void queryAllCurrentUmOpenAlgoOrdersExample() throws ApiException { + String algoType = ""; + String symbol = ""; + Long algoId = 1L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().queryAllCurrentUmOpenAlgoOrders(algoType, symbol, algoId, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenConditionalOrdersExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenConditionalOrdersExample.java index acea4cea0..e053575e2 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenConditionalOrdersExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllCurrentUmOpenConditionalOrdersExample.java @@ -38,7 +38,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { } /** - * Query All Current UM Open Conditional Orders(USER_DATA) + * Query All Current UM Open Conditional Orders * *

Get all open conditional orders on a symbol. * If the symbol is not sent, orders for all * symbols will be returned in an array. Weight: 1 for a single symbol; 40 when the symbol diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllUmConditionalOrdersExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllUmConditionalOrdersExample.java index 6ba62055e..5cecc784c 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllUmConditionalOrdersExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryAllUmConditionalOrdersExample.java @@ -38,7 +38,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { } /** - * Query All UM Conditional Orders(USER_DATA) + * Query All UM Conditional Orders * *

Query All UM Conditional Orders * These orders will not be found: * order strategyStatus * is `CANCELED` or `EXPIRED`, **AND** * order has NO filled trade, **AND** diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenAlgoOrderExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenAlgoOrderExample.java new file mode 100644 index 000000000..44c73f031 --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenAlgoOrderExample.java @@ -0,0 +1,59 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.DerivativesTradingPortfolioMarginRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.DerivativesTradingPortfolioMarginRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryCurrentUmOpenAlgoOrderResponse; + +/** API examples for TradeApi */ +public class QueryCurrentUmOpenAlgoOrderExample { + private DerivativesTradingPortfolioMarginRestApi api; + + public DerivativesTradingPortfolioMarginRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginRestApi(clientConfiguration); + } + return api; + } + + /** + * Query Current UM Open Algo Order (USER_DATA) + * + *

Check an UM algo order's status. * These orders will not be found: * order status is + * `CANCELED` or `EXPIRED` **AND** order has NO filled trade **AND** created + * time + 3 days < current time * order create time + 90 days < current time * Either + * `algoId` or `clientAlgoId` must be sent. * `algoId` is + * self-increment for each specific `symbol` Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void queryCurrentUmOpenAlgoOrderExample() throws ApiException { + Long algoId = 1L; + String clientAlgoId = "1"; + Long recvWindow = 5000L; + ApiResponse response = + getApi().queryCurrentUmOpenAlgoOrder(algoId, clientAlgoId, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenConditionalOrderExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenConditionalOrderExample.java index b546ce826..f21949ab6 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenConditionalOrderExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenConditionalOrderExample.java @@ -38,7 +38,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { } /** - * Query Current UM Open Conditional Order(USER_DATA) + * Query Current UM Open Conditional Order * *

Query Current UM Open Conditional Order * Either `strategyId` or * `newClientStrategyId` must be sent. * If the queried order has been diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmAlgoOrderHistoryExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmAlgoOrderHistoryExample.java new file mode 100644 index 000000000..6e82b5cda --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmAlgoOrderHistoryExample.java @@ -0,0 +1,62 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.DerivativesTradingPortfolioMarginRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.api.DerivativesTradingPortfolioMarginRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model.QueryUmAlgoOrderHistoryResponse; + +/** API examples for TradeApi */ +public class QueryUmAlgoOrderHistoryExample { + private DerivativesTradingPortfolioMarginRestApi api; + + public DerivativesTradingPortfolioMarginRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginRestApi(clientConfiguration); + } + return api; + } + + /** + * Query UM Algo Order History (USER_DATA) + * + *

Get all algo orders; ACTIVE, CANCELED, TRIGGERED or FINISHED . * If `algoId` is + * set, it will get orders >= that `algoId`. Otherwise most recent orders are + * returned. * The query time period must be less then 7 days( default as the recent 7 days). + * Weight: 5 + * + * @throws ApiException if the Api call fails + */ + public void queryUmAlgoOrderHistoryExample() throws ApiException { + String symbol = ""; + Long algoId = 1L; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long limit = 100L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().queryUmAlgoOrderHistory( + symbol, algoId, startTime, endTime, limit, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmConditionalOrderHistoryExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmConditionalOrderHistoryExample.java index f2fe5b33c..9e7f44b4a 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmConditionalOrderHistoryExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUmConditionalOrderHistoryExample.java @@ -38,7 +38,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { } /** - * Query UM Conditional Order History(USER_DATA) + * Query UM Conditional Order History * *

Query UM Conditional Order History * Either `strategyId` or * `newClientStrategyId` must be sent. * `NEW` orders will not be found. * diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersCmForceOrdersExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersCmForceOrdersExample.java index 991a3088b..8267fe8c9 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersCmForceOrdersExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersCmForceOrdersExample.java @@ -43,7 +43,8 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { * *

Query User's CM Force Orders * If \"autoCloseType\" is not sent, orders with * both of the types will be returned * If \"startTime\" is not sent, data within 7 - * days before \"endTime\" can be queried Weight: 20 with symbol, 50 without symbol + * days before \"endTime\" can be queried * Only support querying data in the past 90 + * days Weight: 20 with symbol, 50 without symbol * * @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/QueryUsersUmForceOrdersExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersUmForceOrdersExample.java index 65817c06e..03baeae97 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersUmForceOrdersExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryUsersUmForceOrdersExample.java @@ -43,7 +43,8 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { * *

Query User's UM Force Orders * If `autoCloseType` is not sent, orders with * both of the types will be returned * If `startTime` is not sent, data within 7 days - * before `endTime` can be queried Weight: 20 with symbol, 50 without symbol + * before `endTime` can be queried * Only support querying data in the past 90 days + * Weight: 20 with symbol, 50 without symbol * * @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 7d364e5ce..dea6db20d 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 - 10.0.0 + 11.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/BasisExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/BasisExample.java index 2b866e4d0..eb640e44e 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/BasisExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/BasisExample.java @@ -51,7 +51,7 @@ public void basisExample() throws ApiException { String pair = ""; ContractType contractType = ContractType.PERPETUAL; Period period = Period.PERIOD_5m; - Long limit = 30L; + Long limit = 100L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; ApiResponse response = diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/ContinuousContractKlineCandlestickDataExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/ContinuousContractKlineCandlestickDataExample.java index b15680a82..fc13c2832 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/ContinuousContractKlineCandlestickDataExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/ContinuousContractKlineCandlestickDataExample.java @@ -53,7 +53,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { public void continuousContractKlineCandlestickDataExample() throws ApiException { String pair = ""; ContractType contractType = ContractType.PERPETUAL; - Interval interval = Interval.INTERVAL_1m; + Interval interval = Interval.INTERVAL_1s; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long limit = 100L; diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/IndexPriceKlineCandlestickDataExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/IndexPriceKlineCandlestickDataExample.java index 2a35723dd..04d65f281 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/IndexPriceKlineCandlestickDataExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/IndexPriceKlineCandlestickDataExample.java @@ -50,7 +50,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { */ public void indexPriceKlineCandlestickDataExample() throws ApiException { String pair = ""; - Interval interval = Interval.INTERVAL_1m; + Interval interval = Interval.INTERVAL_1s; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long limit = 100L; diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/KlineCandlestickDataExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/KlineCandlestickDataExample.java index 3bf94a970..5f0b9b29f 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/KlineCandlestickDataExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/KlineCandlestickDataExample.java @@ -50,7 +50,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { */ public void klineCandlestickDataExample() throws ApiException { String symbol = ""; - Interval interval = Interval.INTERVAL_1m; + Interval interval = Interval.INTERVAL_1s; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long limit = 100L; diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/MarkPriceKlineCandlestickDataExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/MarkPriceKlineCandlestickDataExample.java index adc0d7376..604d1e49c 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/MarkPriceKlineCandlestickDataExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/MarkPriceKlineCandlestickDataExample.java @@ -50,7 +50,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { */ public void markPriceKlineCandlestickDataExample() throws ApiException { String symbol = ""; - Interval interval = Interval.INTERVAL_1m; + Interval interval = Interval.INTERVAL_1s; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long limit = 100L; diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OldTradesLookupExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OldTradesLookupExample.java index ff8221ac5..387041a2d 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OldTradesLookupExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OldTradesLookupExample.java @@ -42,7 +42,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { * *

Get older market historical trades. * Market trades means trades filled in the order book. * Only market trades will be returned, which means the insurance fund trades and ADL trades - * won't be returned. * Only supports data from within the last three months Weight: 20 + * won't be returned. * Only supports data from within the last one month Weight: 20 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/PremiumIndexKlineDataExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/PremiumIndexKlineDataExample.java index a6d56286e..d598f80c8 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/PremiumIndexKlineDataExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/PremiumIndexKlineDataExample.java @@ -50,7 +50,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { */ public void premiumIndexKlineDataExample() throws ApiException { String symbol = ""; - Interval interval = Interval.INTERVAL_1m; + Interval interval = Interval.INTERVAL_1s; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long limit = 100L; diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java index 678438f0f..80b38582f 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java @@ -13,13 +13,11 @@ package com.binance.connector.client.derivatives_trading_usds_futures.rest.trade; import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractResponse; /** API examples for TradeApi */ public class FuturesTradfiPerpsContractExample { @@ -48,8 +46,6 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { public void futuresTradfiPerpsContractExample() throws ApiException { FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest = new FuturesTradfiPerpsContractRequest(); - ApiResponse response = - getApi().futuresTradfiPerpsContract(futuresTradfiPerpsContractRequest); - System.out.println(response.getData()); + getApi().futuresTradfiPerpsContract(futuresTradfiPerpsContractRequest); } } diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAllAlgoOrdersExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAllAlgoOrdersExample.java index 696902af1..794741ea5 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAllAlgoOrdersExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAllAlgoOrdersExample.java @@ -54,12 +54,10 @@ public void queryAllAlgoOrdersExample() throws ApiException { Long algoId = 1L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; - Long page = 0L; Long limit = 100L; Long recvWindow = 5000L; ApiResponse response = - getApi().queryAllAlgoOrders( - symbol, algoId, startTime, endTime, page, limit, recvWindow); + getApi().queryAllAlgoOrders(symbol, algoId, startTime, endTime, limit, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/UsersForceOrdersExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/UsersForceOrdersExample.java index 1037d4c03..f5d1cc7da 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/UsersForceOrdersExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/UsersForceOrdersExample.java @@ -43,7 +43,8 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { * *

Query user's Force Orders * If \"autoCloseType\" is not sent, orders with * both of the types will be returned * If \"startTime\" is not sent, data within 7 - * days before \"endTime\" can be queried Weight: 20 with symbol, 50 without symbol + * days before \"endTime\" can be queried * Only support querying data in the past 90 + * days Weight: 20 with symbol, 50 without symbol * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/market/AllMarketLiquidationOrderStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/market/AllMarketLiquidationOrderStreamsExample.java index e4bcfe308..6be510988 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/market/AllMarketLiquidationOrderStreamsExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/market/AllMarketLiquidationOrderStreamsExample.java @@ -37,7 +37,7 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { * All Market Liquidation Order Streams * *

The All Liquidation Order Snapshot Streams push force liquidation order information for - * all symbols in the market. For each symbol,only the latest one liquidation order within + * all symbols in the market. For each symbol,only the largest one liquidation order within * 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, * no stream will be pushed. Update Speed: 1000ms * diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/market/LiquidationOrderStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/market/LiquidationOrderStreamsExample.java index c9942ce50..2eec86f66 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/market/LiquidationOrderStreamsExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/market/LiquidationOrderStreamsExample.java @@ -37,7 +37,7 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { * Liquidation Order Streams * *

The Liquidation Order Snapshot Streams push force liquidation order information for - * specific symbol. For each symbol,only the latest one liquidation order within 1000ms will be + * specific symbol. For each symbol,only the largest one liquidation order within 1000ms will be * pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will * be pushed. Update Speed: 1000ms * diff --git a/examples/pay/pom.xml b/examples/pay/pom.xml index a1a6f364d..9eb737760 100644 --- a/examples/pay/pom.xml +++ b/examples/pay/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-pay - 3.0.0 + 4.0.0 \ No newline at end of file diff --git a/examples/spot/pom.xml b/examples/spot/pom.xml index f573ffd5a..1d09678dc 100644 --- a/examples/spot/pom.xml +++ b/examples/spot/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-spot - 10.0.0 + 10.1.1 \ No newline at end of file diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java index 243d3bf3a..902100bb3 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java @@ -48,6 +48,7 @@ public SpotWebSocketApi getApi() { *

Weight: 2 */ public void userDataStreamSubscribeSignatureExampleStream() throws InterruptedException { + StreamResponse resp = getApi().userDataStreamSubscribeSignature(new UserDataStreamSubscribeSignatureRequest()); resp.getResponse() diff --git a/examples/staking/pom.xml b/examples/staking/pom.xml index 3f3ffa9de..754bb493e 100644 --- a/examples/staking/pom.xml +++ b/examples/staking/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-staking - 4.0.0 + 5.0.0 \ No newline at end of file diff --git a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/ethstaking/GetEthRedemptionHistoryExample.java b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/ethstaking/GetEthRedemptionHistoryExample.java index 0ec47c4ba..e9a6772a7 100644 --- a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/ethstaking/GetEthRedemptionHistoryExample.java +++ b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/ethstaking/GetEthRedemptionHistoryExample.java @@ -50,13 +50,15 @@ public StakingRestApi getApi() { * @throws ApiException if the Api call fails */ public void getEthRedemptionHistoryExample() throws ApiException { + Long redeemId = 1L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long current = 1L; Long size = 10L; Long recvWindow = 5000L; ApiResponse response = - getApi().getEthRedemptionHistory(startTime, endTime, current, size, recvWindow); + getApi().getEthRedemptionHistory( + redeemId, startTime, endTime, current, size, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/ethstaking/GetEthStakingHistoryExample.java b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/ethstaking/GetEthStakingHistoryExample.java index 7d57fbe79..447a6eace 100644 --- a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/ethstaking/GetEthStakingHistoryExample.java +++ b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/ethstaking/GetEthStakingHistoryExample.java @@ -50,13 +50,15 @@ public StakingRestApi getApi() { * @throws ApiException if the Api call fails */ public void getEthStakingHistoryExample() throws ApiException { + Long purchaseId = 1L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long current = 1L; Long size = 10L; Long recvWindow = 5000L; ApiResponse response = - getApi().getEthStakingHistory(startTime, endTime, current, size, recvWindow); + getApi().getEthStakingHistory( + purchaseId, startTime, endTime, current, size, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/solstaking/GetSolRedemptionHistoryExample.java b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/solstaking/GetSolRedemptionHistoryExample.java index 2d1957730..c38c9cc7b 100644 --- a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/solstaking/GetSolRedemptionHistoryExample.java +++ b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/solstaking/GetSolRedemptionHistoryExample.java @@ -50,13 +50,15 @@ public StakingRestApi getApi() { * @throws ApiException if the Api call fails */ public void getSolRedemptionHistoryExample() throws ApiException { + Long redeemId = 1L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long current = 1L; Long size = 10L; Long recvWindow = 5000L; ApiResponse response = - getApi().getSolRedemptionHistory(startTime, endTime, current, size, recvWindow); + getApi().getSolRedemptionHistory( + redeemId, startTime, endTime, current, size, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/solstaking/GetSolStakingHistoryExample.java b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/solstaking/GetSolStakingHistoryExample.java index 5099ab82d..5d83e7cab 100644 --- a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/solstaking/GetSolStakingHistoryExample.java +++ b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/solstaking/GetSolStakingHistoryExample.java @@ -50,13 +50,15 @@ public StakingRestApi getApi() { * @throws ApiException if the Api call fails */ public void getSolStakingHistoryExample() throws ApiException { + Long purchaseId = 1L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long current = 1L; Long size = 10L; Long recvWindow = 5000L; ApiResponse response = - getApi().getSolStakingHistory(startTime, endTime, current, size, recvWindow); + getApi().getSolStakingHistory( + purchaseId, startTime, endTime, current, size, recvWindow); System.out.println(response.getData()); } }