From dd03705b28bc6b537be232cd94e6057b2350e71c Mon Sep 17 00:00:00 2001 From: theo-s68 <194042188+theo-s68@users.noreply.github.com> Date: Wed, 31 Dec 2025 11:13:34 +0700 Subject: [PATCH] spot 8.0.0 --- MIGRATION.md | 2 +- README.md | 2 +- clients/spot/CHANGELOG.md | 66 + clients/spot/docs/AccountApi.md | 2 +- clients/spot/docs/AllTickerResponse.md | 12 - clients/spot/docs/AllTickerResponseInner.md | 35 - clients/spot/docs/DepthRequest.md | 1 + .../ExchangeInfoResponseResultSymbolsInner.md | 1 + .../docs/ExchangeInfoResponseSymbolsInner.md | 1 + clients/spot/docs/ListenKeyExpired.md | 14 - .../spot/docs/NewUserDataStreamResponse.md | 13 - clients/spot/docs/OrderListOpoRequest.md | 42 + clients/spot/docs/OrderListOpoResponse.md | 21 + .../OrderListOpoResponseOrderReportsInner.md | 28 + .../docs/OrderListOpoResponseOrdersInner.md | 15 + clients/spot/docs/OrderListOpocoRequest.md | 54 + clients/spot/docs/OrderListOpocoResponse.md | 21 + ...OrderListOpocoResponseOrderReportsInner.md | 29 + .../docs/OrderListOpocoResponseOrdersInner.md | 15 + clients/spot/docs/OrderListPlaceOpoRequest.md | 42 + ...sponse.md => OrderListPlaceOpoResponse.md} | 5 +- .../docs/OrderListPlaceOpoResponseResult.md | 21 + ...PlaceOpoResponseResultOrderReportsInner.md | 28 + ...erListPlaceOpoResponseResultOrdersInner.md | 15 + .../spot/docs/OrderListPlaceOpocoRequest.md | 54 + ...onse.md => OrderListPlaceOpocoResponse.md} | 5 +- .../docs/OrderListPlaceOpocoResponseResult.md | 21 + ...aceOpocoResponseResultOrderReportsInner.md | 29 + ...ListPlaceOpocoResponseResultOrdersInner.md | 15 + clients/spot/docs/PutUserDataStreamRequest.md | 13 - clients/spot/docs/Ticker24hrRequest.md | 1 + clients/spot/docs/TickerBookRequest.md | 1 + clients/spot/docs/TickerPriceRequest.md | 1 + clients/spot/docs/TickerTradingDayRequest.md | 1 + clients/spot/docs/TradeApi.md | 126 + clients/spot/docs/UserDataStreamApi.md | 185 -- .../spot/docs/UserDataStreamEventsResponse.md | 1 - .../spot/docs/UserDataStreamPingRequest.md | 13 - .../spot/docs/UserDataStreamStartResponse.md | 16 - .../docs/UserDataStreamStartResponseResult.md | 13 - .../spot/docs/UserDataStreamStopRequest.md | 13 - clients/spot/docs/WebSocketStreamsApi.md | 59 - clients/spot/docs/rest-api/migration-guide.md | 4 +- clients/spot/example_rest.md | 24 +- clients/spot/example_websocket_api.md | 12 +- clients/spot/example_websocket_stream.md | 2 - clients/spot/pom.xml | 2 +- .../connector/client/spot/rest/JSON.java | 30 +- .../client/spot/rest/api/AccountApi.java | 2 +- .../client/spot/rest/api/GeneralApi.java | 2 +- .../client/spot/rest/api/MarketApi.java | 193 +- .../client/spot/rest/api/SpotRestApi.java | 170 +- .../client/spot/rest/api/TradeApi.java | 663 ++++- .../spot/rest/api/UserDataStreamApi.java | 474 ---- .../ExchangeInfoResponseSymbolsInner.java | 34 + .../rest/model/NewUserDataStreamResponse.java | 211 -- .../spot/rest/model/OrderListOpoRequest.java | 1393 +++++++++++ .../spot/rest/model/OrderListOpoResponse.java | 589 +++++ ...OrderListOpoResponseOrderReportsInner.java | 843 +++++++ .../OrderListOpoResponseOrdersInner.java | 290 +++ .../rest/model/OrderListOpocoRequest.java | 1954 +++++++++++++++ .../rest/model/OrderListOpocoResponse.java | 591 +++++ ...derListOpocoResponseOrderReportsInner.java | 888 +++++++ .../OrderListOpocoResponseOrdersInner.java | 291 +++ .../rest/model/PutUserDataStreamRequest.java | 222 -- .../client/spot/websocket/api/JSON.java | 57 +- .../spot/websocket/api/api/AccountApi.java | 2 +- .../websocket/api/api/SpotWebSocketApi.java | 36 +- .../spot/websocket/api/api/TradeApi.java | 132 + .../websocket/api/api/UserDataStreamApi.java | 184 +- .../websocket/api/model/DepthRequest.java | 47 +- ...xchangeInfoResponseResultSymbolsInner.java | 40 + .../websocket/api/model/ListenKeyExpired.java | 277 --- .../api/model/OrderListPlaceOpoRequest.java | 1557 ++++++++++++ ...se.java => OrderListPlaceOpoResponse.java} | 173 +- .../OrderListPlaceOpoResponseResult.java | 668 +++++ ...aceOpoResponseResultOrderReportsInner.java | 964 ++++++++ ...ListPlaceOpoResponseResultOrdersInner.java | 341 +++ .../api/model/OrderListPlaceOpocoRequest.java | 2168 +++++++++++++++++ ....java => OrderListPlaceOpocoResponse.java} | 143 +- .../OrderListPlaceOpocoResponseResult.java | 670 +++++ ...eOpocoResponseResultOrderReportsInner.java | 1018 ++++++++ ...stPlaceOpocoResponseResultOrdersInner.java | 343 +++ .../api/model/Ticker24hrRequest.java | 46 +- .../api/model/TickerBookRequest.java | 46 +- .../api/model/TickerPriceRequest.java | 46 +- .../websocket/api/model/TickerRequest.java | 46 +- .../api/model/TickerTradingDayRequest.java | 47 +- .../model/UserDataStreamEventsResponse.java | 88 +- .../api/model/UserDataStreamPingRequest.java | 252 -- .../api/model/UserDataStreamPingResponse.java | 385 --- .../UserDataStreamStartResponseResult.java | 248 -- .../api/model/UserDataStreamStopRequest.java | 252 -- .../client/spot/websocket/stream/JSON.java | 6 - .../stream/api/SpotWebSocketStreams.java | 7 +- .../stream/api/WebSocketStreamsApi.java | 51 - .../stream/model/AllTickerResponse.java | 189 -- .../stream/model/AllTickerResponseInner.java | 1205 --------- .../client/spot/rest/api/MarketApiTest.java | 19 +- .../spot/rest/api/UserDataStreamApiTest.java | 148 -- .../api/api/UserDataStreamApiTest.java | 101 - .../stream/api/WebSocketStreamsApiTest.java | 32 - examples/spot/pom.xml | 2 +- .../client/spot/rest/market/DepthExample.java | 4 +- .../spot/rest/market/Ticker24hrExample.java | 5 +- .../rest/market/TickerBookTickerExample.java | 5 +- .../spot/rest/market/TickerExample.java | 5 +- .../spot/rest/market/TickerPriceExample.java | 5 +- .../rest/market/TickerTradingDayExample.java | 4 +- .../OrderListOpoExample.java} | 36 +- .../OrderListOpocoExample.java} | 31 +- .../DeleteUserDataStreamExample.java | 48 - .../api/account/MyFiltersExample.java | 8 +- .../api/trade/OrderListPlaceOpoExample.java | 94 + .../api/trade/OrderListPlaceOpocoExample.java | 92 + .../UserDataStreamPingExample.java | 84 - .../UserDataStreamStartExample.java | 73 - .../UserDataStreamStopExample.java | 78 - .../websocketstreams/AllTickerExample.java | 50 - 119 files changed, 17054 insertions(+), 5540 deletions(-) delete mode 100644 clients/spot/docs/AllTickerResponse.md delete mode 100644 clients/spot/docs/AllTickerResponseInner.md delete mode 100644 clients/spot/docs/ListenKeyExpired.md delete mode 100644 clients/spot/docs/NewUserDataStreamResponse.md create mode 100644 clients/spot/docs/OrderListOpoRequest.md create mode 100644 clients/spot/docs/OrderListOpoResponse.md create mode 100644 clients/spot/docs/OrderListOpoResponseOrderReportsInner.md create mode 100644 clients/spot/docs/OrderListOpoResponseOrdersInner.md create mode 100644 clients/spot/docs/OrderListOpocoRequest.md create mode 100644 clients/spot/docs/OrderListOpocoResponse.md create mode 100644 clients/spot/docs/OrderListOpocoResponseOrderReportsInner.md create mode 100644 clients/spot/docs/OrderListOpocoResponseOrdersInner.md create mode 100644 clients/spot/docs/OrderListPlaceOpoRequest.md rename clients/spot/docs/{UserDataStreamPingResponse.md => OrderListPlaceOpoResponse.md} (56%) create mode 100644 clients/spot/docs/OrderListPlaceOpoResponseResult.md create mode 100644 clients/spot/docs/OrderListPlaceOpoResponseResultOrderReportsInner.md create mode 100644 clients/spot/docs/OrderListPlaceOpoResponseResultOrdersInner.md create mode 100644 clients/spot/docs/OrderListPlaceOpocoRequest.md rename clients/spot/docs/{UserDataStreamStopResponse.md => OrderListPlaceOpocoResponse.md} (56%) create mode 100644 clients/spot/docs/OrderListPlaceOpocoResponseResult.md create mode 100644 clients/spot/docs/OrderListPlaceOpocoResponseResultOrderReportsInner.md create mode 100644 clients/spot/docs/OrderListPlaceOpocoResponseResultOrdersInner.md delete mode 100644 clients/spot/docs/PutUserDataStreamRequest.md delete mode 100644 clients/spot/docs/UserDataStreamPingRequest.md delete mode 100644 clients/spot/docs/UserDataStreamStartResponse.md delete mode 100644 clients/spot/docs/UserDataStreamStartResponseResult.md delete mode 100644 clients/spot/docs/UserDataStreamStopRequest.md delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewUserDataStreamResponse.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoRequest.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponse.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponseOrderReportsInner.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponseOrdersInner.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoRequest.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponse.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponseOrderReportsInner.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponseOrdersInner.java delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PutUserDataStreamRequest.java delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListenKeyExpired.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoRequest.java rename clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/{UserDataStreamStopResponse.java => OrderListPlaceOpoResponse.java} (58%) create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResult.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResultOrderReportsInner.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResultOrdersInner.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoRequest.java rename clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/{UserDataStreamStartResponse.java => OrderListPlaceOpocoResponse.java} (65%) create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResult.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResultOrderReportsInner.java create mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResultOrdersInner.java delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingRequest.java delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponseResult.java delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopRequest.java delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AllTickerResponse.java delete mode 100644 clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AllTickerResponseInner.java delete mode 100644 clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/UserDataStreamApiTest.java rename examples/spot/src/main/java/com/binance/connector/client/spot/rest/{userdatastream/PutUserDataStreamExample.java => trade/OrderListOpoExample.java} (52%) rename examples/spot/src/main/java/com/binance/connector/client/spot/rest/{userdatastream/NewUserDataStreamExample.java => trade/OrderListOpocoExample.java} (56%) delete mode 100644 examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/DeleteUserDataStreamExample.java create mode 100644 examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpoExample.java create mode 100644 examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpocoExample.java delete mode 100644 examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java delete mode 100644 examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java delete mode 100644 examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java delete mode 100644 examples/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/websocketstreams/AllTickerExample.java diff --git a/MIGRATION.md b/MIGRATION.md index 3b26f8ea..bc3e2aed 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -37,7 +37,7 @@ For Spot (Spot package): io.github.binance binance-spot - 6.0.0 + 8.0.0 ``` diff --git a/README.md b/README.md index e1784859..5053f80c 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Each connector is published as a separate maven dependency. For example: io.github.binance binance-spot - 6.0.0 + 8.0.0 ``` diff --git a/clients/spot/CHANGELOG.md b/clients/spot/CHANGELOG.md index 22c265a4..c75fbc7f 100644 --- a/clients/spot/CHANGELOG.md +++ b/clients/spot/CHANGELOG.md @@ -1,5 +1,71 @@ # Changelog +## 8.0.0 - 2025-12-31 + +### Added (4) + +#### REST API + +- `orderListOpo()` (`POST /api/v3/orderList/opo`) +- `orderListOpoco()` (`POST /api/v3/orderList/opoco`) + +#### WebSocket API + +- `orderListPlaceOpo()` (`orderList.place.opo` method) +- `orderListPlaceOpoco()` (`orderList.place.opoco` method) + +### Changed (6) + +#### REST API + +- Added parameter `symbolStatus` + - affected methods: + - `depth()` (`GET /api/v3/depth`) + - `ticker()` (`GET /api/v3/ticker`) + - `ticker24hr()` (`GET /api/v3/ticker/24hr`) + - `tickerBookTicker()` (`GET /api/v3/ticker/bookTicker`) + - `tickerPrice()` (`GET /api/v3/ticker/price`) + - `tickerTradingDay()` (`GET /api/v3/ticker/tradingDay`) +- Modified response for `exchangeInfo()` (`GET /api/v3/exchangeInfo`): + - `symbols`.items: property `opoAllowed` added + - `symbols`.items: item property `opoAllowed` added + +- Marked `orderOco()` (`POST /api/v3/order/oco`) as deprecated. + +#### WebSocket API + +- Added parameter `symbolStatus` + - affected methods: + - `depth()` (`depth` method) + - `ticker()` (`ticker` method) + - `ticker24hr()` (`ticker.24hr` method) + - `tickerBook()` (`ticker.book` method) + - `tickerPrice()` (`ticker.price` method) + - `tickerTradingDay()` (`ticker.tradingDay` method) +- Modified response for `exchangeInfo()` (`exchangeInfo` method): + - `result`.`symbols`.items: property `opoAllowed` added + - `result`.`symbols`.items: item property `opoAllowed` added + +- Marked `orderListPlace()` (`orderList.place` method) as deprecated. + +### Removed (7) + +#### REST API + +- `deleteUserDataStream()` (`DELETE /api/v3/userDataStream`) +- `newUserDataStream()` (`POST /api/v3/userDataStream`) +- `putUserDataStream()` (`PUT /api/v3/userDataStream`) + +#### WebSocket API + +- `/userDataStream.ping()` (`userDataStream.ping` method) +- `/userDataStream.start()` (`userDataStream.start` method) +- `/userDataStream.stop()` (`userDataStream.stop` method) + +#### WebSocket Streams + +- `/!ticker@arr()` (`!ticker@arr` stream) + ## 7.0.0 - 2025-10-21 ### Added (2) diff --git a/clients/spot/docs/AccountApi.md b/clients/spot/docs/AccountApi.md index d3130654..9eb5b1d2 100644 --- a/clients/spot/docs/AccountApi.md +++ b/clients/spot/docs/AccountApi.md @@ -398,7 +398,7 @@ No authorization required WebSocket Query Relevant Filters -Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` filters applied to it. Weight: 40 +Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This is the only method that shows if an account has `MAX_ASSET` filters applied to it. Weight: 40 ### Example ```java diff --git a/clients/spot/docs/AllTickerResponse.md b/clients/spot/docs/AllTickerResponse.md deleted file mode 100644 index 2ce43cf2..00000000 --- a/clients/spot/docs/AllTickerResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# AllTickerResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/spot/docs/AllTickerResponseInner.md b/clients/spot/docs/AllTickerResponseInner.md deleted file mode 100644 index ab28f31a..00000000 --- a/clients/spot/docs/AllTickerResponseInner.md +++ /dev/null @@ -1,35 +0,0 @@ - - -# AllTickerResponseInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**eLowerCase** | **String** | | [optional] | -|**E** | **Long** | | [optional] | -|**sLowerCase** | **String** | | [optional] | -|**pLowerCase** | **String** | | [optional] | -|**P** | **String** | | [optional] | -|**wLowerCase** | **String** | | [optional] | -|**xLowerCase** | **String** | | [optional] | -|**cLowerCase** | **String** | | [optional] | -|**Q** | **String** | | [optional] | -|**bLowerCase** | **String** | | [optional] | -|**B** | **String** | | [optional] | -|**aLowerCase** | **String** | | [optional] | -|**A** | **String** | | [optional] | -|**oLowerCase** | **String** | | [optional] | -|**hLowerCase** | **String** | | [optional] | -|**lLowerCase** | **String** | | [optional] | -|**vLowerCase** | **String** | | [optional] | -|**qLowerCase** | **String** | | [optional] | -|**O** | **Long** | | [optional] | -|**C** | **Long** | | [optional] | -|**F** | **Long** | | [optional] | -|**L** | **Long** | | [optional] | -|**nLowerCase** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/DepthRequest.md b/clients/spot/docs/DepthRequest.md index d6144a1e..667da1b0 100644 --- a/clients/spot/docs/DepthRequest.md +++ b/clients/spot/docs/DepthRequest.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | | |**limit** | **Integer** | | [optional] | +|**symbolStatus** | **SymbolStatus** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md b/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md index 47a68bef..25a5f62f 100644 --- a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md +++ b/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md @@ -20,6 +20,7 @@ |**icebergAllowed** | **Boolean** | | [optional] | |**ocoAllowed** | **Boolean** | | [optional] | |**otoAllowed** | **Boolean** | | [optional] | +|**opoAllowed** | **Boolean** | | [optional] | |**quoteOrderQtyMarketAllowed** | **Boolean** | | [optional] | |**allowTrailingStop** | **Boolean** | | [optional] | |**cancelReplaceAllowed** | **Boolean** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md b/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md index 9c440158..e1a14c0d 100644 --- a/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md +++ b/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md @@ -20,6 +20,7 @@ |**icebergAllowed** | **Boolean** | | [optional] | |**ocoAllowed** | **Boolean** | | [optional] | |**otoAllowed** | **Boolean** | | [optional] | +|**opoAllowed** | **Boolean** | | [optional] | |**quoteOrderQtyMarketAllowed** | **Boolean** | | [optional] | |**allowTrailingStop** | **Boolean** | | [optional] | |**cancelReplaceAllowed** | **Boolean** | | [optional] | diff --git a/clients/spot/docs/ListenKeyExpired.md b/clients/spot/docs/ListenKeyExpired.md deleted file mode 100644 index ce30d5a4..00000000 --- a/clients/spot/docs/ListenKeyExpired.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ListenKeyExpired - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**E** | **Long** | | [optional] | -|**listenKey** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/NewUserDataStreamResponse.md b/clients/spot/docs/NewUserDataStreamResponse.md deleted file mode 100644 index d8751bc8..00000000 --- a/clients/spot/docs/NewUserDataStreamResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# NewUserDataStreamResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**listenKey** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderListOpoRequest.md b/clients/spot/docs/OrderListOpoRequest.md new file mode 100644 index 00000000..1eba62d6 --- /dev/null +++ b/clients/spot/docs/OrderListOpoRequest.md @@ -0,0 +1,42 @@ + + +# OrderListOpoRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | | +|**listClientOrderId** | **String** | | [optional] | +|**newOrderRespType** | **NewOrderRespType** | | [optional] | +|**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | +|**workingType** | **WorkingType** | | | +|**workingSide** | **WorkingSide** | | | +|**workingClientOrderId** | **String** | | [optional] | +|**workingPrice** | **Double** | | | +|**workingQuantity** | **Double** | | | +|**workingIcebergQty** | **Double** | | [optional] | +|**workingTimeInForce** | **WorkingTimeInForce** | | [optional] | +|**workingStrategyId** | **Long** | | [optional] | +|**workingStrategyType** | **Integer** | | [optional] | +|**workingPegPriceType** | **WorkingPegPriceType** | | [optional] | +|**workingPegOffsetType** | **WorkingPegOffsetType** | | [optional] | +|**workingPegOffsetValue** | **Integer** | | [optional] | +|**pendingType** | **PendingType** | | | +|**pendingSide** | **PendingSide** | | | +|**pendingClientOrderId** | **String** | | [optional] | +|**pendingPrice** | **Double** | | [optional] | +|**pendingStopPrice** | **Double** | | [optional] | +|**pendingTrailingDelta** | **Double** | | [optional] | +|**pendingIcebergQty** | **Double** | | [optional] | +|**pendingTimeInForce** | **PendingTimeInForce** | | [optional] | +|**pendingStrategyId** | **Long** | | [optional] | +|**pendingStrategyType** | **Integer** | | [optional] | +|**pendingPegPriceType** | **PendingPegPriceType** | | [optional] | +|**pendingPegOffsetType** | **PendingPegOffsetType** | | [optional] | +|**pendingPegOffsetValue** | **Integer** | | [optional] | +|**recvWindow** | **Double** | | [optional] | + + + diff --git a/clients/spot/docs/OrderListOpoResponse.md b/clients/spot/docs/OrderListOpoResponse.md new file mode 100644 index 00000000..40a1ff00 --- /dev/null +++ b/clients/spot/docs/OrderListOpoResponse.md @@ -0,0 +1,21 @@ + + +# OrderListOpoResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**orderListId** | **Long** | | [optional] | +|**contingencyType** | **String** | | [optional] | +|**listStatusType** | **String** | | [optional] | +|**listOrderStatus** | **String** | | [optional] | +|**listClientOrderId** | **String** | | [optional] | +|**transactionTime** | **Long** | | [optional] | +|**symbol** | **String** | | [optional] | +|**orders** | [**List<OrderListOpoResponseOrdersInner>**](OrderListOpoResponseOrdersInner.md) | | [optional] | +|**orderReports** | [**List<OrderListOpoResponseOrderReportsInner>**](OrderListOpoResponseOrderReportsInner.md) | | [optional] | + + + diff --git a/clients/spot/docs/OrderListOpoResponseOrderReportsInner.md b/clients/spot/docs/OrderListOpoResponseOrderReportsInner.md new file mode 100644 index 00000000..c316d178 --- /dev/null +++ b/clients/spot/docs/OrderListOpoResponseOrderReportsInner.md @@ -0,0 +1,28 @@ + + +# OrderListOpoResponseOrderReportsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**orderListId** | **Long** | | [optional] | +|**clientOrderId** | **String** | | [optional] | +|**transactTime** | **Long** | | [optional] | +|**price** | **String** | | [optional] | +|**executedQty** | **String** | | [optional] | +|**origQuoteOrderQty** | **String** | | [optional] | +|**cummulativeQuoteQty** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**type** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**workingTime** | **Long** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**origQty** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/OrderListOpoResponseOrdersInner.md b/clients/spot/docs/OrderListOpoResponseOrdersInner.md new file mode 100644 index 00000000..98a5188b --- /dev/null +++ b/clients/spot/docs/OrderListOpoResponseOrdersInner.md @@ -0,0 +1,15 @@ + + +# OrderListOpoResponseOrdersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**clientOrderId** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/OrderListOpocoRequest.md b/clients/spot/docs/OrderListOpocoRequest.md new file mode 100644 index 00000000..0c93b25c --- /dev/null +++ b/clients/spot/docs/OrderListOpocoRequest.md @@ -0,0 +1,54 @@ + + +# OrderListOpocoRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | | +|**listClientOrderId** | **String** | | [optional] | +|**newOrderRespType** | **NewOrderRespType** | | [optional] | +|**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | +|**workingType** | **WorkingType** | | | +|**workingSide** | **WorkingSide** | | | +|**workingClientOrderId** | **String** | | [optional] | +|**workingPrice** | **Double** | | | +|**workingQuantity** | **Double** | | | +|**workingIcebergQty** | **Double** | | [optional] | +|**workingTimeInForce** | **WorkingTimeInForce** | | [optional] | +|**workingStrategyId** | **Long** | | [optional] | +|**workingStrategyType** | **Integer** | | [optional] | +|**workingPegPriceType** | **WorkingPegPriceType** | | [optional] | +|**workingPegOffsetType** | **WorkingPegOffsetType** | | [optional] | +|**workingPegOffsetValue** | **Integer** | | [optional] | +|**pendingSide** | **PendingSide** | | | +|**pendingAboveType** | **PendingAboveType** | | | +|**pendingAboveClientOrderId** | **String** | | [optional] | +|**pendingAbovePrice** | **Double** | | [optional] | +|**pendingAboveStopPrice** | **Double** | | [optional] | +|**pendingAboveTrailingDelta** | **Double** | | [optional] | +|**pendingAboveIcebergQty** | **Double** | | [optional] | +|**pendingAboveTimeInForce** | **PendingAboveTimeInForce** | | [optional] | +|**pendingAboveStrategyId** | **Long** | | [optional] | +|**pendingAboveStrategyType** | **Integer** | | [optional] | +|**pendingAbovePegPriceType** | **PendingAbovePegPriceType** | | [optional] | +|**pendingAbovePegOffsetType** | **PendingAbovePegOffsetType** | | [optional] | +|**pendingAbovePegOffsetValue** | **Integer** | | [optional] | +|**pendingBelowType** | **PendingBelowType** | | [optional] | +|**pendingBelowClientOrderId** | **String** | | [optional] | +|**pendingBelowPrice** | **Double** | | [optional] | +|**pendingBelowStopPrice** | **Double** | | [optional] | +|**pendingBelowTrailingDelta** | **Double** | | [optional] | +|**pendingBelowIcebergQty** | **Double** | | [optional] | +|**pendingBelowTimeInForce** | **PendingBelowTimeInForce** | | [optional] | +|**pendingBelowStrategyId** | **Long** | | [optional] | +|**pendingBelowStrategyType** | **Integer** | | [optional] | +|**pendingBelowPegPriceType** | **PendingBelowPegPriceType** | | [optional] | +|**pendingBelowPegOffsetType** | **PendingBelowPegOffsetType** | | [optional] | +|**pendingBelowPegOffsetValue** | **Integer** | | [optional] | +|**recvWindow** | **Double** | | [optional] | + + + diff --git a/clients/spot/docs/OrderListOpocoResponse.md b/clients/spot/docs/OrderListOpocoResponse.md new file mode 100644 index 00000000..956e3e86 --- /dev/null +++ b/clients/spot/docs/OrderListOpocoResponse.md @@ -0,0 +1,21 @@ + + +# OrderListOpocoResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**orderListId** | **Long** | | [optional] | +|**contingencyType** | **String** | | [optional] | +|**listStatusType** | **String** | | [optional] | +|**listOrderStatus** | **String** | | [optional] | +|**listClientOrderId** | **String** | | [optional] | +|**transactionTime** | **Long** | | [optional] | +|**symbol** | **String** | | [optional] | +|**orders** | [**List<OrderListOpocoResponseOrdersInner>**](OrderListOpocoResponseOrdersInner.md) | | [optional] | +|**orderReports** | [**List<OrderListOpocoResponseOrderReportsInner>**](OrderListOpocoResponseOrderReportsInner.md) | | [optional] | + + + diff --git a/clients/spot/docs/OrderListOpocoResponseOrderReportsInner.md b/clients/spot/docs/OrderListOpocoResponseOrderReportsInner.md new file mode 100644 index 00000000..3eb37359 --- /dev/null +++ b/clients/spot/docs/OrderListOpocoResponseOrderReportsInner.md @@ -0,0 +1,29 @@ + + +# OrderListOpocoResponseOrderReportsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**orderListId** | **Long** | | [optional] | +|**clientOrderId** | **String** | | [optional] | +|**transactTime** | **Long** | | [optional] | +|**price** | **String** | | [optional] | +|**executedQty** | **String** | | [optional] | +|**origQuoteOrderQty** | **String** | | [optional] | +|**cummulativeQuoteQty** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**type** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**workingTime** | **Long** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**stopPrice** | **String** | | [optional] | +|**origQty** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/OrderListOpocoResponseOrdersInner.md b/clients/spot/docs/OrderListOpocoResponseOrdersInner.md new file mode 100644 index 00000000..c5539dce --- /dev/null +++ b/clients/spot/docs/OrderListOpocoResponseOrdersInner.md @@ -0,0 +1,15 @@ + + +# OrderListOpocoResponseOrdersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**clientOrderId** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/OrderListPlaceOpoRequest.md b/clients/spot/docs/OrderListPlaceOpoRequest.md new file mode 100644 index 00000000..85a7a0a7 --- /dev/null +++ b/clients/spot/docs/OrderListPlaceOpoRequest.md @@ -0,0 +1,42 @@ + + +# OrderListPlaceOpoRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | | +|**listClientOrderId** | **String** | | [optional] | +|**newOrderRespType** | **NewOrderRespType** | | [optional] | +|**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | +|**workingType** | **WorkingType** | | | +|**workingSide** | **WorkingSide** | | | +|**workingClientOrderId** | **String** | | [optional] | +|**workingPrice** | **Double** | | | +|**workingQuantity** | **Double** | | | +|**workingIcebergQty** | **Double** | | [optional] | +|**workingTimeInForce** | **WorkingTimeInForce** | | [optional] | +|**workingStrategyId** | **Long** | | [optional] | +|**workingStrategyType** | **Integer** | | [optional] | +|**workingPegPriceType** | **WorkingPegPriceType** | | [optional] | +|**workingPegOffsetType** | **WorkingPegOffsetType** | | [optional] | +|**workingPegOffsetValue** | **Integer** | | [optional] | +|**pendingType** | **PendingType** | | | +|**pendingSide** | **PendingSide** | | | +|**pendingClientOrderId** | **String** | | [optional] | +|**pendingPrice** | **Double** | | [optional] | +|**pendingStopPrice** | **Double** | | [optional] | +|**pendingTrailingDelta** | **Double** | | [optional] | +|**pendingIcebergQty** | **Double** | | [optional] | +|**pendingTimeInForce** | **PendingTimeInForce** | | [optional] | +|**pendingStrategyId** | **Long** | | [optional] | +|**pendingStrategyType** | **Integer** | | [optional] | +|**pendingPegPriceType** | **PendingPegPriceType** | | [optional] | +|**pendingPegOffsetType** | **PendingPegOffsetType** | | [optional] | +|**pendingPegOffsetValue** | **Integer** | | [optional] | +|**recvWindow** | **Double** | | [optional] | + + + diff --git a/clients/spot/docs/UserDataStreamPingResponse.md b/clients/spot/docs/OrderListPlaceOpoResponse.md similarity index 56% rename from clients/spot/docs/UserDataStreamPingResponse.md rename to clients/spot/docs/OrderListPlaceOpoResponse.md index a734f04f..d364b279 100644 --- a/clients/spot/docs/UserDataStreamPingResponse.md +++ b/clients/spot/docs/OrderListPlaceOpoResponse.md @@ -1,6 +1,6 @@ -# UserDataStreamPingResponse +# OrderListPlaceOpoResponse ## Properties @@ -9,8 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | -|**response** | **Object** | | [optional] | -|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | +|**result** | [**OrderListPlaceOpoResponseResult**](OrderListPlaceOpoResponseResult.md) | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOpoResponseResult.md b/clients/spot/docs/OrderListPlaceOpoResponseResult.md new file mode 100644 index 00000000..e0834081 --- /dev/null +++ b/clients/spot/docs/OrderListPlaceOpoResponseResult.md @@ -0,0 +1,21 @@ + + +# OrderListPlaceOpoResponseResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**orderListId** | **Long** | | [optional] | +|**contingencyType** | **String** | | [optional] | +|**listStatusType** | **String** | | [optional] | +|**listOrderStatus** | **String** | | [optional] | +|**listClientOrderId** | **String** | | [optional] | +|**transactionTime** | **Long** | | [optional] | +|**symbol** | **String** | | [optional] | +|**orders** | [**List<OrderListPlaceOpoResponseResultOrdersInner>**](OrderListPlaceOpoResponseResultOrdersInner.md) | | [optional] | +|**orderReports** | [**List<OrderListPlaceOpoResponseResultOrderReportsInner>**](OrderListPlaceOpoResponseResultOrderReportsInner.md) | | [optional] | + + + diff --git a/clients/spot/docs/OrderListPlaceOpoResponseResultOrderReportsInner.md b/clients/spot/docs/OrderListPlaceOpoResponseResultOrderReportsInner.md new file mode 100644 index 00000000..f26e63a0 --- /dev/null +++ b/clients/spot/docs/OrderListPlaceOpoResponseResultOrderReportsInner.md @@ -0,0 +1,28 @@ + + +# OrderListPlaceOpoResponseResultOrderReportsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**orderListId** | **Long** | | [optional] | +|**clientOrderId** | **String** | | [optional] | +|**transactTime** | **Long** | | [optional] | +|**price** | **String** | | [optional] | +|**executedQty** | **String** | | [optional] | +|**origQuoteOrderQty** | **String** | | [optional] | +|**cummulativeQuoteQty** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**type** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**workingTime** | **Long** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**origQty** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/OrderListPlaceOpoResponseResultOrdersInner.md b/clients/spot/docs/OrderListPlaceOpoResponseResultOrdersInner.md new file mode 100644 index 00000000..307d11fd --- /dev/null +++ b/clients/spot/docs/OrderListPlaceOpoResponseResultOrdersInner.md @@ -0,0 +1,15 @@ + + +# OrderListPlaceOpoResponseResultOrdersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**clientOrderId** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/OrderListPlaceOpocoRequest.md b/clients/spot/docs/OrderListPlaceOpocoRequest.md new file mode 100644 index 00000000..2385e7ea --- /dev/null +++ b/clients/spot/docs/OrderListPlaceOpocoRequest.md @@ -0,0 +1,54 @@ + + +# OrderListPlaceOpocoRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | | +|**listClientOrderId** | **String** | | [optional] | +|**newOrderRespType** | **NewOrderRespType** | | [optional] | +|**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | +|**workingType** | **WorkingType** | | | +|**workingSide** | **WorkingSide** | | | +|**workingClientOrderId** | **String** | | [optional] | +|**workingPrice** | **Double** | | | +|**workingQuantity** | **Double** | | | +|**workingIcebergQty** | **Double** | | [optional] | +|**workingTimeInForce** | **WorkingTimeInForce** | | [optional] | +|**workingStrategyId** | **Long** | | [optional] | +|**workingStrategyType** | **Integer** | | [optional] | +|**workingPegPriceType** | **WorkingPegPriceType** | | [optional] | +|**workingPegOffsetType** | **WorkingPegOffsetType** | | [optional] | +|**workingPegOffsetValue** | **Integer** | | [optional] | +|**pendingSide** | **PendingSide** | | | +|**pendingAboveType** | **PendingAboveType** | | | +|**pendingAboveClientOrderId** | **String** | | [optional] | +|**pendingAbovePrice** | **Double** | | [optional] | +|**pendingAboveStopPrice** | **Double** | | [optional] | +|**pendingAboveTrailingDelta** | **Double** | | [optional] | +|**pendingAboveIcebergQty** | **Double** | | [optional] | +|**pendingAboveTimeInForce** | **PendingAboveTimeInForce** | | [optional] | +|**pendingAboveStrategyId** | **Long** | | [optional] | +|**pendingAboveStrategyType** | **Integer** | | [optional] | +|**pendingAbovePegPriceType** | **PendingAbovePegPriceType** | | [optional] | +|**pendingAbovePegOffsetType** | **PendingAbovePegOffsetType** | | [optional] | +|**pendingAbovePegOffsetValue** | **Integer** | | [optional] | +|**pendingBelowType** | **PendingBelowType** | | [optional] | +|**pendingBelowClientOrderId** | **String** | | [optional] | +|**pendingBelowPrice** | **Double** | | [optional] | +|**pendingBelowStopPrice** | **Double** | | [optional] | +|**pendingBelowTrailingDelta** | **Double** | | [optional] | +|**pendingBelowIcebergQty** | **Double** | | [optional] | +|**pendingBelowTimeInForce** | **PendingBelowTimeInForce** | | [optional] | +|**pendingBelowStrategyId** | **Long** | | [optional] | +|**pendingBelowStrategyType** | **Integer** | | [optional] | +|**pendingBelowPegPriceType** | **PendingBelowPegPriceType** | | [optional] | +|**pendingBelowPegOffsetType** | **PendingBelowPegOffsetType** | | [optional] | +|**pendingBelowPegOffsetValue** | **Integer** | | [optional] | +|**recvWindow** | **Double** | | [optional] | + + + diff --git a/clients/spot/docs/UserDataStreamStopResponse.md b/clients/spot/docs/OrderListPlaceOpocoResponse.md similarity index 56% rename from clients/spot/docs/UserDataStreamStopResponse.md rename to clients/spot/docs/OrderListPlaceOpocoResponse.md index bc7e734c..bda6d0f2 100644 --- a/clients/spot/docs/UserDataStreamStopResponse.md +++ b/clients/spot/docs/OrderListPlaceOpocoResponse.md @@ -1,6 +1,6 @@ -# UserDataStreamStopResponse +# OrderListPlaceOpocoResponse ## Properties @@ -9,8 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | -|**response** | **Object** | | [optional] | -|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | +|**result** | [**OrderListPlaceOpocoResponseResult**](OrderListPlaceOpocoResponseResult.md) | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOpocoResponseResult.md b/clients/spot/docs/OrderListPlaceOpocoResponseResult.md new file mode 100644 index 00000000..cf8a1845 --- /dev/null +++ b/clients/spot/docs/OrderListPlaceOpocoResponseResult.md @@ -0,0 +1,21 @@ + + +# OrderListPlaceOpocoResponseResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**orderListId** | **Long** | | [optional] | +|**contingencyType** | **String** | | [optional] | +|**listStatusType** | **String** | | [optional] | +|**listOrderStatus** | **String** | | [optional] | +|**listClientOrderId** | **String** | | [optional] | +|**transactionTime** | **Long** | | [optional] | +|**symbol** | **String** | | [optional] | +|**orders** | [**List<OrderListPlaceOpocoResponseResultOrdersInner>**](OrderListPlaceOpocoResponseResultOrdersInner.md) | | [optional] | +|**orderReports** | [**List<OrderListPlaceOpocoResponseResultOrderReportsInner>**](OrderListPlaceOpocoResponseResultOrderReportsInner.md) | | [optional] | + + + diff --git a/clients/spot/docs/OrderListPlaceOpocoResponseResultOrderReportsInner.md b/clients/spot/docs/OrderListPlaceOpocoResponseResultOrderReportsInner.md new file mode 100644 index 00000000..03c83d04 --- /dev/null +++ b/clients/spot/docs/OrderListPlaceOpocoResponseResultOrderReportsInner.md @@ -0,0 +1,29 @@ + + +# OrderListPlaceOpocoResponseResultOrderReportsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**orderListId** | **Long** | | [optional] | +|**clientOrderId** | **String** | | [optional] | +|**transactTime** | **Long** | | [optional] | +|**price** | **String** | | [optional] | +|**executedQty** | **String** | | [optional] | +|**origQuoteOrderQty** | **String** | | [optional] | +|**cummulativeQuoteQty** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**type** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**workingTime** | **Long** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**stopPrice** | **String** | | [optional] | +|**origQty** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/OrderListPlaceOpocoResponseResultOrdersInner.md b/clients/spot/docs/OrderListPlaceOpocoResponseResultOrdersInner.md new file mode 100644 index 00000000..3700e5f3 --- /dev/null +++ b/clients/spot/docs/OrderListPlaceOpocoResponseResultOrdersInner.md @@ -0,0 +1,15 @@ + + +# OrderListPlaceOpocoResponseResultOrdersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**clientOrderId** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/PutUserDataStreamRequest.md b/clients/spot/docs/PutUserDataStreamRequest.md deleted file mode 100644 index 11e88321..00000000 --- a/clients/spot/docs/PutUserDataStreamRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# PutUserDataStreamRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**listenKey** | **String** | | | - - - diff --git a/clients/spot/docs/Ticker24hrRequest.md b/clients/spot/docs/Ticker24hrRequest.md index 0570f286..9a10d77b 100644 --- a/clients/spot/docs/Ticker24hrRequest.md +++ b/clients/spot/docs/Ticker24hrRequest.md @@ -10,6 +10,7 @@ |**symbol** | **String** | | [optional] | |**symbols** | **Symbols** | | [optional] | |**tickerType** | **TickerType** | | [optional] | +|**symbolStatus** | **SymbolStatus** | | [optional] | diff --git a/clients/spot/docs/TickerBookRequest.md b/clients/spot/docs/TickerBookRequest.md index 9817f476..e807bc2d 100644 --- a/clients/spot/docs/TickerBookRequest.md +++ b/clients/spot/docs/TickerBookRequest.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | |**symbols** | **Symbols** | | [optional] | +|**symbolStatus** | **SymbolStatus** | | [optional] | diff --git a/clients/spot/docs/TickerPriceRequest.md b/clients/spot/docs/TickerPriceRequest.md index 0438b743..009607b2 100644 --- a/clients/spot/docs/TickerPriceRequest.md +++ b/clients/spot/docs/TickerPriceRequest.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | |**symbols** | **Symbols** | | [optional] | +|**symbolStatus** | **SymbolStatus** | | [optional] | diff --git a/clients/spot/docs/TickerTradingDayRequest.md b/clients/spot/docs/TickerTradingDayRequest.md index c317d045..2e13c309 100644 --- a/clients/spot/docs/TickerTradingDayRequest.md +++ b/clients/spot/docs/TickerTradingDayRequest.md @@ -11,6 +11,7 @@ |**symbols** | **Symbols** | | [optional] | |**timeZone** | **String** | | [optional] | |**tickerType** | **TickerType** | | [optional] | +|**symbolStatus** | **SymbolStatus** | | [optional] | diff --git a/clients/spot/docs/TradeApi.md b/clients/spot/docs/TradeApi.md index 568c3463..94342e77 100644 --- a/clients/spot/docs/TradeApi.md +++ b/clients/spot/docs/TradeApi.md @@ -11,6 +11,8 @@ All URIs are relative to *http://localhost* | [**orderListCancel**](TradeApi.md#orderListCancel) | **POST** /orderList.cancel | WebSocket Cancel Order list | | [**orderListPlace**](TradeApi.md#orderListPlace) | **POST** /orderList.place | WebSocket Place new OCO - Deprecated | | [**orderListPlaceOco**](TradeApi.md#orderListPlaceOco) | **POST** /orderList.place.oco | WebSocket Place new Order list - OCO | +| [**orderListPlaceOpo**](TradeApi.md#orderListPlaceOpo) | **POST** /orderList.place.opo | WebSocket OPO | +| [**orderListPlaceOpoco**](TradeApi.md#orderListPlaceOpoco) | **POST** /orderList.place.opoco | WebSocket OPOCO | | [**orderListPlaceOto**](TradeApi.md#orderListPlaceOto) | **POST** /orderList.place.oto | WebSocket Place new Order list - OTO | | [**orderListPlaceOtoco**](TradeApi.md#orderListPlaceOtoco) | **POST** /orderList.place.otoco | WebSocket Place new Order list - OTOCO | | [**orderPlace**](TradeApi.md#orderPlace) | **POST** /order.place | WebSocket Place new order | @@ -453,6 +455,130 @@ No authorization required |-------------|-------------|------------------| | **200** | Place new Order list - OCO | - | + +# **orderListPlaceOpo** +> OrderListPlaceOpoResponse orderListPlaceOpo(orderListPlaceOpoRequest) + +WebSocket OPO + +Place an [OPO](./faqs/opo.md). * OPOs add 2 orders to the EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter. Weight: 1 Unfilled Order Count: 2 + +### Example +```java +// Import classes: +import com.binance.connector.client.spot.ApiClient; +import com.binance.connector.client.spot.ApiException; +import com.binance.connector.client.spot.Configuration; +import com.binance.connector.client.spot.models.*; +import com.binance.connector.client.spot.websocket.api.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + TradeApi apiInstance = new TradeApi(defaultClient); + OrderListPlaceOpoRequest orderListPlaceOpoRequest = new OrderListPlaceOpoRequest(); // OrderListPlaceOpoRequest | + try { + OrderListPlaceOpoResponse result = apiInstance.orderListPlaceOpo(orderListPlaceOpoRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#orderListPlaceOpo"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **orderListPlaceOpoRequest** | [**OrderListPlaceOpoRequest**](OrderListPlaceOpoRequest.md)| | | + +### Return type + +[**OrderListPlaceOpoResponse**](OrderListPlaceOpoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OPO | - | + + +# **orderListPlaceOpoco** +> OrderListPlaceOpocoResponse orderListPlaceOpoco(orderListPlaceOpocoRequest) + +WebSocket OPOCO + +Place an [OPOCO](./faqs/opo.md). Weight: 1 Unfilled Order Count: 3 + +### Example +```java +// Import classes: +import com.binance.connector.client.spot.ApiClient; +import com.binance.connector.client.spot.ApiException; +import com.binance.connector.client.spot.Configuration; +import com.binance.connector.client.spot.models.*; +import com.binance.connector.client.spot.websocket.api.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + TradeApi apiInstance = new TradeApi(defaultClient); + OrderListPlaceOpocoRequest orderListPlaceOpocoRequest = new OrderListPlaceOpocoRequest(); // OrderListPlaceOpocoRequest | + try { + OrderListPlaceOpocoResponse result = apiInstance.orderListPlaceOpoco(orderListPlaceOpocoRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#orderListPlaceOpoco"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **orderListPlaceOpocoRequest** | [**OrderListPlaceOpocoRequest**](OrderListPlaceOpocoRequest.md)| | | + +### Return type + +[**OrderListPlaceOpocoResponse**](OrderListPlaceOpocoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OPOCO | - | + # **orderListPlaceOto** > OrderListPlaceOtoResponse orderListPlaceOto(orderListPlaceOtoRequest) diff --git a/clients/spot/docs/UserDataStreamApi.md b/clients/spot/docs/UserDataStreamApi.md index 786d108d..c761102b 100644 --- a/clients/spot/docs/UserDataStreamApi.md +++ b/clients/spot/docs/UserDataStreamApi.md @@ -5,9 +5,6 @@ All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**sessionSubscriptions**](UserDataStreamApi.md#sessionSubscriptions) | **POST** /session.subscriptions | WebSocket Listing all subscriptions | -| [**userDataStreamPing**](UserDataStreamApi.md#userDataStreamPing) | **POST** /userDataStream.ping | WebSocket Ping user data stream | -| [**userDataStreamStart**](UserDataStreamApi.md#userDataStreamStart) | **POST** /userDataStream.start | WebSocket Start user data stream | -| [**userDataStreamStop**](UserDataStreamApi.md#userDataStreamStop) | **POST** /userDataStream.stop | WebSocket Stop user data stream | | [**userDataStreamSubscribe**](UserDataStreamApi.md#userDataStreamSubscribe) | **POST** /userDataStream.subscribe | WebSocket Subscribe to User Data Stream | | [**userDataStreamSubscribeSignature**](UserDataStreamApi.md#userDataStreamSubscribeSignature) | **POST** /userDataStream.subscribe.signature | WebSocket Subscribe to User Data Stream through signature subscription | | [**userDataStreamUnsubscribe**](UserDataStreamApi.md#userDataStreamUnsubscribe) | **POST** /userDataStream.unsubscribe | WebSocket Unsubscribe from User Data Stream | @@ -71,188 +68,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Listing all subscriptions | - | - -# **userDataStreamPing** -> UserDataStreamPingResponse userDataStreamPing(userDataStreamPingRequest) - -WebSocket Ping user data stream - -Ping a user data stream to keep it alive. User data streams close automatically after 60 minutes, even if you're listening to them on WebSocket Streams. In order to keep the stream open, you have to regularly send pings using the `userDataStream.ping` request. It is recommended to send a ping once every 30 minutes. This request does not require `signature`. Weight: 2 - -### Example -```java -// Import classes: -import com.binance.connector.client.spot.ApiClient; -import com.binance.connector.client.spot.ApiException; -import com.binance.connector.client.spot.Configuration; -import com.binance.connector.client.spot.models.*; -import com.binance.connector.client.spot.websocket.api.api.UserDataStreamApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - UserDataStreamApi apiInstance = new UserDataStreamApi(defaultClient); - UserDataStreamPingRequest userDataStreamPingRequest = new UserDataStreamPingRequest(); // UserDataStreamPingRequest | - try { - UserDataStreamPingResponse result = apiInstance.userDataStreamPing(userDataStreamPingRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserDataStreamApi#userDataStreamPing"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **userDataStreamPingRequest** | [**UserDataStreamPingRequest**](UserDataStreamPingRequest.md)| | | - -### Return type - -[**UserDataStreamPingResponse**](UserDataStreamPingResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Ping user data stream | - | - - -# **userDataStreamStart** -> UserDataStreamStartResponse userDataStreamStart() - -WebSocket Start user data stream - -Start a new user data stream. Note the stream will close in 60 minutes unless `userDataStream.ping` requests are sent regularly. This request does not require `signature`. Weight: 2 - -### Example -```java -// Import classes: -import com.binance.connector.client.spot.ApiClient; -import com.binance.connector.client.spot.ApiException; -import com.binance.connector.client.spot.Configuration; -import com.binance.connector.client.spot.models.*; -import com.binance.connector.client.spot.websocket.api.api.UserDataStreamApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - UserDataStreamApi apiInstance = new UserDataStreamApi(defaultClient); - try { - UserDataStreamStartResponse result = apiInstance.userDataStreamStart(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserDataStreamApi#userDataStreamStart"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**UserDataStreamStartResponse**](UserDataStreamStartResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Start user data stream | - | - - -# **userDataStreamStop** -> UserDataStreamStopResponse userDataStreamStop(userDataStreamStopRequest) - -WebSocket Stop user data stream - -Explicitly stop and close the user data stream. This request does not require `signature`. Weight: 2 - -### Example -```java -// Import classes: -import com.binance.connector.client.spot.ApiClient; -import com.binance.connector.client.spot.ApiException; -import com.binance.connector.client.spot.Configuration; -import com.binance.connector.client.spot.models.*; -import com.binance.connector.client.spot.websocket.api.api.UserDataStreamApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - UserDataStreamApi apiInstance = new UserDataStreamApi(defaultClient); - UserDataStreamStopRequest userDataStreamStopRequest = new UserDataStreamStopRequest(); // UserDataStreamStopRequest | - try { - UserDataStreamStopResponse result = apiInstance.userDataStreamStop(userDataStreamStopRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserDataStreamApi#userDataStreamStop"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **userDataStreamStopRequest** | [**UserDataStreamStopRequest**](UserDataStreamStopRequest.md)| | | - -### Return type - -[**UserDataStreamStopResponse**](UserDataStreamStopResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Stop user data stream | - | - # **userDataStreamSubscribe** > UserDataStreamSubscribeResponse userDataStreamSubscribe() diff --git a/clients/spot/docs/UserDataStreamEventsResponse.md b/clients/spot/docs/UserDataStreamEventsResponse.md index 527fd351..739047a4 100644 --- a/clients/spot/docs/UserDataStreamEventsResponse.md +++ b/clients/spot/docs/UserDataStreamEventsResponse.md @@ -61,7 +61,6 @@ |**gOT** | **String** | | [optional] | |**gOV** | **Long** | | [optional] | |**gp** | **String** | | [optional] | -|**listenKey** | **String** | | [optional] | diff --git a/clients/spot/docs/UserDataStreamPingRequest.md b/clients/spot/docs/UserDataStreamPingRequest.md deleted file mode 100644 index 9c6f4cb8..00000000 --- a/clients/spot/docs/UserDataStreamPingRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UserDataStreamPingRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**listenKey** | **String** | | | - - - diff --git a/clients/spot/docs/UserDataStreamStartResponse.md b/clients/spot/docs/UserDataStreamStartResponse.md deleted file mode 100644 index 9c7fbc36..00000000 --- a/clients/spot/docs/UserDataStreamStartResponse.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# UserDataStreamStartResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**UserDataStreamStartResponseResult**](UserDataStreamStartResponseResult.md) | | [optional] | -|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | - - - diff --git a/clients/spot/docs/UserDataStreamStartResponseResult.md b/clients/spot/docs/UserDataStreamStartResponseResult.md deleted file mode 100644 index cd385db0..00000000 --- a/clients/spot/docs/UserDataStreamStartResponseResult.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UserDataStreamStartResponseResult - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**listenKey** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/UserDataStreamStopRequest.md b/clients/spot/docs/UserDataStreamStopRequest.md deleted file mode 100644 index aa363e25..00000000 --- a/clients/spot/docs/UserDataStreamStopRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UserDataStreamStopRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**listenKey** | **String** | | | - - - diff --git a/clients/spot/docs/WebSocketStreamsApi.md b/clients/spot/docs/WebSocketStreamsApi.md index 52016003..1365286e 100644 --- a/clients/spot/docs/WebSocketStreamsApi.md +++ b/clients/spot/docs/WebSocketStreamsApi.md @@ -7,7 +7,6 @@ All URIs are relative to *http://localhost* | [**aggTrade**](WebSocketStreamsApi.md#aggTrade) | **POST** /<symbol>@aggTrade | WebSocket Aggregate Trade Streams | | [**allMarketRollingWindowTicker**](WebSocketStreamsApi.md#allMarketRollingWindowTicker) | **POST** /!ticker_<windowSize>@arr | WebSocket All Market Rolling Window Statistics Streams | | [**allMiniTicker**](WebSocketStreamsApi.md#allMiniTicker) | **POST** /!miniTicker@arr | WebSocket All Market Mini Tickers Stream | -| [**allTicker**](WebSocketStreamsApi.md#allTicker) | **POST** /!ticker@arr | WebSocket All Market Tickers Stream | | [**avgPrice**](WebSocketStreamsApi.md#avgPrice) | **POST** /<symbol>@avgPrice | WebSocket Average Price | | [**bookTicker**](WebSocketStreamsApi.md#bookTicker) | **POST** /<symbol>@bookTicker | WebSocket Individual Symbol Book Ticker Streams | | [**diffBookDepth**](WebSocketStreamsApi.md#diffBookDepth) | **POST** /<symbol>@depth@<updateSpeed> | WebSocket Diff. Depth Stream | @@ -202,64 +201,6 @@ No authorization required |-------------|-------------|------------------| | **200** | All Market Mini Tickers Stream | - | - -# **allTicker** -> AllTickerResponse allTicker() - -WebSocket All Market Tickers Stream - -24hr rolling window ticker statistics for all symbols that changed in an array. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note that only tickers that have changed will be present in the array. - -### Example -```java -// Import classes: -import com.binance.connector.client.spot.ApiClient; -import com.binance.connector.client.spot.ApiException; -import com.binance.connector.client.spot.Configuration; -import com.binance.connector.client.spot.models.*; -import com.binance.connector.client.spot.websocket.stream.api.WebSocketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebSocketStreamsApi apiInstance = new WebSocketStreamsApi(defaultClient); - try { - AllTickerResponse result = apiInstance.allTicker(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebSocketStreamsApi#allTicker"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**AllTickerResponse**](AllTickerResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | All Market Tickers Stream | - | - # **avgPrice** > AvgPriceResponse avgPrice(avgPriceRequest) diff --git a/clients/spot/docs/rest-api/migration-guide.md b/clients/spot/docs/rest-api/migration-guide.md index ad195702..551cd0af 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 - 7.0.1 + 8.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-spot - 7.0.0 + 8.0.0 ``` diff --git a/clients/spot/example_rest.md b/clients/spot/example_rest.md index 4cabc9e1..b4e8bb7f 100644 --- a/clients/spot/example_rest.md +++ b/clients/spot/example_rest.md @@ -42,7 +42,7 @@ [GET /api/v3/avgPrice](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#current-average-price) - avgPrice - [AvgPriceExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/AvgPriceExample.java#L46) -[GET /api/v3/depth](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book) - depth - [DepthExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/DepthExample.java#L47) +[GET /api/v3/depth](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book) - depth - [DepthExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/DepthExample.java#L48) [GET /api/v3/trades](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#recent-trades-list) - getTrades - [GetTradesExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/GetTradesExample.java#L46) @@ -50,15 +50,15 @@ [GET /api/v3/klines](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#klinecandlestick-data) - klines - [KlinesExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/KlinesExample.java#L48) -[GET /api/v3/ticker](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#rolling-window-price-change-statistics) - ticker - [TickerExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerExample.java#L51) +[GET /api/v3/ticker](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#rolling-window-price-change-statistics) - ticker - [TickerExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerExample.java#L52) -[GET /api/v3/ticker/24hr](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics) - ticker24hr - [Ticker24hrExample.java:58](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/Ticker24hrExample.java#L58) +[GET /api/v3/ticker/24hr](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics) - ticker24hr - [Ticker24hrExample.java:59](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/Ticker24hrExample.java#L59) -[GET /api/v3/ticker/bookTicker](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker) - tickerBookTicker - [TickerBookTickerExample.java:53](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerBookTickerExample.java#L53) +[GET /api/v3/ticker/bookTicker](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker) - tickerBookTicker - [TickerBookTickerExample.java:54](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerBookTickerExample.java#L54) -[GET /api/v3/ticker/price](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker) - tickerPrice - [TickerPriceExample.java:53](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerPriceExample.java#L53) +[GET /api/v3/ticker/price](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker) - tickerPrice - [TickerPriceExample.java:54](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerPriceExample.java#L54) -[GET /api/v3/ticker/tradingDay](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#trading-day-ticker) - tickerTradingDay - [TickerTradingDayExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerTradingDayExample.java#L50) +[GET /api/v3/ticker/tradingDay](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#trading-day-ticker) - tickerTradingDay - [TickerTradingDayExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerTradingDayExample.java#L51) [GET /api/v3/uiKlines](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#uiklines) - uiKlines - [UiKlinesExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/UiKlinesExample.java#L49) @@ -78,6 +78,10 @@ [POST /api/v3/orderList/oco](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade) - orderListOco - [OrderListOcoExample.java:62](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOcoExample.java#L62) +[POST /api/v3/orderList/opo](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---opo-trade) - orderListOpo - [OrderListOpoExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOpoExample.java#L52) + +[POST /api/v3/orderList/opoco](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---opoco-trade) - orderListOpoco - [OrderListOpocoExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOpocoExample.java#L51) + [POST /api/v3/orderList/oto](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oto-trade) - orderListOto - [OrderListOtoExample.java:63](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOtoExample.java#L63) [POST /api/v3/orderList/otoco](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---otoco-trade) - orderListOtoco - [OrderListOtocoExample.java:60](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOtocoExample.java#L60) @@ -90,11 +94,3 @@ [POST /api/v3/sor/order/test](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#test-new-order-using-sor-trade) - sorOrderTest - [SorOrderTestExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/SorOrderTestExample.java#L52) -## UserDataStream - -[DELETE /api/v3/userDataStream](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/user-data-stream-endpoints---deprecated#close-user-data-stream-user_stream) - deleteUserDataStream - [DeleteUserDataStreamExample.java:44](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/DeleteUserDataStreamExample.java#L44) - -[POST /api/v3/userDataStream](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/user-data-stream-endpoints---deprecated#start-user-data-stream-user_stream) - newUserDataStream - [NewUserDataStreamExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/NewUserDataStreamExample.java#L47) - -[PUT /api/v3/userDataStream](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/user-data-stream-endpoints---deprecated#keepalive-user-data-stream-user_stream) - putUserDataStream - [PutUserDataStreamExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java#L47) - diff --git a/clients/spot/example_websocket_api.md b/clients/spot/example_websocket_api.md index e3598456..e541aa27 100644 --- a/clients/spot/example_websocket_api.md +++ b/clients/spot/example_websocket_api.md @@ -86,6 +86,10 @@ [orderList.place.oco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---oco-trade) - orderListPlaceOco - [OrderListPlaceOcoExample.java:63](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java#L63) +[orderList.place.opo](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#opo-trade) - orderListPlaceOpo - [OrderListPlaceOpoExample.java:53](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpoExample.java#L53) + +[orderList.place.opoco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#opoco-trade) - orderListPlaceOpoco - [OrderListPlaceOpocoExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpocoExample.java#L52) + [orderList.place.oto](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---oto-trade) - orderListPlaceOto - [OrderListPlaceOtoExample.java:64](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java#L64) [orderList.place.otoco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---otoco-trade) - orderListPlaceOtoco - [OrderListPlaceOtocoExample.java:61](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java#L61) @@ -102,15 +106,9 @@ [session.subscriptions](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#listing-all-subscriptions) - sessionSubscriptions - [SessionSubscriptionsExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/SessionSubscriptionsExample.java#L47) -[userDataStream.ping](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#ping-user-data-stream-user_stream) - userDataStreamPing - [UserDataStreamPingExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java#L52) - -[userDataStream.start](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#start-user-data-stream-user_stream) - userDataStreamStart - [UserDataStreamStartExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java#L49) - -[userDataStream.stop](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#stop-user-data-stream-user_stream) - userDataStreamStop - [UserDataStreamStopExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java#L49) - [userDataStream.subscribe](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#subscribe-to-user-data-stream-user_stream) - userDataStreamSubscribe - [UserDataStreamSubscribeExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeExample.java#L49) -[userDataStream.subscribe.signature](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#subscribe-to-user-data-stream-through-signature-subscription-user_data) - userDataStreamSubscribeSignature - [UserDataStreamSubscribeSignatureExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java#L49) +[userDataStream.subscribe.signature](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#subscribe-to-user-data-stream-through-signature-subscription-user_stream) - userDataStreamSubscribeSignature - [UserDataStreamSubscribeSignatureExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java#L49) [userDataStream.unsubscribe](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#unsubscribe-from-user-data-stream) - userDataStreamUnsubscribe - [UserDataStreamUnsubscribeExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java#L51) diff --git a/clients/spot/example_websocket_stream.md b/clients/spot/example_websocket_stream.md index 236a2bb1..750c31b4 100644 --- a/clients/spot/example_websocket_stream.md +++ b/clients/spot/example_websocket_stream.md @@ -6,8 +6,6 @@ [!miniTicker@arr](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-mini-tickers-stream) - allMiniTicker - [AllMiniTickerExample.java:44](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/websocketstreams/AllMiniTickerExample.java#L44) -[!ticker@arr](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-tickers-stream) - allTicker - [AllTickerExample.java:44](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/websocketstreams/AllTickerExample.java#L44) - [@avgPrice](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#average-price) - avgPrice - [AvgPriceExample.java:43](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/websocketstreams/AvgPriceExample.java#L43) [@bookTicker](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-book-ticker-streams) - bookTicker - [BookTickerExample.java:45](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/websocketstreams/BookTickerExample.java#L45) diff --git a/clients/spot/pom.xml b/clients/spot/pom.xml index d9c53593..37a0d626 100644 --- a/clients/spot/pom.xml +++ b/clients/spot/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-spot spot - 7.0.1 + 8.0.0 jar diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java index 3d0b0e62..fa49a22a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java @@ -531,9 +531,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.NewOrderResponseFillsInner .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.rest.model.NewUserDataStreamResponse - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.NotionalFilter .CustomTypeAdapterFactory()); @@ -601,6 +598,30 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.OrderListOcoResponseOrdersInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.OrderListOpoRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.OrderListOpoResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model + .OrderListOpoResponseOrderReportsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.OrderListOpoResponseOrdersInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.OrderListOpocoRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.OrderListOpocoResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model + .OrderListOpocoResponseOrderReportsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.OrderListOpocoResponseOrdersInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.OrderListOtoRequest .CustomTypeAdapterFactory()); @@ -664,9 +685,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.PriceFilter .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.rest.model.PutUserDataStreamRequest - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.RateLimitOrderResponse .CustomTypeAdapterFactory()); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java index 1b16788a..3b6201e1 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/7.0.0 (Java/%s; %s; %s)", + "binance-spot/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java index 0df1ccb3..7f999583 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java @@ -47,7 +47,7 @@ public class GeneralApi { private static final String USER_AGENT = String.format( - "binance-spot/7.0.0 (Java/%s; %s; %s)", + "binance-spot/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java index ffa5a831..6b3fd792 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 @@ -27,6 +27,7 @@ import com.binance.connector.client.spot.rest.model.HistoricalTradesResponse; import com.binance.connector.client.spot.rest.model.Interval; import com.binance.connector.client.spot.rest.model.KlinesResponse; +import com.binance.connector.client.spot.rest.model.SymbolStatus; import com.binance.connector.client.spot.rest.model.Symbols; import com.binance.connector.client.spot.rest.model.Ticker24hrResponse; import com.binance.connector.client.spot.rest.model.TickerBookTickerResponse; @@ -58,7 +59,7 @@ public class MarketApi { private static final String USER_AGENT = String.format( - "binance-spot/7.0.0 (Java/%s; %s; %s)", + "binance-spot/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; @@ -399,6 +400,7 @@ public ApiResponse avgPrice(@NotNull String symbol) throws Api * * @param symbol (required) * @param limit Default: 500; Maximum: 1000. (optional) + * @param symbolStatus (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -412,7 +414,8 @@ public ApiResponse avgPrice(@NotNull String symbol) throws Api * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book">Order * book Documentation */ - private okhttp3.Call depthCall(String symbol, Integer limit) throws ApiException { + private okhttp3.Call depthCall(String symbol, Integer limit, SymbolStatus symbolStatus) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -445,6 +448,11 @@ private okhttp3.Call depthCall(String symbol, Integer limit) throws ApiException localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } + if (symbolStatus != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("symbolStatus", symbolStatus)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -475,7 +483,8 @@ private okhttp3.Call depthCall(String symbol, Integer limit) throws ApiException } @SuppressWarnings("rawtypes") - private okhttp3.Call depthValidateBeforeCall(String symbol, Integer limit) throws ApiException { + private okhttp3.Call depthValidateBeforeCall( + String symbol, Integer limit, SymbolStatus symbolStatus) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -485,13 +494,15 @@ private okhttp3.Call depthValidateBeforeCall(String symbol, Integer limit) throw .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, limit}; - Method method = this.getClass().getMethod("depth", String.class, Integer.class); + Object[] parameterValues = {symbol, limit, symbolStatus}; + Method method = + this.getClass() + .getMethod("depth", String.class, Integer.class, SymbolStatus.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return depthCall(symbol, limit); + return depthCall(symbol, limit, symbolStatus); } else { throw new ConstraintViolationException((Set) violations); } @@ -510,6 +521,7 @@ private okhttp3.Call depthValidateBeforeCall(String symbol, Integer limit) throw * * @param symbol (required) * @param limit Default: 500; Maximum: 1000. (optional) + * @param symbolStatus (optional) * @return ApiResponse<DepthResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -524,9 +536,9 @@ private okhttp3.Call depthValidateBeforeCall(String symbol, Integer limit) throw * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book">Order * book Documentation */ - public ApiResponse depth(@NotNull String symbol, Integer limit) - throws ApiException { - okhttp3.Call localVarCall = depthValidateBeforeCall(symbol, limit); + public ApiResponse depth( + @NotNull String symbol, Integer limit, SymbolStatus symbolStatus) throws ApiException { + okhttp3.Call localVarCall = depthValidateBeforeCall(symbol, limit, symbolStatus); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1013,6 +1025,7 @@ public ApiResponse klines( * @param symbols List of symbols to query (optional) * @param windowSize (optional) * @param type (optional) + * @param symbolStatus (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1027,7 +1040,11 @@ public ApiResponse klines( * window price change statistics Documentation */ private okhttp3.Call tickerCall( - String symbol, Symbols symbols, WindowSize windowSize, TickerType type) + String symbol, + Symbols symbols, + WindowSize windowSize, + TickerType type, + SymbolStatus symbolStatus) throws ApiException { String basePath = null; // Operation Servers @@ -1070,6 +1087,11 @@ private okhttp3.Call tickerCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); } + if (symbolStatus != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("symbolStatus", symbolStatus)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1101,7 +1123,11 @@ private okhttp3.Call tickerCall( @SuppressWarnings("rawtypes") private okhttp3.Call tickerValidateBeforeCall( - String symbol, Symbols symbols, WindowSize windowSize, TickerType type) + String symbol, + Symbols symbols, + WindowSize windowSize, + TickerType type, + SymbolStatus symbolStatus) throws ApiException { try { Validator validator = @@ -1112,7 +1138,7 @@ private okhttp3.Call tickerValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, symbols, windowSize, type}; + Object[] parameterValues = {symbol, symbols, windowSize, type, symbolStatus}; Method method = this.getClass() .getMethod( @@ -1120,12 +1146,13 @@ private okhttp3.Call tickerValidateBeforeCall( String.class, Symbols.class, WindowSize.class, - TickerType.class); + TickerType.class, + SymbolStatus.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return tickerCall(symbol, symbols, windowSize, type); + return tickerCall(symbol, symbols, windowSize, type, symbolStatus); } else { throw new ConstraintViolationException((Set) violations); } @@ -1148,6 +1175,7 @@ private okhttp3.Call tickerValidateBeforeCall( * @param symbols List of symbols to query (optional) * @param windowSize (optional) * @param type (optional) + * @param symbolStatus (optional) * @return ApiResponse<TickerResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1163,9 +1191,14 @@ private okhttp3.Call tickerValidateBeforeCall( * window price change statistics Documentation */ public ApiResponse ticker( - String symbol, Symbols symbols, WindowSize windowSize, TickerType type) + String symbol, + Symbols symbols, + WindowSize windowSize, + TickerType type, + SymbolStatus symbolStatus) throws ApiException { - okhttp3.Call localVarCall = tickerValidateBeforeCall(symbol, symbols, windowSize, type); + okhttp3.Call localVarCall = + tickerValidateBeforeCall(symbol, symbols, windowSize, type, symbolStatus); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1176,6 +1209,7 @@ public ApiResponse ticker( * @param symbol Symbol to query (optional) * @param symbols List of symbols to query (optional) * @param type (optional) + * @param symbolStatus (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1189,7 +1223,8 @@ public ApiResponse ticker( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics">24hr * ticker price change statistics Documentation */ - private okhttp3.Call ticker24hrCall(String symbol, Symbols symbols, TickerType type) + private okhttp3.Call ticker24hrCall( + String symbol, Symbols symbols, TickerType type, SymbolStatus symbolStatus) throws ApiException { String basePath = null; // Operation Servers @@ -1228,6 +1263,11 @@ private okhttp3.Call ticker24hrCall(String symbol, Symbols symbols, TickerType t localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); } + if (symbolStatus != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("symbolStatus", symbolStatus)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1259,7 +1299,8 @@ private okhttp3.Call ticker24hrCall(String symbol, Symbols symbols, TickerType t @SuppressWarnings("rawtypes") private okhttp3.Call ticker24hrValidateBeforeCall( - String symbol, Symbols symbols, TickerType type) throws ApiException { + String symbol, Symbols symbols, TickerType type, SymbolStatus symbolStatus) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1269,15 +1310,20 @@ private okhttp3.Call ticker24hrValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, symbols, type}; + Object[] parameterValues = {symbol, symbols, type, symbolStatus}; Method method = this.getClass() - .getMethod("ticker24hr", String.class, Symbols.class, TickerType.class); + .getMethod( + "ticker24hr", + String.class, + Symbols.class, + TickerType.class, + SymbolStatus.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return ticker24hrCall(symbol, symbols, type); + return ticker24hrCall(symbol, symbols, type, symbolStatus); } else { throw new ConstraintViolationException((Set) violations); } @@ -1307,6 +1353,7 @@ private okhttp3.Call ticker24hrValidateBeforeCall( * @param symbol Symbol to query (optional) * @param symbols List of symbols to query (optional) * @param type (optional) + * @param symbolStatus (optional) * @return ApiResponse<Ticker24hrResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1322,8 +1369,10 @@ private okhttp3.Call ticker24hrValidateBeforeCall( * ticker price change statistics Documentation */ public ApiResponse ticker24hr( - String symbol, Symbols symbols, TickerType type) throws ApiException { - okhttp3.Call localVarCall = ticker24hrValidateBeforeCall(symbol, symbols, type); + String symbol, Symbols symbols, TickerType type, SymbolStatus symbolStatus) + throws ApiException { + okhttp3.Call localVarCall = + ticker24hrValidateBeforeCall(symbol, symbols, type, symbolStatus); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -1334,6 +1383,7 @@ public ApiResponse ticker24hr( * * @param symbol Symbol to query (optional) * @param symbols List of symbols to query (optional) + * @param symbolStatus (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1347,7 +1397,8 @@ public ApiResponse ticker24hr( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker">Symbol * order book ticker Documentation */ - private okhttp3.Call tickerBookTickerCall(String symbol, Symbols symbols) throws ApiException { + private okhttp3.Call tickerBookTickerCall( + String symbol, Symbols symbols, SymbolStatus symbolStatus) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1381,6 +1432,11 @@ private okhttp3.Call tickerBookTickerCall(String symbol, Symbols symbols) throws localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbols", json)); } + if (symbolStatus != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("symbolStatus", symbolStatus)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1411,8 +1467,8 @@ private okhttp3.Call tickerBookTickerCall(String symbol, Symbols symbols) throws } @SuppressWarnings("rawtypes") - private okhttp3.Call tickerBookTickerValidateBeforeCall(String symbol, Symbols symbols) - throws ApiException { + private okhttp3.Call tickerBookTickerValidateBeforeCall( + String symbol, Symbols symbols, SymbolStatus symbolStatus) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1422,14 +1478,19 @@ private okhttp3.Call tickerBookTickerValidateBeforeCall(String symbol, Symbols s .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, symbols}; + Object[] parameterValues = {symbol, symbols, symbolStatus}; Method method = - this.getClass().getMethod("tickerBookTicker", String.class, Symbols.class); + this.getClass() + .getMethod( + "tickerBookTicker", + String.class, + Symbols.class, + SymbolStatus.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return tickerBookTickerCall(symbol, symbols); + return tickerBookTickerCall(symbol, symbols, symbolStatus); } else { throw new ConstraintViolationException((Set) violations); } @@ -1453,6 +1514,7 @@ private okhttp3.Call tickerBookTickerValidateBeforeCall(String symbol, Symbols s * * @param symbol Symbol to query (optional) * @param symbols List of symbols to query (optional) + * @param symbolStatus (optional) * @return ApiResponse<TickerBookTickerResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1467,9 +1529,10 @@ private okhttp3.Call tickerBookTickerValidateBeforeCall(String symbol, Symbols s * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker">Symbol * order book ticker Documentation */ - public ApiResponse tickerBookTicker(String symbol, Symbols symbols) - throws ApiException { - okhttp3.Call localVarCall = tickerBookTickerValidateBeforeCall(symbol, symbols); + public ApiResponse tickerBookTicker( + String symbol, Symbols symbols, SymbolStatus symbolStatus) throws ApiException { + okhttp3.Call localVarCall = + tickerBookTickerValidateBeforeCall(symbol, symbols, symbolStatus); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -1480,6 +1543,7 @@ public ApiResponse tickerBookTicker(String symbol, Sym * * @param symbol Symbol to query (optional) * @param symbols List of symbols to query (optional) + * @param symbolStatus (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1493,7 +1557,8 @@ public ApiResponse tickerBookTicker(String symbol, Sym * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker">Symbol * price ticker Documentation */ - private okhttp3.Call tickerPriceCall(String symbol, Symbols symbols) throws ApiException { + private okhttp3.Call tickerPriceCall(String symbol, Symbols symbols, SymbolStatus symbolStatus) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1527,6 +1592,11 @@ private okhttp3.Call tickerPriceCall(String symbol, Symbols symbols) throws ApiE localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbols", json)); } + if (symbolStatus != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("symbolStatus", symbolStatus)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1557,8 +1627,8 @@ private okhttp3.Call tickerPriceCall(String symbol, Symbols symbols) throws ApiE } @SuppressWarnings("rawtypes") - private okhttp3.Call tickerPriceValidateBeforeCall(String symbol, Symbols symbols) - throws ApiException { + private okhttp3.Call tickerPriceValidateBeforeCall( + String symbol, Symbols symbols, SymbolStatus symbolStatus) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1568,13 +1638,16 @@ private okhttp3.Call tickerPriceValidateBeforeCall(String symbol, Symbols symbol .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, symbols}; - Method method = this.getClass().getMethod("tickerPrice", String.class, Symbols.class); + Object[] parameterValues = {symbol, symbols, symbolStatus}; + Method method = + this.getClass() + .getMethod( + "tickerPrice", String.class, Symbols.class, SymbolStatus.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return tickerPriceCall(symbol, symbols); + return tickerPriceCall(symbol, symbols, symbolStatus); } else { throw new ConstraintViolationException((Set) violations); } @@ -1598,6 +1671,7 @@ private okhttp3.Call tickerPriceValidateBeforeCall(String symbol, Symbols symbol * * @param symbol Symbol to query (optional) * @param symbols List of symbols to query (optional) + * @param symbolStatus (optional) * @return ApiResponse<TickerPriceResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1612,9 +1686,9 @@ private okhttp3.Call tickerPriceValidateBeforeCall(String symbol, Symbols symbol * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker">Symbol * price ticker Documentation */ - public ApiResponse tickerPrice(String symbol, Symbols symbols) - throws ApiException { - okhttp3.Call localVarCall = tickerPriceValidateBeforeCall(symbol, symbols); + public ApiResponse tickerPrice( + String symbol, Symbols symbols, SymbolStatus symbolStatus) throws ApiException { + okhttp3.Call localVarCall = tickerPriceValidateBeforeCall(symbol, symbols, symbolStatus); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -1627,6 +1701,7 @@ public ApiResponse tickerPrice(String symbol, Symbols symbo * @param symbols List of symbols to query (optional) * @param timeZone Default: 0 (UTC) (optional) * @param type (optional) + * @param symbolStatus (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1641,7 +1716,12 @@ public ApiResponse tickerPrice(String symbol, Symbols symbo * Day Ticker Documentation */ private okhttp3.Call tickerTradingDayCall( - String symbol, Symbols symbols, String timeZone, TickerType type) throws ApiException { + String symbol, + Symbols symbols, + String timeZone, + TickerType type, + SymbolStatus symbolStatus) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1683,6 +1763,11 @@ private okhttp3.Call tickerTradingDayCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); } + if (symbolStatus != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("symbolStatus", symbolStatus)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1714,7 +1799,12 @@ private okhttp3.Call tickerTradingDayCall( @SuppressWarnings("rawtypes") private okhttp3.Call tickerTradingDayValidateBeforeCall( - String symbol, Symbols symbols, String timeZone, TickerType type) throws ApiException { + String symbol, + Symbols symbols, + String timeZone, + TickerType type, + SymbolStatus symbolStatus) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1724,7 +1814,7 @@ private okhttp3.Call tickerTradingDayValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, symbols, timeZone, type}; + Object[] parameterValues = {symbol, symbols, timeZone, type, symbolStatus}; Method method = this.getClass() .getMethod( @@ -1732,12 +1822,13 @@ private okhttp3.Call tickerTradingDayValidateBeforeCall( String.class, Symbols.class, String.class, - TickerType.class); + TickerType.class, + SymbolStatus.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return tickerTradingDayCall(symbol, symbols, timeZone, type); + return tickerTradingDayCall(symbol, symbols, timeZone, type, symbolStatus); } else { throw new ConstraintViolationException((Set) violations); } @@ -1759,6 +1850,7 @@ private okhttp3.Call tickerTradingDayValidateBeforeCall( * @param symbols List of symbols to query (optional) * @param timeZone Default: 0 (UTC) (optional) * @param type (optional) + * @param symbolStatus (optional) * @return ApiResponse<TickerTradingDayResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1774,9 +1866,14 @@ private okhttp3.Call tickerTradingDayValidateBeforeCall( * Day Ticker Documentation */ public ApiResponse tickerTradingDay( - String symbol, Symbols symbols, String timeZone, TickerType type) throws ApiException { + String symbol, + Symbols symbols, + String timeZone, + TickerType type, + SymbolStatus symbolStatus) + throws ApiException { okhttp3.Call localVarCall = - tickerTradingDayValidateBeforeCall(symbol, symbols, timeZone, type); + tickerTradingDayValidateBeforeCall(symbol, symbols, timeZone, type, symbolStatus); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java index 7652873c..317aecdc 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java @@ -30,7 +30,6 @@ import com.binance.connector.client.spot.rest.model.MyTradesResponse; import com.binance.connector.client.spot.rest.model.NewOrderRequest; import com.binance.connector.client.spot.rest.model.NewOrderResponse; -import com.binance.connector.client.spot.rest.model.NewUserDataStreamResponse; import com.binance.connector.client.spot.rest.model.OpenOrderListResponse; import com.binance.connector.client.spot.rest.model.OrderAmendKeepPriorityRequest; import com.binance.connector.client.spot.rest.model.OrderAmendKeepPriorityResponse; @@ -39,6 +38,10 @@ import com.binance.connector.client.spot.rest.model.OrderCancelReplaceResponse; import com.binance.connector.client.spot.rest.model.OrderListOcoRequest; import com.binance.connector.client.spot.rest.model.OrderListOcoResponse; +import com.binance.connector.client.spot.rest.model.OrderListOpoRequest; +import com.binance.connector.client.spot.rest.model.OrderListOpoResponse; +import com.binance.connector.client.spot.rest.model.OrderListOpocoRequest; +import com.binance.connector.client.spot.rest.model.OrderListOpocoResponse; import com.binance.connector.client.spot.rest.model.OrderListOtoRequest; import com.binance.connector.client.spot.rest.model.OrderListOtoResponse; import com.binance.connector.client.spot.rest.model.OrderListOtocoRequest; @@ -48,7 +51,6 @@ import com.binance.connector.client.spot.rest.model.OrderTestRequest; import com.binance.connector.client.spot.rest.model.OrderTestResponse; import com.binance.connector.client.spot.rest.model.Permissions; -import com.binance.connector.client.spot.rest.model.PutUserDataStreamRequest; import com.binance.connector.client.spot.rest.model.RateLimitOrderResponse; import com.binance.connector.client.spot.rest.model.SorOrderRequest; import com.binance.connector.client.spot.rest.model.SorOrderResponse; @@ -72,7 +74,6 @@ public class SpotRestApi { private final GeneralApi generalApi; private final MarketApi marketApi; private final TradeApi tradeApi; - private final UserDataStreamApi userDataStreamApi; public SpotRestApi(ClientConfiguration configuration) { this(SpotRestApiUtil.getDefaultClient(configuration)); @@ -83,7 +84,6 @@ public SpotRestApi(ApiClient apiClient) { this.generalApi = new GeneralApi(apiClient); this.marketApi = new MarketApi(apiClient); this.tradeApi = new TradeApi(apiClient); - this.userDataStreamApi = new UserDataStreamApi(apiClient); } /** @@ -653,6 +653,7 @@ public ApiResponse avgPrice(String symbol) throws ApiException * * @param symbol (required) * @param limit Default: 500; Maximum: 1000. (optional) + * @param symbolStatus (optional) * @return ApiResponse<DepthResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -667,8 +668,9 @@ public ApiResponse avgPrice(String symbol) throws ApiException * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book">Order * book Documentation */ - public ApiResponse depth(String symbol, Integer limit) throws ApiException { - return marketApi.depth(symbol, limit); + public ApiResponse depth(String symbol, Integer limit, SymbolStatus symbolStatus) + throws ApiException { + return marketApi.depth(symbol, limit, symbolStatus); } /** @@ -765,6 +767,7 @@ public ApiResponse klines( * @param symbols List of symbols to query (optional) * @param windowSize (optional) * @param type (optional) + * @param symbolStatus (optional) * @return ApiResponse<TickerResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -780,9 +783,13 @@ public ApiResponse klines( * window price change statistics Documentation */ public ApiResponse ticker( - String symbol, Symbols symbols, WindowSize windowSize, TickerType type) + String symbol, + Symbols symbols, + WindowSize windowSize, + TickerType type, + SymbolStatus symbolStatus) throws ApiException { - return marketApi.ticker(symbol, symbols, windowSize, type); + return marketApi.ticker(symbol, symbols, windowSize, type, symbolStatus); } /** @@ -802,6 +809,7 @@ public ApiResponse ticker( * @param symbol Symbol to query (optional) * @param symbols List of symbols to query (optional) * @param type (optional) + * @param symbolStatus (optional) * @return ApiResponse<Ticker24hrResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -817,8 +825,9 @@ public ApiResponse ticker( * ticker price change statistics Documentation */ public ApiResponse ticker24hr( - String symbol, Symbols symbols, TickerType type) throws ApiException { - return marketApi.ticker24hr(symbol, symbols, type); + String symbol, Symbols symbols, TickerType type, SymbolStatus symbolStatus) + throws ApiException { + return marketApi.ticker24hr(symbol, symbols, type, symbolStatus); } /** @@ -832,6 +841,7 @@ public ApiResponse ticker24hr( * * @param symbol Symbol to query (optional) * @param symbols List of symbols to query (optional) + * @param symbolStatus (optional) * @return ApiResponse<TickerBookTickerResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -846,9 +856,9 @@ public ApiResponse ticker24hr( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker">Symbol * order book ticker Documentation */ - public ApiResponse tickerBookTicker(String symbol, Symbols symbols) - throws ApiException { - return marketApi.tickerBookTicker(symbol, symbols); + public ApiResponse tickerBookTicker( + String symbol, Symbols symbols, SymbolStatus symbolStatus) throws ApiException { + return marketApi.tickerBookTicker(symbol, symbols, symbolStatus); } /** @@ -862,6 +872,7 @@ public ApiResponse tickerBookTicker(String symbol, Sym * * @param symbol Symbol to query (optional) * @param symbols List of symbols to query (optional) + * @param symbolStatus (optional) * @return ApiResponse<TickerPriceResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -876,9 +887,9 @@ public ApiResponse tickerBookTicker(String symbol, Sym * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker">Symbol * price ticker Documentation */ - public ApiResponse tickerPrice(String symbol, Symbols symbols) - throws ApiException { - return marketApi.tickerPrice(symbol, symbols); + public ApiResponse tickerPrice( + String symbol, Symbols symbols, SymbolStatus symbolStatus) throws ApiException { + return marketApi.tickerPrice(symbol, symbols, symbolStatus); } /** @@ -890,6 +901,7 @@ public ApiResponse tickerPrice(String symbol, Symbols symbo * @param symbols List of symbols to query (optional) * @param timeZone Default: 0 (UTC) (optional) * @param type (optional) + * @param symbolStatus (optional) * @return ApiResponse<TickerTradingDayResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -905,8 +917,13 @@ public ApiResponse tickerPrice(String symbol, Symbols symbo * Day Ticker Documentation */ public ApiResponse tickerTradingDay( - String symbol, Symbols symbols, String timeZone, TickerType type) throws ApiException { - return marketApi.tickerTradingDay(symbol, symbols, timeZone, type); + String symbol, + Symbols symbols, + String timeZone, + TickerType type, + SymbolStatus symbolStatus) + throws ApiException { + return marketApi.tickerTradingDay(symbol, symbols, timeZone, type, symbolStatus); } /** @@ -1166,6 +1183,53 @@ public ApiResponse orderListOco(OrderListOcoRequest orderL return tradeApi.orderListOco(orderListOcoRequest); } + /** + * New Order List - OPO Place an [OPO](./faqs/opo.md). * OPOs add 2 orders to the + * EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter. Weight: 1 Unfilled Order Count: 2 + * + * @param orderListOpoRequest (required) + * @return ApiResponse<OrderListOpoResponse> + * @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 Order List - OPO -
+ * + * @see New + * Order List - OPO Documentation + */ + public ApiResponse orderListOpo(OrderListOpoRequest orderListOpoRequest) + throws ApiException { + return tradeApi.orderListOpo(orderListOpoRequest); + } + + /** + * New Order List - OPOCO Place an [OPOCO](./faqs/opo.md). Weight: 1 Unfilled Order Count: 3 + * + * @param orderListOpocoRequest (required) + * @return ApiResponse<OrderListOpocoResponse> + * @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 Order List - OPOCO -
+ * + * @see New + * Order List - OPOCO Documentation + */ + public ApiResponse orderListOpoco( + OrderListOpocoRequest orderListOpocoRequest) throws ApiException { + return tradeApi.orderListOpoco(orderListOpocoRequest); + } + /** * New Order list - OTO Place an OTO. * An OTO (One-Triggers-the-Other) is an order list * comprised of 2 orders. * The first order is called the **working order** and must be @@ -1252,6 +1316,7 @@ public ApiResponse orderListOtoco( * 200 New OCO - Deprecated - * * + * @deprecated * @see New * OCO - Deprecated Documentation @@ -1337,73 +1402,4 @@ public ApiResponse sorOrderTest(SorOrderTestRequest sorOrd throws ApiException { return tradeApi.sorOrderTest(sorOrderTestRequest); } - - /** - * Close user data stream Close out a user data stream. Weight: 2 - * - * @param listenKey (required) - * @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 OK -
- * - * @see Close - * user data stream Documentation - */ - public void deleteUserDataStream(String listenKey) throws ApiException { - userDataStreamApi.deleteUserDataStream(listenKey); - } - - /** - * Start user data stream Start a new user data stream. The stream will close after 60 minutes - * unless a keepalive is sent. This request does not require `signature`. Weight: 2 - * - * @return ApiResponse<NewUserDataStreamResponse> - * @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 Start user data stream -
- * - * @see Start - * user data stream Documentation - */ - public ApiResponse newUserDataStream() throws ApiException { - return userDataStreamApi.newUserDataStream(); - } - - /** - * Keepalive user data stream Keepalive a user data stream to prevent a time out. User data - * streams will close after 60 minutes. It's recommended to send a ping about every 30 - * minutes. This request does not require `signature`. Weight: 2 - * - * @param putUserDataStreamRequest (required) - * @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 OK -
- * - * @see Keepalive - * user data stream Documentation - */ - public void putUserDataStream(PutUserDataStreamRequest putUserDataStreamRequest) - throws ApiException { - userDataStreamApi.putUserDataStream(putUserDataStreamRequest); - } } 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 fbdb32d4..b0cb5194 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 @@ -32,6 +32,10 @@ import com.binance.connector.client.spot.rest.model.OrderCancelReplaceResponse; import com.binance.connector.client.spot.rest.model.OrderListOcoRequest; import com.binance.connector.client.spot.rest.model.OrderListOcoResponse; +import com.binance.connector.client.spot.rest.model.OrderListOpoRequest; +import com.binance.connector.client.spot.rest.model.OrderListOpoResponse; +import com.binance.connector.client.spot.rest.model.OrderListOpocoRequest; +import com.binance.connector.client.spot.rest.model.OrderListOpocoResponse; import com.binance.connector.client.spot.rest.model.OrderListOtoRequest; import com.binance.connector.client.spot.rest.model.OrderListOtoResponse; import com.binance.connector.client.spot.rest.model.OrderListOtocoRequest; @@ -67,7 +71,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-spot/7.0.0 (Java/%s; %s; %s)", + "binance-spot/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; @@ -1614,6 +1618,658 @@ public ApiResponse orderListOco( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for orderListOpo + * + * @param orderListOpoRequest (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 Order List - OPO -
+ * + * @see New + * Order List - OPO Documentation + */ + private okhttp3.Call orderListOpoCall(OrderListOpoRequest orderListOpoRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v3/orderList/opo"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (orderListOpoRequest.getSymbol() != null) { + localVarFormParams.put("symbol", orderListOpoRequest.getSymbol()); + } + + if (orderListOpoRequest.getListClientOrderId() != null) { + localVarFormParams.put("listClientOrderId", orderListOpoRequest.getListClientOrderId()); + } + + if (orderListOpoRequest.getNewOrderRespType() != null) { + localVarFormParams.put("newOrderRespType", orderListOpoRequest.getNewOrderRespType()); + } + + if (orderListOpoRequest.getSelfTradePreventionMode() != null) { + localVarFormParams.put( + "selfTradePreventionMode", orderListOpoRequest.getSelfTradePreventionMode()); + } + + if (orderListOpoRequest.getWorkingType() != null) { + localVarFormParams.put("workingType", orderListOpoRequest.getWorkingType()); + } + + if (orderListOpoRequest.getWorkingSide() != null) { + localVarFormParams.put("workingSide", orderListOpoRequest.getWorkingSide()); + } + + if (orderListOpoRequest.getWorkingClientOrderId() != null) { + localVarFormParams.put( + "workingClientOrderId", orderListOpoRequest.getWorkingClientOrderId()); + } + + if (orderListOpoRequest.getWorkingPrice() != null) { + localVarFormParams.put( + "workingPrice", + DecimalFormatter.getFormatter().format(orderListOpoRequest.getWorkingPrice())); + } + + if (orderListOpoRequest.getWorkingQuantity() != null) { + localVarFormParams.put( + "workingQuantity", + DecimalFormatter.getFormatter() + .format(orderListOpoRequest.getWorkingQuantity())); + } + + if (orderListOpoRequest.getWorkingIcebergQty() != null) { + localVarFormParams.put( + "workingIcebergQty", + DecimalFormatter.getFormatter() + .format(orderListOpoRequest.getWorkingIcebergQty())); + } + + if (orderListOpoRequest.getWorkingTimeInForce() != null) { + localVarFormParams.put( + "workingTimeInForce", orderListOpoRequest.getWorkingTimeInForce()); + } + + if (orderListOpoRequest.getWorkingStrategyId() != null) { + localVarFormParams.put("workingStrategyId", orderListOpoRequest.getWorkingStrategyId()); + } + + if (orderListOpoRequest.getWorkingStrategyType() != null) { + localVarFormParams.put( + "workingStrategyType", orderListOpoRequest.getWorkingStrategyType()); + } + + if (orderListOpoRequest.getWorkingPegPriceType() != null) { + localVarFormParams.put( + "workingPegPriceType", orderListOpoRequest.getWorkingPegPriceType()); + } + + if (orderListOpoRequest.getWorkingPegOffsetType() != null) { + localVarFormParams.put( + "workingPegOffsetType", orderListOpoRequest.getWorkingPegOffsetType()); + } + + if (orderListOpoRequest.getWorkingPegOffsetValue() != null) { + localVarFormParams.put( + "workingPegOffsetValue", orderListOpoRequest.getWorkingPegOffsetValue()); + } + + if (orderListOpoRequest.getPendingType() != null) { + localVarFormParams.put("pendingType", orderListOpoRequest.getPendingType()); + } + + if (orderListOpoRequest.getPendingSide() != null) { + localVarFormParams.put("pendingSide", orderListOpoRequest.getPendingSide()); + } + + if (orderListOpoRequest.getPendingClientOrderId() != null) { + localVarFormParams.put( + "pendingClientOrderId", orderListOpoRequest.getPendingClientOrderId()); + } + + if (orderListOpoRequest.getPendingPrice() != null) { + localVarFormParams.put( + "pendingPrice", + DecimalFormatter.getFormatter().format(orderListOpoRequest.getPendingPrice())); + } + + if (orderListOpoRequest.getPendingStopPrice() != null) { + localVarFormParams.put( + "pendingStopPrice", + DecimalFormatter.getFormatter() + .format(orderListOpoRequest.getPendingStopPrice())); + } + + if (orderListOpoRequest.getPendingTrailingDelta() != null) { + localVarFormParams.put( + "pendingTrailingDelta", + DecimalFormatter.getFormatter() + .format(orderListOpoRequest.getPendingTrailingDelta())); + } + + if (orderListOpoRequest.getPendingIcebergQty() != null) { + localVarFormParams.put( + "pendingIcebergQty", + DecimalFormatter.getFormatter() + .format(orderListOpoRequest.getPendingIcebergQty())); + } + + if (orderListOpoRequest.getPendingTimeInForce() != null) { + localVarFormParams.put( + "pendingTimeInForce", orderListOpoRequest.getPendingTimeInForce()); + } + + if (orderListOpoRequest.getPendingStrategyId() != null) { + localVarFormParams.put("pendingStrategyId", orderListOpoRequest.getPendingStrategyId()); + } + + if (orderListOpoRequest.getPendingStrategyType() != null) { + localVarFormParams.put( + "pendingStrategyType", orderListOpoRequest.getPendingStrategyType()); + } + + if (orderListOpoRequest.getPendingPegPriceType() != null) { + localVarFormParams.put( + "pendingPegPriceType", orderListOpoRequest.getPendingPegPriceType()); + } + + if (orderListOpoRequest.getPendingPegOffsetType() != null) { + localVarFormParams.put( + "pendingPegOffsetType", orderListOpoRequest.getPendingPegOffsetType()); + } + + if (orderListOpoRequest.getPendingPegOffsetValue() != null) { + localVarFormParams.put( + "pendingPegOffsetValue", orderListOpoRequest.getPendingPegOffsetValue()); + } + + if (orderListOpoRequest.getRecvWindow() != null) { + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(orderListOpoRequest.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 orderListOpoValidateBeforeCall(OrderListOpoRequest orderListOpoRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {orderListOpoRequest}; + Method method = this.getClass().getMethod("orderListOpo", OrderListOpoRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return orderListOpoCall(orderListOpoRequest); + } 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 Order List - OPO Place an [OPO](./faqs/opo.md). * OPOs add 2 orders to the + * EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter. Weight: 1 Unfilled Order Count: 2 + * + * @param orderListOpoRequest (required) + * @return ApiResponse<OrderListOpoResponse> + * @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 Order List - OPO -
+ * + * @see New + * Order List - OPO Documentation + */ + public ApiResponse orderListOpo( + @Valid @NotNull OrderListOpoRequest orderListOpoRequest) throws ApiException { + okhttp3.Call localVarCall = orderListOpoValidateBeforeCall(orderListOpoRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for orderListOpoco + * + * @param orderListOpocoRequest (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 Order List - OPOCO -
+ * + * @see New + * Order List - OPOCO Documentation + */ + private okhttp3.Call orderListOpocoCall(OrderListOpocoRequest orderListOpocoRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v3/orderList/opoco"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (orderListOpocoRequest.getSymbol() != null) { + localVarFormParams.put("symbol", orderListOpocoRequest.getSymbol()); + } + + if (orderListOpocoRequest.getListClientOrderId() != null) { + localVarFormParams.put( + "listClientOrderId", orderListOpocoRequest.getListClientOrderId()); + } + + if (orderListOpocoRequest.getNewOrderRespType() != null) { + localVarFormParams.put("newOrderRespType", orderListOpocoRequest.getNewOrderRespType()); + } + + if (orderListOpocoRequest.getSelfTradePreventionMode() != null) { + localVarFormParams.put( + "selfTradePreventionMode", orderListOpocoRequest.getSelfTradePreventionMode()); + } + + if (orderListOpocoRequest.getWorkingType() != null) { + localVarFormParams.put("workingType", orderListOpocoRequest.getWorkingType()); + } + + if (orderListOpocoRequest.getWorkingSide() != null) { + localVarFormParams.put("workingSide", orderListOpocoRequest.getWorkingSide()); + } + + if (orderListOpocoRequest.getWorkingClientOrderId() != null) { + localVarFormParams.put( + "workingClientOrderId", orderListOpocoRequest.getWorkingClientOrderId()); + } + + if (orderListOpocoRequest.getWorkingPrice() != null) { + localVarFormParams.put( + "workingPrice", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getWorkingPrice())); + } + + if (orderListOpocoRequest.getWorkingQuantity() != null) { + localVarFormParams.put( + "workingQuantity", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getWorkingQuantity())); + } + + if (orderListOpocoRequest.getWorkingIcebergQty() != null) { + localVarFormParams.put( + "workingIcebergQty", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getWorkingIcebergQty())); + } + + if (orderListOpocoRequest.getWorkingTimeInForce() != null) { + localVarFormParams.put( + "workingTimeInForce", orderListOpocoRequest.getWorkingTimeInForce()); + } + + if (orderListOpocoRequest.getWorkingStrategyId() != null) { + localVarFormParams.put( + "workingStrategyId", orderListOpocoRequest.getWorkingStrategyId()); + } + + if (orderListOpocoRequest.getWorkingStrategyType() != null) { + localVarFormParams.put( + "workingStrategyType", orderListOpocoRequest.getWorkingStrategyType()); + } + + if (orderListOpocoRequest.getWorkingPegPriceType() != null) { + localVarFormParams.put( + "workingPegPriceType", orderListOpocoRequest.getWorkingPegPriceType()); + } + + if (orderListOpocoRequest.getWorkingPegOffsetType() != null) { + localVarFormParams.put( + "workingPegOffsetType", orderListOpocoRequest.getWorkingPegOffsetType()); + } + + if (orderListOpocoRequest.getWorkingPegOffsetValue() != null) { + localVarFormParams.put( + "workingPegOffsetValue", orderListOpocoRequest.getWorkingPegOffsetValue()); + } + + if (orderListOpocoRequest.getPendingSide() != null) { + localVarFormParams.put("pendingSide", orderListOpocoRequest.getPendingSide()); + } + + if (orderListOpocoRequest.getPendingAboveType() != null) { + localVarFormParams.put("pendingAboveType", orderListOpocoRequest.getPendingAboveType()); + } + + if (orderListOpocoRequest.getPendingAboveClientOrderId() != null) { + localVarFormParams.put( + "pendingAboveClientOrderId", + orderListOpocoRequest.getPendingAboveClientOrderId()); + } + + if (orderListOpocoRequest.getPendingAbovePrice() != null) { + localVarFormParams.put( + "pendingAbovePrice", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getPendingAbovePrice())); + } + + if (orderListOpocoRequest.getPendingAboveStopPrice() != null) { + localVarFormParams.put( + "pendingAboveStopPrice", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getPendingAboveStopPrice())); + } + + if (orderListOpocoRequest.getPendingAboveTrailingDelta() != null) { + localVarFormParams.put( + "pendingAboveTrailingDelta", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getPendingAboveTrailingDelta())); + } + + if (orderListOpocoRequest.getPendingAboveIcebergQty() != null) { + localVarFormParams.put( + "pendingAboveIcebergQty", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getPendingAboveIcebergQty())); + } + + if (orderListOpocoRequest.getPendingAboveTimeInForce() != null) { + localVarFormParams.put( + "pendingAboveTimeInForce", orderListOpocoRequest.getPendingAboveTimeInForce()); + } + + if (orderListOpocoRequest.getPendingAboveStrategyId() != null) { + localVarFormParams.put( + "pendingAboveStrategyId", orderListOpocoRequest.getPendingAboveStrategyId()); + } + + if (orderListOpocoRequest.getPendingAboveStrategyType() != null) { + localVarFormParams.put( + "pendingAboveStrategyType", + orderListOpocoRequest.getPendingAboveStrategyType()); + } + + if (orderListOpocoRequest.getPendingAbovePegPriceType() != null) { + localVarFormParams.put( + "pendingAbovePegPriceType", + orderListOpocoRequest.getPendingAbovePegPriceType()); + } + + if (orderListOpocoRequest.getPendingAbovePegOffsetType() != null) { + localVarFormParams.put( + "pendingAbovePegOffsetType", + orderListOpocoRequest.getPendingAbovePegOffsetType()); + } + + if (orderListOpocoRequest.getPendingAbovePegOffsetValue() != null) { + localVarFormParams.put( + "pendingAbovePegOffsetValue", + orderListOpocoRequest.getPendingAbovePegOffsetValue()); + } + + if (orderListOpocoRequest.getPendingBelowType() != null) { + localVarFormParams.put("pendingBelowType", orderListOpocoRequest.getPendingBelowType()); + } + + if (orderListOpocoRequest.getPendingBelowClientOrderId() != null) { + localVarFormParams.put( + "pendingBelowClientOrderId", + orderListOpocoRequest.getPendingBelowClientOrderId()); + } + + if (orderListOpocoRequest.getPendingBelowPrice() != null) { + localVarFormParams.put( + "pendingBelowPrice", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getPendingBelowPrice())); + } + + if (orderListOpocoRequest.getPendingBelowStopPrice() != null) { + localVarFormParams.put( + "pendingBelowStopPrice", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getPendingBelowStopPrice())); + } + + if (orderListOpocoRequest.getPendingBelowTrailingDelta() != null) { + localVarFormParams.put( + "pendingBelowTrailingDelta", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getPendingBelowTrailingDelta())); + } + + if (orderListOpocoRequest.getPendingBelowIcebergQty() != null) { + localVarFormParams.put( + "pendingBelowIcebergQty", + DecimalFormatter.getFormatter() + .format(orderListOpocoRequest.getPendingBelowIcebergQty())); + } + + if (orderListOpocoRequest.getPendingBelowTimeInForce() != null) { + localVarFormParams.put( + "pendingBelowTimeInForce", orderListOpocoRequest.getPendingBelowTimeInForce()); + } + + if (orderListOpocoRequest.getPendingBelowStrategyId() != null) { + localVarFormParams.put( + "pendingBelowStrategyId", orderListOpocoRequest.getPendingBelowStrategyId()); + } + + if (orderListOpocoRequest.getPendingBelowStrategyType() != null) { + localVarFormParams.put( + "pendingBelowStrategyType", + orderListOpocoRequest.getPendingBelowStrategyType()); + } + + if (orderListOpocoRequest.getPendingBelowPegPriceType() != null) { + localVarFormParams.put( + "pendingBelowPegPriceType", + orderListOpocoRequest.getPendingBelowPegPriceType()); + } + + if (orderListOpocoRequest.getPendingBelowPegOffsetType() != null) { + localVarFormParams.put( + "pendingBelowPegOffsetType", + orderListOpocoRequest.getPendingBelowPegOffsetType()); + } + + if (orderListOpocoRequest.getPendingBelowPegOffsetValue() != null) { + localVarFormParams.put( + "pendingBelowPegOffsetValue", + orderListOpocoRequest.getPendingBelowPegOffsetValue()); + } + + if (orderListOpocoRequest.getRecvWindow() != null) { + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(orderListOpocoRequest.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 orderListOpocoValidateBeforeCall( + OrderListOpocoRequest orderListOpocoRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {orderListOpocoRequest}; + Method method = + this.getClass().getMethod("orderListOpoco", OrderListOpocoRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return orderListOpocoCall(orderListOpocoRequest); + } 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 Order List - OPOCO Place an [OPOCO](./faqs/opo.md). Weight: 1 Unfilled Order Count: 3 + * + * @param orderListOpocoRequest (required) + * @return ApiResponse<OrderListOpocoResponse> + * @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 Order List - OPOCO -
+ * + * @see New + * Order List - OPOCO Documentation + */ + public ApiResponse orderListOpoco( + @Valid @NotNull OrderListOpocoRequest orderListOpocoRequest) throws ApiException { + okhttp3.Call localVarCall = orderListOpocoValidateBeforeCall(orderListOpocoRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for orderListOto * @@ -2313,10 +2969,12 @@ public ApiResponse orderListOtoco( * 200 New OCO - Deprecated - * * + * @deprecated * @see New * OCO - Deprecated Documentation */ + @Deprecated private okhttp3.Call orderOcoCall(OrderOcoRequest orderOcoRequest) throws ApiException { String basePath = null; // Operation Servers @@ -2467,6 +3125,7 @@ private okhttp3.Call orderOcoCall(OrderOcoRequest orderOcoRequest) throws ApiExc localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call orderOcoValidateBeforeCall(OrderOcoRequest orderOcoRequest) throws ApiException { @@ -2517,10 +3176,12 @@ private okhttp3.Call orderOcoValidateBeforeCall(OrderOcoRequest orderOcoRequest) * 200 New OCO - Deprecated - * * + * @deprecated * @see New * OCO - Deprecated Documentation */ + @Deprecated public ApiResponse orderOco(@Valid @NotNull OrderOcoRequest orderOcoRequest) throws ApiException { okhttp3.Call localVarCall = orderOcoValidateBeforeCall(orderOcoRequest); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java deleted file mode 100644 index ba3cf8c7..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java +++ /dev/null @@ -1,474 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.rest.api; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.Pair; -import com.binance.connector.client.common.SystemUtil; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.exception.ConstraintViolationException; -import com.binance.connector.client.spot.rest.model.NewUserDataStreamResponse; -import com.binance.connector.client.spot.rest.model.PutUserDataStreamRequest; -import com.google.gson.reflect.TypeToken; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Valid; -import jakarta.validation.Validation; -import jakarta.validation.Validator; -import jakarta.validation.constraints.*; -import jakarta.validation.executable.ExecutableValidator; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; - -public class UserDataStreamApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - private static final String USER_AGENT = - String.format( - "binance-spot/7.0.0 (Java/%s; %s; %s)", - SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); - private static final boolean HAS_TIME_UNIT = true; - - public UserDataStreamApi(ClientConfiguration clientConfiguration) { - this(new ApiClient(clientConfiguration)); - } - - public UserDataStreamApi(ApiClient apiClient) { - apiClient.setUserAgent(USER_AGENT); - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for deleteUserDataStream - * - * @param listenKey (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 OK -
- * - * @see Close - * user data stream Documentation - */ - private okhttp3.Call deleteUserDataStreamCall(String listenKey) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/v3/userDataStream"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (listenKey != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("listenKey", listenKey)); - } - - 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("binanceApiKeyOnly"); - 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 deleteUserDataStreamValidateBeforeCall(String listenKey) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {listenKey}; - Method method = this.getClass().getMethod("deleteUserDataStream", String.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return deleteUserDataStreamCall(listenKey); - } 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()); - } - } - - /** - * Close user data stream Close out a user data stream. Weight: 2 - * - * @param listenKey (required) - * @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 OK -
- * - * @see Close - * user data stream Documentation - */ - public ApiResponse deleteUserDataStream(@NotNull String listenKey) throws ApiException { - okhttp3.Call localVarCall = deleteUserDataStreamValidateBeforeCall(listenKey); - return localVarApiClient.execute(localVarCall); - } - - /** - * Build call for newUserDataStream - * - * @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 Start user data stream -
- * - * @see Start - * user data stream Documentation - */ - private okhttp3.Call newUserDataStreamCall() throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/v3/userDataStream"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - 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("binanceApiKeyOnly"); - 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 newUserDataStreamValidateBeforeCall() throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {}; - Method method = this.getClass().getMethod("newUserDataStream"); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return newUserDataStreamCall(); - } 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()); - } - } - - /** - * Start user data stream Start a new user data stream. The stream will close after 60 minutes - * unless a keepalive is sent. This request does not require `signature`. Weight: 2 - * - * @return ApiResponse<NewUserDataStreamResponse> - * @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 Start user data stream -
- * - * @see Start - * user data stream Documentation - */ - public ApiResponse newUserDataStream() throws ApiException { - okhttp3.Call localVarCall = newUserDataStreamValidateBeforeCall(); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for putUserDataStream - * - * @param putUserDataStreamRequest (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 OK -
- * - * @see Keepalive - * user data stream Documentation - */ - private okhttp3.Call putUserDataStreamCall(PutUserDataStreamRequest putUserDataStreamRequest) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/v3/userDataStream"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (putUserDataStreamRequest.getListenKey() != null) { - localVarFormParams.put("listenKey", putUserDataStreamRequest.getListenKey()); - } - - 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("binanceApiKeyOnly"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PUT", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call putUserDataStreamValidateBeforeCall( - PutUserDataStreamRequest putUserDataStreamRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {putUserDataStreamRequest}; - Method method = - this.getClass().getMethod("putUserDataStream", PutUserDataStreamRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return putUserDataStreamCall(putUserDataStreamRequest); - } 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()); - } - } - - /** - * Keepalive user data stream Keepalive a user data stream to prevent a time out. User data - * streams will close after 60 minutes. It's recommended to send a ping about every 30 - * minutes. This request does not require `signature`. Weight: 2 - * - * @param putUserDataStreamRequest (required) - * @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 OK -
- * - * @see Keepalive - * user data stream Documentation - */ - public ApiResponse putUserDataStream( - @Valid @NotNull PutUserDataStreamRequest putUserDataStreamRequest) throws ApiException { - okhttp3.Call localVarCall = putUserDataStreamValidateBeforeCall(putUserDataStreamRequest); - return localVarApiClient.execute(localVarCall); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseSymbolsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseSymbolsInner.java index fc7c7bba..7d1923cc 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseSymbolsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseSymbolsInner.java @@ -122,6 +122,12 @@ public class ExchangeInfoResponseSymbolsInner { @jakarta.annotation.Nullable private Boolean otoAllowed; + public static final String SERIALIZED_NAME_OPO_ALLOWED = "opoAllowed"; + + @SerializedName(SERIALIZED_NAME_OPO_ALLOWED) + @jakarta.annotation.Nullable + private Boolean opoAllowed; + public static final String SERIALIZED_NAME_QUOTE_ORDER_QTY_MARKET_ALLOWED = "quoteOrderQtyMarketAllowed"; @@ -467,6 +473,26 @@ public void setOtoAllowed(@jakarta.annotation.Nullable Boolean otoAllowed) { this.otoAllowed = otoAllowed; } + public ExchangeInfoResponseSymbolsInner opoAllowed( + @jakarta.annotation.Nullable Boolean opoAllowed) { + this.opoAllowed = opoAllowed; + return this; + } + + /** + * Get opoAllowed + * + * @return opoAllowed + */ + @jakarta.annotation.Nullable + public Boolean getOpoAllowed() { + return opoAllowed; + } + + public void setOpoAllowed(@jakarta.annotation.Nullable Boolean opoAllowed) { + this.opoAllowed = opoAllowed; + } + public ExchangeInfoResponseSymbolsInner quoteOrderQtyMarketAllowed( @jakarta.annotation.Nullable Boolean quoteOrderQtyMarketAllowed) { this.quoteOrderQtyMarketAllowed = quoteOrderQtyMarketAllowed; @@ -780,6 +806,7 @@ public boolean equals(Object o) { this.icebergAllowed, exchangeInfoResponseSymbolsInner.icebergAllowed) && Objects.equals(this.ocoAllowed, exchangeInfoResponseSymbolsInner.ocoAllowed) && Objects.equals(this.otoAllowed, exchangeInfoResponseSymbolsInner.otoAllowed) + && Objects.equals(this.opoAllowed, exchangeInfoResponseSymbolsInner.opoAllowed) && Objects.equals( this.quoteOrderQtyMarketAllowed, exchangeInfoResponseSymbolsInner.quoteOrderQtyMarketAllowed) @@ -826,6 +853,7 @@ public int hashCode() { icebergAllowed, ocoAllowed, otoAllowed, + opoAllowed, quoteOrderQtyMarketAllowed, allowTrailingStop, cancelReplaceAllowed, @@ -865,6 +893,7 @@ public String toString() { sb.append(" icebergAllowed: ").append(toIndentedString(icebergAllowed)).append("\n"); sb.append(" ocoAllowed: ").append(toIndentedString(ocoAllowed)).append("\n"); sb.append(" otoAllowed: ").append(toIndentedString(otoAllowed)).append("\n"); + sb.append(" opoAllowed: ").append(toIndentedString(opoAllowed)).append("\n"); sb.append(" quoteOrderQtyMarketAllowed: ") .append(toIndentedString(quoteOrderQtyMarketAllowed)) .append("\n"); @@ -961,6 +990,10 @@ public String toUrlQueryString() { String otoAllowedValueAsString = ""; otoAllowedValueAsString = otoAllowedValue.toString(); sb.append("otoAllowed=").append(urlEncode(otoAllowedValueAsString)).append(""); + Object opoAllowedValue = getOpoAllowed(); + String opoAllowedValueAsString = ""; + opoAllowedValueAsString = opoAllowedValue.toString(); + sb.append("opoAllowed=").append(urlEncode(opoAllowedValueAsString)).append(""); Object quoteOrderQtyMarketAllowedValue = getQuoteOrderQtyMarketAllowed(); String quoteOrderQtyMarketAllowedValueAsString = ""; quoteOrderQtyMarketAllowedValueAsString = quoteOrderQtyMarketAllowedValue.toString(); @@ -1079,6 +1112,7 @@ private String toIndentedString(Object o) { openapiFields.add("icebergAllowed"); openapiFields.add("ocoAllowed"); openapiFields.add("otoAllowed"); + openapiFields.add("opoAllowed"); openapiFields.add("quoteOrderQtyMarketAllowed"); openapiFields.add("allowTrailingStop"); openapiFields.add("cancelReplaceAllowed"); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewUserDataStreamResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewUserDataStreamResponse.java deleted file mode 100644 index a26e6d31..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewUserDataStreamResponse.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.rest.model; - -import com.binance.connector.client.spot.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** NewUserDataStreamResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class NewUserDataStreamResponse { - public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; - - @SerializedName(SERIALIZED_NAME_LISTEN_KEY) - @jakarta.annotation.Nullable - private String listenKey; - - public NewUserDataStreamResponse() {} - - public NewUserDataStreamResponse listenKey(@jakarta.annotation.Nullable String listenKey) { - this.listenKey = listenKey; - return this; - } - - /** - * Get listenKey - * - * @return listenKey - */ - @jakarta.annotation.Nullable - public String getListenKey() { - return listenKey; - } - - public void setListenKey(@jakarta.annotation.Nullable String listenKey) { - this.listenKey = listenKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NewUserDataStreamResponse newUserDataStreamResponse = (NewUserDataStreamResponse) o; - return Objects.equals(this.listenKey, newUserDataStreamResponse.listenKey); - } - - @Override - public int hashCode() { - return Objects.hash(listenKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NewUserDataStreamResponse {\n"); - sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object listenKeyValue = getListenKey(); - String listenKeyValueAsString = ""; - listenKeyValueAsString = listenKeyValue.toString(); - sb.append("listenKey=").append(urlEncode(listenKeyValueAsString)).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("listenKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NewUserDataStreamResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NewUserDataStreamResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in NewUserDataStreamResponse is not found" - + " in the empty JSON string", - NewUserDataStreamResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) - && !jsonObj.get("listenKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `listenKey` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("listenKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NewUserDataStreamResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NewUserDataStreamResponse' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NewUserDataStreamResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NewUserDataStreamResponse value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public NewUserDataStreamResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of NewUserDataStreamResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of NewUserDataStreamResponse - * @throws IOException if the JSON string is invalid with respect to NewUserDataStreamResponse - */ - public static NewUserDataStreamResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NewUserDataStreamResponse.class); - } - - /** - * Convert an instance of NewUserDataStreamResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoRequest.java new file mode 100644 index 00000000..f4ab4b00 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoRequest.java @@ -0,0 +1,1393 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.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.*; + +/** OrderListOpoRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListOpoRequest { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public static final String SERIALIZED_NAME_LIST_CLIENT_ORDER_ID = "listClientOrderId"; + + @SerializedName(SERIALIZED_NAME_LIST_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String listClientOrderId; + + 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_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nonnull + private WorkingType workingType; + + public static final String SERIALIZED_NAME_WORKING_SIDE = "workingSide"; + + @SerializedName(SERIALIZED_NAME_WORKING_SIDE) + @jakarta.annotation.Nonnull + private WorkingSide workingSide; + + public static final String SERIALIZED_NAME_WORKING_CLIENT_ORDER_ID = "workingClientOrderId"; + + @SerializedName(SERIALIZED_NAME_WORKING_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String workingClientOrderId; + + public static final String SERIALIZED_NAME_WORKING_PRICE = "workingPrice"; + + @SerializedName(SERIALIZED_NAME_WORKING_PRICE) + @jakarta.annotation.Nonnull + private Double workingPrice; + + public static final String SERIALIZED_NAME_WORKING_QUANTITY = "workingQuantity"; + + @SerializedName(SERIALIZED_NAME_WORKING_QUANTITY) + @jakarta.annotation.Nonnull + private Double workingQuantity; + + public static final String SERIALIZED_NAME_WORKING_ICEBERG_QTY = "workingIcebergQty"; + + @SerializedName(SERIALIZED_NAME_WORKING_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double workingIcebergQty; + + public static final String SERIALIZED_NAME_WORKING_TIME_IN_FORCE = "workingTimeInForce"; + + @SerializedName(SERIALIZED_NAME_WORKING_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private WorkingTimeInForce workingTimeInForce; + + public static final String SERIALIZED_NAME_WORKING_STRATEGY_ID = "workingStrategyId"; + + @SerializedName(SERIALIZED_NAME_WORKING_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long workingStrategyId; + + public static final String SERIALIZED_NAME_WORKING_STRATEGY_TYPE = "workingStrategyType"; + + @SerializedName(SERIALIZED_NAME_WORKING_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer workingStrategyType; + + public static final String SERIALIZED_NAME_WORKING_PEG_PRICE_TYPE = "workingPegPriceType"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private WorkingPegPriceType workingPegPriceType; + + public static final String SERIALIZED_NAME_WORKING_PEG_OFFSET_TYPE = "workingPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private WorkingPegOffsetType workingPegOffsetType; + + public static final String SERIALIZED_NAME_WORKING_PEG_OFFSET_VALUE = "workingPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer workingPegOffsetValue; + + public static final String SERIALIZED_NAME_PENDING_TYPE = "pendingType"; + + @SerializedName(SERIALIZED_NAME_PENDING_TYPE) + @jakarta.annotation.Nonnull + private PendingType pendingType; + + public static final String SERIALIZED_NAME_PENDING_SIDE = "pendingSide"; + + @SerializedName(SERIALIZED_NAME_PENDING_SIDE) + @jakarta.annotation.Nonnull + private PendingSide pendingSide; + + public static final String SERIALIZED_NAME_PENDING_CLIENT_ORDER_ID = "pendingClientOrderId"; + + @SerializedName(SERIALIZED_NAME_PENDING_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String pendingClientOrderId; + + public static final String SERIALIZED_NAME_PENDING_PRICE = "pendingPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_PRICE) + @jakarta.annotation.Nullable + private Double pendingPrice; + + public static final String SERIALIZED_NAME_PENDING_STOP_PRICE = "pendingStopPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_STOP_PRICE) + @jakarta.annotation.Nullable + private Double pendingStopPrice; + + public static final String SERIALIZED_NAME_PENDING_TRAILING_DELTA = "pendingTrailingDelta"; + + @SerializedName(SERIALIZED_NAME_PENDING_TRAILING_DELTA) + @jakarta.annotation.Nullable + private Double pendingTrailingDelta; + + public static final String SERIALIZED_NAME_PENDING_ICEBERG_QTY = "pendingIcebergQty"; + + @SerializedName(SERIALIZED_NAME_PENDING_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double pendingIcebergQty; + + public static final String SERIALIZED_NAME_PENDING_TIME_IN_FORCE = "pendingTimeInForce"; + + @SerializedName(SERIALIZED_NAME_PENDING_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private PendingTimeInForce pendingTimeInForce; + + public static final String SERIALIZED_NAME_PENDING_STRATEGY_ID = "pendingStrategyId"; + + @SerializedName(SERIALIZED_NAME_PENDING_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long pendingStrategyId; + + public static final String SERIALIZED_NAME_PENDING_STRATEGY_TYPE = "pendingStrategyType"; + + @SerializedName(SERIALIZED_NAME_PENDING_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer pendingStrategyType; + + public static final String SERIALIZED_NAME_PENDING_PEG_PRICE_TYPE = "pendingPegPriceType"; + + @SerializedName(SERIALIZED_NAME_PENDING_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PendingPegPriceType pendingPegPriceType; + + public static final String SERIALIZED_NAME_PENDING_PEG_OFFSET_TYPE = "pendingPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PENDING_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PendingPegOffsetType pendingPegOffsetType; + + public static final String SERIALIZED_NAME_PENDING_PEG_OFFSET_VALUE = "pendingPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PENDING_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pendingPegOffsetValue; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Double recvWindow; + + public OrderListOpoRequest() {} + + public OrderListOpoRequest 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 OrderListOpoRequest listClientOrderId( + @jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + return this; + } + + /** + * Get listClientOrderId + * + * @return listClientOrderId + */ + @jakarta.annotation.Nullable + public String getListClientOrderId() { + return listClientOrderId; + } + + public void setListClientOrderId(@jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + } + + public OrderListOpoRequest 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 OrderListOpoRequest 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 OrderListOpoRequest workingType(@jakarta.annotation.Nonnull WorkingType workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public WorkingType getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nonnull WorkingType workingType) { + this.workingType = workingType; + } + + public OrderListOpoRequest workingSide(@jakarta.annotation.Nonnull WorkingSide workingSide) { + this.workingSide = workingSide; + return this; + } + + /** + * Get workingSide + * + * @return workingSide + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public WorkingSide getWorkingSide() { + return workingSide; + } + + public void setWorkingSide(@jakarta.annotation.Nonnull WorkingSide workingSide) { + this.workingSide = workingSide; + } + + public OrderListOpoRequest workingClientOrderId( + @jakarta.annotation.Nullable String workingClientOrderId) { + this.workingClientOrderId = workingClientOrderId; + return this; + } + + /** + * Get workingClientOrderId + * + * @return workingClientOrderId + */ + @jakarta.annotation.Nullable + public String getWorkingClientOrderId() { + return workingClientOrderId; + } + + public void setWorkingClientOrderId(@jakarta.annotation.Nullable String workingClientOrderId) { + this.workingClientOrderId = workingClientOrderId; + } + + public OrderListOpoRequest workingPrice(@jakarta.annotation.Nonnull Double workingPrice) { + this.workingPrice = workingPrice; + return this; + } + + /** + * Get workingPrice + * + * @return workingPrice + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getWorkingPrice() { + return workingPrice; + } + + public void setWorkingPrice(@jakarta.annotation.Nonnull Double workingPrice) { + this.workingPrice = workingPrice; + } + + public OrderListOpoRequest workingQuantity(@jakarta.annotation.Nonnull Double workingQuantity) { + this.workingQuantity = workingQuantity; + return this; + } + + /** + * Get workingQuantity + * + * @return workingQuantity + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getWorkingQuantity() { + return workingQuantity; + } + + public void setWorkingQuantity(@jakarta.annotation.Nonnull Double workingQuantity) { + this.workingQuantity = workingQuantity; + } + + public OrderListOpoRequest workingIcebergQty( + @jakarta.annotation.Nullable Double workingIcebergQty) { + this.workingIcebergQty = workingIcebergQty; + return this; + } + + /** + * Get workingIcebergQty + * + * @return workingIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getWorkingIcebergQty() { + return workingIcebergQty; + } + + public void setWorkingIcebergQty(@jakarta.annotation.Nullable Double workingIcebergQty) { + this.workingIcebergQty = workingIcebergQty; + } + + public OrderListOpoRequest workingTimeInForce( + @jakarta.annotation.Nullable WorkingTimeInForce workingTimeInForce) { + this.workingTimeInForce = workingTimeInForce; + return this; + } + + /** + * Get workingTimeInForce + * + * @return workingTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public WorkingTimeInForce getWorkingTimeInForce() { + return workingTimeInForce; + } + + public void setWorkingTimeInForce( + @jakarta.annotation.Nullable WorkingTimeInForce workingTimeInForce) { + this.workingTimeInForce = workingTimeInForce; + } + + public OrderListOpoRequest workingStrategyId( + @jakarta.annotation.Nullable Long workingStrategyId) { + this.workingStrategyId = workingStrategyId; + return this; + } + + /** + * Get workingStrategyId + * + * @return workingStrategyId + */ + @jakarta.annotation.Nullable + public Long getWorkingStrategyId() { + return workingStrategyId; + } + + public void setWorkingStrategyId(@jakarta.annotation.Nullable Long workingStrategyId) { + this.workingStrategyId = workingStrategyId; + } + + public OrderListOpoRequest workingStrategyType( + @jakarta.annotation.Nullable Integer workingStrategyType) { + this.workingStrategyType = workingStrategyType; + return this; + } + + /** + * Get workingStrategyType + * + * @return workingStrategyType + */ + @jakarta.annotation.Nullable + public Integer getWorkingStrategyType() { + return workingStrategyType; + } + + public void setWorkingStrategyType(@jakarta.annotation.Nullable Integer workingStrategyType) { + this.workingStrategyType = workingStrategyType; + } + + public OrderListOpoRequest workingPegPriceType( + @jakarta.annotation.Nullable WorkingPegPriceType workingPegPriceType) { + this.workingPegPriceType = workingPegPriceType; + return this; + } + + /** + * Get workingPegPriceType + * + * @return workingPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingPegPriceType getWorkingPegPriceType() { + return workingPegPriceType; + } + + public void setWorkingPegPriceType( + @jakarta.annotation.Nullable WorkingPegPriceType workingPegPriceType) { + this.workingPegPriceType = workingPegPriceType; + } + + public OrderListOpoRequest workingPegOffsetType( + @jakarta.annotation.Nullable WorkingPegOffsetType workingPegOffsetType) { + this.workingPegOffsetType = workingPegOffsetType; + return this; + } + + /** + * Get workingPegOffsetType + * + * @return workingPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingPegOffsetType getWorkingPegOffsetType() { + return workingPegOffsetType; + } + + public void setWorkingPegOffsetType( + @jakarta.annotation.Nullable WorkingPegOffsetType workingPegOffsetType) { + this.workingPegOffsetType = workingPegOffsetType; + } + + public OrderListOpoRequest workingPegOffsetValue( + @jakarta.annotation.Nullable Integer workingPegOffsetValue) { + this.workingPegOffsetValue = workingPegOffsetValue; + return this; + } + + /** + * Get workingPegOffsetValue + * + * @return workingPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getWorkingPegOffsetValue() { + return workingPegOffsetValue; + } + + public void setWorkingPegOffsetValue( + @jakarta.annotation.Nullable Integer workingPegOffsetValue) { + this.workingPegOffsetValue = workingPegOffsetValue; + } + + public OrderListOpoRequest pendingType(@jakarta.annotation.Nonnull PendingType pendingType) { + this.pendingType = pendingType; + return this; + } + + /** + * Get pendingType + * + * @return pendingType + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public PendingType getPendingType() { + return pendingType; + } + + public void setPendingType(@jakarta.annotation.Nonnull PendingType pendingType) { + this.pendingType = pendingType; + } + + public OrderListOpoRequest pendingSide(@jakarta.annotation.Nonnull PendingSide pendingSide) { + this.pendingSide = pendingSide; + return this; + } + + /** + * Get pendingSide + * + * @return pendingSide + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public PendingSide getPendingSide() { + return pendingSide; + } + + public void setPendingSide(@jakarta.annotation.Nonnull PendingSide pendingSide) { + this.pendingSide = pendingSide; + } + + public OrderListOpoRequest pendingClientOrderId( + @jakarta.annotation.Nullable String pendingClientOrderId) { + this.pendingClientOrderId = pendingClientOrderId; + return this; + } + + /** + * Get pendingClientOrderId + * + * @return pendingClientOrderId + */ + @jakarta.annotation.Nullable + public String getPendingClientOrderId() { + return pendingClientOrderId; + } + + public void setPendingClientOrderId(@jakarta.annotation.Nullable String pendingClientOrderId) { + this.pendingClientOrderId = pendingClientOrderId; + } + + public OrderListOpoRequest pendingPrice(@jakarta.annotation.Nullable Double pendingPrice) { + this.pendingPrice = pendingPrice; + return this; + } + + /** + * Get pendingPrice + * + * @return pendingPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingPrice() { + return pendingPrice; + } + + public void setPendingPrice(@jakarta.annotation.Nullable Double pendingPrice) { + this.pendingPrice = pendingPrice; + } + + public OrderListOpoRequest pendingStopPrice( + @jakarta.annotation.Nullable Double pendingStopPrice) { + this.pendingStopPrice = pendingStopPrice; + return this; + } + + /** + * Get pendingStopPrice + * + * @return pendingStopPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingStopPrice() { + return pendingStopPrice; + } + + public void setPendingStopPrice(@jakarta.annotation.Nullable Double pendingStopPrice) { + this.pendingStopPrice = pendingStopPrice; + } + + public OrderListOpoRequest pendingTrailingDelta( + @jakarta.annotation.Nullable Double pendingTrailingDelta) { + this.pendingTrailingDelta = pendingTrailingDelta; + return this; + } + + /** + * Get pendingTrailingDelta + * + * @return pendingTrailingDelta + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingTrailingDelta() { + return pendingTrailingDelta; + } + + public void setPendingTrailingDelta(@jakarta.annotation.Nullable Double pendingTrailingDelta) { + this.pendingTrailingDelta = pendingTrailingDelta; + } + + public OrderListOpoRequest pendingIcebergQty( + @jakarta.annotation.Nullable Double pendingIcebergQty) { + this.pendingIcebergQty = pendingIcebergQty; + return this; + } + + /** + * Get pendingIcebergQty + * + * @return pendingIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingIcebergQty() { + return pendingIcebergQty; + } + + public void setPendingIcebergQty(@jakarta.annotation.Nullable Double pendingIcebergQty) { + this.pendingIcebergQty = pendingIcebergQty; + } + + public OrderListOpoRequest pendingTimeInForce( + @jakarta.annotation.Nullable PendingTimeInForce pendingTimeInForce) { + this.pendingTimeInForce = pendingTimeInForce; + return this; + } + + /** + * Get pendingTimeInForce + * + * @return pendingTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public PendingTimeInForce getPendingTimeInForce() { + return pendingTimeInForce; + } + + public void setPendingTimeInForce( + @jakarta.annotation.Nullable PendingTimeInForce pendingTimeInForce) { + this.pendingTimeInForce = pendingTimeInForce; + } + + public OrderListOpoRequest pendingStrategyId( + @jakarta.annotation.Nullable Long pendingStrategyId) { + this.pendingStrategyId = pendingStrategyId; + return this; + } + + /** + * Get pendingStrategyId + * + * @return pendingStrategyId + */ + @jakarta.annotation.Nullable + public Long getPendingStrategyId() { + return pendingStrategyId; + } + + public void setPendingStrategyId(@jakarta.annotation.Nullable Long pendingStrategyId) { + this.pendingStrategyId = pendingStrategyId; + } + + public OrderListOpoRequest pendingStrategyType( + @jakarta.annotation.Nullable Integer pendingStrategyType) { + this.pendingStrategyType = pendingStrategyType; + return this; + } + + /** + * Get pendingStrategyType + * + * @return pendingStrategyType + */ + @jakarta.annotation.Nullable + public Integer getPendingStrategyType() { + return pendingStrategyType; + } + + public void setPendingStrategyType(@jakarta.annotation.Nullable Integer pendingStrategyType) { + this.pendingStrategyType = pendingStrategyType; + } + + public OrderListOpoRequest pendingPegPriceType( + @jakarta.annotation.Nullable PendingPegPriceType pendingPegPriceType) { + this.pendingPegPriceType = pendingPegPriceType; + return this; + } + + /** + * Get pendingPegPriceType + * + * @return pendingPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PendingPegPriceType getPendingPegPriceType() { + return pendingPegPriceType; + } + + public void setPendingPegPriceType( + @jakarta.annotation.Nullable PendingPegPriceType pendingPegPriceType) { + this.pendingPegPriceType = pendingPegPriceType; + } + + public OrderListOpoRequest pendingPegOffsetType( + @jakarta.annotation.Nullable PendingPegOffsetType pendingPegOffsetType) { + this.pendingPegOffsetType = pendingPegOffsetType; + return this; + } + + /** + * Get pendingPegOffsetType + * + * @return pendingPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PendingPegOffsetType getPendingPegOffsetType() { + return pendingPegOffsetType; + } + + public void setPendingPegOffsetType( + @jakarta.annotation.Nullable PendingPegOffsetType pendingPegOffsetType) { + this.pendingPegOffsetType = pendingPegOffsetType; + } + + public OrderListOpoRequest pendingPegOffsetValue( + @jakarta.annotation.Nullable Integer pendingPegOffsetValue) { + this.pendingPegOffsetValue = pendingPegOffsetValue; + return this; + } + + /** + * Get pendingPegOffsetValue + * + * @return pendingPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPendingPegOffsetValue() { + return pendingPegOffsetValue; + } + + public void setPendingPegOffsetValue( + @jakarta.annotation.Nullable Integer pendingPegOffsetValue) { + this.pendingPegOffsetValue = pendingPegOffsetValue; + } + + public OrderListOpoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + @Valid + public Double getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListOpoRequest orderListOpoRequest = (OrderListOpoRequest) o; + return Objects.equals(this.symbol, orderListOpoRequest.symbol) + && Objects.equals(this.listClientOrderId, orderListOpoRequest.listClientOrderId) + && Objects.equals(this.newOrderRespType, orderListOpoRequest.newOrderRespType) + && Objects.equals( + this.selfTradePreventionMode, orderListOpoRequest.selfTradePreventionMode) + && Objects.equals(this.workingType, orderListOpoRequest.workingType) + && Objects.equals(this.workingSide, orderListOpoRequest.workingSide) + && Objects.equals( + this.workingClientOrderId, orderListOpoRequest.workingClientOrderId) + && Objects.equals(this.workingPrice, orderListOpoRequest.workingPrice) + && Objects.equals(this.workingQuantity, orderListOpoRequest.workingQuantity) + && Objects.equals(this.workingIcebergQty, orderListOpoRequest.workingIcebergQty) + && Objects.equals(this.workingTimeInForce, orderListOpoRequest.workingTimeInForce) + && Objects.equals(this.workingStrategyId, orderListOpoRequest.workingStrategyId) + && Objects.equals(this.workingStrategyType, orderListOpoRequest.workingStrategyType) + && Objects.equals(this.workingPegPriceType, orderListOpoRequest.workingPegPriceType) + && Objects.equals( + this.workingPegOffsetType, orderListOpoRequest.workingPegOffsetType) + && Objects.equals( + this.workingPegOffsetValue, orderListOpoRequest.workingPegOffsetValue) + && Objects.equals(this.pendingType, orderListOpoRequest.pendingType) + && Objects.equals(this.pendingSide, orderListOpoRequest.pendingSide) + && Objects.equals( + this.pendingClientOrderId, orderListOpoRequest.pendingClientOrderId) + && Objects.equals(this.pendingPrice, orderListOpoRequest.pendingPrice) + && Objects.equals(this.pendingStopPrice, orderListOpoRequest.pendingStopPrice) + && Objects.equals( + this.pendingTrailingDelta, orderListOpoRequest.pendingTrailingDelta) + && Objects.equals(this.pendingIcebergQty, orderListOpoRequest.pendingIcebergQty) + && Objects.equals(this.pendingTimeInForce, orderListOpoRequest.pendingTimeInForce) + && Objects.equals(this.pendingStrategyId, orderListOpoRequest.pendingStrategyId) + && Objects.equals(this.pendingStrategyType, orderListOpoRequest.pendingStrategyType) + && Objects.equals(this.pendingPegPriceType, orderListOpoRequest.pendingPegPriceType) + && Objects.equals( + this.pendingPegOffsetType, orderListOpoRequest.pendingPegOffsetType) + && Objects.equals( + this.pendingPegOffsetValue, orderListOpoRequest.pendingPegOffsetValue) + && Objects.equals(this.recvWindow, orderListOpoRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + listClientOrderId, + newOrderRespType, + selfTradePreventionMode, + workingType, + workingSide, + workingClientOrderId, + workingPrice, + workingQuantity, + workingIcebergQty, + workingTimeInForce, + workingStrategyId, + workingStrategyType, + workingPegPriceType, + workingPegOffsetType, + workingPegOffsetValue, + pendingType, + pendingSide, + pendingClientOrderId, + pendingPrice, + pendingStopPrice, + pendingTrailingDelta, + pendingIcebergQty, + pendingTimeInForce, + pendingStrategyId, + pendingStrategyType, + pendingPegPriceType, + pendingPegOffsetType, + pendingPegOffsetValue, + recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListOpoRequest {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" listClientOrderId: ").append(toIndentedString(listClientOrderId)).append("\n"); + sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" workingSide: ").append(toIndentedString(workingSide)).append("\n"); + sb.append(" workingClientOrderId: ") + .append(toIndentedString(workingClientOrderId)) + .append("\n"); + sb.append(" workingPrice: ").append(toIndentedString(workingPrice)).append("\n"); + sb.append(" workingQuantity: ").append(toIndentedString(workingQuantity)).append("\n"); + sb.append(" workingIcebergQty: ").append(toIndentedString(workingIcebergQty)).append("\n"); + sb.append(" workingTimeInForce: ") + .append(toIndentedString(workingTimeInForce)) + .append("\n"); + sb.append(" workingStrategyId: ").append(toIndentedString(workingStrategyId)).append("\n"); + sb.append(" workingStrategyType: ") + .append(toIndentedString(workingStrategyType)) + .append("\n"); + sb.append(" workingPegPriceType: ") + .append(toIndentedString(workingPegPriceType)) + .append("\n"); + sb.append(" workingPegOffsetType: ") + .append(toIndentedString(workingPegOffsetType)) + .append("\n"); + sb.append(" workingPegOffsetValue: ") + .append(toIndentedString(workingPegOffsetValue)) + .append("\n"); + sb.append(" pendingType: ").append(toIndentedString(pendingType)).append("\n"); + sb.append(" pendingSide: ").append(toIndentedString(pendingSide)).append("\n"); + sb.append(" pendingClientOrderId: ") + .append(toIndentedString(pendingClientOrderId)) + .append("\n"); + sb.append(" pendingPrice: ").append(toIndentedString(pendingPrice)).append("\n"); + sb.append(" pendingStopPrice: ").append(toIndentedString(pendingStopPrice)).append("\n"); + sb.append(" pendingTrailingDelta: ") + .append(toIndentedString(pendingTrailingDelta)) + .append("\n"); + sb.append(" pendingIcebergQty: ").append(toIndentedString(pendingIcebergQty)).append("\n"); + sb.append(" pendingTimeInForce: ") + .append(toIndentedString(pendingTimeInForce)) + .append("\n"); + sb.append(" pendingStrategyId: ").append(toIndentedString(pendingStrategyId)).append("\n"); + sb.append(" pendingStrategyType: ") + .append(toIndentedString(pendingStrategyType)) + .append("\n"); + sb.append(" pendingPegPriceType: ") + .append(toIndentedString(pendingPegPriceType)) + .append("\n"); + sb.append(" pendingPegOffsetType: ") + .append(toIndentedString(pendingPegOffsetType)) + .append("\n"); + sb.append(" pendingPegOffsetValue: ") + .append(toIndentedString(pendingPegOffsetValue)) + .append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object listClientOrderIdValue = getListClientOrderId(); + String listClientOrderIdValueAsString = ""; + listClientOrderIdValueAsString = listClientOrderIdValue.toString(); + sb.append("listClientOrderId=") + .append(urlEncode(listClientOrderIdValueAsString)) + .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 workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object workingSideValue = getWorkingSide(); + String workingSideValueAsString = ""; + workingSideValueAsString = workingSideValue.toString(); + sb.append("workingSide=").append(urlEncode(workingSideValueAsString)).append(""); + Object workingClientOrderIdValue = getWorkingClientOrderId(); + String workingClientOrderIdValueAsString = ""; + workingClientOrderIdValueAsString = workingClientOrderIdValue.toString(); + sb.append("workingClientOrderId=") + .append(urlEncode(workingClientOrderIdValueAsString)) + .append(""); + Object workingPriceValue = getWorkingPrice(); + String workingPriceValueAsString = ""; + workingPriceValueAsString = workingPriceValue.toString(); + sb.append("workingPrice=").append(urlEncode(workingPriceValueAsString)).append(""); + Object workingQuantityValue = getWorkingQuantity(); + String workingQuantityValueAsString = ""; + workingQuantityValueAsString = workingQuantityValue.toString(); + sb.append("workingQuantity=").append(urlEncode(workingQuantityValueAsString)).append(""); + Object workingIcebergQtyValue = getWorkingIcebergQty(); + String workingIcebergQtyValueAsString = ""; + workingIcebergQtyValueAsString = workingIcebergQtyValue.toString(); + sb.append("workingIcebergQty=") + .append(urlEncode(workingIcebergQtyValueAsString)) + .append(""); + Object workingTimeInForceValue = getWorkingTimeInForce(); + String workingTimeInForceValueAsString = ""; + workingTimeInForceValueAsString = workingTimeInForceValue.toString(); + sb.append("workingTimeInForce=") + .append(urlEncode(workingTimeInForceValueAsString)) + .append(""); + Object workingStrategyIdValue = getWorkingStrategyId(); + String workingStrategyIdValueAsString = ""; + workingStrategyIdValueAsString = workingStrategyIdValue.toString(); + sb.append("workingStrategyId=") + .append(urlEncode(workingStrategyIdValueAsString)) + .append(""); + Object workingStrategyTypeValue = getWorkingStrategyType(); + String workingStrategyTypeValueAsString = ""; + workingStrategyTypeValueAsString = workingStrategyTypeValue.toString(); + sb.append("workingStrategyType=") + .append(urlEncode(workingStrategyTypeValueAsString)) + .append(""); + Object workingPegPriceTypeValue = getWorkingPegPriceType(); + String workingPegPriceTypeValueAsString = ""; + workingPegPriceTypeValueAsString = workingPegPriceTypeValue.toString(); + sb.append("workingPegPriceType=") + .append(urlEncode(workingPegPriceTypeValueAsString)) + .append(""); + Object workingPegOffsetTypeValue = getWorkingPegOffsetType(); + String workingPegOffsetTypeValueAsString = ""; + workingPegOffsetTypeValueAsString = workingPegOffsetTypeValue.toString(); + sb.append("workingPegOffsetType=") + .append(urlEncode(workingPegOffsetTypeValueAsString)) + .append(""); + Object workingPegOffsetValueValue = getWorkingPegOffsetValue(); + String workingPegOffsetValueValueAsString = ""; + workingPegOffsetValueValueAsString = workingPegOffsetValueValue.toString(); + sb.append("workingPegOffsetValue=") + .append(urlEncode(workingPegOffsetValueValueAsString)) + .append(""); + Object pendingTypeValue = getPendingType(); + String pendingTypeValueAsString = ""; + pendingTypeValueAsString = pendingTypeValue.toString(); + sb.append("pendingType=").append(urlEncode(pendingTypeValueAsString)).append(""); + Object pendingSideValue = getPendingSide(); + String pendingSideValueAsString = ""; + pendingSideValueAsString = pendingSideValue.toString(); + sb.append("pendingSide=").append(urlEncode(pendingSideValueAsString)).append(""); + Object pendingClientOrderIdValue = getPendingClientOrderId(); + String pendingClientOrderIdValueAsString = ""; + pendingClientOrderIdValueAsString = pendingClientOrderIdValue.toString(); + sb.append("pendingClientOrderId=") + .append(urlEncode(pendingClientOrderIdValueAsString)) + .append(""); + Object pendingPriceValue = getPendingPrice(); + String pendingPriceValueAsString = ""; + pendingPriceValueAsString = pendingPriceValue.toString(); + sb.append("pendingPrice=").append(urlEncode(pendingPriceValueAsString)).append(""); + Object pendingStopPriceValue = getPendingStopPrice(); + String pendingStopPriceValueAsString = ""; + pendingStopPriceValueAsString = pendingStopPriceValue.toString(); + sb.append("pendingStopPrice=").append(urlEncode(pendingStopPriceValueAsString)).append(""); + Object pendingTrailingDeltaValue = getPendingTrailingDelta(); + String pendingTrailingDeltaValueAsString = ""; + pendingTrailingDeltaValueAsString = pendingTrailingDeltaValue.toString(); + sb.append("pendingTrailingDelta=") + .append(urlEncode(pendingTrailingDeltaValueAsString)) + .append(""); + Object pendingIcebergQtyValue = getPendingIcebergQty(); + String pendingIcebergQtyValueAsString = ""; + pendingIcebergQtyValueAsString = pendingIcebergQtyValue.toString(); + sb.append("pendingIcebergQty=") + .append(urlEncode(pendingIcebergQtyValueAsString)) + .append(""); + Object pendingTimeInForceValue = getPendingTimeInForce(); + String pendingTimeInForceValueAsString = ""; + pendingTimeInForceValueAsString = pendingTimeInForceValue.toString(); + sb.append("pendingTimeInForce=") + .append(urlEncode(pendingTimeInForceValueAsString)) + .append(""); + Object pendingStrategyIdValue = getPendingStrategyId(); + String pendingStrategyIdValueAsString = ""; + pendingStrategyIdValueAsString = pendingStrategyIdValue.toString(); + sb.append("pendingStrategyId=") + .append(urlEncode(pendingStrategyIdValueAsString)) + .append(""); + Object pendingStrategyTypeValue = getPendingStrategyType(); + String pendingStrategyTypeValueAsString = ""; + pendingStrategyTypeValueAsString = pendingStrategyTypeValue.toString(); + sb.append("pendingStrategyType=") + .append(urlEncode(pendingStrategyTypeValueAsString)) + .append(""); + Object pendingPegPriceTypeValue = getPendingPegPriceType(); + String pendingPegPriceTypeValueAsString = ""; + pendingPegPriceTypeValueAsString = pendingPegPriceTypeValue.toString(); + sb.append("pendingPegPriceType=") + .append(urlEncode(pendingPegPriceTypeValueAsString)) + .append(""); + Object pendingPegOffsetTypeValue = getPendingPegOffsetType(); + String pendingPegOffsetTypeValueAsString = ""; + pendingPegOffsetTypeValueAsString = pendingPegOffsetTypeValue.toString(); + sb.append("pendingPegOffsetType=") + .append(urlEncode(pendingPegOffsetTypeValueAsString)) + .append(""); + Object pendingPegOffsetValueValue = getPendingPegOffsetValue(); + String pendingPegOffsetValueValueAsString = ""; + pendingPegOffsetValueValueAsString = pendingPegOffsetValueValue.toString(); + sb.append("pendingPegOffsetValue=") + .append(urlEncode(pendingPegOffsetValueValueAsString)) + .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("symbol"); + openapiFields.add("listClientOrderId"); + openapiFields.add("newOrderRespType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("workingSide"); + openapiFields.add("workingClientOrderId"); + openapiFields.add("workingPrice"); + openapiFields.add("workingQuantity"); + openapiFields.add("workingIcebergQty"); + openapiFields.add("workingTimeInForce"); + openapiFields.add("workingStrategyId"); + openapiFields.add("workingStrategyType"); + openapiFields.add("workingPegPriceType"); + openapiFields.add("workingPegOffsetType"); + openapiFields.add("workingPegOffsetValue"); + openapiFields.add("pendingType"); + openapiFields.add("pendingSide"); + openapiFields.add("pendingClientOrderId"); + openapiFields.add("pendingPrice"); + openapiFields.add("pendingStopPrice"); + openapiFields.add("pendingTrailingDelta"); + openapiFields.add("pendingIcebergQty"); + openapiFields.add("pendingTimeInForce"); + openapiFields.add("pendingStrategyId"); + openapiFields.add("pendingStrategyType"); + openapiFields.add("pendingPegPriceType"); + openapiFields.add("pendingPegOffsetType"); + openapiFields.add("pendingPegOffsetValue"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("symbol"); + openapiRequiredFields.add("workingType"); + openapiRequiredFields.add("workingSide"); + openapiRequiredFields.add("workingPrice"); + openapiRequiredFields.add("workingQuantity"); + openapiRequiredFields.add("pendingType"); + openapiRequiredFields.add("pendingSide"); + } + + /** + * 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 OrderListOpoRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListOpoRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListOpoRequest is not found in" + + " the empty JSON string", + OrderListOpoRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrderListOpoRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("listClientOrderId") != null + && !jsonObj.get("listClientOrderId").isJsonNull()) + && !jsonObj.get("listClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listClientOrderId").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")); + } + // validate the required field `workingType` + WorkingType.validateJsonElement(jsonObj.get("workingType")); + // validate the required field `workingSide` + WorkingSide.validateJsonElement(jsonObj.get("workingSide")); + if ((jsonObj.get("workingClientOrderId") != null + && !jsonObj.get("workingClientOrderId").isJsonNull()) + && !jsonObj.get("workingClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingClientOrderId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("workingClientOrderId").toString())); + } + // validate the optional field `workingTimeInForce` + if (jsonObj.get("workingTimeInForce") != null + && !jsonObj.get("workingTimeInForce").isJsonNull()) { + WorkingTimeInForce.validateJsonElement(jsonObj.get("workingTimeInForce")); + } + // validate the optional field `workingPegPriceType` + if (jsonObj.get("workingPegPriceType") != null + && !jsonObj.get("workingPegPriceType").isJsonNull()) { + WorkingPegPriceType.validateJsonElement(jsonObj.get("workingPegPriceType")); + } + // validate the optional field `workingPegOffsetType` + if (jsonObj.get("workingPegOffsetType") != null + && !jsonObj.get("workingPegOffsetType").isJsonNull()) { + WorkingPegOffsetType.validateJsonElement(jsonObj.get("workingPegOffsetType")); + } + // validate the required field `pendingType` + PendingType.validateJsonElement(jsonObj.get("pendingType")); + // validate the required field `pendingSide` + PendingSide.validateJsonElement(jsonObj.get("pendingSide")); + if ((jsonObj.get("pendingClientOrderId") != null + && !jsonObj.get("pendingClientOrderId").isJsonNull()) + && !jsonObj.get("pendingClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pendingClientOrderId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("pendingClientOrderId").toString())); + } + // validate the optional field `pendingTimeInForce` + if (jsonObj.get("pendingTimeInForce") != null + && !jsonObj.get("pendingTimeInForce").isJsonNull()) { + PendingTimeInForce.validateJsonElement(jsonObj.get("pendingTimeInForce")); + } + // validate the optional field `pendingPegPriceType` + if (jsonObj.get("pendingPegPriceType") != null + && !jsonObj.get("pendingPegPriceType").isJsonNull()) { + PendingPegPriceType.validateJsonElement(jsonObj.get("pendingPegPriceType")); + } + // validate the optional field `pendingPegOffsetType` + if (jsonObj.get("pendingPegOffsetType") != null + && !jsonObj.get("pendingPegOffsetType").isJsonNull()) { + PendingPegOffsetType.validateJsonElement(jsonObj.get("pendingPegOffsetType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListOpoRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListOpoRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderListOpoRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListOpoRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListOpoRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListOpoRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListOpoRequest + * @throws IOException if the JSON string is invalid with respect to OrderListOpoRequest + */ + public static OrderListOpoRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListOpoRequest.class); + } + + /** + * Convert an instance of OrderListOpoRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponse.java new file mode 100644 index 00000000..e54364c8 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponse.java @@ -0,0 +1,589 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListOpoResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListOpoResponse { + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CONTINGENCY_TYPE = "contingencyType"; + + @SerializedName(SERIALIZED_NAME_CONTINGENCY_TYPE) + @jakarta.annotation.Nullable + private String contingencyType; + + public static final String SERIALIZED_NAME_LIST_STATUS_TYPE = "listStatusType"; + + @SerializedName(SERIALIZED_NAME_LIST_STATUS_TYPE) + @jakarta.annotation.Nullable + private String listStatusType; + + public static final String SERIALIZED_NAME_LIST_ORDER_STATUS = "listOrderStatus"; + + @SerializedName(SERIALIZED_NAME_LIST_ORDER_STATUS) + @jakarta.annotation.Nullable + private String listOrderStatus; + + public static final String SERIALIZED_NAME_LIST_CLIENT_ORDER_ID = "listClientOrderId"; + + @SerializedName(SERIALIZED_NAME_LIST_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String listClientOrderId; + + public static final String SERIALIZED_NAME_TRANSACTION_TIME = "transactionTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACTION_TIME) + @jakarta.annotation.Nullable + private Long transactionTime; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDERS = "orders"; + + @SerializedName(SERIALIZED_NAME_ORDERS) + @jakarta.annotation.Nullable + private List<@Valid OrderListOpoResponseOrdersInner> orders; + + public static final String SERIALIZED_NAME_ORDER_REPORTS = "orderReports"; + + @SerializedName(SERIALIZED_NAME_ORDER_REPORTS) + @jakarta.annotation.Nullable + private List<@Valid OrderListOpoResponseOrderReportsInner> orderReports; + + public OrderListOpoResponse() {} + + public OrderListOpoResponse orderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderListOpoResponse contingencyType( + @jakarta.annotation.Nullable String contingencyType) { + this.contingencyType = contingencyType; + return this; + } + + /** + * Get contingencyType + * + * @return contingencyType + */ + @jakarta.annotation.Nullable + public String getContingencyType() { + return contingencyType; + } + + public void setContingencyType(@jakarta.annotation.Nullable String contingencyType) { + this.contingencyType = contingencyType; + } + + public OrderListOpoResponse listStatusType(@jakarta.annotation.Nullable String listStatusType) { + this.listStatusType = listStatusType; + return this; + } + + /** + * Get listStatusType + * + * @return listStatusType + */ + @jakarta.annotation.Nullable + public String getListStatusType() { + return listStatusType; + } + + public void setListStatusType(@jakarta.annotation.Nullable String listStatusType) { + this.listStatusType = listStatusType; + } + + public OrderListOpoResponse listOrderStatus( + @jakarta.annotation.Nullable String listOrderStatus) { + this.listOrderStatus = listOrderStatus; + return this; + } + + /** + * Get listOrderStatus + * + * @return listOrderStatus + */ + @jakarta.annotation.Nullable + public String getListOrderStatus() { + return listOrderStatus; + } + + public void setListOrderStatus(@jakarta.annotation.Nullable String listOrderStatus) { + this.listOrderStatus = listOrderStatus; + } + + public OrderListOpoResponse listClientOrderId( + @jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + return this; + } + + /** + * Get listClientOrderId + * + * @return listClientOrderId + */ + @jakarta.annotation.Nullable + public String getListClientOrderId() { + return listClientOrderId; + } + + public void setListClientOrderId(@jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + } + + public OrderListOpoResponse transactionTime(@jakarta.annotation.Nullable Long transactionTime) { + this.transactionTime = transactionTime; + return this; + } + + /** + * Get transactionTime + * + * @return transactionTime + */ + @jakarta.annotation.Nullable + public Long getTransactionTime() { + return transactionTime; + } + + public void setTransactionTime(@jakarta.annotation.Nullable Long transactionTime) { + this.transactionTime = transactionTime; + } + + public OrderListOpoResponse 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 OrderListOpoResponse orders( + @jakarta.annotation.Nullable List<@Valid OrderListOpoResponseOrdersInner> orders) { + this.orders = orders; + return this; + } + + public OrderListOpoResponse addOrdersItem(OrderListOpoResponseOrdersInner ordersItem) { + if (this.orders == null) { + this.orders = new ArrayList<>(); + } + this.orders.add(ordersItem); + return this; + } + + /** + * Get orders + * + * @return orders + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OrderListOpoResponseOrdersInner> getOrders() { + return orders; + } + + public void setOrders( + @jakarta.annotation.Nullable List<@Valid OrderListOpoResponseOrdersInner> orders) { + this.orders = orders; + } + + public OrderListOpoResponse orderReports( + @jakarta.annotation.Nullable + List<@Valid OrderListOpoResponseOrderReportsInner> orderReports) { + this.orderReports = orderReports; + return this; + } + + public OrderListOpoResponse addOrderReportsItem( + OrderListOpoResponseOrderReportsInner orderReportsItem) { + if (this.orderReports == null) { + this.orderReports = new ArrayList<>(); + } + this.orderReports.add(orderReportsItem); + return this; + } + + /** + * Get orderReports + * + * @return orderReports + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OrderListOpoResponseOrderReportsInner> getOrderReports() { + return orderReports; + } + + public void setOrderReports( + @jakarta.annotation.Nullable + List<@Valid OrderListOpoResponseOrderReportsInner> orderReports) { + this.orderReports = orderReports; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListOpoResponse orderListOpoResponse = (OrderListOpoResponse) o; + return Objects.equals(this.orderListId, orderListOpoResponse.orderListId) + && Objects.equals(this.contingencyType, orderListOpoResponse.contingencyType) + && Objects.equals(this.listStatusType, orderListOpoResponse.listStatusType) + && Objects.equals(this.listOrderStatus, orderListOpoResponse.listOrderStatus) + && Objects.equals(this.listClientOrderId, orderListOpoResponse.listClientOrderId) + && Objects.equals(this.transactionTime, orderListOpoResponse.transactionTime) + && Objects.equals(this.symbol, orderListOpoResponse.symbol) + && Objects.equals(this.orders, orderListOpoResponse.orders) + && Objects.equals(this.orderReports, orderListOpoResponse.orderReports); + } + + @Override + public int hashCode() { + return Objects.hash( + orderListId, + contingencyType, + listStatusType, + listOrderStatus, + listClientOrderId, + transactionTime, + symbol, + orders, + orderReports); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListOpoResponse {\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" contingencyType: ").append(toIndentedString(contingencyType)).append("\n"); + sb.append(" listStatusType: ").append(toIndentedString(listStatusType)).append("\n"); + sb.append(" listOrderStatus: ").append(toIndentedString(listOrderStatus)).append("\n"); + sb.append(" listClientOrderId: ").append(toIndentedString(listClientOrderId)).append("\n"); + sb.append(" transactionTime: ").append(toIndentedString(transactionTime)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orders: ").append(toIndentedString(orders)).append("\n"); + sb.append(" orderReports: ").append(toIndentedString(orderReports)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object orderListIdValue = getOrderListId(); + String orderListIdValueAsString = ""; + orderListIdValueAsString = orderListIdValue.toString(); + sb.append("orderListId=").append(urlEncode(orderListIdValueAsString)).append(""); + Object contingencyTypeValue = getContingencyType(); + String contingencyTypeValueAsString = ""; + contingencyTypeValueAsString = contingencyTypeValue.toString(); + sb.append("contingencyType=").append(urlEncode(contingencyTypeValueAsString)).append(""); + Object listStatusTypeValue = getListStatusType(); + String listStatusTypeValueAsString = ""; + listStatusTypeValueAsString = listStatusTypeValue.toString(); + sb.append("listStatusType=").append(urlEncode(listStatusTypeValueAsString)).append(""); + Object listOrderStatusValue = getListOrderStatus(); + String listOrderStatusValueAsString = ""; + listOrderStatusValueAsString = listOrderStatusValue.toString(); + sb.append("listOrderStatus=").append(urlEncode(listOrderStatusValueAsString)).append(""); + Object listClientOrderIdValue = getListClientOrderId(); + String listClientOrderIdValueAsString = ""; + listClientOrderIdValueAsString = listClientOrderIdValue.toString(); + sb.append("listClientOrderId=") + .append(urlEncode(listClientOrderIdValueAsString)) + .append(""); + Object transactionTimeValue = getTransactionTime(); + String transactionTimeValueAsString = ""; + transactionTimeValueAsString = transactionTimeValue.toString(); + sb.append("transactionTime=").append(urlEncode(transactionTimeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object ordersValue = getOrders(); + String ordersValueAsString = ""; + ordersValueAsString = + (String) + ((Collection) ordersValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("orders=").append(urlEncode(ordersValueAsString)).append(""); + Object orderReportsValue = getOrderReports(); + String orderReportsValueAsString = ""; + orderReportsValueAsString = + (String) + ((Collection) orderReportsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("orderReports=").append(urlEncode(orderReportsValueAsString)).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("orderListId"); + openapiFields.add("contingencyType"); + openapiFields.add("listStatusType"); + openapiFields.add("listOrderStatus"); + openapiFields.add("listClientOrderId"); + openapiFields.add("transactionTime"); + openapiFields.add("symbol"); + openapiFields.add("orders"); + openapiFields.add("orderReports"); + + // 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 OrderListOpoResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListOpoResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListOpoResponse is not found in" + + " the empty JSON string", + OrderListOpoResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) + && !jsonObj.get("contingencyType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `contingencyType` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("contingencyType").toString())); + } + if ((jsonObj.get("listStatusType") != null && !jsonObj.get("listStatusType").isJsonNull()) + && !jsonObj.get("listStatusType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listStatusType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("listStatusType").toString())); + } + if ((jsonObj.get("listOrderStatus") != null && !jsonObj.get("listOrderStatus").isJsonNull()) + && !jsonObj.get("listOrderStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listOrderStatus` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listOrderStatus").toString())); + } + if ((jsonObj.get("listClientOrderId") != null + && !jsonObj.get("listClientOrderId").isJsonNull()) + && !jsonObj.get("listClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listClientOrderId").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("orders") != null && !jsonObj.get("orders").isJsonNull()) { + JsonArray jsonArrayorders = jsonObj.getAsJsonArray("orders"); + if (jsonArrayorders != null) { + // ensure the json data is an array + if (!jsonObj.get("orders").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orders` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("orders").toString())); + } + + // validate the optional field `orders` (array) + for (int i = 0; i < jsonArrayorders.size(); i++) { + OrderListOpoResponseOrdersInner.validateJsonElement(jsonArrayorders.get(i)); + } + ; + } + } + if (jsonObj.get("orderReports") != null && !jsonObj.get("orderReports").isJsonNull()) { + JsonArray jsonArrayorderReports = jsonObj.getAsJsonArray("orderReports"); + if (jsonArrayorderReports != null) { + // ensure the json data is an array + if (!jsonObj.get("orderReports").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderReports` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("orderReports").toString())); + } + + // validate the optional field `orderReports` (array) + for (int i = 0; i < jsonArrayorderReports.size(); i++) { + OrderListOpoResponseOrderReportsInner.validateJsonElement( + jsonArrayorderReports.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListOpoResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListOpoResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderListOpoResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListOpoResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListOpoResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListOpoResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListOpoResponse + * @throws IOException if the JSON string is invalid with respect to OrderListOpoResponse + */ + public static OrderListOpoResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListOpoResponse.class); + } + + /** + * Convert an instance of OrderListOpoResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponseOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponseOrderReportsInner.java new file mode 100644 index 00000000..ea0c514b --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponseOrderReportsInner.java @@ -0,0 +1,843 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** OrderListOpoResponseOrderReportsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListOpoResponseOrderReportsInner { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public static final String SERIALIZED_NAME_TRANSACT_TIME = "transactTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACT_TIME) + @jakarta.annotation.Nullable + private Long transactTime; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; + + @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) + @jakarta.annotation.Nullable + private String executedQty; + + public static final String SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY = "origQuoteOrderQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY) + @jakarta.annotation.Nullable + private String origQuoteOrderQty; + + public static final String SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY = "cummulativeQuoteQty"; + + @SerializedName(SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY) + @jakarta.annotation.Nullable + private String cummulativeQuoteQty; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_WORKING_TIME = "workingTime"; + + @SerializedName(SERIALIZED_NAME_WORKING_TIME) + @jakarta.annotation.Nullable + private Long workingTime; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QTY) + @jakarta.annotation.Nullable + private String origQty; + + public OrderListOpoResponseOrderReportsInner() {} + + public OrderListOpoResponseOrderReportsInner 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 OrderListOpoResponseOrderReportsInner orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderListOpoResponseOrderReportsInner orderListId( + @jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderListOpoResponseOrderReportsInner clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public OrderListOpoResponseOrderReportsInner transactTime( + @jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + return this; + } + + /** + * Get transactTime + * + * @return transactTime + */ + @jakarta.annotation.Nullable + public Long getTransactTime() { + return transactTime; + } + + public void setTransactTime(@jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + } + + public OrderListOpoResponseOrderReportsInner 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 OrderListOpoResponseOrderReportsInner executedQty( + @jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + return this; + } + + /** + * Get executedQty + * + * @return executedQty + */ + @jakarta.annotation.Nullable + public String getExecutedQty() { + return executedQty; + } + + public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + } + + public OrderListOpoResponseOrderReportsInner origQuoteOrderQty( + @jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + return this; + } + + /** + * Get origQuoteOrderQty + * + * @return origQuoteOrderQty + */ + @jakarta.annotation.Nullable + public String getOrigQuoteOrderQty() { + return origQuoteOrderQty; + } + + public void setOrigQuoteOrderQty(@jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + } + + public OrderListOpoResponseOrderReportsInner cummulativeQuoteQty( + @jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + return this; + } + + /** + * Get cummulativeQuoteQty + * + * @return cummulativeQuoteQty + */ + @jakarta.annotation.Nullable + public String getCummulativeQuoteQty() { + return cummulativeQuoteQty; + } + + public void setCummulativeQuoteQty(@jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + } + + public OrderListOpoResponseOrderReportsInner status( + @jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + public OrderListOpoResponseOrderReportsInner 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 OrderListOpoResponseOrderReportsInner type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + public OrderListOpoResponseOrderReportsInner 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 OrderListOpoResponseOrderReportsInner workingTime( + @jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + return this; + } + + /** + * Get workingTime + * + * @return workingTime + */ + @jakarta.annotation.Nullable + public Long getWorkingTime() { + return workingTime; + } + + public void setWorkingTime(@jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + } + + public OrderListOpoResponseOrderReportsInner 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 OrderListOpoResponseOrderReportsInner origQty( + @jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + return this; + } + + /** + * Get origQty + * + * @return origQty + */ + @jakarta.annotation.Nullable + public String getOrigQty() { + return origQty; + } + + public void setOrigQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListOpoResponseOrderReportsInner orderListOpoResponseOrderReportsInner = + (OrderListOpoResponseOrderReportsInner) o; + return Objects.equals(this.symbol, orderListOpoResponseOrderReportsInner.symbol) + && Objects.equals(this.orderId, orderListOpoResponseOrderReportsInner.orderId) + && Objects.equals( + this.orderListId, orderListOpoResponseOrderReportsInner.orderListId) + && Objects.equals( + this.clientOrderId, orderListOpoResponseOrderReportsInner.clientOrderId) + && Objects.equals( + this.transactTime, orderListOpoResponseOrderReportsInner.transactTime) + && Objects.equals(this.price, orderListOpoResponseOrderReportsInner.price) + && Objects.equals( + this.executedQty, orderListOpoResponseOrderReportsInner.executedQty) + && Objects.equals( + this.origQuoteOrderQty, + orderListOpoResponseOrderReportsInner.origQuoteOrderQty) + && Objects.equals( + this.cummulativeQuoteQty, + orderListOpoResponseOrderReportsInner.cummulativeQuoteQty) + && Objects.equals(this.status, orderListOpoResponseOrderReportsInner.status) + && Objects.equals( + this.timeInForce, orderListOpoResponseOrderReportsInner.timeInForce) + && Objects.equals(this.type, orderListOpoResponseOrderReportsInner.type) + && Objects.equals(this.side, orderListOpoResponseOrderReportsInner.side) + && Objects.equals( + this.workingTime, orderListOpoResponseOrderReportsInner.workingTime) + && Objects.equals( + this.selfTradePreventionMode, + orderListOpoResponseOrderReportsInner.selfTradePreventionMode) + && Objects.equals(this.origQty, orderListOpoResponseOrderReportsInner.origQty); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + orderId, + orderListId, + clientOrderId, + transactTime, + price, + executedQty, + origQuoteOrderQty, + cummulativeQuoteQty, + status, + timeInForce, + type, + side, + workingTime, + selfTradePreventionMode, + origQty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListOpoResponseOrderReportsInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" transactTime: ").append(toIndentedString(transactTime)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); + sb.append(" origQuoteOrderQty: ").append(toIndentedString(origQuoteOrderQty)).append("\n"); + sb.append(" cummulativeQuoteQty: ") + .append(toIndentedString(cummulativeQuoteQty)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" workingTime: ").append(toIndentedString(workingTime)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object orderListIdValue = getOrderListId(); + String orderListIdValueAsString = ""; + orderListIdValueAsString = orderListIdValue.toString(); + sb.append("orderListId=").append(urlEncode(orderListIdValueAsString)).append(""); + Object clientOrderIdValue = getClientOrderId(); + String clientOrderIdValueAsString = ""; + clientOrderIdValueAsString = clientOrderIdValue.toString(); + sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + Object transactTimeValue = getTransactTime(); + String transactTimeValueAsString = ""; + transactTimeValueAsString = transactTimeValue.toString(); + sb.append("transactTime=").append(urlEncode(transactTimeValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object executedQtyValue = getExecutedQty(); + String executedQtyValueAsString = ""; + executedQtyValueAsString = executedQtyValue.toString(); + sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); + Object origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + String origQuoteOrderQtyValueAsString = ""; + origQuoteOrderQtyValueAsString = origQuoteOrderQtyValue.toString(); + sb.append("origQuoteOrderQty=") + .append(urlEncode(origQuoteOrderQtyValueAsString)) + .append(""); + Object cummulativeQuoteQtyValue = getCummulativeQuoteQty(); + String cummulativeQuoteQtyValueAsString = ""; + cummulativeQuoteQtyValueAsString = cummulativeQuoteQtyValue.toString(); + sb.append("cummulativeQuoteQty=") + .append(urlEncode(cummulativeQuoteQtyValueAsString)) + .append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object workingTimeValue = getWorkingTime(); + String workingTimeValueAsString = ""; + workingTimeValueAsString = workingTimeValue.toString(); + sb.append("workingTime=").append(urlEncode(workingTimeValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object origQtyValue = getOrigQty(); + String origQtyValueAsString = ""; + origQtyValueAsString = origQtyValue.toString(); + sb.append("origQty=").append(urlEncode(origQtyValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("orderListId"); + openapiFields.add("clientOrderId"); + openapiFields.add("transactTime"); + openapiFields.add("price"); + openapiFields.add("executedQty"); + openapiFields.add("origQuoteOrderQty"); + openapiFields.add("cummulativeQuoteQty"); + openapiFields.add("status"); + openapiFields.add("timeInForce"); + openapiFields.add("type"); + openapiFields.add("side"); + openapiFields.add("workingTime"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("origQty"); + + // 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 + * OrderListOpoResponseOrderReportsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListOpoResponseOrderReportsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListOpoResponseOrderReportsInner" + + " is not found in the empty JSON string", + OrderListOpoResponseOrderReportsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) + && !jsonObj.get("executedQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executedQty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executedQty").toString())); + } + if ((jsonObj.get("origQuoteOrderQty") != null + && !jsonObj.get("origQuoteOrderQty").isJsonNull()) + && !jsonObj.get("origQuoteOrderQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQuoteOrderQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origQuoteOrderQty").toString())); + } + if ((jsonObj.get("cummulativeQuoteQty") != null + && !jsonObj.get("cummulativeQuoteQty").isJsonNull()) + && !jsonObj.get("cummulativeQuoteQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cummulativeQuoteQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("cummulativeQuoteQty").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) + && !jsonObj.get("origQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("origQty").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListOpoResponseOrderReportsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListOpoResponseOrderReportsInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderListOpoResponseOrderReportsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, OrderListOpoResponseOrderReportsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListOpoResponseOrderReportsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListOpoResponseOrderReportsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListOpoResponseOrderReportsInner + * @throws IOException if the JSON string is invalid with respect to + * OrderListOpoResponseOrderReportsInner + */ + public static OrderListOpoResponseOrderReportsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListOpoResponseOrderReportsInner.class); + } + + /** + * Convert an instance of OrderListOpoResponseOrderReportsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponseOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponseOrdersInner.java new file mode 100644 index 00000000..4861c045 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpoResponseOrdersInner.java @@ -0,0 +1,290 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** OrderListOpoResponseOrdersInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListOpoResponseOrdersInner { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public OrderListOpoResponseOrdersInner() {} + + public OrderListOpoResponseOrdersInner 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 OrderListOpoResponseOrdersInner orderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderListOpoResponseOrdersInner clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListOpoResponseOrdersInner orderListOpoResponseOrdersInner = + (OrderListOpoResponseOrdersInner) o; + return Objects.equals(this.symbol, orderListOpoResponseOrdersInner.symbol) + && Objects.equals(this.orderId, orderListOpoResponseOrdersInner.orderId) + && Objects.equals( + this.clientOrderId, orderListOpoResponseOrdersInner.clientOrderId); + } + + @Override + public int hashCode() { + return Objects.hash(symbol, orderId, clientOrderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListOpoResponseOrdersInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object clientOrderIdValue = getClientOrderId(); + String clientOrderIdValueAsString = ""; + clientOrderIdValueAsString = clientOrderIdValue.toString(); + sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("clientOrderId"); + + // 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 + * OrderListOpoResponseOrdersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListOpoResponseOrdersInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListOpoResponseOrdersInner is not" + + " found in the empty JSON string", + OrderListOpoResponseOrdersInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListOpoResponseOrdersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListOpoResponseOrdersInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderListOpoResponseOrdersInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListOpoResponseOrdersInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListOpoResponseOrdersInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListOpoResponseOrdersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListOpoResponseOrdersInner + * @throws IOException if the JSON string is invalid with respect to + * OrderListOpoResponseOrdersInner + */ + public static OrderListOpoResponseOrdersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListOpoResponseOrdersInner.class); + } + + /** + * Convert an instance of OrderListOpoResponseOrdersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoRequest.java new file mode 100644 index 00000000..fab9e531 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoRequest.java @@ -0,0 +1,1954 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.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.*; + +/** OrderListOpocoRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListOpocoRequest { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public static final String SERIALIZED_NAME_LIST_CLIENT_ORDER_ID = "listClientOrderId"; + + @SerializedName(SERIALIZED_NAME_LIST_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String listClientOrderId; + + 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_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nonnull + private WorkingType workingType; + + public static final String SERIALIZED_NAME_WORKING_SIDE = "workingSide"; + + @SerializedName(SERIALIZED_NAME_WORKING_SIDE) + @jakarta.annotation.Nonnull + private WorkingSide workingSide; + + public static final String SERIALIZED_NAME_WORKING_CLIENT_ORDER_ID = "workingClientOrderId"; + + @SerializedName(SERIALIZED_NAME_WORKING_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String workingClientOrderId; + + public static final String SERIALIZED_NAME_WORKING_PRICE = "workingPrice"; + + @SerializedName(SERIALIZED_NAME_WORKING_PRICE) + @jakarta.annotation.Nonnull + private Double workingPrice; + + public static final String SERIALIZED_NAME_WORKING_QUANTITY = "workingQuantity"; + + @SerializedName(SERIALIZED_NAME_WORKING_QUANTITY) + @jakarta.annotation.Nonnull + private Double workingQuantity; + + public static final String SERIALIZED_NAME_WORKING_ICEBERG_QTY = "workingIcebergQty"; + + @SerializedName(SERIALIZED_NAME_WORKING_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double workingIcebergQty; + + public static final String SERIALIZED_NAME_WORKING_TIME_IN_FORCE = "workingTimeInForce"; + + @SerializedName(SERIALIZED_NAME_WORKING_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private WorkingTimeInForce workingTimeInForce; + + public static final String SERIALIZED_NAME_WORKING_STRATEGY_ID = "workingStrategyId"; + + @SerializedName(SERIALIZED_NAME_WORKING_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long workingStrategyId; + + public static final String SERIALIZED_NAME_WORKING_STRATEGY_TYPE = "workingStrategyType"; + + @SerializedName(SERIALIZED_NAME_WORKING_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer workingStrategyType; + + public static final String SERIALIZED_NAME_WORKING_PEG_PRICE_TYPE = "workingPegPriceType"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private WorkingPegPriceType workingPegPriceType; + + public static final String SERIALIZED_NAME_WORKING_PEG_OFFSET_TYPE = "workingPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private WorkingPegOffsetType workingPegOffsetType; + + public static final String SERIALIZED_NAME_WORKING_PEG_OFFSET_VALUE = "workingPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer workingPegOffsetValue; + + public static final String SERIALIZED_NAME_PENDING_SIDE = "pendingSide"; + + @SerializedName(SERIALIZED_NAME_PENDING_SIDE) + @jakarta.annotation.Nonnull + private PendingSide pendingSide; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_TYPE = "pendingAboveType"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_TYPE) + @jakarta.annotation.Nonnull + private PendingAboveType pendingAboveType; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_CLIENT_ORDER_ID = + "pendingAboveClientOrderId"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String pendingAboveClientOrderId; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_PRICE = "pendingAbovePrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_PRICE) + @jakarta.annotation.Nullable + private Double pendingAbovePrice; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_STOP_PRICE = "pendingAboveStopPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_STOP_PRICE) + @jakarta.annotation.Nullable + private Double pendingAboveStopPrice; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_TRAILING_DELTA = + "pendingAboveTrailingDelta"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_TRAILING_DELTA) + @jakarta.annotation.Nullable + private Double pendingAboveTrailingDelta; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_ICEBERG_QTY = "pendingAboveIcebergQty"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double pendingAboveIcebergQty; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_TIME_IN_FORCE = + "pendingAboveTimeInForce"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private PendingAboveTimeInForce pendingAboveTimeInForce; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_STRATEGY_ID = "pendingAboveStrategyId"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long pendingAboveStrategyId; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_STRATEGY_TYPE = + "pendingAboveStrategyType"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer pendingAboveStrategyType; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_PEG_PRICE_TYPE = + "pendingAbovePegPriceType"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PendingAbovePegPriceType pendingAbovePegPriceType; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_PEG_OFFSET_TYPE = + "pendingAbovePegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PendingAbovePegOffsetType pendingAbovePegOffsetType; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_PEG_OFFSET_VALUE = + "pendingAbovePegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pendingAbovePegOffsetValue; + + public static final String SERIALIZED_NAME_PENDING_BELOW_TYPE = "pendingBelowType"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_TYPE) + @jakarta.annotation.Nullable + private PendingBelowType pendingBelowType; + + public static final String SERIALIZED_NAME_PENDING_BELOW_CLIENT_ORDER_ID = + "pendingBelowClientOrderId"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String pendingBelowClientOrderId; + + public static final String SERIALIZED_NAME_PENDING_BELOW_PRICE = "pendingBelowPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_PRICE) + @jakarta.annotation.Nullable + private Double pendingBelowPrice; + + public static final String SERIALIZED_NAME_PENDING_BELOW_STOP_PRICE = "pendingBelowStopPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_STOP_PRICE) + @jakarta.annotation.Nullable + private Double pendingBelowStopPrice; + + public static final String SERIALIZED_NAME_PENDING_BELOW_TRAILING_DELTA = + "pendingBelowTrailingDelta"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_TRAILING_DELTA) + @jakarta.annotation.Nullable + private Double pendingBelowTrailingDelta; + + public static final String SERIALIZED_NAME_PENDING_BELOW_ICEBERG_QTY = "pendingBelowIcebergQty"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double pendingBelowIcebergQty; + + public static final String SERIALIZED_NAME_PENDING_BELOW_TIME_IN_FORCE = + "pendingBelowTimeInForce"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private PendingBelowTimeInForce pendingBelowTimeInForce; + + public static final String SERIALIZED_NAME_PENDING_BELOW_STRATEGY_ID = "pendingBelowStrategyId"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long pendingBelowStrategyId; + + public static final String SERIALIZED_NAME_PENDING_BELOW_STRATEGY_TYPE = + "pendingBelowStrategyType"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer pendingBelowStrategyType; + + public static final String SERIALIZED_NAME_PENDING_BELOW_PEG_PRICE_TYPE = + "pendingBelowPegPriceType"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PendingBelowPegPriceType pendingBelowPegPriceType; + + public static final String SERIALIZED_NAME_PENDING_BELOW_PEG_OFFSET_TYPE = + "pendingBelowPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PendingBelowPegOffsetType pendingBelowPegOffsetType; + + public static final String SERIALIZED_NAME_PENDING_BELOW_PEG_OFFSET_VALUE = + "pendingBelowPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pendingBelowPegOffsetValue; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Double recvWindow; + + public OrderListOpocoRequest() {} + + public OrderListOpocoRequest 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 OrderListOpocoRequest listClientOrderId( + @jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + return this; + } + + /** + * Get listClientOrderId + * + * @return listClientOrderId + */ + @jakarta.annotation.Nullable + public String getListClientOrderId() { + return listClientOrderId; + } + + public void setListClientOrderId(@jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + } + + public OrderListOpocoRequest 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 OrderListOpocoRequest 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 OrderListOpocoRequest workingType(@jakarta.annotation.Nonnull WorkingType workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public WorkingType getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nonnull WorkingType workingType) { + this.workingType = workingType; + } + + public OrderListOpocoRequest workingSide(@jakarta.annotation.Nonnull WorkingSide workingSide) { + this.workingSide = workingSide; + return this; + } + + /** + * Get workingSide + * + * @return workingSide + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public WorkingSide getWorkingSide() { + return workingSide; + } + + public void setWorkingSide(@jakarta.annotation.Nonnull WorkingSide workingSide) { + this.workingSide = workingSide; + } + + public OrderListOpocoRequest workingClientOrderId( + @jakarta.annotation.Nullable String workingClientOrderId) { + this.workingClientOrderId = workingClientOrderId; + return this; + } + + /** + * Get workingClientOrderId + * + * @return workingClientOrderId + */ + @jakarta.annotation.Nullable + public String getWorkingClientOrderId() { + return workingClientOrderId; + } + + public void setWorkingClientOrderId(@jakarta.annotation.Nullable String workingClientOrderId) { + this.workingClientOrderId = workingClientOrderId; + } + + public OrderListOpocoRequest workingPrice(@jakarta.annotation.Nonnull Double workingPrice) { + this.workingPrice = workingPrice; + return this; + } + + /** + * Get workingPrice + * + * @return workingPrice + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getWorkingPrice() { + return workingPrice; + } + + public void setWorkingPrice(@jakarta.annotation.Nonnull Double workingPrice) { + this.workingPrice = workingPrice; + } + + public OrderListOpocoRequest workingQuantity( + @jakarta.annotation.Nonnull Double workingQuantity) { + this.workingQuantity = workingQuantity; + return this; + } + + /** + * Get workingQuantity + * + * @return workingQuantity + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getWorkingQuantity() { + return workingQuantity; + } + + public void setWorkingQuantity(@jakarta.annotation.Nonnull Double workingQuantity) { + this.workingQuantity = workingQuantity; + } + + public OrderListOpocoRequest workingIcebergQty( + @jakarta.annotation.Nullable Double workingIcebergQty) { + this.workingIcebergQty = workingIcebergQty; + return this; + } + + /** + * Get workingIcebergQty + * + * @return workingIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getWorkingIcebergQty() { + return workingIcebergQty; + } + + public void setWorkingIcebergQty(@jakarta.annotation.Nullable Double workingIcebergQty) { + this.workingIcebergQty = workingIcebergQty; + } + + public OrderListOpocoRequest workingTimeInForce( + @jakarta.annotation.Nullable WorkingTimeInForce workingTimeInForce) { + this.workingTimeInForce = workingTimeInForce; + return this; + } + + /** + * Get workingTimeInForce + * + * @return workingTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public WorkingTimeInForce getWorkingTimeInForce() { + return workingTimeInForce; + } + + public void setWorkingTimeInForce( + @jakarta.annotation.Nullable WorkingTimeInForce workingTimeInForce) { + this.workingTimeInForce = workingTimeInForce; + } + + public OrderListOpocoRequest workingStrategyId( + @jakarta.annotation.Nullable Long workingStrategyId) { + this.workingStrategyId = workingStrategyId; + return this; + } + + /** + * Get workingStrategyId + * + * @return workingStrategyId + */ + @jakarta.annotation.Nullable + public Long getWorkingStrategyId() { + return workingStrategyId; + } + + public void setWorkingStrategyId(@jakarta.annotation.Nullable Long workingStrategyId) { + this.workingStrategyId = workingStrategyId; + } + + public OrderListOpocoRequest workingStrategyType( + @jakarta.annotation.Nullable Integer workingStrategyType) { + this.workingStrategyType = workingStrategyType; + return this; + } + + /** + * Get workingStrategyType + * + * @return workingStrategyType + */ + @jakarta.annotation.Nullable + public Integer getWorkingStrategyType() { + return workingStrategyType; + } + + public void setWorkingStrategyType(@jakarta.annotation.Nullable Integer workingStrategyType) { + this.workingStrategyType = workingStrategyType; + } + + public OrderListOpocoRequest workingPegPriceType( + @jakarta.annotation.Nullable WorkingPegPriceType workingPegPriceType) { + this.workingPegPriceType = workingPegPriceType; + return this; + } + + /** + * Get workingPegPriceType + * + * @return workingPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingPegPriceType getWorkingPegPriceType() { + return workingPegPriceType; + } + + public void setWorkingPegPriceType( + @jakarta.annotation.Nullable WorkingPegPriceType workingPegPriceType) { + this.workingPegPriceType = workingPegPriceType; + } + + public OrderListOpocoRequest workingPegOffsetType( + @jakarta.annotation.Nullable WorkingPegOffsetType workingPegOffsetType) { + this.workingPegOffsetType = workingPegOffsetType; + return this; + } + + /** + * Get workingPegOffsetType + * + * @return workingPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingPegOffsetType getWorkingPegOffsetType() { + return workingPegOffsetType; + } + + public void setWorkingPegOffsetType( + @jakarta.annotation.Nullable WorkingPegOffsetType workingPegOffsetType) { + this.workingPegOffsetType = workingPegOffsetType; + } + + public OrderListOpocoRequest workingPegOffsetValue( + @jakarta.annotation.Nullable Integer workingPegOffsetValue) { + this.workingPegOffsetValue = workingPegOffsetValue; + return this; + } + + /** + * Get workingPegOffsetValue + * + * @return workingPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getWorkingPegOffsetValue() { + return workingPegOffsetValue; + } + + public void setWorkingPegOffsetValue( + @jakarta.annotation.Nullable Integer workingPegOffsetValue) { + this.workingPegOffsetValue = workingPegOffsetValue; + } + + public OrderListOpocoRequest pendingSide(@jakarta.annotation.Nonnull PendingSide pendingSide) { + this.pendingSide = pendingSide; + return this; + } + + /** + * Get pendingSide + * + * @return pendingSide + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public PendingSide getPendingSide() { + return pendingSide; + } + + public void setPendingSide(@jakarta.annotation.Nonnull PendingSide pendingSide) { + this.pendingSide = pendingSide; + } + + public OrderListOpocoRequest pendingAboveType( + @jakarta.annotation.Nonnull PendingAboveType pendingAboveType) { + this.pendingAboveType = pendingAboveType; + return this; + } + + /** + * Get pendingAboveType + * + * @return pendingAboveType + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public PendingAboveType getPendingAboveType() { + return pendingAboveType; + } + + public void setPendingAboveType(@jakarta.annotation.Nonnull PendingAboveType pendingAboveType) { + this.pendingAboveType = pendingAboveType; + } + + public OrderListOpocoRequest pendingAboveClientOrderId( + @jakarta.annotation.Nullable String pendingAboveClientOrderId) { + this.pendingAboveClientOrderId = pendingAboveClientOrderId; + return this; + } + + /** + * Get pendingAboveClientOrderId + * + * @return pendingAboveClientOrderId + */ + @jakarta.annotation.Nullable + public String getPendingAboveClientOrderId() { + return pendingAboveClientOrderId; + } + + public void setPendingAboveClientOrderId( + @jakarta.annotation.Nullable String pendingAboveClientOrderId) { + this.pendingAboveClientOrderId = pendingAboveClientOrderId; + } + + public OrderListOpocoRequest pendingAbovePrice( + @jakarta.annotation.Nullable Double pendingAbovePrice) { + this.pendingAbovePrice = pendingAbovePrice; + return this; + } + + /** + * Get pendingAbovePrice + * + * @return pendingAbovePrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingAbovePrice() { + return pendingAbovePrice; + } + + public void setPendingAbovePrice(@jakarta.annotation.Nullable Double pendingAbovePrice) { + this.pendingAbovePrice = pendingAbovePrice; + } + + public OrderListOpocoRequest pendingAboveStopPrice( + @jakarta.annotation.Nullable Double pendingAboveStopPrice) { + this.pendingAboveStopPrice = pendingAboveStopPrice; + return this; + } + + /** + * Get pendingAboveStopPrice + * + * @return pendingAboveStopPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingAboveStopPrice() { + return pendingAboveStopPrice; + } + + public void setPendingAboveStopPrice( + @jakarta.annotation.Nullable Double pendingAboveStopPrice) { + this.pendingAboveStopPrice = pendingAboveStopPrice; + } + + public OrderListOpocoRequest pendingAboveTrailingDelta( + @jakarta.annotation.Nullable Double pendingAboveTrailingDelta) { + this.pendingAboveTrailingDelta = pendingAboveTrailingDelta; + return this; + } + + /** + * Get pendingAboveTrailingDelta + * + * @return pendingAboveTrailingDelta + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingAboveTrailingDelta() { + return pendingAboveTrailingDelta; + } + + public void setPendingAboveTrailingDelta( + @jakarta.annotation.Nullable Double pendingAboveTrailingDelta) { + this.pendingAboveTrailingDelta = pendingAboveTrailingDelta; + } + + public OrderListOpocoRequest pendingAboveIcebergQty( + @jakarta.annotation.Nullable Double pendingAboveIcebergQty) { + this.pendingAboveIcebergQty = pendingAboveIcebergQty; + return this; + } + + /** + * Get pendingAboveIcebergQty + * + * @return pendingAboveIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingAboveIcebergQty() { + return pendingAboveIcebergQty; + } + + public void setPendingAboveIcebergQty( + @jakarta.annotation.Nullable Double pendingAboveIcebergQty) { + this.pendingAboveIcebergQty = pendingAboveIcebergQty; + } + + public OrderListOpocoRequest pendingAboveTimeInForce( + @jakarta.annotation.Nullable PendingAboveTimeInForce pendingAboveTimeInForce) { + this.pendingAboveTimeInForce = pendingAboveTimeInForce; + return this; + } + + /** + * Get pendingAboveTimeInForce + * + * @return pendingAboveTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public PendingAboveTimeInForce getPendingAboveTimeInForce() { + return pendingAboveTimeInForce; + } + + public void setPendingAboveTimeInForce( + @jakarta.annotation.Nullable PendingAboveTimeInForce pendingAboveTimeInForce) { + this.pendingAboveTimeInForce = pendingAboveTimeInForce; + } + + public OrderListOpocoRequest pendingAboveStrategyId( + @jakarta.annotation.Nullable Long pendingAboveStrategyId) { + this.pendingAboveStrategyId = pendingAboveStrategyId; + return this; + } + + /** + * Get pendingAboveStrategyId + * + * @return pendingAboveStrategyId + */ + @jakarta.annotation.Nullable + public Long getPendingAboveStrategyId() { + return pendingAboveStrategyId; + } + + public void setPendingAboveStrategyId( + @jakarta.annotation.Nullable Long pendingAboveStrategyId) { + this.pendingAboveStrategyId = pendingAboveStrategyId; + } + + public OrderListOpocoRequest pendingAboveStrategyType( + @jakarta.annotation.Nullable Integer pendingAboveStrategyType) { + this.pendingAboveStrategyType = pendingAboveStrategyType; + return this; + } + + /** + * Get pendingAboveStrategyType + * + * @return pendingAboveStrategyType + */ + @jakarta.annotation.Nullable + public Integer getPendingAboveStrategyType() { + return pendingAboveStrategyType; + } + + public void setPendingAboveStrategyType( + @jakarta.annotation.Nullable Integer pendingAboveStrategyType) { + this.pendingAboveStrategyType = pendingAboveStrategyType; + } + + public OrderListOpocoRequest pendingAbovePegPriceType( + @jakarta.annotation.Nullable PendingAbovePegPriceType pendingAbovePegPriceType) { + this.pendingAbovePegPriceType = pendingAbovePegPriceType; + return this; + } + + /** + * Get pendingAbovePegPriceType + * + * @return pendingAbovePegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PendingAbovePegPriceType getPendingAbovePegPriceType() { + return pendingAbovePegPriceType; + } + + public void setPendingAbovePegPriceType( + @jakarta.annotation.Nullable PendingAbovePegPriceType pendingAbovePegPriceType) { + this.pendingAbovePegPriceType = pendingAbovePegPriceType; + } + + public OrderListOpocoRequest pendingAbovePegOffsetType( + @jakarta.annotation.Nullable PendingAbovePegOffsetType pendingAbovePegOffsetType) { + this.pendingAbovePegOffsetType = pendingAbovePegOffsetType; + return this; + } + + /** + * Get pendingAbovePegOffsetType + * + * @return pendingAbovePegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PendingAbovePegOffsetType getPendingAbovePegOffsetType() { + return pendingAbovePegOffsetType; + } + + public void setPendingAbovePegOffsetType( + @jakarta.annotation.Nullable PendingAbovePegOffsetType pendingAbovePegOffsetType) { + this.pendingAbovePegOffsetType = pendingAbovePegOffsetType; + } + + public OrderListOpocoRequest pendingAbovePegOffsetValue( + @jakarta.annotation.Nullable Integer pendingAbovePegOffsetValue) { + this.pendingAbovePegOffsetValue = pendingAbovePegOffsetValue; + return this; + } + + /** + * Get pendingAbovePegOffsetValue + * + * @return pendingAbovePegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPendingAbovePegOffsetValue() { + return pendingAbovePegOffsetValue; + } + + public void setPendingAbovePegOffsetValue( + @jakarta.annotation.Nullable Integer pendingAbovePegOffsetValue) { + this.pendingAbovePegOffsetValue = pendingAbovePegOffsetValue; + } + + public OrderListOpocoRequest pendingBelowType( + @jakarta.annotation.Nullable PendingBelowType pendingBelowType) { + this.pendingBelowType = pendingBelowType; + return this; + } + + /** + * Get pendingBelowType + * + * @return pendingBelowType + */ + @jakarta.annotation.Nullable + @Valid + public PendingBelowType getPendingBelowType() { + return pendingBelowType; + } + + public void setPendingBelowType( + @jakarta.annotation.Nullable PendingBelowType pendingBelowType) { + this.pendingBelowType = pendingBelowType; + } + + public OrderListOpocoRequest pendingBelowClientOrderId( + @jakarta.annotation.Nullable String pendingBelowClientOrderId) { + this.pendingBelowClientOrderId = pendingBelowClientOrderId; + return this; + } + + /** + * Get pendingBelowClientOrderId + * + * @return pendingBelowClientOrderId + */ + @jakarta.annotation.Nullable + public String getPendingBelowClientOrderId() { + return pendingBelowClientOrderId; + } + + public void setPendingBelowClientOrderId( + @jakarta.annotation.Nullable String pendingBelowClientOrderId) { + this.pendingBelowClientOrderId = pendingBelowClientOrderId; + } + + public OrderListOpocoRequest pendingBelowPrice( + @jakarta.annotation.Nullable Double pendingBelowPrice) { + this.pendingBelowPrice = pendingBelowPrice; + return this; + } + + /** + * Get pendingBelowPrice + * + * @return pendingBelowPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingBelowPrice() { + return pendingBelowPrice; + } + + public void setPendingBelowPrice(@jakarta.annotation.Nullable Double pendingBelowPrice) { + this.pendingBelowPrice = pendingBelowPrice; + } + + public OrderListOpocoRequest pendingBelowStopPrice( + @jakarta.annotation.Nullable Double pendingBelowStopPrice) { + this.pendingBelowStopPrice = pendingBelowStopPrice; + return this; + } + + /** + * Get pendingBelowStopPrice + * + * @return pendingBelowStopPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingBelowStopPrice() { + return pendingBelowStopPrice; + } + + public void setPendingBelowStopPrice( + @jakarta.annotation.Nullable Double pendingBelowStopPrice) { + this.pendingBelowStopPrice = pendingBelowStopPrice; + } + + public OrderListOpocoRequest pendingBelowTrailingDelta( + @jakarta.annotation.Nullable Double pendingBelowTrailingDelta) { + this.pendingBelowTrailingDelta = pendingBelowTrailingDelta; + return this; + } + + /** + * Get pendingBelowTrailingDelta + * + * @return pendingBelowTrailingDelta + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingBelowTrailingDelta() { + return pendingBelowTrailingDelta; + } + + public void setPendingBelowTrailingDelta( + @jakarta.annotation.Nullable Double pendingBelowTrailingDelta) { + this.pendingBelowTrailingDelta = pendingBelowTrailingDelta; + } + + public OrderListOpocoRequest pendingBelowIcebergQty( + @jakarta.annotation.Nullable Double pendingBelowIcebergQty) { + this.pendingBelowIcebergQty = pendingBelowIcebergQty; + return this; + } + + /** + * Get pendingBelowIcebergQty + * + * @return pendingBelowIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingBelowIcebergQty() { + return pendingBelowIcebergQty; + } + + public void setPendingBelowIcebergQty( + @jakarta.annotation.Nullable Double pendingBelowIcebergQty) { + this.pendingBelowIcebergQty = pendingBelowIcebergQty; + } + + public OrderListOpocoRequest pendingBelowTimeInForce( + @jakarta.annotation.Nullable PendingBelowTimeInForce pendingBelowTimeInForce) { + this.pendingBelowTimeInForce = pendingBelowTimeInForce; + return this; + } + + /** + * Get pendingBelowTimeInForce + * + * @return pendingBelowTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public PendingBelowTimeInForce getPendingBelowTimeInForce() { + return pendingBelowTimeInForce; + } + + public void setPendingBelowTimeInForce( + @jakarta.annotation.Nullable PendingBelowTimeInForce pendingBelowTimeInForce) { + this.pendingBelowTimeInForce = pendingBelowTimeInForce; + } + + public OrderListOpocoRequest pendingBelowStrategyId( + @jakarta.annotation.Nullable Long pendingBelowStrategyId) { + this.pendingBelowStrategyId = pendingBelowStrategyId; + return this; + } + + /** + * Get pendingBelowStrategyId + * + * @return pendingBelowStrategyId + */ + @jakarta.annotation.Nullable + public Long getPendingBelowStrategyId() { + return pendingBelowStrategyId; + } + + public void setPendingBelowStrategyId( + @jakarta.annotation.Nullable Long pendingBelowStrategyId) { + this.pendingBelowStrategyId = pendingBelowStrategyId; + } + + public OrderListOpocoRequest pendingBelowStrategyType( + @jakarta.annotation.Nullable Integer pendingBelowStrategyType) { + this.pendingBelowStrategyType = pendingBelowStrategyType; + return this; + } + + /** + * Get pendingBelowStrategyType + * + * @return pendingBelowStrategyType + */ + @jakarta.annotation.Nullable + public Integer getPendingBelowStrategyType() { + return pendingBelowStrategyType; + } + + public void setPendingBelowStrategyType( + @jakarta.annotation.Nullable Integer pendingBelowStrategyType) { + this.pendingBelowStrategyType = pendingBelowStrategyType; + } + + public OrderListOpocoRequest pendingBelowPegPriceType( + @jakarta.annotation.Nullable PendingBelowPegPriceType pendingBelowPegPriceType) { + this.pendingBelowPegPriceType = pendingBelowPegPriceType; + return this; + } + + /** + * Get pendingBelowPegPriceType + * + * @return pendingBelowPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PendingBelowPegPriceType getPendingBelowPegPriceType() { + return pendingBelowPegPriceType; + } + + public void setPendingBelowPegPriceType( + @jakarta.annotation.Nullable PendingBelowPegPriceType pendingBelowPegPriceType) { + this.pendingBelowPegPriceType = pendingBelowPegPriceType; + } + + public OrderListOpocoRequest pendingBelowPegOffsetType( + @jakarta.annotation.Nullable PendingBelowPegOffsetType pendingBelowPegOffsetType) { + this.pendingBelowPegOffsetType = pendingBelowPegOffsetType; + return this; + } + + /** + * Get pendingBelowPegOffsetType + * + * @return pendingBelowPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PendingBelowPegOffsetType getPendingBelowPegOffsetType() { + return pendingBelowPegOffsetType; + } + + public void setPendingBelowPegOffsetType( + @jakarta.annotation.Nullable PendingBelowPegOffsetType pendingBelowPegOffsetType) { + this.pendingBelowPegOffsetType = pendingBelowPegOffsetType; + } + + public OrderListOpocoRequest pendingBelowPegOffsetValue( + @jakarta.annotation.Nullable Integer pendingBelowPegOffsetValue) { + this.pendingBelowPegOffsetValue = pendingBelowPegOffsetValue; + return this; + } + + /** + * Get pendingBelowPegOffsetValue + * + * @return pendingBelowPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPendingBelowPegOffsetValue() { + return pendingBelowPegOffsetValue; + } + + public void setPendingBelowPegOffsetValue( + @jakarta.annotation.Nullable Integer pendingBelowPegOffsetValue) { + this.pendingBelowPegOffsetValue = pendingBelowPegOffsetValue; + } + + public OrderListOpocoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + @Valid + public Double getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListOpocoRequest orderListOpocoRequest = (OrderListOpocoRequest) o; + return Objects.equals(this.symbol, orderListOpocoRequest.symbol) + && Objects.equals(this.listClientOrderId, orderListOpocoRequest.listClientOrderId) + && Objects.equals(this.newOrderRespType, orderListOpocoRequest.newOrderRespType) + && Objects.equals( + this.selfTradePreventionMode, orderListOpocoRequest.selfTradePreventionMode) + && Objects.equals(this.workingType, orderListOpocoRequest.workingType) + && Objects.equals(this.workingSide, orderListOpocoRequest.workingSide) + && Objects.equals( + this.workingClientOrderId, orderListOpocoRequest.workingClientOrderId) + && Objects.equals(this.workingPrice, orderListOpocoRequest.workingPrice) + && Objects.equals(this.workingQuantity, orderListOpocoRequest.workingQuantity) + && Objects.equals(this.workingIcebergQty, orderListOpocoRequest.workingIcebergQty) + && Objects.equals(this.workingTimeInForce, orderListOpocoRequest.workingTimeInForce) + && Objects.equals(this.workingStrategyId, orderListOpocoRequest.workingStrategyId) + && Objects.equals( + this.workingStrategyType, orderListOpocoRequest.workingStrategyType) + && Objects.equals( + this.workingPegPriceType, orderListOpocoRequest.workingPegPriceType) + && Objects.equals( + this.workingPegOffsetType, orderListOpocoRequest.workingPegOffsetType) + && Objects.equals( + this.workingPegOffsetValue, orderListOpocoRequest.workingPegOffsetValue) + && Objects.equals(this.pendingSide, orderListOpocoRequest.pendingSide) + && Objects.equals(this.pendingAboveType, orderListOpocoRequest.pendingAboveType) + && Objects.equals( + this.pendingAboveClientOrderId, + orderListOpocoRequest.pendingAboveClientOrderId) + && Objects.equals(this.pendingAbovePrice, orderListOpocoRequest.pendingAbovePrice) + && Objects.equals( + this.pendingAboveStopPrice, orderListOpocoRequest.pendingAboveStopPrice) + && Objects.equals( + this.pendingAboveTrailingDelta, + orderListOpocoRequest.pendingAboveTrailingDelta) + && Objects.equals( + this.pendingAboveIcebergQty, orderListOpocoRequest.pendingAboveIcebergQty) + && Objects.equals( + this.pendingAboveTimeInForce, orderListOpocoRequest.pendingAboveTimeInForce) + && Objects.equals( + this.pendingAboveStrategyId, orderListOpocoRequest.pendingAboveStrategyId) + && Objects.equals( + this.pendingAboveStrategyType, + orderListOpocoRequest.pendingAboveStrategyType) + && Objects.equals( + this.pendingAbovePegPriceType, + orderListOpocoRequest.pendingAbovePegPriceType) + && Objects.equals( + this.pendingAbovePegOffsetType, + orderListOpocoRequest.pendingAbovePegOffsetType) + && Objects.equals( + this.pendingAbovePegOffsetValue, + orderListOpocoRequest.pendingAbovePegOffsetValue) + && Objects.equals(this.pendingBelowType, orderListOpocoRequest.pendingBelowType) + && Objects.equals( + this.pendingBelowClientOrderId, + orderListOpocoRequest.pendingBelowClientOrderId) + && Objects.equals(this.pendingBelowPrice, orderListOpocoRequest.pendingBelowPrice) + && Objects.equals( + this.pendingBelowStopPrice, orderListOpocoRequest.pendingBelowStopPrice) + && Objects.equals( + this.pendingBelowTrailingDelta, + orderListOpocoRequest.pendingBelowTrailingDelta) + && Objects.equals( + this.pendingBelowIcebergQty, orderListOpocoRequest.pendingBelowIcebergQty) + && Objects.equals( + this.pendingBelowTimeInForce, orderListOpocoRequest.pendingBelowTimeInForce) + && Objects.equals( + this.pendingBelowStrategyId, orderListOpocoRequest.pendingBelowStrategyId) + && Objects.equals( + this.pendingBelowStrategyType, + orderListOpocoRequest.pendingBelowStrategyType) + && Objects.equals( + this.pendingBelowPegPriceType, + orderListOpocoRequest.pendingBelowPegPriceType) + && Objects.equals( + this.pendingBelowPegOffsetType, + orderListOpocoRequest.pendingBelowPegOffsetType) + && Objects.equals( + this.pendingBelowPegOffsetValue, + orderListOpocoRequest.pendingBelowPegOffsetValue) + && Objects.equals(this.recvWindow, orderListOpocoRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + listClientOrderId, + newOrderRespType, + selfTradePreventionMode, + workingType, + workingSide, + workingClientOrderId, + workingPrice, + workingQuantity, + workingIcebergQty, + workingTimeInForce, + workingStrategyId, + workingStrategyType, + workingPegPriceType, + workingPegOffsetType, + workingPegOffsetValue, + pendingSide, + pendingAboveType, + pendingAboveClientOrderId, + pendingAbovePrice, + pendingAboveStopPrice, + pendingAboveTrailingDelta, + pendingAboveIcebergQty, + pendingAboveTimeInForce, + pendingAboveStrategyId, + pendingAboveStrategyType, + pendingAbovePegPriceType, + pendingAbovePegOffsetType, + pendingAbovePegOffsetValue, + pendingBelowType, + pendingBelowClientOrderId, + pendingBelowPrice, + pendingBelowStopPrice, + pendingBelowTrailingDelta, + pendingBelowIcebergQty, + pendingBelowTimeInForce, + pendingBelowStrategyId, + pendingBelowStrategyType, + pendingBelowPegPriceType, + pendingBelowPegOffsetType, + pendingBelowPegOffsetValue, + recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListOpocoRequest {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" listClientOrderId: ").append(toIndentedString(listClientOrderId)).append("\n"); + sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" workingSide: ").append(toIndentedString(workingSide)).append("\n"); + sb.append(" workingClientOrderId: ") + .append(toIndentedString(workingClientOrderId)) + .append("\n"); + sb.append(" workingPrice: ").append(toIndentedString(workingPrice)).append("\n"); + sb.append(" workingQuantity: ").append(toIndentedString(workingQuantity)).append("\n"); + sb.append(" workingIcebergQty: ").append(toIndentedString(workingIcebergQty)).append("\n"); + sb.append(" workingTimeInForce: ") + .append(toIndentedString(workingTimeInForce)) + .append("\n"); + sb.append(" workingStrategyId: ").append(toIndentedString(workingStrategyId)).append("\n"); + sb.append(" workingStrategyType: ") + .append(toIndentedString(workingStrategyType)) + .append("\n"); + sb.append(" workingPegPriceType: ") + .append(toIndentedString(workingPegPriceType)) + .append("\n"); + sb.append(" workingPegOffsetType: ") + .append(toIndentedString(workingPegOffsetType)) + .append("\n"); + sb.append(" workingPegOffsetValue: ") + .append(toIndentedString(workingPegOffsetValue)) + .append("\n"); + sb.append(" pendingSide: ").append(toIndentedString(pendingSide)).append("\n"); + sb.append(" pendingAboveType: ").append(toIndentedString(pendingAboveType)).append("\n"); + sb.append(" pendingAboveClientOrderId: ") + .append(toIndentedString(pendingAboveClientOrderId)) + .append("\n"); + sb.append(" pendingAbovePrice: ").append(toIndentedString(pendingAbovePrice)).append("\n"); + sb.append(" pendingAboveStopPrice: ") + .append(toIndentedString(pendingAboveStopPrice)) + .append("\n"); + sb.append(" pendingAboveTrailingDelta: ") + .append(toIndentedString(pendingAboveTrailingDelta)) + .append("\n"); + sb.append(" pendingAboveIcebergQty: ") + .append(toIndentedString(pendingAboveIcebergQty)) + .append("\n"); + sb.append(" pendingAboveTimeInForce: ") + .append(toIndentedString(pendingAboveTimeInForce)) + .append("\n"); + sb.append(" pendingAboveStrategyId: ") + .append(toIndentedString(pendingAboveStrategyId)) + .append("\n"); + sb.append(" pendingAboveStrategyType: ") + .append(toIndentedString(pendingAboveStrategyType)) + .append("\n"); + sb.append(" pendingAbovePegPriceType: ") + .append(toIndentedString(pendingAbovePegPriceType)) + .append("\n"); + sb.append(" pendingAbovePegOffsetType: ") + .append(toIndentedString(pendingAbovePegOffsetType)) + .append("\n"); + sb.append(" pendingAbovePegOffsetValue: ") + .append(toIndentedString(pendingAbovePegOffsetValue)) + .append("\n"); + sb.append(" pendingBelowType: ").append(toIndentedString(pendingBelowType)).append("\n"); + sb.append(" pendingBelowClientOrderId: ") + .append(toIndentedString(pendingBelowClientOrderId)) + .append("\n"); + sb.append(" pendingBelowPrice: ").append(toIndentedString(pendingBelowPrice)).append("\n"); + sb.append(" pendingBelowStopPrice: ") + .append(toIndentedString(pendingBelowStopPrice)) + .append("\n"); + sb.append(" pendingBelowTrailingDelta: ") + .append(toIndentedString(pendingBelowTrailingDelta)) + .append("\n"); + sb.append(" pendingBelowIcebergQty: ") + .append(toIndentedString(pendingBelowIcebergQty)) + .append("\n"); + sb.append(" pendingBelowTimeInForce: ") + .append(toIndentedString(pendingBelowTimeInForce)) + .append("\n"); + sb.append(" pendingBelowStrategyId: ") + .append(toIndentedString(pendingBelowStrategyId)) + .append("\n"); + sb.append(" pendingBelowStrategyType: ") + .append(toIndentedString(pendingBelowStrategyType)) + .append("\n"); + sb.append(" pendingBelowPegPriceType: ") + .append(toIndentedString(pendingBelowPegPriceType)) + .append("\n"); + sb.append(" pendingBelowPegOffsetType: ") + .append(toIndentedString(pendingBelowPegOffsetType)) + .append("\n"); + sb.append(" pendingBelowPegOffsetValue: ") + .append(toIndentedString(pendingBelowPegOffsetValue)) + .append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object listClientOrderIdValue = getListClientOrderId(); + String listClientOrderIdValueAsString = ""; + listClientOrderIdValueAsString = listClientOrderIdValue.toString(); + sb.append("listClientOrderId=") + .append(urlEncode(listClientOrderIdValueAsString)) + .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 workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object workingSideValue = getWorkingSide(); + String workingSideValueAsString = ""; + workingSideValueAsString = workingSideValue.toString(); + sb.append("workingSide=").append(urlEncode(workingSideValueAsString)).append(""); + Object workingClientOrderIdValue = getWorkingClientOrderId(); + String workingClientOrderIdValueAsString = ""; + workingClientOrderIdValueAsString = workingClientOrderIdValue.toString(); + sb.append("workingClientOrderId=") + .append(urlEncode(workingClientOrderIdValueAsString)) + .append(""); + Object workingPriceValue = getWorkingPrice(); + String workingPriceValueAsString = ""; + workingPriceValueAsString = workingPriceValue.toString(); + sb.append("workingPrice=").append(urlEncode(workingPriceValueAsString)).append(""); + Object workingQuantityValue = getWorkingQuantity(); + String workingQuantityValueAsString = ""; + workingQuantityValueAsString = workingQuantityValue.toString(); + sb.append("workingQuantity=").append(urlEncode(workingQuantityValueAsString)).append(""); + Object workingIcebergQtyValue = getWorkingIcebergQty(); + String workingIcebergQtyValueAsString = ""; + workingIcebergQtyValueAsString = workingIcebergQtyValue.toString(); + sb.append("workingIcebergQty=") + .append(urlEncode(workingIcebergQtyValueAsString)) + .append(""); + Object workingTimeInForceValue = getWorkingTimeInForce(); + String workingTimeInForceValueAsString = ""; + workingTimeInForceValueAsString = workingTimeInForceValue.toString(); + sb.append("workingTimeInForce=") + .append(urlEncode(workingTimeInForceValueAsString)) + .append(""); + Object workingStrategyIdValue = getWorkingStrategyId(); + String workingStrategyIdValueAsString = ""; + workingStrategyIdValueAsString = workingStrategyIdValue.toString(); + sb.append("workingStrategyId=") + .append(urlEncode(workingStrategyIdValueAsString)) + .append(""); + Object workingStrategyTypeValue = getWorkingStrategyType(); + String workingStrategyTypeValueAsString = ""; + workingStrategyTypeValueAsString = workingStrategyTypeValue.toString(); + sb.append("workingStrategyType=") + .append(urlEncode(workingStrategyTypeValueAsString)) + .append(""); + Object workingPegPriceTypeValue = getWorkingPegPriceType(); + String workingPegPriceTypeValueAsString = ""; + workingPegPriceTypeValueAsString = workingPegPriceTypeValue.toString(); + sb.append("workingPegPriceType=") + .append(urlEncode(workingPegPriceTypeValueAsString)) + .append(""); + Object workingPegOffsetTypeValue = getWorkingPegOffsetType(); + String workingPegOffsetTypeValueAsString = ""; + workingPegOffsetTypeValueAsString = workingPegOffsetTypeValue.toString(); + sb.append("workingPegOffsetType=") + .append(urlEncode(workingPegOffsetTypeValueAsString)) + .append(""); + Object workingPegOffsetValueValue = getWorkingPegOffsetValue(); + String workingPegOffsetValueValueAsString = ""; + workingPegOffsetValueValueAsString = workingPegOffsetValueValue.toString(); + sb.append("workingPegOffsetValue=") + .append(urlEncode(workingPegOffsetValueValueAsString)) + .append(""); + Object pendingSideValue = getPendingSide(); + String pendingSideValueAsString = ""; + pendingSideValueAsString = pendingSideValue.toString(); + sb.append("pendingSide=").append(urlEncode(pendingSideValueAsString)).append(""); + Object pendingAboveTypeValue = getPendingAboveType(); + String pendingAboveTypeValueAsString = ""; + pendingAboveTypeValueAsString = pendingAboveTypeValue.toString(); + sb.append("pendingAboveType=").append(urlEncode(pendingAboveTypeValueAsString)).append(""); + Object pendingAboveClientOrderIdValue = getPendingAboveClientOrderId(); + String pendingAboveClientOrderIdValueAsString = ""; + pendingAboveClientOrderIdValueAsString = pendingAboveClientOrderIdValue.toString(); + sb.append("pendingAboveClientOrderId=") + .append(urlEncode(pendingAboveClientOrderIdValueAsString)) + .append(""); + Object pendingAbovePriceValue = getPendingAbovePrice(); + String pendingAbovePriceValueAsString = ""; + pendingAbovePriceValueAsString = pendingAbovePriceValue.toString(); + sb.append("pendingAbovePrice=") + .append(urlEncode(pendingAbovePriceValueAsString)) + .append(""); + Object pendingAboveStopPriceValue = getPendingAboveStopPrice(); + String pendingAboveStopPriceValueAsString = ""; + pendingAboveStopPriceValueAsString = pendingAboveStopPriceValue.toString(); + sb.append("pendingAboveStopPrice=") + .append(urlEncode(pendingAboveStopPriceValueAsString)) + .append(""); + Object pendingAboveTrailingDeltaValue = getPendingAboveTrailingDelta(); + String pendingAboveTrailingDeltaValueAsString = ""; + pendingAboveTrailingDeltaValueAsString = pendingAboveTrailingDeltaValue.toString(); + sb.append("pendingAboveTrailingDelta=") + .append(urlEncode(pendingAboveTrailingDeltaValueAsString)) + .append(""); + Object pendingAboveIcebergQtyValue = getPendingAboveIcebergQty(); + String pendingAboveIcebergQtyValueAsString = ""; + pendingAboveIcebergQtyValueAsString = pendingAboveIcebergQtyValue.toString(); + sb.append("pendingAboveIcebergQty=") + .append(urlEncode(pendingAboveIcebergQtyValueAsString)) + .append(""); + Object pendingAboveTimeInForceValue = getPendingAboveTimeInForce(); + String pendingAboveTimeInForceValueAsString = ""; + pendingAboveTimeInForceValueAsString = pendingAboveTimeInForceValue.toString(); + sb.append("pendingAboveTimeInForce=") + .append(urlEncode(pendingAboveTimeInForceValueAsString)) + .append(""); + Object pendingAboveStrategyIdValue = getPendingAboveStrategyId(); + String pendingAboveStrategyIdValueAsString = ""; + pendingAboveStrategyIdValueAsString = pendingAboveStrategyIdValue.toString(); + sb.append("pendingAboveStrategyId=") + .append(urlEncode(pendingAboveStrategyIdValueAsString)) + .append(""); + Object pendingAboveStrategyTypeValue = getPendingAboveStrategyType(); + String pendingAboveStrategyTypeValueAsString = ""; + pendingAboveStrategyTypeValueAsString = pendingAboveStrategyTypeValue.toString(); + sb.append("pendingAboveStrategyType=") + .append(urlEncode(pendingAboveStrategyTypeValueAsString)) + .append(""); + Object pendingAbovePegPriceTypeValue = getPendingAbovePegPriceType(); + String pendingAbovePegPriceTypeValueAsString = ""; + pendingAbovePegPriceTypeValueAsString = pendingAbovePegPriceTypeValue.toString(); + sb.append("pendingAbovePegPriceType=") + .append(urlEncode(pendingAbovePegPriceTypeValueAsString)) + .append(""); + Object pendingAbovePegOffsetTypeValue = getPendingAbovePegOffsetType(); + String pendingAbovePegOffsetTypeValueAsString = ""; + pendingAbovePegOffsetTypeValueAsString = pendingAbovePegOffsetTypeValue.toString(); + sb.append("pendingAbovePegOffsetType=") + .append(urlEncode(pendingAbovePegOffsetTypeValueAsString)) + .append(""); + Object pendingAbovePegOffsetValueValue = getPendingAbovePegOffsetValue(); + String pendingAbovePegOffsetValueValueAsString = ""; + pendingAbovePegOffsetValueValueAsString = pendingAbovePegOffsetValueValue.toString(); + sb.append("pendingAbovePegOffsetValue=") + .append(urlEncode(pendingAbovePegOffsetValueValueAsString)) + .append(""); + Object pendingBelowTypeValue = getPendingBelowType(); + String pendingBelowTypeValueAsString = ""; + pendingBelowTypeValueAsString = pendingBelowTypeValue.toString(); + sb.append("pendingBelowType=").append(urlEncode(pendingBelowTypeValueAsString)).append(""); + Object pendingBelowClientOrderIdValue = getPendingBelowClientOrderId(); + String pendingBelowClientOrderIdValueAsString = ""; + pendingBelowClientOrderIdValueAsString = pendingBelowClientOrderIdValue.toString(); + sb.append("pendingBelowClientOrderId=") + .append(urlEncode(pendingBelowClientOrderIdValueAsString)) + .append(""); + Object pendingBelowPriceValue = getPendingBelowPrice(); + String pendingBelowPriceValueAsString = ""; + pendingBelowPriceValueAsString = pendingBelowPriceValue.toString(); + sb.append("pendingBelowPrice=") + .append(urlEncode(pendingBelowPriceValueAsString)) + .append(""); + Object pendingBelowStopPriceValue = getPendingBelowStopPrice(); + String pendingBelowStopPriceValueAsString = ""; + pendingBelowStopPriceValueAsString = pendingBelowStopPriceValue.toString(); + sb.append("pendingBelowStopPrice=") + .append(urlEncode(pendingBelowStopPriceValueAsString)) + .append(""); + Object pendingBelowTrailingDeltaValue = getPendingBelowTrailingDelta(); + String pendingBelowTrailingDeltaValueAsString = ""; + pendingBelowTrailingDeltaValueAsString = pendingBelowTrailingDeltaValue.toString(); + sb.append("pendingBelowTrailingDelta=") + .append(urlEncode(pendingBelowTrailingDeltaValueAsString)) + .append(""); + Object pendingBelowIcebergQtyValue = getPendingBelowIcebergQty(); + String pendingBelowIcebergQtyValueAsString = ""; + pendingBelowIcebergQtyValueAsString = pendingBelowIcebergQtyValue.toString(); + sb.append("pendingBelowIcebergQty=") + .append(urlEncode(pendingBelowIcebergQtyValueAsString)) + .append(""); + Object pendingBelowTimeInForceValue = getPendingBelowTimeInForce(); + String pendingBelowTimeInForceValueAsString = ""; + pendingBelowTimeInForceValueAsString = pendingBelowTimeInForceValue.toString(); + sb.append("pendingBelowTimeInForce=") + .append(urlEncode(pendingBelowTimeInForceValueAsString)) + .append(""); + Object pendingBelowStrategyIdValue = getPendingBelowStrategyId(); + String pendingBelowStrategyIdValueAsString = ""; + pendingBelowStrategyIdValueAsString = pendingBelowStrategyIdValue.toString(); + sb.append("pendingBelowStrategyId=") + .append(urlEncode(pendingBelowStrategyIdValueAsString)) + .append(""); + Object pendingBelowStrategyTypeValue = getPendingBelowStrategyType(); + String pendingBelowStrategyTypeValueAsString = ""; + pendingBelowStrategyTypeValueAsString = pendingBelowStrategyTypeValue.toString(); + sb.append("pendingBelowStrategyType=") + .append(urlEncode(pendingBelowStrategyTypeValueAsString)) + .append(""); + Object pendingBelowPegPriceTypeValue = getPendingBelowPegPriceType(); + String pendingBelowPegPriceTypeValueAsString = ""; + pendingBelowPegPriceTypeValueAsString = pendingBelowPegPriceTypeValue.toString(); + sb.append("pendingBelowPegPriceType=") + .append(urlEncode(pendingBelowPegPriceTypeValueAsString)) + .append(""); + Object pendingBelowPegOffsetTypeValue = getPendingBelowPegOffsetType(); + String pendingBelowPegOffsetTypeValueAsString = ""; + pendingBelowPegOffsetTypeValueAsString = pendingBelowPegOffsetTypeValue.toString(); + sb.append("pendingBelowPegOffsetType=") + .append(urlEncode(pendingBelowPegOffsetTypeValueAsString)) + .append(""); + Object pendingBelowPegOffsetValueValue = getPendingBelowPegOffsetValue(); + String pendingBelowPegOffsetValueValueAsString = ""; + pendingBelowPegOffsetValueValueAsString = pendingBelowPegOffsetValueValue.toString(); + sb.append("pendingBelowPegOffsetValue=") + .append(urlEncode(pendingBelowPegOffsetValueValueAsString)) + .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("symbol"); + openapiFields.add("listClientOrderId"); + openapiFields.add("newOrderRespType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("workingSide"); + openapiFields.add("workingClientOrderId"); + openapiFields.add("workingPrice"); + openapiFields.add("workingQuantity"); + openapiFields.add("workingIcebergQty"); + openapiFields.add("workingTimeInForce"); + openapiFields.add("workingStrategyId"); + openapiFields.add("workingStrategyType"); + openapiFields.add("workingPegPriceType"); + openapiFields.add("workingPegOffsetType"); + openapiFields.add("workingPegOffsetValue"); + openapiFields.add("pendingSide"); + openapiFields.add("pendingAboveType"); + openapiFields.add("pendingAboveClientOrderId"); + openapiFields.add("pendingAbovePrice"); + openapiFields.add("pendingAboveStopPrice"); + openapiFields.add("pendingAboveTrailingDelta"); + openapiFields.add("pendingAboveIcebergQty"); + openapiFields.add("pendingAboveTimeInForce"); + openapiFields.add("pendingAboveStrategyId"); + openapiFields.add("pendingAboveStrategyType"); + openapiFields.add("pendingAbovePegPriceType"); + openapiFields.add("pendingAbovePegOffsetType"); + openapiFields.add("pendingAbovePegOffsetValue"); + openapiFields.add("pendingBelowType"); + openapiFields.add("pendingBelowClientOrderId"); + openapiFields.add("pendingBelowPrice"); + openapiFields.add("pendingBelowStopPrice"); + openapiFields.add("pendingBelowTrailingDelta"); + openapiFields.add("pendingBelowIcebergQty"); + openapiFields.add("pendingBelowTimeInForce"); + openapiFields.add("pendingBelowStrategyId"); + openapiFields.add("pendingBelowStrategyType"); + openapiFields.add("pendingBelowPegPriceType"); + openapiFields.add("pendingBelowPegOffsetType"); + openapiFields.add("pendingBelowPegOffsetValue"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("symbol"); + openapiRequiredFields.add("workingType"); + openapiRequiredFields.add("workingSide"); + openapiRequiredFields.add("workingPrice"); + openapiRequiredFields.add("workingQuantity"); + openapiRequiredFields.add("pendingSide"); + openapiRequiredFields.add("pendingAboveType"); + } + + /** + * 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 OrderListOpocoRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListOpocoRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListOpocoRequest is not found in" + + " the empty JSON string", + OrderListOpocoRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrderListOpocoRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("listClientOrderId") != null + && !jsonObj.get("listClientOrderId").isJsonNull()) + && !jsonObj.get("listClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listClientOrderId").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")); + } + // validate the required field `workingType` + WorkingType.validateJsonElement(jsonObj.get("workingType")); + // validate the required field `workingSide` + WorkingSide.validateJsonElement(jsonObj.get("workingSide")); + if ((jsonObj.get("workingClientOrderId") != null + && !jsonObj.get("workingClientOrderId").isJsonNull()) + && !jsonObj.get("workingClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingClientOrderId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("workingClientOrderId").toString())); + } + // validate the optional field `workingTimeInForce` + if (jsonObj.get("workingTimeInForce") != null + && !jsonObj.get("workingTimeInForce").isJsonNull()) { + WorkingTimeInForce.validateJsonElement(jsonObj.get("workingTimeInForce")); + } + // validate the optional field `workingPegPriceType` + if (jsonObj.get("workingPegPriceType") != null + && !jsonObj.get("workingPegPriceType").isJsonNull()) { + WorkingPegPriceType.validateJsonElement(jsonObj.get("workingPegPriceType")); + } + // validate the optional field `workingPegOffsetType` + if (jsonObj.get("workingPegOffsetType") != null + && !jsonObj.get("workingPegOffsetType").isJsonNull()) { + WorkingPegOffsetType.validateJsonElement(jsonObj.get("workingPegOffsetType")); + } + // validate the required field `pendingSide` + PendingSide.validateJsonElement(jsonObj.get("pendingSide")); + // validate the required field `pendingAboveType` + PendingAboveType.validateJsonElement(jsonObj.get("pendingAboveType")); + if ((jsonObj.get("pendingAboveClientOrderId") != null + && !jsonObj.get("pendingAboveClientOrderId").isJsonNull()) + && !jsonObj.get("pendingAboveClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pendingAboveClientOrderId` to be a primitive type" + + " in the JSON string but got `%s`", + jsonObj.get("pendingAboveClientOrderId").toString())); + } + // validate the optional field `pendingAboveTimeInForce` + if (jsonObj.get("pendingAboveTimeInForce") != null + && !jsonObj.get("pendingAboveTimeInForce").isJsonNull()) { + PendingAboveTimeInForce.validateJsonElement(jsonObj.get("pendingAboveTimeInForce")); + } + // validate the optional field `pendingAbovePegPriceType` + if (jsonObj.get("pendingAbovePegPriceType") != null + && !jsonObj.get("pendingAbovePegPriceType").isJsonNull()) { + PendingAbovePegPriceType.validateJsonElement(jsonObj.get("pendingAbovePegPriceType")); + } + // validate the optional field `pendingAbovePegOffsetType` + if (jsonObj.get("pendingAbovePegOffsetType") != null + && !jsonObj.get("pendingAbovePegOffsetType").isJsonNull()) { + PendingAbovePegOffsetType.validateJsonElement(jsonObj.get("pendingAbovePegOffsetType")); + } + // validate the optional field `pendingBelowType` + if (jsonObj.get("pendingBelowType") != null + && !jsonObj.get("pendingBelowType").isJsonNull()) { + PendingBelowType.validateJsonElement(jsonObj.get("pendingBelowType")); + } + if ((jsonObj.get("pendingBelowClientOrderId") != null + && !jsonObj.get("pendingBelowClientOrderId").isJsonNull()) + && !jsonObj.get("pendingBelowClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pendingBelowClientOrderId` to be a primitive type" + + " in the JSON string but got `%s`", + jsonObj.get("pendingBelowClientOrderId").toString())); + } + // validate the optional field `pendingBelowTimeInForce` + if (jsonObj.get("pendingBelowTimeInForce") != null + && !jsonObj.get("pendingBelowTimeInForce").isJsonNull()) { + PendingBelowTimeInForce.validateJsonElement(jsonObj.get("pendingBelowTimeInForce")); + } + // validate the optional field `pendingBelowPegPriceType` + if (jsonObj.get("pendingBelowPegPriceType") != null + && !jsonObj.get("pendingBelowPegPriceType").isJsonNull()) { + PendingBelowPegPriceType.validateJsonElement(jsonObj.get("pendingBelowPegPriceType")); + } + // validate the optional field `pendingBelowPegOffsetType` + if (jsonObj.get("pendingBelowPegOffsetType") != null + && !jsonObj.get("pendingBelowPegOffsetType").isJsonNull()) { + PendingBelowPegOffsetType.validateJsonElement(jsonObj.get("pendingBelowPegOffsetType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListOpocoRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListOpocoRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderListOpocoRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListOpocoRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListOpocoRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListOpocoRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListOpocoRequest + * @throws IOException if the JSON string is invalid with respect to OrderListOpocoRequest + */ + public static OrderListOpocoRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListOpocoRequest.class); + } + + /** + * Convert an instance of OrderListOpocoRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponse.java new file mode 100644 index 00000000..a2065fb6 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponse.java @@ -0,0 +1,591 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListOpocoResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListOpocoResponse { + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CONTINGENCY_TYPE = "contingencyType"; + + @SerializedName(SERIALIZED_NAME_CONTINGENCY_TYPE) + @jakarta.annotation.Nullable + private String contingencyType; + + public static final String SERIALIZED_NAME_LIST_STATUS_TYPE = "listStatusType"; + + @SerializedName(SERIALIZED_NAME_LIST_STATUS_TYPE) + @jakarta.annotation.Nullable + private String listStatusType; + + public static final String SERIALIZED_NAME_LIST_ORDER_STATUS = "listOrderStatus"; + + @SerializedName(SERIALIZED_NAME_LIST_ORDER_STATUS) + @jakarta.annotation.Nullable + private String listOrderStatus; + + public static final String SERIALIZED_NAME_LIST_CLIENT_ORDER_ID = "listClientOrderId"; + + @SerializedName(SERIALIZED_NAME_LIST_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String listClientOrderId; + + public static final String SERIALIZED_NAME_TRANSACTION_TIME = "transactionTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACTION_TIME) + @jakarta.annotation.Nullable + private Long transactionTime; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDERS = "orders"; + + @SerializedName(SERIALIZED_NAME_ORDERS) + @jakarta.annotation.Nullable + private List<@Valid OrderListOpocoResponseOrdersInner> orders; + + public static final String SERIALIZED_NAME_ORDER_REPORTS = "orderReports"; + + @SerializedName(SERIALIZED_NAME_ORDER_REPORTS) + @jakarta.annotation.Nullable + private List<@Valid OrderListOpocoResponseOrderReportsInner> orderReports; + + public OrderListOpocoResponse() {} + + public OrderListOpocoResponse orderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderListOpocoResponse contingencyType( + @jakarta.annotation.Nullable String contingencyType) { + this.contingencyType = contingencyType; + return this; + } + + /** + * Get contingencyType + * + * @return contingencyType + */ + @jakarta.annotation.Nullable + public String getContingencyType() { + return contingencyType; + } + + public void setContingencyType(@jakarta.annotation.Nullable String contingencyType) { + this.contingencyType = contingencyType; + } + + public OrderListOpocoResponse listStatusType( + @jakarta.annotation.Nullable String listStatusType) { + this.listStatusType = listStatusType; + return this; + } + + /** + * Get listStatusType + * + * @return listStatusType + */ + @jakarta.annotation.Nullable + public String getListStatusType() { + return listStatusType; + } + + public void setListStatusType(@jakarta.annotation.Nullable String listStatusType) { + this.listStatusType = listStatusType; + } + + public OrderListOpocoResponse listOrderStatus( + @jakarta.annotation.Nullable String listOrderStatus) { + this.listOrderStatus = listOrderStatus; + return this; + } + + /** + * Get listOrderStatus + * + * @return listOrderStatus + */ + @jakarta.annotation.Nullable + public String getListOrderStatus() { + return listOrderStatus; + } + + public void setListOrderStatus(@jakarta.annotation.Nullable String listOrderStatus) { + this.listOrderStatus = listOrderStatus; + } + + public OrderListOpocoResponse listClientOrderId( + @jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + return this; + } + + /** + * Get listClientOrderId + * + * @return listClientOrderId + */ + @jakarta.annotation.Nullable + public String getListClientOrderId() { + return listClientOrderId; + } + + public void setListClientOrderId(@jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + } + + public OrderListOpocoResponse transactionTime( + @jakarta.annotation.Nullable Long transactionTime) { + this.transactionTime = transactionTime; + return this; + } + + /** + * Get transactionTime + * + * @return transactionTime + */ + @jakarta.annotation.Nullable + public Long getTransactionTime() { + return transactionTime; + } + + public void setTransactionTime(@jakarta.annotation.Nullable Long transactionTime) { + this.transactionTime = transactionTime; + } + + public OrderListOpocoResponse 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 OrderListOpocoResponse orders( + @jakarta.annotation.Nullable List<@Valid OrderListOpocoResponseOrdersInner> orders) { + this.orders = orders; + return this; + } + + public OrderListOpocoResponse addOrdersItem(OrderListOpocoResponseOrdersInner ordersItem) { + if (this.orders == null) { + this.orders = new ArrayList<>(); + } + this.orders.add(ordersItem); + return this; + } + + /** + * Get orders + * + * @return orders + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OrderListOpocoResponseOrdersInner> getOrders() { + return orders; + } + + public void setOrders( + @jakarta.annotation.Nullable List<@Valid OrderListOpocoResponseOrdersInner> orders) { + this.orders = orders; + } + + public OrderListOpocoResponse orderReports( + @jakarta.annotation.Nullable + List<@Valid OrderListOpocoResponseOrderReportsInner> orderReports) { + this.orderReports = orderReports; + return this; + } + + public OrderListOpocoResponse addOrderReportsItem( + OrderListOpocoResponseOrderReportsInner orderReportsItem) { + if (this.orderReports == null) { + this.orderReports = new ArrayList<>(); + } + this.orderReports.add(orderReportsItem); + return this; + } + + /** + * Get orderReports + * + * @return orderReports + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OrderListOpocoResponseOrderReportsInner> getOrderReports() { + return orderReports; + } + + public void setOrderReports( + @jakarta.annotation.Nullable + List<@Valid OrderListOpocoResponseOrderReportsInner> orderReports) { + this.orderReports = orderReports; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListOpocoResponse orderListOpocoResponse = (OrderListOpocoResponse) o; + return Objects.equals(this.orderListId, orderListOpocoResponse.orderListId) + && Objects.equals(this.contingencyType, orderListOpocoResponse.contingencyType) + && Objects.equals(this.listStatusType, orderListOpocoResponse.listStatusType) + && Objects.equals(this.listOrderStatus, orderListOpocoResponse.listOrderStatus) + && Objects.equals(this.listClientOrderId, orderListOpocoResponse.listClientOrderId) + && Objects.equals(this.transactionTime, orderListOpocoResponse.transactionTime) + && Objects.equals(this.symbol, orderListOpocoResponse.symbol) + && Objects.equals(this.orders, orderListOpocoResponse.orders) + && Objects.equals(this.orderReports, orderListOpocoResponse.orderReports); + } + + @Override + public int hashCode() { + return Objects.hash( + orderListId, + contingencyType, + listStatusType, + listOrderStatus, + listClientOrderId, + transactionTime, + symbol, + orders, + orderReports); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListOpocoResponse {\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" contingencyType: ").append(toIndentedString(contingencyType)).append("\n"); + sb.append(" listStatusType: ").append(toIndentedString(listStatusType)).append("\n"); + sb.append(" listOrderStatus: ").append(toIndentedString(listOrderStatus)).append("\n"); + sb.append(" listClientOrderId: ").append(toIndentedString(listClientOrderId)).append("\n"); + sb.append(" transactionTime: ").append(toIndentedString(transactionTime)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orders: ").append(toIndentedString(orders)).append("\n"); + sb.append(" orderReports: ").append(toIndentedString(orderReports)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object orderListIdValue = getOrderListId(); + String orderListIdValueAsString = ""; + orderListIdValueAsString = orderListIdValue.toString(); + sb.append("orderListId=").append(urlEncode(orderListIdValueAsString)).append(""); + Object contingencyTypeValue = getContingencyType(); + String contingencyTypeValueAsString = ""; + contingencyTypeValueAsString = contingencyTypeValue.toString(); + sb.append("contingencyType=").append(urlEncode(contingencyTypeValueAsString)).append(""); + Object listStatusTypeValue = getListStatusType(); + String listStatusTypeValueAsString = ""; + listStatusTypeValueAsString = listStatusTypeValue.toString(); + sb.append("listStatusType=").append(urlEncode(listStatusTypeValueAsString)).append(""); + Object listOrderStatusValue = getListOrderStatus(); + String listOrderStatusValueAsString = ""; + listOrderStatusValueAsString = listOrderStatusValue.toString(); + sb.append("listOrderStatus=").append(urlEncode(listOrderStatusValueAsString)).append(""); + Object listClientOrderIdValue = getListClientOrderId(); + String listClientOrderIdValueAsString = ""; + listClientOrderIdValueAsString = listClientOrderIdValue.toString(); + sb.append("listClientOrderId=") + .append(urlEncode(listClientOrderIdValueAsString)) + .append(""); + Object transactionTimeValue = getTransactionTime(); + String transactionTimeValueAsString = ""; + transactionTimeValueAsString = transactionTimeValue.toString(); + sb.append("transactionTime=").append(urlEncode(transactionTimeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object ordersValue = getOrders(); + String ordersValueAsString = ""; + ordersValueAsString = + (String) + ((Collection) ordersValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("orders=").append(urlEncode(ordersValueAsString)).append(""); + Object orderReportsValue = getOrderReports(); + String orderReportsValueAsString = ""; + orderReportsValueAsString = + (String) + ((Collection) orderReportsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("orderReports=").append(urlEncode(orderReportsValueAsString)).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("orderListId"); + openapiFields.add("contingencyType"); + openapiFields.add("listStatusType"); + openapiFields.add("listOrderStatus"); + openapiFields.add("listClientOrderId"); + openapiFields.add("transactionTime"); + openapiFields.add("symbol"); + openapiFields.add("orders"); + openapiFields.add("orderReports"); + + // 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 OrderListOpocoResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListOpocoResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListOpocoResponse is not found in" + + " the empty JSON string", + OrderListOpocoResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) + && !jsonObj.get("contingencyType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `contingencyType` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("contingencyType").toString())); + } + if ((jsonObj.get("listStatusType") != null && !jsonObj.get("listStatusType").isJsonNull()) + && !jsonObj.get("listStatusType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listStatusType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("listStatusType").toString())); + } + if ((jsonObj.get("listOrderStatus") != null && !jsonObj.get("listOrderStatus").isJsonNull()) + && !jsonObj.get("listOrderStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listOrderStatus` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listOrderStatus").toString())); + } + if ((jsonObj.get("listClientOrderId") != null + && !jsonObj.get("listClientOrderId").isJsonNull()) + && !jsonObj.get("listClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listClientOrderId").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("orders") != null && !jsonObj.get("orders").isJsonNull()) { + JsonArray jsonArrayorders = jsonObj.getAsJsonArray("orders"); + if (jsonArrayorders != null) { + // ensure the json data is an array + if (!jsonObj.get("orders").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orders` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("orders").toString())); + } + + // validate the optional field `orders` (array) + for (int i = 0; i < jsonArrayorders.size(); i++) { + OrderListOpocoResponseOrdersInner.validateJsonElement(jsonArrayorders.get(i)); + } + ; + } + } + if (jsonObj.get("orderReports") != null && !jsonObj.get("orderReports").isJsonNull()) { + JsonArray jsonArrayorderReports = jsonObj.getAsJsonArray("orderReports"); + if (jsonArrayorderReports != null) { + // ensure the json data is an array + if (!jsonObj.get("orderReports").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderReports` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("orderReports").toString())); + } + + // validate the optional field `orderReports` (array) + for (int i = 0; i < jsonArrayorderReports.size(); i++) { + OrderListOpocoResponseOrderReportsInner.validateJsonElement( + jsonArrayorderReports.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListOpocoResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListOpocoResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderListOpocoResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListOpocoResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListOpocoResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListOpocoResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListOpocoResponse + * @throws IOException if the JSON string is invalid with respect to OrderListOpocoResponse + */ + public static OrderListOpocoResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListOpocoResponse.class); + } + + /** + * Convert an instance of OrderListOpocoResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponseOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponseOrderReportsInner.java new file mode 100644 index 00000000..bc3d0ce1 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponseOrderReportsInner.java @@ -0,0 +1,888 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** OrderListOpocoResponseOrderReportsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListOpocoResponseOrderReportsInner { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public static final String SERIALIZED_NAME_TRANSACT_TIME = "transactTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACT_TIME) + @jakarta.annotation.Nullable + private Long transactTime; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; + + @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) + @jakarta.annotation.Nullable + private String executedQty; + + public static final String SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY = "origQuoteOrderQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY) + @jakarta.annotation.Nullable + private String origQuoteOrderQty; + + public static final String SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY = "cummulativeQuoteQty"; + + @SerializedName(SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY) + @jakarta.annotation.Nullable + private String cummulativeQuoteQty; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_WORKING_TIME = "workingTime"; + + @SerializedName(SERIALIZED_NAME_WORKING_TIME) + @jakarta.annotation.Nullable + private Long workingTime; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_STOP_PRICE = "stopPrice"; + + @SerializedName(SERIALIZED_NAME_STOP_PRICE) + @jakarta.annotation.Nullable + private String stopPrice; + + public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QTY) + @jakarta.annotation.Nullable + private String origQty; + + public OrderListOpocoResponseOrderReportsInner() {} + + public OrderListOpocoResponseOrderReportsInner 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 OrderListOpocoResponseOrderReportsInner orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderListOpocoResponseOrderReportsInner orderListId( + @jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderListOpocoResponseOrderReportsInner clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public OrderListOpocoResponseOrderReportsInner transactTime( + @jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + return this; + } + + /** + * Get transactTime + * + * @return transactTime + */ + @jakarta.annotation.Nullable + public Long getTransactTime() { + return transactTime; + } + + public void setTransactTime(@jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + } + + public OrderListOpocoResponseOrderReportsInner 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 OrderListOpocoResponseOrderReportsInner executedQty( + @jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + return this; + } + + /** + * Get executedQty + * + * @return executedQty + */ + @jakarta.annotation.Nullable + public String getExecutedQty() { + return executedQty; + } + + public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + } + + public OrderListOpocoResponseOrderReportsInner origQuoteOrderQty( + @jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + return this; + } + + /** + * Get origQuoteOrderQty + * + * @return origQuoteOrderQty + */ + @jakarta.annotation.Nullable + public String getOrigQuoteOrderQty() { + return origQuoteOrderQty; + } + + public void setOrigQuoteOrderQty(@jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + } + + public OrderListOpocoResponseOrderReportsInner cummulativeQuoteQty( + @jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + return this; + } + + /** + * Get cummulativeQuoteQty + * + * @return cummulativeQuoteQty + */ + @jakarta.annotation.Nullable + public String getCummulativeQuoteQty() { + return cummulativeQuoteQty; + } + + public void setCummulativeQuoteQty(@jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + } + + public OrderListOpocoResponseOrderReportsInner status( + @jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + public OrderListOpocoResponseOrderReportsInner 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 OrderListOpocoResponseOrderReportsInner type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + public OrderListOpocoResponseOrderReportsInner 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 OrderListOpocoResponseOrderReportsInner workingTime( + @jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + return this; + } + + /** + * Get workingTime + * + * @return workingTime + */ + @jakarta.annotation.Nullable + public Long getWorkingTime() { + return workingTime; + } + + public void setWorkingTime(@jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + } + + public OrderListOpocoResponseOrderReportsInner 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 OrderListOpocoResponseOrderReportsInner stopPrice( + @jakarta.annotation.Nullable String stopPrice) { + this.stopPrice = stopPrice; + return this; + } + + /** + * Get stopPrice + * + * @return stopPrice + */ + @jakarta.annotation.Nullable + public String getStopPrice() { + return stopPrice; + } + + public void setStopPrice(@jakarta.annotation.Nullable String stopPrice) { + this.stopPrice = stopPrice; + } + + public OrderListOpocoResponseOrderReportsInner origQty( + @jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + return this; + } + + /** + * Get origQty + * + * @return origQty + */ + @jakarta.annotation.Nullable + public String getOrigQty() { + return origQty; + } + + public void setOrigQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListOpocoResponseOrderReportsInner orderListOpocoResponseOrderReportsInner = + (OrderListOpocoResponseOrderReportsInner) o; + return Objects.equals(this.symbol, orderListOpocoResponseOrderReportsInner.symbol) + && Objects.equals(this.orderId, orderListOpocoResponseOrderReportsInner.orderId) + && Objects.equals( + this.orderListId, orderListOpocoResponseOrderReportsInner.orderListId) + && Objects.equals( + this.clientOrderId, orderListOpocoResponseOrderReportsInner.clientOrderId) + && Objects.equals( + this.transactTime, orderListOpocoResponseOrderReportsInner.transactTime) + && Objects.equals(this.price, orderListOpocoResponseOrderReportsInner.price) + && Objects.equals( + this.executedQty, orderListOpocoResponseOrderReportsInner.executedQty) + && Objects.equals( + this.origQuoteOrderQty, + orderListOpocoResponseOrderReportsInner.origQuoteOrderQty) + && Objects.equals( + this.cummulativeQuoteQty, + orderListOpocoResponseOrderReportsInner.cummulativeQuoteQty) + && Objects.equals(this.status, orderListOpocoResponseOrderReportsInner.status) + && Objects.equals( + this.timeInForce, orderListOpocoResponseOrderReportsInner.timeInForce) + && Objects.equals(this.type, orderListOpocoResponseOrderReportsInner.type) + && Objects.equals(this.side, orderListOpocoResponseOrderReportsInner.side) + && Objects.equals( + this.workingTime, orderListOpocoResponseOrderReportsInner.workingTime) + && Objects.equals( + this.selfTradePreventionMode, + orderListOpocoResponseOrderReportsInner.selfTradePreventionMode) + && Objects.equals(this.stopPrice, orderListOpocoResponseOrderReportsInner.stopPrice) + && Objects.equals(this.origQty, orderListOpocoResponseOrderReportsInner.origQty); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + orderId, + orderListId, + clientOrderId, + transactTime, + price, + executedQty, + origQuoteOrderQty, + cummulativeQuoteQty, + status, + timeInForce, + type, + side, + workingTime, + selfTradePreventionMode, + stopPrice, + origQty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListOpocoResponseOrderReportsInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" transactTime: ").append(toIndentedString(transactTime)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); + sb.append(" origQuoteOrderQty: ").append(toIndentedString(origQuoteOrderQty)).append("\n"); + sb.append(" cummulativeQuoteQty: ") + .append(toIndentedString(cummulativeQuoteQty)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" workingTime: ").append(toIndentedString(workingTime)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); + sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object orderListIdValue = getOrderListId(); + String orderListIdValueAsString = ""; + orderListIdValueAsString = orderListIdValue.toString(); + sb.append("orderListId=").append(urlEncode(orderListIdValueAsString)).append(""); + Object clientOrderIdValue = getClientOrderId(); + String clientOrderIdValueAsString = ""; + clientOrderIdValueAsString = clientOrderIdValue.toString(); + sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + Object transactTimeValue = getTransactTime(); + String transactTimeValueAsString = ""; + transactTimeValueAsString = transactTimeValue.toString(); + sb.append("transactTime=").append(urlEncode(transactTimeValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object executedQtyValue = getExecutedQty(); + String executedQtyValueAsString = ""; + executedQtyValueAsString = executedQtyValue.toString(); + sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); + Object origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + String origQuoteOrderQtyValueAsString = ""; + origQuoteOrderQtyValueAsString = origQuoteOrderQtyValue.toString(); + sb.append("origQuoteOrderQty=") + .append(urlEncode(origQuoteOrderQtyValueAsString)) + .append(""); + Object cummulativeQuoteQtyValue = getCummulativeQuoteQty(); + String cummulativeQuoteQtyValueAsString = ""; + cummulativeQuoteQtyValueAsString = cummulativeQuoteQtyValue.toString(); + sb.append("cummulativeQuoteQty=") + .append(urlEncode(cummulativeQuoteQtyValueAsString)) + .append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object workingTimeValue = getWorkingTime(); + String workingTimeValueAsString = ""; + workingTimeValueAsString = workingTimeValue.toString(); + sb.append("workingTime=").append(urlEncode(workingTimeValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object stopPriceValue = getStopPrice(); + String stopPriceValueAsString = ""; + stopPriceValueAsString = stopPriceValue.toString(); + sb.append("stopPrice=").append(urlEncode(stopPriceValueAsString)).append(""); + Object origQtyValue = getOrigQty(); + String origQtyValueAsString = ""; + origQtyValueAsString = origQtyValue.toString(); + sb.append("origQty=").append(urlEncode(origQtyValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("orderListId"); + openapiFields.add("clientOrderId"); + openapiFields.add("transactTime"); + openapiFields.add("price"); + openapiFields.add("executedQty"); + openapiFields.add("origQuoteOrderQty"); + openapiFields.add("cummulativeQuoteQty"); + openapiFields.add("status"); + openapiFields.add("timeInForce"); + openapiFields.add("type"); + openapiFields.add("side"); + openapiFields.add("workingTime"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("stopPrice"); + openapiFields.add("origQty"); + + // 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 + * OrderListOpocoResponseOrderReportsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListOpocoResponseOrderReportsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " OrderListOpocoResponseOrderReportsInner is not found in the" + + " empty JSON string", + OrderListOpocoResponseOrderReportsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) + && !jsonObj.get("executedQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executedQty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executedQty").toString())); + } + if ((jsonObj.get("origQuoteOrderQty") != null + && !jsonObj.get("origQuoteOrderQty").isJsonNull()) + && !jsonObj.get("origQuoteOrderQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQuoteOrderQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origQuoteOrderQty").toString())); + } + if ((jsonObj.get("cummulativeQuoteQty") != null + && !jsonObj.get("cummulativeQuoteQty").isJsonNull()) + && !jsonObj.get("cummulativeQuoteQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cummulativeQuoteQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("cummulativeQuoteQty").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("stopPrice") != null && !jsonObj.get("stopPrice").isJsonNull()) + && !jsonObj.get("stopPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stopPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stopPrice").toString())); + } + if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) + && !jsonObj.get("origQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("origQty").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListOpocoResponseOrderReportsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'OrderListOpocoResponseOrderReportsInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderListOpocoResponseOrderReportsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, OrderListOpocoResponseOrderReportsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListOpocoResponseOrderReportsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListOpocoResponseOrderReportsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListOpocoResponseOrderReportsInner + * @throws IOException if the JSON string is invalid with respect to + * OrderListOpocoResponseOrderReportsInner + */ + public static OrderListOpocoResponseOrderReportsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListOpocoResponseOrderReportsInner.class); + } + + /** + * Convert an instance of OrderListOpocoResponseOrderReportsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponseOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponseOrdersInner.java new file mode 100644 index 00000000..daa036c8 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOpocoResponseOrdersInner.java @@ -0,0 +1,291 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** OrderListOpocoResponseOrdersInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListOpocoResponseOrdersInner { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public OrderListOpocoResponseOrdersInner() {} + + public OrderListOpocoResponseOrdersInner 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 OrderListOpocoResponseOrdersInner orderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderListOpocoResponseOrdersInner clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListOpocoResponseOrdersInner orderListOpocoResponseOrdersInner = + (OrderListOpocoResponseOrdersInner) o; + return Objects.equals(this.symbol, orderListOpocoResponseOrdersInner.symbol) + && Objects.equals(this.orderId, orderListOpocoResponseOrdersInner.orderId) + && Objects.equals( + this.clientOrderId, orderListOpocoResponseOrdersInner.clientOrderId); + } + + @Override + public int hashCode() { + return Objects.hash(symbol, orderId, clientOrderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListOpocoResponseOrdersInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object clientOrderIdValue = getClientOrderId(); + String clientOrderIdValueAsString = ""; + clientOrderIdValueAsString = clientOrderIdValue.toString(); + sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("clientOrderId"); + + // 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 + * OrderListOpocoResponseOrdersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListOpocoResponseOrdersInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListOpocoResponseOrdersInner is" + + " not found in the empty JSON string", + OrderListOpocoResponseOrdersInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListOpocoResponseOrdersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListOpocoResponseOrdersInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderListOpocoResponseOrdersInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListOpocoResponseOrdersInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListOpocoResponseOrdersInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListOpocoResponseOrdersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListOpocoResponseOrdersInner + * @throws IOException if the JSON string is invalid with respect to + * OrderListOpocoResponseOrdersInner + */ + public static OrderListOpocoResponseOrdersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListOpocoResponseOrdersInner.class); + } + + /** + * Convert an instance of OrderListOpocoResponseOrdersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PutUserDataStreamRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PutUserDataStreamRequest.java deleted file mode 100644 index e5b20538..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PutUserDataStreamRequest.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.rest.model; - -import com.binance.connector.client.spot.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** PutUserDataStreamRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class PutUserDataStreamRequest { - public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; - - @SerializedName(SERIALIZED_NAME_LISTEN_KEY) - @jakarta.annotation.Nonnull - private String listenKey; - - public PutUserDataStreamRequest() {} - - public PutUserDataStreamRequest listenKey(@jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; - return this; - } - - /** - * Get listenKey - * - * @return listenKey - */ - @jakarta.annotation.Nonnull - @NotNull - public String getListenKey() { - return listenKey; - } - - public void setListenKey(@jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PutUserDataStreamRequest putUserDataStreamRequest = (PutUserDataStreamRequest) o; - return Objects.equals(this.listenKey, putUserDataStreamRequest.listenKey); - } - - @Override - public int hashCode() { - return Objects.hash(listenKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PutUserDataStreamRequest {\n"); - sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object listenKeyValue = getListenKey(); - String listenKeyValueAsString = ""; - listenKeyValueAsString = listenKeyValue.toString(); - sb.append("listenKey=").append(urlEncode(listenKeyValueAsString)).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("listenKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("listenKey"); - } - - /** - * 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 PutUserDataStreamRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PutUserDataStreamRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in PutUserDataStreamRequest is not found" - + " in the empty JSON string", - PutUserDataStreamRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PutUserDataStreamRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - 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("listenKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `listenKey` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("listenKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PutUserDataStreamRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PutUserDataStreamRequest' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PutUserDataStreamRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PutUserDataStreamRequest value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public PutUserDataStreamRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of PutUserDataStreamRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of PutUserDataStreamRequest - * @throws IOException if the JSON string is invalid with respect to PutUserDataStreamRequest - */ - public static PutUserDataStreamRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PutUserDataStreamRequest.class); - } - - /** - * Convert an instance of PutUserDataStreamRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java index be8d9cfa..77ef42fc 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java @@ -343,10 +343,6 @@ public static GsonBuilder createGson() { "listStatus", com.binance.connector.client.spot.websocket.api .model.ListStatus.class); - classByDiscriminatorValue.put( - "listenKeyExpired", - com.binance.connector.client.spot.websocket.api - .model.ListenKeyExpired.class); classByDiscriminatorValue.put( "outboundAccountPosition", com.binance.connector.client.spot.websocket.api @@ -558,9 +554,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.ListStatusOInner .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model.ListenKeyExpired - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.LotSizeFilter .CustomTypeAdapterFactory()); @@ -754,6 +747,38 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OrderListPlaceOcoResponseResultOrdersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpoRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpoResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .OrderListPlaceOpoResponseResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .OrderListPlaceOpoResponseResultOrderReportsInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .OrderListPlaceOpoResponseResultOrdersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpocoRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .OrderListPlaceOpocoResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .OrderListPlaceOpocoResponseResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .OrderListPlaceOpocoResponseResultOrderReportsInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .OrderListPlaceOpocoResponseResultOrdersInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOtoRequest .CustomTypeAdapterFactory()); @@ -1052,24 +1077,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .UserDataStreamEventsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingRequest - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .UserDataStreamStartResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .UserDataStreamStartResponseResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopRequest - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopResponse - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .UserDataStreamSubscribeResponse.CustomTypeAdapterFactory()); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AccountApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AccountApi.java index 3fda197f..4e5c1510 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 @@ -438,7 +438,7 @@ private void myAllocationsValidateBeforeCall(MyAllocationsRequest myAllocationsR /** * WebSocket Query Relevant Filters Retrieves the list of [filters](filters.md) relevant to an - * account on a given symbol. This is the only endpoint that shows if an account has + * account on a given symbol. This is the only method that shows if an account has * `MAX_ASSET` filters applied to it. Weight: 40 * * @param myFiltersRequest (required) 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 62d40121..81307c46 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 @@ -52,6 +52,10 @@ import com.binance.connector.client.spot.websocket.api.model.OrderListCancelResponse; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOcoRequest; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOcoResponse; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpoRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpoResponse; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpocoRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpocoResponse; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOtoRequest; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOtoResponse; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOtocoRequest; @@ -96,11 +100,6 @@ import com.binance.connector.client.spot.websocket.api.model.UiKlinesRequest; import com.binance.connector.client.spot.websocket.api.model.UiKlinesResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingRequest; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingResponse; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStartResponse; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopRequest; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeSignatureResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeRequest; @@ -112,7 +111,7 @@ public class SpotWebSocketApi { private static final String USER_AGENT = String.format( - "binance-spot/7.0.0 (Java/%s; %s; %s)", + "binance-spot/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; @@ -342,6 +341,16 @@ public CompletableFuture orderListPlaceOco( return tradeApi.orderListPlaceOco(orderListPlaceOcoRequest); } + public CompletableFuture orderListPlaceOpo( + OrderListPlaceOpoRequest orderListPlaceOpoRequest) throws ApiException { + return tradeApi.orderListPlaceOpo(orderListPlaceOpoRequest); + } + + public CompletableFuture orderListPlaceOpoco( + OrderListPlaceOpocoRequest orderListPlaceOpocoRequest) throws ApiException { + return tradeApi.orderListPlaceOpoco(orderListPlaceOpocoRequest); + } + public CompletableFuture orderListPlaceOto( OrderListPlaceOtoRequest orderListPlaceOtoRequest) throws ApiException { return tradeApi.orderListPlaceOto(orderListPlaceOtoRequest); @@ -377,21 +386,6 @@ public CompletableFuture sessionSubscriptions() return userDataStreamApi.sessionSubscriptions(); } - public CompletableFuture userDataStreamPing( - UserDataStreamPingRequest userDataStreamPingRequest) throws ApiException { - return userDataStreamApi.userDataStreamPing(userDataStreamPingRequest); - } - - public CompletableFuture userDataStreamStart() - throws ApiException { - return userDataStreamApi.userDataStreamStart(); - } - - public CompletableFuture userDataStreamStop( - UserDataStreamStopRequest userDataStreamStopRequest) throws ApiException { - return userDataStreamApi.userDataStreamStop(userDataStreamStopRequest); - } - public StreamResponse userDataStreamSubscribe() throws ApiException { return userDataStreamApi.userDataStreamSubscribe(); 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 64e5c277..d5c0e31b 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 @@ -28,6 +28,10 @@ import com.binance.connector.client.spot.websocket.api.model.OrderListCancelResponse; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOcoRequest; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOcoResponse; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpoRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpoResponse; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpocoRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpocoResponse; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOtoRequest; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOtoResponse; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOtocoRequest; @@ -393,10 +397,12 @@ private void orderListCancelValidateBeforeCall(OrderListCancelRequest orderListC * 200 Place new OCO - Deprecated - * * + * @deprecated * @see WebSocket * Place new OCO - Deprecated Documentation */ + @Deprecated public CompletableFuture orderListPlace( OrderListPlaceRequest orderListPlaceRequest) throws ApiException { orderListPlaceValidateBeforeCall(orderListPlaceRequest); @@ -417,6 +423,7 @@ public CompletableFuture orderListPlace( return build.getResponseCallback(); } + @Deprecated @SuppressWarnings("rawtypes") private void orderListPlaceValidateBeforeCall(OrderListPlaceRequest orderListPlaceRequest) throws ApiException { @@ -515,6 +522,131 @@ private void orderListPlaceOcoValidateBeforeCall( } } + /** + * WebSocket OPO Place an [OPO](./faqs/opo.md). * OPOs add 2 orders to the + * EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter. Weight: 1 Unfilled Order Count: 2 + * + * @param orderListPlaceOpoRequest (required) + * @return OrderListPlaceOpoResponse + * @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 OPO -
+ * + * @see WebSocket + * OPO Documentation + */ + public CompletableFuture orderListPlaceOpo( + OrderListPlaceOpoRequest orderListPlaceOpoRequest) throws ApiException { + orderListPlaceOpoValidateBeforeCall(orderListPlaceOpoRequest); + String methodName = "/orderList.place.opo".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder< + OrderListPlaceOpoRequest, OrderListPlaceOpoResponse>() + .id(getRequestID()) + .method(methodName) + .params(orderListPlaceOpoRequest) + .responseType(OrderListPlaceOpoResponse.class) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @SuppressWarnings("rawtypes") + private void orderListPlaceOpoValidateBeforeCall( + OrderListPlaceOpoRequest orderListPlaceOpoRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(orderListPlaceOpoRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * WebSocket OPOCO Place an [OPOCO](./faqs/opo.md). Weight: 1 Unfilled Order Count: 3 + * + * @param orderListPlaceOpocoRequest (required) + * @return OrderListPlaceOpocoResponse + * @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 OPOCO -
+ * + * @see WebSocket + * OPOCO Documentation + */ + public CompletableFuture orderListPlaceOpoco( + OrderListPlaceOpocoRequest orderListPlaceOpocoRequest) throws ApiException { + orderListPlaceOpocoValidateBeforeCall(orderListPlaceOpocoRequest); + String methodName = "/orderList.place.opoco".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder< + OrderListPlaceOpocoRequest, OrderListPlaceOpocoResponse>() + .id(getRequestID()) + .method(methodName) + .params(orderListPlaceOpocoRequest) + .responseType(OrderListPlaceOpocoResponse.class) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @SuppressWarnings("rawtypes") + private void orderListPlaceOpocoValidateBeforeCall( + OrderListPlaceOpocoRequest orderListPlaceOpocoRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(orderListPlaceOpocoRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + /** * WebSocket Place new Order list - OTO Places an OTO. * An OTO (One-Triggers-the-Other) is an * order list comprised of 2 orders. * The first order is called the **working order** and must 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 1af5e189..b2dd9c3d 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 @@ -23,11 +23,6 @@ import com.binance.connector.client.spot.websocket.api.JSON; import com.binance.connector.client.spot.websocket.api.model.SessionSubscriptionsResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingRequest; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingResponse; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStartResponse; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopRequest; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeSignatureResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeRequest; @@ -93,183 +88,6 @@ public CompletableFuture sessionSubscriptions() @SuppressWarnings("rawtypes") private void sessionSubscriptionsValidateBeforeCall() throws ApiException {} - /** - * WebSocket Ping user data stream Ping a user data stream to keep it alive. User data streams - * close automatically after 60 minutes, even if you're listening to them on WebSocket - * Streams. In order to keep the stream open, you have to regularly send pings using the - * `userDataStream.ping` request. It is recommended to send a ping once every 30 - * minutes. This request does not require `signature`. Weight: 2 - * - * @param userDataStreamPingRequest (required) - * @return UserDataStreamPingResponse - * @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 Ping user data stream -
- * - * @see WebSocket - * Ping user data stream Documentation - */ - public CompletableFuture userDataStreamPing( - UserDataStreamPingRequest userDataStreamPingRequest) throws ApiException { - userDataStreamPingValidateBeforeCall(userDataStreamPingRequest); - String methodName = "/userDataStream.ping".substring(1); - ApiRequestWrapperDTO build = - new ApiRequestWrapperDTO.Builder< - UserDataStreamPingRequest, UserDataStreamPingResponse>() - .id(getRequestID()) - .method(methodName) - .params(userDataStreamPingRequest) - .responseType(UserDataStreamPingResponse.class) - .signed(false) - .apiKeyOnly(true) - .build(); - - try { - connection.send(build); - } catch (InterruptedException e) { - throw new ApiException(e); - } - return build.getResponseCallback(); - } - - @SuppressWarnings("rawtypes") - private void userDataStreamPingValidateBeforeCall( - UserDataStreamPingRequest userDataStreamPingRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(userDataStreamPingRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * WebSocket Start user data stream Start a new user data stream. Note the stream will close in - * 60 minutes unless `userDataStream.ping` requests are sent regularly. This request - * does not require `signature`. Weight: 2 - * - * @return UserDataStreamStartResponse - * @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 Start user data stream -
- * - * @see WebSocket - * Start user data stream Documentation - */ - public CompletableFuture userDataStreamStart() - throws ApiException { - userDataStreamStartValidateBeforeCall(); - String methodName = "/userDataStream.start".substring(1); - ApiRequestWrapperDTO build = - new ApiRequestWrapperDTO.Builder() - .id(getRequestID()) - .method(methodName) - .params(new BaseRequestDTO()) - .responseType(UserDataStreamStartResponse.class) - .signed(false) - .apiKeyOnly(true) - .build(); - - try { - connection.send(build); - } catch (InterruptedException e) { - throw new ApiException(e); - } - return build.getResponseCallback(); - } - - @SuppressWarnings("rawtypes") - private void userDataStreamStartValidateBeforeCall() throws ApiException {} - - /** - * WebSocket Stop user data stream Explicitly stop and close the user data stream. This request - * does not require `signature`. Weight: 2 - * - * @param userDataStreamStopRequest (required) - * @return UserDataStreamStopResponse - * @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 Stop user data stream -
- * - * @see WebSocket - * Stop user data stream Documentation - */ - public CompletableFuture userDataStreamStop( - UserDataStreamStopRequest userDataStreamStopRequest) throws ApiException { - userDataStreamStopValidateBeforeCall(userDataStreamStopRequest); - String methodName = "/userDataStream.stop".substring(1); - ApiRequestWrapperDTO build = - new ApiRequestWrapperDTO.Builder< - UserDataStreamStopRequest, UserDataStreamStopResponse>() - .id(getRequestID()) - .method(methodName) - .params(userDataStreamStopRequest) - .responseType(UserDataStreamStopResponse.class) - .signed(false) - .apiKeyOnly(true) - .build(); - - try { - connection.send(build); - } catch (InterruptedException e) { - throw new ApiException(e); - } - return build.getResponseCallback(); - } - - @SuppressWarnings("rawtypes") - private void userDataStreamStopValidateBeforeCall( - UserDataStreamStopRequest userDataStreamStopRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(userDataStreamStopRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - /** * WebSocket Subscribe to User Data Stream Subscribe to the User Data Stream in the current * WebSocket connection. Weight: 2 @@ -331,7 +149,7 @@ private void userDataStreamSubscribeValidateBeforeCall() throws ApiException {} * * * @see WebSocket + * href="https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#subscribe-to-user-data-stream-through-signature-subscription-user_stream">WebSocket * Subscribe to User Data Stream through signature subscription Documentation */ public StreamResponse diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthRequest.java index 4745c060..e50d57f3 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthRequest.java @@ -23,6 +23,7 @@ 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; @@ -51,6 +52,12 @@ public class DepthRequest extends BaseDTO { @jakarta.annotation.Nullable private Integer limit; + public static final String SERIALIZED_NAME_SYMBOL_STATUS = "symbolStatus"; + + @SerializedName(SERIALIZED_NAME_SYMBOL_STATUS) + @jakarta.annotation.Nullable + private SymbolStatus symbolStatus; + public DepthRequest() {} public DepthRequest symbol(@jakarta.annotation.Nonnull String symbol) { @@ -92,6 +99,26 @@ public void setLimit(@jakarta.annotation.Nullable Integer limit) { this.limit = limit; } + public DepthRequest symbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + return this; + } + + /** + * Get symbolStatus + * + * @return symbolStatus + */ + @jakarta.annotation.Nullable + @Valid + public SymbolStatus getSymbolStatus() { + return symbolStatus; + } + + public void setSymbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -102,12 +129,13 @@ public boolean equals(Object o) { } DepthRequest depthRequest = (DepthRequest) o; return Objects.equals(this.symbol, depthRequest.symbol) - && Objects.equals(this.limit, depthRequest.limit); + && Objects.equals(this.limit, depthRequest.limit) + && Objects.equals(this.symbolStatus, depthRequest.symbolStatus); } @Override public int hashCode() { - return Objects.hash(symbol, limit); + return Objects.hash(symbol, limit, symbolStatus); } @Override @@ -116,6 +144,7 @@ public String toString() { sb.append("class DepthRequest {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" symbolStatus: ").append(toIndentedString(symbolStatus)).append("\n"); sb.append("}"); return sb.toString(); } @@ -134,6 +163,11 @@ public String toUrlQueryString() { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); } + SymbolStatus symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + String symbolStatusValueAsString = symbolStatusValue.toString(); + valMap.put("symbolStatus", symbolStatusValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -153,6 +187,10 @@ public Map toMap() { if (limitValue != null) { valMap.put("limit", limitValue); } + Object symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + valMap.put("symbolStatus", symbolStatusValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -181,6 +219,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("symbol"); openapiFields.add("limit"); + openapiFields.add("symbolStatus"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -234,6 +273,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + // validate the optional field `symbolStatus` + if (jsonObj.get("symbolStatus") != null && !jsonObj.get("symbolStatus").isJsonNull()) { + SymbolStatus.validateJsonElement(jsonObj.get("symbolStatus")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultSymbolsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultSymbolsInner.java index b868c31f..0f01bf36 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultSymbolsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultSymbolsInner.java @@ -123,6 +123,12 @@ public class ExchangeInfoResponseResultSymbolsInner extends BaseDTO { @jakarta.annotation.Nullable private Boolean otoAllowed; + public static final String SERIALIZED_NAME_OPO_ALLOWED = "opoAllowed"; + + @SerializedName(SERIALIZED_NAME_OPO_ALLOWED) + @jakarta.annotation.Nullable + private Boolean opoAllowed; + public static final String SERIALIZED_NAME_QUOTE_ORDER_QTY_MARKET_ALLOWED = "quoteOrderQtyMarketAllowed"; @@ -470,6 +476,26 @@ public void setOtoAllowed(@jakarta.annotation.Nullable Boolean otoAllowed) { this.otoAllowed = otoAllowed; } + public ExchangeInfoResponseResultSymbolsInner opoAllowed( + @jakarta.annotation.Nullable Boolean opoAllowed) { + this.opoAllowed = opoAllowed; + return this; + } + + /** + * Get opoAllowed + * + * @return opoAllowed + */ + @jakarta.annotation.Nullable + public Boolean getOpoAllowed() { + return opoAllowed; + } + + public void setOpoAllowed(@jakarta.annotation.Nullable Boolean opoAllowed) { + this.opoAllowed = opoAllowed; + } + public ExchangeInfoResponseResultSymbolsInner quoteOrderQtyMarketAllowed( @jakarta.annotation.Nullable Boolean quoteOrderQtyMarketAllowed) { this.quoteOrderQtyMarketAllowed = quoteOrderQtyMarketAllowed; @@ -788,6 +814,8 @@ public boolean equals(Object o) { this.ocoAllowed, exchangeInfoResponseResultSymbolsInner.ocoAllowed) && Objects.equals( this.otoAllowed, exchangeInfoResponseResultSymbolsInner.otoAllowed) + && Objects.equals( + this.opoAllowed, exchangeInfoResponseResultSymbolsInner.opoAllowed) && Objects.equals( this.quoteOrderQtyMarketAllowed, exchangeInfoResponseResultSymbolsInner.quoteOrderQtyMarketAllowed) @@ -837,6 +865,7 @@ public int hashCode() { icebergAllowed, ocoAllowed, otoAllowed, + opoAllowed, quoteOrderQtyMarketAllowed, allowTrailingStop, cancelReplaceAllowed, @@ -876,6 +905,7 @@ public String toString() { sb.append(" icebergAllowed: ").append(toIndentedString(icebergAllowed)).append("\n"); sb.append(" ocoAllowed: ").append(toIndentedString(ocoAllowed)).append("\n"); sb.append(" otoAllowed: ").append(toIndentedString(otoAllowed)).append("\n"); + sb.append(" opoAllowed: ").append(toIndentedString(opoAllowed)).append("\n"); sb.append(" quoteOrderQtyMarketAllowed: ") .append(toIndentedString(quoteOrderQtyMarketAllowed)) .append("\n"); @@ -975,6 +1005,11 @@ public String toUrlQueryString() { String otoAllowedValueAsString = otoAllowedValue.toString(); valMap.put("otoAllowed", otoAllowedValueAsString); } + Boolean opoAllowedValue = getOpoAllowed(); + if (opoAllowedValue != null) { + String opoAllowedValueAsString = opoAllowedValue.toString(); + valMap.put("opoAllowed", opoAllowedValueAsString); + } Boolean quoteOrderQtyMarketAllowedValue = getQuoteOrderQtyMarketAllowed(); if (quoteOrderQtyMarketAllowedValue != null) { String quoteOrderQtyMarketAllowedValueAsString = @@ -1104,6 +1139,10 @@ public Map toMap() { if (otoAllowedValue != null) { valMap.put("otoAllowed", otoAllowedValue); } + Object opoAllowedValue = getOpoAllowed(); + if (opoAllowedValue != null) { + valMap.put("opoAllowed", opoAllowedValue); + } Object quoteOrderQtyMarketAllowedValue = getQuoteOrderQtyMarketAllowed(); if (quoteOrderQtyMarketAllowedValue != null) { valMap.put("quoteOrderQtyMarketAllowed", quoteOrderQtyMarketAllowedValue); @@ -1191,6 +1230,7 @@ private String toIndentedString(Object o) { openapiFields.add("icebergAllowed"); openapiFields.add("ocoAllowed"); openapiFields.add("otoAllowed"); + openapiFields.add("opoAllowed"); openapiFields.add("quoteOrderQtyMarketAllowed"); openapiFields.add("allowTrailingStop"); openapiFields.add("cancelReplaceAllowed"); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListenKeyExpired.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListenKeyExpired.java deleted file mode 100644 index 175c5404..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ListenKeyExpired.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.websocket.api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** ListenKeyExpired */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class ListenKeyExpired extends BaseDTO { - public static final String SERIALIZED_NAME_E = "E"; - - @SerializedName(SERIALIZED_NAME_E) - @jakarta.annotation.Nullable - private Long E; - - public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; - - @SerializedName(SERIALIZED_NAME_LISTEN_KEY) - @jakarta.annotation.Nullable - private String listenKey; - - public ListenKeyExpired() {} - - public ListenKeyExpired E(@jakarta.annotation.Nullable Long E) { - this.E = E; - return this; - } - - /** - * Get E - * - * @return E - */ - @jakarta.annotation.Nullable - public Long getE() { - return E; - } - - public void setE(@jakarta.annotation.Nullable Long E) { - this.E = E; - } - - public ListenKeyExpired listenKey(@jakarta.annotation.Nullable String listenKey) { - this.listenKey = listenKey; - return this; - } - - /** - * Get listenKey - * - * @return listenKey - */ - @jakarta.annotation.Nullable - public String getListenKey() { - return listenKey; - } - - public void setListenKey(@jakarta.annotation.Nullable String listenKey) { - this.listenKey = listenKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListenKeyExpired listenKeyExpired = (ListenKeyExpired) o; - return Objects.equals(this.E, listenKeyExpired.E) - && Objects.equals(this.listenKey, listenKeyExpired.listenKey); - } - - @Override - public int hashCode() { - return Objects.hash(E, listenKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListenKeyExpired {\n"); - sb.append(" E: ").append(toIndentedString(E)).append("\n"); - sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Long EValue = getE(); - if (EValue != null) { - String EValueAsString = EValue.toString(); - valMap.put("E", EValueAsString); - } - String listenKeyValue = getListenKey(); - if (listenKeyValue != null) { - String listenKeyValueAsString = listenKeyValue.toString(); - valMap.put("listenKey", listenKeyValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object EValue = getE(); - if (EValue != null) { - valMap.put("E", EValue); - } - Object listenKeyValue = getListenKey(); - if (listenKeyValue != null) { - valMap.put("listenKey", listenKeyValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("E"); - openapiFields.add("listenKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ListenKeyExpired - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListenKeyExpired.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListenKeyExpired is not found in the" - + " empty JSON string", - ListenKeyExpired.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListenKeyExpired.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListenKeyExpired` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) - && !jsonObj.get("listenKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `listenKey` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("listenKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListenKeyExpired.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListenKeyExpired' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ListenKeyExpired.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListenKeyExpired value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListenKeyExpired read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListenKeyExpired given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListenKeyExpired - * @throws IOException if the JSON string is invalid with respect to ListenKeyExpired - */ - public static ListenKeyExpired fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListenKeyExpired.class); - } - - /** - * Convert an instance of ListenKeyExpired to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoRequest.java new file mode 100644 index 00000000..6da842ea --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoRequest.java @@ -0,0 +1,1557 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListPlaceOpoRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListPlaceOpoRequest extends BaseDTO { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public static final String SERIALIZED_NAME_LIST_CLIENT_ORDER_ID = "listClientOrderId"; + + @SerializedName(SERIALIZED_NAME_LIST_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String listClientOrderId; + + 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_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nonnull + private WorkingType workingType; + + public static final String SERIALIZED_NAME_WORKING_SIDE = "workingSide"; + + @SerializedName(SERIALIZED_NAME_WORKING_SIDE) + @jakarta.annotation.Nonnull + private WorkingSide workingSide; + + public static final String SERIALIZED_NAME_WORKING_CLIENT_ORDER_ID = "workingClientOrderId"; + + @SerializedName(SERIALIZED_NAME_WORKING_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String workingClientOrderId; + + public static final String SERIALIZED_NAME_WORKING_PRICE = "workingPrice"; + + @SerializedName(SERIALIZED_NAME_WORKING_PRICE) + @jakarta.annotation.Nonnull + private Double workingPrice; + + public static final String SERIALIZED_NAME_WORKING_QUANTITY = "workingQuantity"; + + @SerializedName(SERIALIZED_NAME_WORKING_QUANTITY) + @jakarta.annotation.Nonnull + private Double workingQuantity; + + public static final String SERIALIZED_NAME_WORKING_ICEBERG_QTY = "workingIcebergQty"; + + @SerializedName(SERIALIZED_NAME_WORKING_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double workingIcebergQty; + + public static final String SERIALIZED_NAME_WORKING_TIME_IN_FORCE = "workingTimeInForce"; + + @SerializedName(SERIALIZED_NAME_WORKING_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private WorkingTimeInForce workingTimeInForce; + + public static final String SERIALIZED_NAME_WORKING_STRATEGY_ID = "workingStrategyId"; + + @SerializedName(SERIALIZED_NAME_WORKING_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long workingStrategyId; + + public static final String SERIALIZED_NAME_WORKING_STRATEGY_TYPE = "workingStrategyType"; + + @SerializedName(SERIALIZED_NAME_WORKING_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer workingStrategyType; + + public static final String SERIALIZED_NAME_WORKING_PEG_PRICE_TYPE = "workingPegPriceType"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private WorkingPegPriceType workingPegPriceType; + + public static final String SERIALIZED_NAME_WORKING_PEG_OFFSET_TYPE = "workingPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private WorkingPegOffsetType workingPegOffsetType; + + public static final String SERIALIZED_NAME_WORKING_PEG_OFFSET_VALUE = "workingPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer workingPegOffsetValue; + + public static final String SERIALIZED_NAME_PENDING_TYPE = "pendingType"; + + @SerializedName(SERIALIZED_NAME_PENDING_TYPE) + @jakarta.annotation.Nonnull + private PendingType pendingType; + + public static final String SERIALIZED_NAME_PENDING_SIDE = "pendingSide"; + + @SerializedName(SERIALIZED_NAME_PENDING_SIDE) + @jakarta.annotation.Nonnull + private PendingSide pendingSide; + + public static final String SERIALIZED_NAME_PENDING_CLIENT_ORDER_ID = "pendingClientOrderId"; + + @SerializedName(SERIALIZED_NAME_PENDING_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String pendingClientOrderId; + + public static final String SERIALIZED_NAME_PENDING_PRICE = "pendingPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_PRICE) + @jakarta.annotation.Nullable + private Double pendingPrice; + + public static final String SERIALIZED_NAME_PENDING_STOP_PRICE = "pendingStopPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_STOP_PRICE) + @jakarta.annotation.Nullable + private Double pendingStopPrice; + + public static final String SERIALIZED_NAME_PENDING_TRAILING_DELTA = "pendingTrailingDelta"; + + @SerializedName(SERIALIZED_NAME_PENDING_TRAILING_DELTA) + @jakarta.annotation.Nullable + private Double pendingTrailingDelta; + + public static final String SERIALIZED_NAME_PENDING_ICEBERG_QTY = "pendingIcebergQty"; + + @SerializedName(SERIALIZED_NAME_PENDING_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double pendingIcebergQty; + + public static final String SERIALIZED_NAME_PENDING_TIME_IN_FORCE = "pendingTimeInForce"; + + @SerializedName(SERIALIZED_NAME_PENDING_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private PendingTimeInForce pendingTimeInForce; + + public static final String SERIALIZED_NAME_PENDING_STRATEGY_ID = "pendingStrategyId"; + + @SerializedName(SERIALIZED_NAME_PENDING_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long pendingStrategyId; + + public static final String SERIALIZED_NAME_PENDING_STRATEGY_TYPE = "pendingStrategyType"; + + @SerializedName(SERIALIZED_NAME_PENDING_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer pendingStrategyType; + + public static final String SERIALIZED_NAME_PENDING_PEG_PRICE_TYPE = "pendingPegPriceType"; + + @SerializedName(SERIALIZED_NAME_PENDING_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PendingPegPriceType pendingPegPriceType; + + public static final String SERIALIZED_NAME_PENDING_PEG_OFFSET_TYPE = "pendingPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PENDING_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PendingPegOffsetType pendingPegOffsetType; + + public static final String SERIALIZED_NAME_PENDING_PEG_OFFSET_VALUE = "pendingPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PENDING_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pendingPegOffsetValue; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Double recvWindow; + + public OrderListPlaceOpoRequest() {} + + public OrderListPlaceOpoRequest 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 OrderListPlaceOpoRequest listClientOrderId( + @jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + return this; + } + + /** + * Get listClientOrderId + * + * @return listClientOrderId + */ + @jakarta.annotation.Nullable + public String getListClientOrderId() { + return listClientOrderId; + } + + public void setListClientOrderId(@jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + } + + public OrderListPlaceOpoRequest 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 OrderListPlaceOpoRequest 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 OrderListPlaceOpoRequest workingType( + @jakarta.annotation.Nonnull WorkingType workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public WorkingType getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nonnull WorkingType workingType) { + this.workingType = workingType; + } + + public OrderListPlaceOpoRequest workingSide( + @jakarta.annotation.Nonnull WorkingSide workingSide) { + this.workingSide = workingSide; + return this; + } + + /** + * Get workingSide + * + * @return workingSide + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public WorkingSide getWorkingSide() { + return workingSide; + } + + public void setWorkingSide(@jakarta.annotation.Nonnull WorkingSide workingSide) { + this.workingSide = workingSide; + } + + public OrderListPlaceOpoRequest workingClientOrderId( + @jakarta.annotation.Nullable String workingClientOrderId) { + this.workingClientOrderId = workingClientOrderId; + return this; + } + + /** + * Get workingClientOrderId + * + * @return workingClientOrderId + */ + @jakarta.annotation.Nullable + public String getWorkingClientOrderId() { + return workingClientOrderId; + } + + public void setWorkingClientOrderId(@jakarta.annotation.Nullable String workingClientOrderId) { + this.workingClientOrderId = workingClientOrderId; + } + + public OrderListPlaceOpoRequest workingPrice(@jakarta.annotation.Nonnull Double workingPrice) { + this.workingPrice = workingPrice; + return this; + } + + /** + * Get workingPrice + * + * @return workingPrice + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getWorkingPrice() { + return workingPrice; + } + + public void setWorkingPrice(@jakarta.annotation.Nonnull Double workingPrice) { + this.workingPrice = workingPrice; + } + + public OrderListPlaceOpoRequest workingQuantity( + @jakarta.annotation.Nonnull Double workingQuantity) { + this.workingQuantity = workingQuantity; + return this; + } + + /** + * Get workingQuantity + * + * @return workingQuantity + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getWorkingQuantity() { + return workingQuantity; + } + + public void setWorkingQuantity(@jakarta.annotation.Nonnull Double workingQuantity) { + this.workingQuantity = workingQuantity; + } + + public OrderListPlaceOpoRequest workingIcebergQty( + @jakarta.annotation.Nullable Double workingIcebergQty) { + this.workingIcebergQty = workingIcebergQty; + return this; + } + + /** + * Get workingIcebergQty + * + * @return workingIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getWorkingIcebergQty() { + return workingIcebergQty; + } + + public void setWorkingIcebergQty(@jakarta.annotation.Nullable Double workingIcebergQty) { + this.workingIcebergQty = workingIcebergQty; + } + + public OrderListPlaceOpoRequest workingTimeInForce( + @jakarta.annotation.Nullable WorkingTimeInForce workingTimeInForce) { + this.workingTimeInForce = workingTimeInForce; + return this; + } + + /** + * Get workingTimeInForce + * + * @return workingTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public WorkingTimeInForce getWorkingTimeInForce() { + return workingTimeInForce; + } + + public void setWorkingTimeInForce( + @jakarta.annotation.Nullable WorkingTimeInForce workingTimeInForce) { + this.workingTimeInForce = workingTimeInForce; + } + + public OrderListPlaceOpoRequest workingStrategyId( + @jakarta.annotation.Nullable Long workingStrategyId) { + this.workingStrategyId = workingStrategyId; + return this; + } + + /** + * Get workingStrategyId + * + * @return workingStrategyId + */ + @jakarta.annotation.Nullable + public Long getWorkingStrategyId() { + return workingStrategyId; + } + + public void setWorkingStrategyId(@jakarta.annotation.Nullable Long workingStrategyId) { + this.workingStrategyId = workingStrategyId; + } + + public OrderListPlaceOpoRequest workingStrategyType( + @jakarta.annotation.Nullable Integer workingStrategyType) { + this.workingStrategyType = workingStrategyType; + return this; + } + + /** + * Get workingStrategyType + * + * @return workingStrategyType + */ + @jakarta.annotation.Nullable + public Integer getWorkingStrategyType() { + return workingStrategyType; + } + + public void setWorkingStrategyType(@jakarta.annotation.Nullable Integer workingStrategyType) { + this.workingStrategyType = workingStrategyType; + } + + public OrderListPlaceOpoRequest workingPegPriceType( + @jakarta.annotation.Nullable WorkingPegPriceType workingPegPriceType) { + this.workingPegPriceType = workingPegPriceType; + return this; + } + + /** + * Get workingPegPriceType + * + * @return workingPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingPegPriceType getWorkingPegPriceType() { + return workingPegPriceType; + } + + public void setWorkingPegPriceType( + @jakarta.annotation.Nullable WorkingPegPriceType workingPegPriceType) { + this.workingPegPriceType = workingPegPriceType; + } + + public OrderListPlaceOpoRequest workingPegOffsetType( + @jakarta.annotation.Nullable WorkingPegOffsetType workingPegOffsetType) { + this.workingPegOffsetType = workingPegOffsetType; + return this; + } + + /** + * Get workingPegOffsetType + * + * @return workingPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingPegOffsetType getWorkingPegOffsetType() { + return workingPegOffsetType; + } + + public void setWorkingPegOffsetType( + @jakarta.annotation.Nullable WorkingPegOffsetType workingPegOffsetType) { + this.workingPegOffsetType = workingPegOffsetType; + } + + public OrderListPlaceOpoRequest workingPegOffsetValue( + @jakarta.annotation.Nullable Integer workingPegOffsetValue) { + this.workingPegOffsetValue = workingPegOffsetValue; + return this; + } + + /** + * Get workingPegOffsetValue + * + * @return workingPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getWorkingPegOffsetValue() { + return workingPegOffsetValue; + } + + public void setWorkingPegOffsetValue( + @jakarta.annotation.Nullable Integer workingPegOffsetValue) { + this.workingPegOffsetValue = workingPegOffsetValue; + } + + public OrderListPlaceOpoRequest pendingType( + @jakarta.annotation.Nonnull PendingType pendingType) { + this.pendingType = pendingType; + return this; + } + + /** + * Get pendingType + * + * @return pendingType + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public PendingType getPendingType() { + return pendingType; + } + + public void setPendingType(@jakarta.annotation.Nonnull PendingType pendingType) { + this.pendingType = pendingType; + } + + public OrderListPlaceOpoRequest pendingSide( + @jakarta.annotation.Nonnull PendingSide pendingSide) { + this.pendingSide = pendingSide; + return this; + } + + /** + * Get pendingSide + * + * @return pendingSide + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public PendingSide getPendingSide() { + return pendingSide; + } + + public void setPendingSide(@jakarta.annotation.Nonnull PendingSide pendingSide) { + this.pendingSide = pendingSide; + } + + public OrderListPlaceOpoRequest pendingClientOrderId( + @jakarta.annotation.Nullable String pendingClientOrderId) { + this.pendingClientOrderId = pendingClientOrderId; + return this; + } + + /** + * Get pendingClientOrderId + * + * @return pendingClientOrderId + */ + @jakarta.annotation.Nullable + public String getPendingClientOrderId() { + return pendingClientOrderId; + } + + public void setPendingClientOrderId(@jakarta.annotation.Nullable String pendingClientOrderId) { + this.pendingClientOrderId = pendingClientOrderId; + } + + public OrderListPlaceOpoRequest pendingPrice(@jakarta.annotation.Nullable Double pendingPrice) { + this.pendingPrice = pendingPrice; + return this; + } + + /** + * Get pendingPrice + * + * @return pendingPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingPrice() { + return pendingPrice; + } + + public void setPendingPrice(@jakarta.annotation.Nullable Double pendingPrice) { + this.pendingPrice = pendingPrice; + } + + public OrderListPlaceOpoRequest pendingStopPrice( + @jakarta.annotation.Nullable Double pendingStopPrice) { + this.pendingStopPrice = pendingStopPrice; + return this; + } + + /** + * Get pendingStopPrice + * + * @return pendingStopPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingStopPrice() { + return pendingStopPrice; + } + + public void setPendingStopPrice(@jakarta.annotation.Nullable Double pendingStopPrice) { + this.pendingStopPrice = pendingStopPrice; + } + + public OrderListPlaceOpoRequest pendingTrailingDelta( + @jakarta.annotation.Nullable Double pendingTrailingDelta) { + this.pendingTrailingDelta = pendingTrailingDelta; + return this; + } + + /** + * Get pendingTrailingDelta + * + * @return pendingTrailingDelta + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingTrailingDelta() { + return pendingTrailingDelta; + } + + public void setPendingTrailingDelta(@jakarta.annotation.Nullable Double pendingTrailingDelta) { + this.pendingTrailingDelta = pendingTrailingDelta; + } + + public OrderListPlaceOpoRequest pendingIcebergQty( + @jakarta.annotation.Nullable Double pendingIcebergQty) { + this.pendingIcebergQty = pendingIcebergQty; + return this; + } + + /** + * Get pendingIcebergQty + * + * @return pendingIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingIcebergQty() { + return pendingIcebergQty; + } + + public void setPendingIcebergQty(@jakarta.annotation.Nullable Double pendingIcebergQty) { + this.pendingIcebergQty = pendingIcebergQty; + } + + public OrderListPlaceOpoRequest pendingTimeInForce( + @jakarta.annotation.Nullable PendingTimeInForce pendingTimeInForce) { + this.pendingTimeInForce = pendingTimeInForce; + return this; + } + + /** + * Get pendingTimeInForce + * + * @return pendingTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public PendingTimeInForce getPendingTimeInForce() { + return pendingTimeInForce; + } + + public void setPendingTimeInForce( + @jakarta.annotation.Nullable PendingTimeInForce pendingTimeInForce) { + this.pendingTimeInForce = pendingTimeInForce; + } + + public OrderListPlaceOpoRequest pendingStrategyId( + @jakarta.annotation.Nullable Long pendingStrategyId) { + this.pendingStrategyId = pendingStrategyId; + return this; + } + + /** + * Get pendingStrategyId + * + * @return pendingStrategyId + */ + @jakarta.annotation.Nullable + public Long getPendingStrategyId() { + return pendingStrategyId; + } + + public void setPendingStrategyId(@jakarta.annotation.Nullable Long pendingStrategyId) { + this.pendingStrategyId = pendingStrategyId; + } + + public OrderListPlaceOpoRequest pendingStrategyType( + @jakarta.annotation.Nullable Integer pendingStrategyType) { + this.pendingStrategyType = pendingStrategyType; + return this; + } + + /** + * Get pendingStrategyType + * + * @return pendingStrategyType + */ + @jakarta.annotation.Nullable + public Integer getPendingStrategyType() { + return pendingStrategyType; + } + + public void setPendingStrategyType(@jakarta.annotation.Nullable Integer pendingStrategyType) { + this.pendingStrategyType = pendingStrategyType; + } + + public OrderListPlaceOpoRequest pendingPegPriceType( + @jakarta.annotation.Nullable PendingPegPriceType pendingPegPriceType) { + this.pendingPegPriceType = pendingPegPriceType; + return this; + } + + /** + * Get pendingPegPriceType + * + * @return pendingPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PendingPegPriceType getPendingPegPriceType() { + return pendingPegPriceType; + } + + public void setPendingPegPriceType( + @jakarta.annotation.Nullable PendingPegPriceType pendingPegPriceType) { + this.pendingPegPriceType = pendingPegPriceType; + } + + public OrderListPlaceOpoRequest pendingPegOffsetType( + @jakarta.annotation.Nullable PendingPegOffsetType pendingPegOffsetType) { + this.pendingPegOffsetType = pendingPegOffsetType; + return this; + } + + /** + * Get pendingPegOffsetType + * + * @return pendingPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PendingPegOffsetType getPendingPegOffsetType() { + return pendingPegOffsetType; + } + + public void setPendingPegOffsetType( + @jakarta.annotation.Nullable PendingPegOffsetType pendingPegOffsetType) { + this.pendingPegOffsetType = pendingPegOffsetType; + } + + public OrderListPlaceOpoRequest pendingPegOffsetValue( + @jakarta.annotation.Nullable Integer pendingPegOffsetValue) { + this.pendingPegOffsetValue = pendingPegOffsetValue; + return this; + } + + /** + * Get pendingPegOffsetValue + * + * @return pendingPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPendingPegOffsetValue() { + return pendingPegOffsetValue; + } + + public void setPendingPegOffsetValue( + @jakarta.annotation.Nullable Integer pendingPegOffsetValue) { + this.pendingPegOffsetValue = pendingPegOffsetValue; + } + + public OrderListPlaceOpoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + @Valid + public Double getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListPlaceOpoRequest orderListPlaceOpoRequest = (OrderListPlaceOpoRequest) o; + return Objects.equals(this.symbol, orderListPlaceOpoRequest.symbol) + && Objects.equals( + this.listClientOrderId, orderListPlaceOpoRequest.listClientOrderId) + && Objects.equals(this.newOrderRespType, orderListPlaceOpoRequest.newOrderRespType) + && Objects.equals( + this.selfTradePreventionMode, + orderListPlaceOpoRequest.selfTradePreventionMode) + && Objects.equals(this.workingType, orderListPlaceOpoRequest.workingType) + && Objects.equals(this.workingSide, orderListPlaceOpoRequest.workingSide) + && Objects.equals( + this.workingClientOrderId, orderListPlaceOpoRequest.workingClientOrderId) + && Objects.equals(this.workingPrice, orderListPlaceOpoRequest.workingPrice) + && Objects.equals(this.workingQuantity, orderListPlaceOpoRequest.workingQuantity) + && Objects.equals( + this.workingIcebergQty, orderListPlaceOpoRequest.workingIcebergQty) + && Objects.equals( + this.workingTimeInForce, orderListPlaceOpoRequest.workingTimeInForce) + && Objects.equals( + this.workingStrategyId, orderListPlaceOpoRequest.workingStrategyId) + && Objects.equals( + this.workingStrategyType, orderListPlaceOpoRequest.workingStrategyType) + && Objects.equals( + this.workingPegPriceType, orderListPlaceOpoRequest.workingPegPriceType) + && Objects.equals( + this.workingPegOffsetType, orderListPlaceOpoRequest.workingPegOffsetType) + && Objects.equals( + this.workingPegOffsetValue, orderListPlaceOpoRequest.workingPegOffsetValue) + && Objects.equals(this.pendingType, orderListPlaceOpoRequest.pendingType) + && Objects.equals(this.pendingSide, orderListPlaceOpoRequest.pendingSide) + && Objects.equals( + this.pendingClientOrderId, orderListPlaceOpoRequest.pendingClientOrderId) + && Objects.equals(this.pendingPrice, orderListPlaceOpoRequest.pendingPrice) + && Objects.equals(this.pendingStopPrice, orderListPlaceOpoRequest.pendingStopPrice) + && Objects.equals( + this.pendingTrailingDelta, orderListPlaceOpoRequest.pendingTrailingDelta) + && Objects.equals( + this.pendingIcebergQty, orderListPlaceOpoRequest.pendingIcebergQty) + && Objects.equals( + this.pendingTimeInForce, orderListPlaceOpoRequest.pendingTimeInForce) + && Objects.equals( + this.pendingStrategyId, orderListPlaceOpoRequest.pendingStrategyId) + && Objects.equals( + this.pendingStrategyType, orderListPlaceOpoRequest.pendingStrategyType) + && Objects.equals( + this.pendingPegPriceType, orderListPlaceOpoRequest.pendingPegPriceType) + && Objects.equals( + this.pendingPegOffsetType, orderListPlaceOpoRequest.pendingPegOffsetType) + && Objects.equals( + this.pendingPegOffsetValue, orderListPlaceOpoRequest.pendingPegOffsetValue) + && Objects.equals(this.recvWindow, orderListPlaceOpoRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + listClientOrderId, + newOrderRespType, + selfTradePreventionMode, + workingType, + workingSide, + workingClientOrderId, + workingPrice, + workingQuantity, + workingIcebergQty, + workingTimeInForce, + workingStrategyId, + workingStrategyType, + workingPegPriceType, + workingPegOffsetType, + workingPegOffsetValue, + pendingType, + pendingSide, + pendingClientOrderId, + pendingPrice, + pendingStopPrice, + pendingTrailingDelta, + pendingIcebergQty, + pendingTimeInForce, + pendingStrategyId, + pendingStrategyType, + pendingPegPriceType, + pendingPegOffsetType, + pendingPegOffsetValue, + recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListPlaceOpoRequest {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" listClientOrderId: ").append(toIndentedString(listClientOrderId)).append("\n"); + sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" workingSide: ").append(toIndentedString(workingSide)).append("\n"); + sb.append(" workingClientOrderId: ") + .append(toIndentedString(workingClientOrderId)) + .append("\n"); + sb.append(" workingPrice: ").append(toIndentedString(workingPrice)).append("\n"); + sb.append(" workingQuantity: ").append(toIndentedString(workingQuantity)).append("\n"); + sb.append(" workingIcebergQty: ").append(toIndentedString(workingIcebergQty)).append("\n"); + sb.append(" workingTimeInForce: ") + .append(toIndentedString(workingTimeInForce)) + .append("\n"); + sb.append(" workingStrategyId: ").append(toIndentedString(workingStrategyId)).append("\n"); + sb.append(" workingStrategyType: ") + .append(toIndentedString(workingStrategyType)) + .append("\n"); + sb.append(" workingPegPriceType: ") + .append(toIndentedString(workingPegPriceType)) + .append("\n"); + sb.append(" workingPegOffsetType: ") + .append(toIndentedString(workingPegOffsetType)) + .append("\n"); + sb.append(" workingPegOffsetValue: ") + .append(toIndentedString(workingPegOffsetValue)) + .append("\n"); + sb.append(" pendingType: ").append(toIndentedString(pendingType)).append("\n"); + sb.append(" pendingSide: ").append(toIndentedString(pendingSide)).append("\n"); + sb.append(" pendingClientOrderId: ") + .append(toIndentedString(pendingClientOrderId)) + .append("\n"); + sb.append(" pendingPrice: ").append(toIndentedString(pendingPrice)).append("\n"); + sb.append(" pendingStopPrice: ").append(toIndentedString(pendingStopPrice)).append("\n"); + sb.append(" pendingTrailingDelta: ") + .append(toIndentedString(pendingTrailingDelta)) + .append("\n"); + sb.append(" pendingIcebergQty: ").append(toIndentedString(pendingIcebergQty)).append("\n"); + sb.append(" pendingTimeInForce: ") + .append(toIndentedString(pendingTimeInForce)) + .append("\n"); + sb.append(" pendingStrategyId: ").append(toIndentedString(pendingStrategyId)).append("\n"); + sb.append(" pendingStrategyType: ") + .append(toIndentedString(pendingStrategyType)) + .append("\n"); + sb.append(" pendingPegPriceType: ") + .append(toIndentedString(pendingPegPriceType)) + .append("\n"); + sb.append(" pendingPegOffsetType: ") + .append(toIndentedString(pendingPegOffsetType)) + .append("\n"); + sb.append(" pendingPegOffsetValue: ") + .append(toIndentedString(pendingPegOffsetValue)) + .append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + String listClientOrderIdValue = getListClientOrderId(); + if (listClientOrderIdValue != null) { + String listClientOrderIdValueAsString = listClientOrderIdValue.toString(); + valMap.put("listClientOrderId", listClientOrderIdValueAsString); + } + NewOrderRespType newOrderRespTypeValue = getNewOrderRespType(); + if (newOrderRespTypeValue != null) { + String newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); + valMap.put("newOrderRespType", newOrderRespTypeValueAsString); + } + SelfTradePreventionMode selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); + } + WorkingType workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + String workingTypeValueAsString = workingTypeValue.toString(); + valMap.put("workingType", workingTypeValueAsString); + } + WorkingSide workingSideValue = getWorkingSide(); + if (workingSideValue != null) { + String workingSideValueAsString = workingSideValue.toString(); + valMap.put("workingSide", workingSideValueAsString); + } + String workingClientOrderIdValue = getWorkingClientOrderId(); + if (workingClientOrderIdValue != null) { + String workingClientOrderIdValueAsString = workingClientOrderIdValue.toString(); + valMap.put("workingClientOrderId", workingClientOrderIdValueAsString); + } + Double workingPriceValue = getWorkingPrice(); + if (workingPriceValue != null) { + String workingPriceValueAsString = + DecimalFormatter.getFormatter().format(workingPriceValue); + valMap.put("workingPrice", workingPriceValueAsString); + } + Double workingQuantityValue = getWorkingQuantity(); + if (workingQuantityValue != null) { + String workingQuantityValueAsString = + DecimalFormatter.getFormatter().format(workingQuantityValue); + valMap.put("workingQuantity", workingQuantityValueAsString); + } + Double workingIcebergQtyValue = getWorkingIcebergQty(); + if (workingIcebergQtyValue != null) { + String workingIcebergQtyValueAsString = + DecimalFormatter.getFormatter().format(workingIcebergQtyValue); + valMap.put("workingIcebergQty", workingIcebergQtyValueAsString); + } + WorkingTimeInForce workingTimeInForceValue = getWorkingTimeInForce(); + if (workingTimeInForceValue != null) { + String workingTimeInForceValueAsString = workingTimeInForceValue.toString(); + valMap.put("workingTimeInForce", workingTimeInForceValueAsString); + } + Long workingStrategyIdValue = getWorkingStrategyId(); + if (workingStrategyIdValue != null) { + String workingStrategyIdValueAsString = workingStrategyIdValue.toString(); + valMap.put("workingStrategyId", workingStrategyIdValueAsString); + } + Integer workingStrategyTypeValue = getWorkingStrategyType(); + if (workingStrategyTypeValue != null) { + String workingStrategyTypeValueAsString = workingStrategyTypeValue.toString(); + valMap.put("workingStrategyType", workingStrategyTypeValueAsString); + } + WorkingPegPriceType workingPegPriceTypeValue = getWorkingPegPriceType(); + if (workingPegPriceTypeValue != null) { + String workingPegPriceTypeValueAsString = workingPegPriceTypeValue.toString(); + valMap.put("workingPegPriceType", workingPegPriceTypeValueAsString); + } + WorkingPegOffsetType workingPegOffsetTypeValue = getWorkingPegOffsetType(); + if (workingPegOffsetTypeValue != null) { + String workingPegOffsetTypeValueAsString = workingPegOffsetTypeValue.toString(); + valMap.put("workingPegOffsetType", workingPegOffsetTypeValueAsString); + } + Integer workingPegOffsetValueValue = getWorkingPegOffsetValue(); + if (workingPegOffsetValueValue != null) { + String workingPegOffsetValueValueAsString = workingPegOffsetValueValue.toString(); + valMap.put("workingPegOffsetValue", workingPegOffsetValueValueAsString); + } + PendingType pendingTypeValue = getPendingType(); + if (pendingTypeValue != null) { + String pendingTypeValueAsString = pendingTypeValue.toString(); + valMap.put("pendingType", pendingTypeValueAsString); + } + PendingSide pendingSideValue = getPendingSide(); + if (pendingSideValue != null) { + String pendingSideValueAsString = pendingSideValue.toString(); + valMap.put("pendingSide", pendingSideValueAsString); + } + String pendingClientOrderIdValue = getPendingClientOrderId(); + if (pendingClientOrderIdValue != null) { + String pendingClientOrderIdValueAsString = pendingClientOrderIdValue.toString(); + valMap.put("pendingClientOrderId", pendingClientOrderIdValueAsString); + } + Double pendingPriceValue = getPendingPrice(); + if (pendingPriceValue != null) { + String pendingPriceValueAsString = + DecimalFormatter.getFormatter().format(pendingPriceValue); + valMap.put("pendingPrice", pendingPriceValueAsString); + } + Double pendingStopPriceValue = getPendingStopPrice(); + if (pendingStopPriceValue != null) { + String pendingStopPriceValueAsString = + DecimalFormatter.getFormatter().format(pendingStopPriceValue); + valMap.put("pendingStopPrice", pendingStopPriceValueAsString); + } + Double pendingTrailingDeltaValue = getPendingTrailingDelta(); + if (pendingTrailingDeltaValue != null) { + String pendingTrailingDeltaValueAsString = + DecimalFormatter.getFormatter().format(pendingTrailingDeltaValue); + valMap.put("pendingTrailingDelta", pendingTrailingDeltaValueAsString); + } + Double pendingIcebergQtyValue = getPendingIcebergQty(); + if (pendingIcebergQtyValue != null) { + String pendingIcebergQtyValueAsString = + DecimalFormatter.getFormatter().format(pendingIcebergQtyValue); + valMap.put("pendingIcebergQty", pendingIcebergQtyValueAsString); + } + PendingTimeInForce pendingTimeInForceValue = getPendingTimeInForce(); + if (pendingTimeInForceValue != null) { + String pendingTimeInForceValueAsString = pendingTimeInForceValue.toString(); + valMap.put("pendingTimeInForce", pendingTimeInForceValueAsString); + } + Long pendingStrategyIdValue = getPendingStrategyId(); + if (pendingStrategyIdValue != null) { + String pendingStrategyIdValueAsString = pendingStrategyIdValue.toString(); + valMap.put("pendingStrategyId", pendingStrategyIdValueAsString); + } + Integer pendingStrategyTypeValue = getPendingStrategyType(); + if (pendingStrategyTypeValue != null) { + String pendingStrategyTypeValueAsString = pendingStrategyTypeValue.toString(); + valMap.put("pendingStrategyType", pendingStrategyTypeValueAsString); + } + PendingPegPriceType pendingPegPriceTypeValue = getPendingPegPriceType(); + if (pendingPegPriceTypeValue != null) { + String pendingPegPriceTypeValueAsString = pendingPegPriceTypeValue.toString(); + valMap.put("pendingPegPriceType", pendingPegPriceTypeValueAsString); + } + PendingPegOffsetType pendingPegOffsetTypeValue = getPendingPegOffsetType(); + if (pendingPegOffsetTypeValue != null) { + String pendingPegOffsetTypeValueAsString = pendingPegOffsetTypeValue.toString(); + valMap.put("pendingPegOffsetType", pendingPegOffsetTypeValueAsString); + } + Integer pendingPegOffsetValueValue = getPendingPegOffsetValue(); + if (pendingPegOffsetValueValue != null) { + String pendingPegOffsetValueValueAsString = pendingPegOffsetValueValue.toString(); + valMap.put("pendingPegOffsetValue", pendingPegOffsetValueValueAsString); + } + Double recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); + valMap.put("recvWindow", recvWindowValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object listClientOrderIdValue = getListClientOrderId(); + if (listClientOrderIdValue != null) { + valMap.put("listClientOrderId", listClientOrderIdValue); + } + Object newOrderRespTypeValue = getNewOrderRespType(); + if (newOrderRespTypeValue != null) { + valMap.put("newOrderRespType", newOrderRespTypeValue); + } + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); + } + Object workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + valMap.put("workingType", workingTypeValue); + } + Object workingSideValue = getWorkingSide(); + if (workingSideValue != null) { + valMap.put("workingSide", workingSideValue); + } + Object workingClientOrderIdValue = getWorkingClientOrderId(); + if (workingClientOrderIdValue != null) { + valMap.put("workingClientOrderId", workingClientOrderIdValue); + } + Object workingPriceValue = getWorkingPrice(); + if (workingPriceValue != null) { + valMap.put("workingPrice", workingPriceValue); + } + Object workingQuantityValue = getWorkingQuantity(); + if (workingQuantityValue != null) { + valMap.put("workingQuantity", workingQuantityValue); + } + Object workingIcebergQtyValue = getWorkingIcebergQty(); + if (workingIcebergQtyValue != null) { + valMap.put("workingIcebergQty", workingIcebergQtyValue); + } + Object workingTimeInForceValue = getWorkingTimeInForce(); + if (workingTimeInForceValue != null) { + valMap.put("workingTimeInForce", workingTimeInForceValue); + } + Object workingStrategyIdValue = getWorkingStrategyId(); + if (workingStrategyIdValue != null) { + valMap.put("workingStrategyId", workingStrategyIdValue); + } + Object workingStrategyTypeValue = getWorkingStrategyType(); + if (workingStrategyTypeValue != null) { + valMap.put("workingStrategyType", workingStrategyTypeValue); + } + Object workingPegPriceTypeValue = getWorkingPegPriceType(); + if (workingPegPriceTypeValue != null) { + valMap.put("workingPegPriceType", workingPegPriceTypeValue); + } + Object workingPegOffsetTypeValue = getWorkingPegOffsetType(); + if (workingPegOffsetTypeValue != null) { + valMap.put("workingPegOffsetType", workingPegOffsetTypeValue); + } + Object workingPegOffsetValueValue = getWorkingPegOffsetValue(); + if (workingPegOffsetValueValue != null) { + valMap.put("workingPegOffsetValue", workingPegOffsetValueValue); + } + Object pendingTypeValue = getPendingType(); + if (pendingTypeValue != null) { + valMap.put("pendingType", pendingTypeValue); + } + Object pendingSideValue = getPendingSide(); + if (pendingSideValue != null) { + valMap.put("pendingSide", pendingSideValue); + } + Object pendingClientOrderIdValue = getPendingClientOrderId(); + if (pendingClientOrderIdValue != null) { + valMap.put("pendingClientOrderId", pendingClientOrderIdValue); + } + Object pendingPriceValue = getPendingPrice(); + if (pendingPriceValue != null) { + valMap.put("pendingPrice", pendingPriceValue); + } + Object pendingStopPriceValue = getPendingStopPrice(); + if (pendingStopPriceValue != null) { + valMap.put("pendingStopPrice", pendingStopPriceValue); + } + Object pendingTrailingDeltaValue = getPendingTrailingDelta(); + if (pendingTrailingDeltaValue != null) { + valMap.put("pendingTrailingDelta", pendingTrailingDeltaValue); + } + Object pendingIcebergQtyValue = getPendingIcebergQty(); + if (pendingIcebergQtyValue != null) { + valMap.put("pendingIcebergQty", pendingIcebergQtyValue); + } + Object pendingTimeInForceValue = getPendingTimeInForce(); + if (pendingTimeInForceValue != null) { + valMap.put("pendingTimeInForce", pendingTimeInForceValue); + } + Object pendingStrategyIdValue = getPendingStrategyId(); + if (pendingStrategyIdValue != null) { + valMap.put("pendingStrategyId", pendingStrategyIdValue); + } + Object pendingStrategyTypeValue = getPendingStrategyType(); + if (pendingStrategyTypeValue != null) { + valMap.put("pendingStrategyType", pendingStrategyTypeValue); + } + Object pendingPegPriceTypeValue = getPendingPegPriceType(); + if (pendingPegPriceTypeValue != null) { + valMap.put("pendingPegPriceType", pendingPegPriceTypeValue); + } + Object pendingPegOffsetTypeValue = getPendingPegOffsetType(); + if (pendingPegOffsetTypeValue != null) { + valMap.put("pendingPegOffsetType", pendingPegOffsetTypeValue); + } + Object pendingPegOffsetValueValue = getPendingPegOffsetValue(); + if (pendingPegOffsetValueValue != null) { + valMap.put("pendingPegOffsetValue", pendingPegOffsetValueValue); + } + Object recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + valMap.put("recvWindow", recvWindowValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("listClientOrderId"); + openapiFields.add("newOrderRespType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("workingSide"); + openapiFields.add("workingClientOrderId"); + openapiFields.add("workingPrice"); + openapiFields.add("workingQuantity"); + openapiFields.add("workingIcebergQty"); + openapiFields.add("workingTimeInForce"); + openapiFields.add("workingStrategyId"); + openapiFields.add("workingStrategyType"); + openapiFields.add("workingPegPriceType"); + openapiFields.add("workingPegOffsetType"); + openapiFields.add("workingPegOffsetValue"); + openapiFields.add("pendingType"); + openapiFields.add("pendingSide"); + openapiFields.add("pendingClientOrderId"); + openapiFields.add("pendingPrice"); + openapiFields.add("pendingStopPrice"); + openapiFields.add("pendingTrailingDelta"); + openapiFields.add("pendingIcebergQty"); + openapiFields.add("pendingTimeInForce"); + openapiFields.add("pendingStrategyId"); + openapiFields.add("pendingStrategyType"); + openapiFields.add("pendingPegPriceType"); + openapiFields.add("pendingPegOffsetType"); + openapiFields.add("pendingPegOffsetValue"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("symbol"); + openapiRequiredFields.add("workingType"); + openapiRequiredFields.add("workingSide"); + openapiRequiredFields.add("workingPrice"); + openapiRequiredFields.add("workingQuantity"); + openapiRequiredFields.add("pendingType"); + openapiRequiredFields.add("pendingSide"); + } + + /** + * 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 OrderListPlaceOpoRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListPlaceOpoRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListPlaceOpoRequest is not found" + + " in the empty JSON string", + OrderListPlaceOpoRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderListPlaceOpoRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderListPlaceOpoRequest` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrderListPlaceOpoRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("listClientOrderId") != null + && !jsonObj.get("listClientOrderId").isJsonNull()) + && !jsonObj.get("listClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listClientOrderId").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")); + } + // validate the required field `workingType` + WorkingType.validateJsonElement(jsonObj.get("workingType")); + // validate the required field `workingSide` + WorkingSide.validateJsonElement(jsonObj.get("workingSide")); + if ((jsonObj.get("workingClientOrderId") != null + && !jsonObj.get("workingClientOrderId").isJsonNull()) + && !jsonObj.get("workingClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingClientOrderId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("workingClientOrderId").toString())); + } + // validate the optional field `workingTimeInForce` + if (jsonObj.get("workingTimeInForce") != null + && !jsonObj.get("workingTimeInForce").isJsonNull()) { + WorkingTimeInForce.validateJsonElement(jsonObj.get("workingTimeInForce")); + } + // validate the optional field `workingPegPriceType` + if (jsonObj.get("workingPegPriceType") != null + && !jsonObj.get("workingPegPriceType").isJsonNull()) { + WorkingPegPriceType.validateJsonElement(jsonObj.get("workingPegPriceType")); + } + // validate the optional field `workingPegOffsetType` + if (jsonObj.get("workingPegOffsetType") != null + && !jsonObj.get("workingPegOffsetType").isJsonNull()) { + WorkingPegOffsetType.validateJsonElement(jsonObj.get("workingPegOffsetType")); + } + // validate the required field `pendingType` + PendingType.validateJsonElement(jsonObj.get("pendingType")); + // validate the required field `pendingSide` + PendingSide.validateJsonElement(jsonObj.get("pendingSide")); + if ((jsonObj.get("pendingClientOrderId") != null + && !jsonObj.get("pendingClientOrderId").isJsonNull()) + && !jsonObj.get("pendingClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pendingClientOrderId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("pendingClientOrderId").toString())); + } + // validate the optional field `pendingTimeInForce` + if (jsonObj.get("pendingTimeInForce") != null + && !jsonObj.get("pendingTimeInForce").isJsonNull()) { + PendingTimeInForce.validateJsonElement(jsonObj.get("pendingTimeInForce")); + } + // validate the optional field `pendingPegPriceType` + if (jsonObj.get("pendingPegPriceType") != null + && !jsonObj.get("pendingPegPriceType").isJsonNull()) { + PendingPegPriceType.validateJsonElement(jsonObj.get("pendingPegPriceType")); + } + // validate the optional field `pendingPegOffsetType` + if (jsonObj.get("pendingPegOffsetType") != null + && !jsonObj.get("pendingPegOffsetType").isJsonNull()) { + PendingPegOffsetType.validateJsonElement(jsonObj.get("pendingPegOffsetType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListPlaceOpoRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListPlaceOpoRequest' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderListPlaceOpoRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListPlaceOpoRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListPlaceOpoRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListPlaceOpoRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListPlaceOpoRequest + * @throws IOException if the JSON string is invalid with respect to OrderListPlaceOpoRequest + */ + public static OrderListPlaceOpoRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListPlaceOpoRequest.class); + } + + /** + * Convert an instance of OrderListPlaceOpoRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponse.java similarity index 58% rename from clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponse.java index 54097d59..33dc9421 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -28,9 +27,7 @@ import jakarta.validation.constraints.*; import java.io.IOException; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -38,11 +35,11 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** UserDataStreamStopResponse */ +/** OrderListPlaceOpoResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class UserDataStreamStopResponse extends BaseDTO { +public class OrderListPlaceOpoResponse extends BaseDTO { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,21 +52,15 @@ public class UserDataStreamStopResponse extends BaseDTO { @jakarta.annotation.Nullable private Long status; - public static final String SERIALIZED_NAME_RESPONSE = "response"; + public static final String SERIALIZED_NAME_RESULT = "result"; - @SerializedName(SERIALIZED_NAME_RESPONSE) + @SerializedName(SERIALIZED_NAME_RESULT) @jakarta.annotation.Nullable - private Object response; + private OrderListPlaceOpoResponseResult result; - public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; + public OrderListPlaceOpoResponse() {} - @SerializedName(SERIALIZED_NAME_RATE_LIMITS) - @jakarta.annotation.Nullable - private List<@Valid RateLimits> rateLimits; - - public UserDataStreamStopResponse() {} - - public UserDataStreamStopResponse id(@jakarta.annotation.Nullable String id) { + public OrderListPlaceOpoResponse id(@jakarta.annotation.Nullable String id) { this.id = id; return this; } @@ -88,7 +79,7 @@ public void setId(@jakarta.annotation.Nullable String id) { this.id = id; } - public UserDataStreamStopResponse status(@jakarta.annotation.Nullable Long status) { + public OrderListPlaceOpoResponse status(@jakarta.annotation.Nullable Long status) { this.status = status; return this; } @@ -107,52 +98,25 @@ public void setStatus(@jakarta.annotation.Nullable Long status) { this.status = status; } - public UserDataStreamStopResponse response(@jakarta.annotation.Nullable Object response) { - this.response = response; + public OrderListPlaceOpoResponse result( + @jakarta.annotation.Nullable OrderListPlaceOpoResponseResult result) { + this.result = result; return this; } /** - * Get response + * Get result * - * @return response - */ - @jakarta.annotation.Nullable - public Object getResponse() { - return response; - } - - public void setResponse(@jakarta.annotation.Nullable Object response) { - this.response = response; - } - - public UserDataStreamStopResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { - this.rateLimits = rateLimits; - return this; - } - - public UserDataStreamStopResponse addRateLimitsItem(RateLimits rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - - /** - * Get rateLimits - * - * @return rateLimits + * @return result */ @jakarta.annotation.Nullable @Valid - public List<@Valid RateLimits> getRateLimits() { - return rateLimits; + public OrderListPlaceOpoResponseResult getResult() { + return result; } - public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { - this.rateLimits = rateLimits; + public void setResult(@jakarta.annotation.Nullable OrderListPlaceOpoResponseResult result) { + this.result = result; } @Override @@ -163,26 +127,24 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - UserDataStreamStopResponse userDataStreamStopResponse = (UserDataStreamStopResponse) o; - return Objects.equals(this.id, userDataStreamStopResponse.id) - && Objects.equals(this.status, userDataStreamStopResponse.status) - && Objects.equals(this.response, userDataStreamStopResponse.response) - && Objects.equals(this.rateLimits, userDataStreamStopResponse.rateLimits); + OrderListPlaceOpoResponse orderListPlaceOpoResponse = (OrderListPlaceOpoResponse) o; + return Objects.equals(this.id, orderListPlaceOpoResponse.id) + && Objects.equals(this.status, orderListPlaceOpoResponse.status) + && Objects.equals(this.result, orderListPlaceOpoResponse.result); } @Override public int hashCode() { - return Objects.hash(id, status, response, rateLimits); + return Objects.hash(id, status, result); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class UserDataStreamStopResponse {\n"); + sb.append("class OrderListPlaceOpoResponse {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - sb.append(" rateLimits: ").append(toIndentedString(rateLimits)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); sb.append("}"); return sb.toString(); } @@ -201,15 +163,10 @@ public String toUrlQueryString() { String statusValueAsString = statusValue.toString(); valMap.put("status", statusValueAsString); } - Object responseValue = getResponse(); - if (responseValue != null) { - String responseValueAsString = responseValue.toString(); - valMap.put("response", responseValueAsString); - } - List<@Valid RateLimits> rateLimitsValue = getRateLimits(); - if (rateLimitsValue != null) { - String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); - valMap.put("rateLimits", rateLimitsValueAsString); + OrderListPlaceOpoResponseResult resultValue = getResult(); + if (resultValue != null) { + String resultValueAsString = JSON.getGson().toJson(resultValue); + valMap.put("result", resultValueAsString); } valMap.put("timestamp", getTimestamp()); @@ -230,13 +187,9 @@ public Map toMap() { if (statusValue != null) { valMap.put("status", statusValue); } - Object responseValue = getResponse(); - if (responseValue != null) { - valMap.put("response", responseValue); - } - Object rateLimitsValue = getRateLimits(); - if (rateLimitsValue != null) { - valMap.put("rateLimits", rateLimitsValue); + Object resultValue = getResult(); + if (resultValue != null) { + valMap.put("result", resultValue); } valMap.put("timestamp", getTimestamp()); @@ -266,8 +219,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("id"); openapiFields.add("status"); - openapiFields.add("response"); - openapiFields.add("rateLimits"); + openapiFields.add("result"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -277,28 +229,28 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserDataStreamStopResponse + * @throws IOException if the JSON Element is invalid with respect to OrderListPlaceOpoResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!UserDataStreamStopResponse.openapiRequiredFields + if (!OrderListPlaceOpoResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in UserDataStreamStopResponse is not" - + " found in the empty JSON string", - UserDataStreamStopResponse.openapiRequiredFields.toString())); + "The required field(s) %s in OrderListPlaceOpoResponse is not found" + + " in the empty JSON string", + OrderListPlaceOpoResponse.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!UserDataStreamStopResponse.openapiFields.contains(entry.getKey())) { + if (!OrderListPlaceOpoResponse.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `UserDataStreamStopResponse` properties. JSON: %s", + + " `OrderListPlaceOpoResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -311,24 +263,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("id").toString())); } - if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { - JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); - if (jsonArrayrateLimits != null) { - // ensure the json data is an array - if (!jsonObj.get("rateLimits").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimits` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimits").toString())); - } - - // validate the optional field `rateLimits` (array) - for (int i = 0; i < jsonArrayrateLimits.size(); i++) { - RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } + // validate the optional field `result` + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { + OrderListPlaceOpoResponseResult.validateJsonElement(jsonObj.get("result")); } } @@ -336,25 +273,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserDataStreamStopResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserDataStreamStopResponse' and its + if (!OrderListPlaceOpoResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListPlaceOpoResponse' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UserDataStreamStopResponse.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderListPlaceOpoResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, UserDataStreamStopResponse value) + public void write(JsonWriter out, OrderListPlaceOpoResponse value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public UserDataStreamStopResponse read(JsonReader in) throws IOException { + public OrderListPlaceOpoResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -364,18 +301,18 @@ public UserDataStreamStopResponse read(JsonReader in) throws IOException { } /** - * Create an instance of UserDataStreamStopResponse given an JSON string + * Create an instance of OrderListPlaceOpoResponse given an JSON string * * @param jsonString JSON string - * @return An instance of UserDataStreamStopResponse - * @throws IOException if the JSON string is invalid with respect to UserDataStreamStopResponse + * @return An instance of OrderListPlaceOpoResponse + * @throws IOException if the JSON string is invalid with respect to OrderListPlaceOpoResponse */ - public static UserDataStreamStopResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserDataStreamStopResponse.class); + public static OrderListPlaceOpoResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListPlaceOpoResponse.class); } /** - * Convert an instance of UserDataStreamStopResponse to an JSON string + * Convert an instance of OrderListPlaceOpoResponse to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResult.java new file mode 100644 index 00000000..85fa23eb --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResult.java @@ -0,0 +1,668 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListPlaceOpoResponseResult */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListPlaceOpoResponseResult extends BaseDTO { + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CONTINGENCY_TYPE = "contingencyType"; + + @SerializedName(SERIALIZED_NAME_CONTINGENCY_TYPE) + @jakarta.annotation.Nullable + private String contingencyType; + + public static final String SERIALIZED_NAME_LIST_STATUS_TYPE = "listStatusType"; + + @SerializedName(SERIALIZED_NAME_LIST_STATUS_TYPE) + @jakarta.annotation.Nullable + private String listStatusType; + + public static final String SERIALIZED_NAME_LIST_ORDER_STATUS = "listOrderStatus"; + + @SerializedName(SERIALIZED_NAME_LIST_ORDER_STATUS) + @jakarta.annotation.Nullable + private String listOrderStatus; + + public static final String SERIALIZED_NAME_LIST_CLIENT_ORDER_ID = "listClientOrderId"; + + @SerializedName(SERIALIZED_NAME_LIST_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String listClientOrderId; + + public static final String SERIALIZED_NAME_TRANSACTION_TIME = "transactionTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACTION_TIME) + @jakarta.annotation.Nullable + private Long transactionTime; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDERS = "orders"; + + @SerializedName(SERIALIZED_NAME_ORDERS) + @jakarta.annotation.Nullable + private List<@Valid OrderListPlaceOpoResponseResultOrdersInner> orders; + + public static final String SERIALIZED_NAME_ORDER_REPORTS = "orderReports"; + + @SerializedName(SERIALIZED_NAME_ORDER_REPORTS) + @jakarta.annotation.Nullable + private List<@Valid OrderListPlaceOpoResponseResultOrderReportsInner> orderReports; + + public OrderListPlaceOpoResponseResult() {} + + public OrderListPlaceOpoResponseResult orderListId( + @jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderListPlaceOpoResponseResult contingencyType( + @jakarta.annotation.Nullable String contingencyType) { + this.contingencyType = contingencyType; + return this; + } + + /** + * Get contingencyType + * + * @return contingencyType + */ + @jakarta.annotation.Nullable + public String getContingencyType() { + return contingencyType; + } + + public void setContingencyType(@jakarta.annotation.Nullable String contingencyType) { + this.contingencyType = contingencyType; + } + + public OrderListPlaceOpoResponseResult listStatusType( + @jakarta.annotation.Nullable String listStatusType) { + this.listStatusType = listStatusType; + return this; + } + + /** + * Get listStatusType + * + * @return listStatusType + */ + @jakarta.annotation.Nullable + public String getListStatusType() { + return listStatusType; + } + + public void setListStatusType(@jakarta.annotation.Nullable String listStatusType) { + this.listStatusType = listStatusType; + } + + public OrderListPlaceOpoResponseResult listOrderStatus( + @jakarta.annotation.Nullable String listOrderStatus) { + this.listOrderStatus = listOrderStatus; + return this; + } + + /** + * Get listOrderStatus + * + * @return listOrderStatus + */ + @jakarta.annotation.Nullable + public String getListOrderStatus() { + return listOrderStatus; + } + + public void setListOrderStatus(@jakarta.annotation.Nullable String listOrderStatus) { + this.listOrderStatus = listOrderStatus; + } + + public OrderListPlaceOpoResponseResult listClientOrderId( + @jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + return this; + } + + /** + * Get listClientOrderId + * + * @return listClientOrderId + */ + @jakarta.annotation.Nullable + public String getListClientOrderId() { + return listClientOrderId; + } + + public void setListClientOrderId(@jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + } + + public OrderListPlaceOpoResponseResult transactionTime( + @jakarta.annotation.Nullable Long transactionTime) { + this.transactionTime = transactionTime; + return this; + } + + /** + * Get transactionTime + * + * @return transactionTime + */ + @jakarta.annotation.Nullable + public Long getTransactionTime() { + return transactionTime; + } + + public void setTransactionTime(@jakarta.annotation.Nullable Long transactionTime) { + this.transactionTime = transactionTime; + } + + public OrderListPlaceOpoResponseResult 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 OrderListPlaceOpoResponseResult orders( + @jakarta.annotation.Nullable + List<@Valid OrderListPlaceOpoResponseResultOrdersInner> orders) { + this.orders = orders; + return this; + } + + public OrderListPlaceOpoResponseResult addOrdersItem( + OrderListPlaceOpoResponseResultOrdersInner ordersItem) { + if (this.orders == null) { + this.orders = new ArrayList<>(); + } + this.orders.add(ordersItem); + return this; + } + + /** + * Get orders + * + * @return orders + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OrderListPlaceOpoResponseResultOrdersInner> getOrders() { + return orders; + } + + public void setOrders( + @jakarta.annotation.Nullable + List<@Valid OrderListPlaceOpoResponseResultOrdersInner> orders) { + this.orders = orders; + } + + public OrderListPlaceOpoResponseResult orderReports( + @jakarta.annotation.Nullable + List<@Valid OrderListPlaceOpoResponseResultOrderReportsInner> orderReports) { + this.orderReports = orderReports; + return this; + } + + public OrderListPlaceOpoResponseResult addOrderReportsItem( + OrderListPlaceOpoResponseResultOrderReportsInner orderReportsItem) { + if (this.orderReports == null) { + this.orderReports = new ArrayList<>(); + } + this.orderReports.add(orderReportsItem); + return this; + } + + /** + * Get orderReports + * + * @return orderReports + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OrderListPlaceOpoResponseResultOrderReportsInner> getOrderReports() { + return orderReports; + } + + public void setOrderReports( + @jakarta.annotation.Nullable + List<@Valid OrderListPlaceOpoResponseResultOrderReportsInner> orderReports) { + this.orderReports = orderReports; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListPlaceOpoResponseResult orderListPlaceOpoResponseResult = + (OrderListPlaceOpoResponseResult) o; + return Objects.equals(this.orderListId, orderListPlaceOpoResponseResult.orderListId) + && Objects.equals( + this.contingencyType, orderListPlaceOpoResponseResult.contingencyType) + && Objects.equals( + this.listStatusType, orderListPlaceOpoResponseResult.listStatusType) + && Objects.equals( + this.listOrderStatus, orderListPlaceOpoResponseResult.listOrderStatus) + && Objects.equals( + this.listClientOrderId, orderListPlaceOpoResponseResult.listClientOrderId) + && Objects.equals( + this.transactionTime, orderListPlaceOpoResponseResult.transactionTime) + && Objects.equals(this.symbol, orderListPlaceOpoResponseResult.symbol) + && Objects.equals(this.orders, orderListPlaceOpoResponseResult.orders) + && Objects.equals(this.orderReports, orderListPlaceOpoResponseResult.orderReports); + } + + @Override + public int hashCode() { + return Objects.hash( + orderListId, + contingencyType, + listStatusType, + listOrderStatus, + listClientOrderId, + transactionTime, + symbol, + orders, + orderReports); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListPlaceOpoResponseResult {\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" contingencyType: ").append(toIndentedString(contingencyType)).append("\n"); + sb.append(" listStatusType: ").append(toIndentedString(listStatusType)).append("\n"); + sb.append(" listOrderStatus: ").append(toIndentedString(listOrderStatus)).append("\n"); + sb.append(" listClientOrderId: ").append(toIndentedString(listClientOrderId)).append("\n"); + sb.append(" transactionTime: ").append(toIndentedString(transactionTime)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orders: ").append(toIndentedString(orders)).append("\n"); + sb.append(" orderReports: ").append(toIndentedString(orderReports)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long orderListIdValue = getOrderListId(); + if (orderListIdValue != null) { + String orderListIdValueAsString = orderListIdValue.toString(); + valMap.put("orderListId", orderListIdValueAsString); + } + String contingencyTypeValue = getContingencyType(); + if (contingencyTypeValue != null) { + String contingencyTypeValueAsString = contingencyTypeValue.toString(); + valMap.put("contingencyType", contingencyTypeValueAsString); + } + String listStatusTypeValue = getListStatusType(); + if (listStatusTypeValue != null) { + String listStatusTypeValueAsString = listStatusTypeValue.toString(); + valMap.put("listStatusType", listStatusTypeValueAsString); + } + String listOrderStatusValue = getListOrderStatus(); + if (listOrderStatusValue != null) { + String listOrderStatusValueAsString = listOrderStatusValue.toString(); + valMap.put("listOrderStatus", listOrderStatusValueAsString); + } + String listClientOrderIdValue = getListClientOrderId(); + if (listClientOrderIdValue != null) { + String listClientOrderIdValueAsString = listClientOrderIdValue.toString(); + valMap.put("listClientOrderId", listClientOrderIdValueAsString); + } + Long transactionTimeValue = getTransactionTime(); + if (transactionTimeValue != null) { + String transactionTimeValueAsString = transactionTimeValue.toString(); + valMap.put("transactionTime", transactionTimeValueAsString); + } + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + List<@Valid OrderListPlaceOpoResponseResultOrdersInner> ordersValue = getOrders(); + if (ordersValue != null) { + String ordersValueAsString = JSON.getGson().toJson(ordersValue); + valMap.put("orders", ordersValueAsString); + } + List<@Valid OrderListPlaceOpoResponseResultOrderReportsInner> orderReportsValue = + getOrderReports(); + if (orderReportsValue != null) { + String orderReportsValueAsString = JSON.getGson().toJson(orderReportsValue); + valMap.put("orderReports", orderReportsValueAsString); + } + + 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 orderListIdValue = getOrderListId(); + if (orderListIdValue != null) { + valMap.put("orderListId", orderListIdValue); + } + Object contingencyTypeValue = getContingencyType(); + if (contingencyTypeValue != null) { + valMap.put("contingencyType", contingencyTypeValue); + } + Object listStatusTypeValue = getListStatusType(); + if (listStatusTypeValue != null) { + valMap.put("listStatusType", listStatusTypeValue); + } + Object listOrderStatusValue = getListOrderStatus(); + if (listOrderStatusValue != null) { + valMap.put("listOrderStatus", listOrderStatusValue); + } + Object listClientOrderIdValue = getListClientOrderId(); + if (listClientOrderIdValue != null) { + valMap.put("listClientOrderId", listClientOrderIdValue); + } + Object transactionTimeValue = getTransactionTime(); + if (transactionTimeValue != null) { + valMap.put("transactionTime", transactionTimeValue); + } + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object ordersValue = getOrders(); + if (ordersValue != null) { + valMap.put("orders", ordersValue); + } + Object orderReportsValue = getOrderReports(); + if (orderReportsValue != null) { + valMap.put("orderReports", orderReportsValue); + } + + 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("orderListId"); + openapiFields.add("contingencyType"); + openapiFields.add("listStatusType"); + openapiFields.add("listOrderStatus"); + openapiFields.add("listClientOrderId"); + openapiFields.add("transactionTime"); + openapiFields.add("symbol"); + openapiFields.add("orders"); + openapiFields.add("orderReports"); + + // 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 + * OrderListPlaceOpoResponseResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListPlaceOpoResponseResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListPlaceOpoResponseResult is not" + + " found in the empty JSON string", + OrderListPlaceOpoResponseResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderListPlaceOpoResponseResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderListPlaceOpoResponseResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) + && !jsonObj.get("contingencyType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `contingencyType` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("contingencyType").toString())); + } + if ((jsonObj.get("listStatusType") != null && !jsonObj.get("listStatusType").isJsonNull()) + && !jsonObj.get("listStatusType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listStatusType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("listStatusType").toString())); + } + if ((jsonObj.get("listOrderStatus") != null && !jsonObj.get("listOrderStatus").isJsonNull()) + && !jsonObj.get("listOrderStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listOrderStatus` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listOrderStatus").toString())); + } + if ((jsonObj.get("listClientOrderId") != null + && !jsonObj.get("listClientOrderId").isJsonNull()) + && !jsonObj.get("listClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listClientOrderId").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("orders") != null && !jsonObj.get("orders").isJsonNull()) { + JsonArray jsonArrayorders = jsonObj.getAsJsonArray("orders"); + if (jsonArrayorders != null) { + // ensure the json data is an array + if (!jsonObj.get("orders").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orders` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("orders").toString())); + } + + // validate the optional field `orders` (array) + for (int i = 0; i < jsonArrayorders.size(); i++) { + OrderListPlaceOpoResponseResultOrdersInner.validateJsonElement( + jsonArrayorders.get(i)); + } + ; + } + } + if (jsonObj.get("orderReports") != null && !jsonObj.get("orderReports").isJsonNull()) { + JsonArray jsonArrayorderReports = jsonObj.getAsJsonArray("orderReports"); + if (jsonArrayorderReports != null) { + // ensure the json data is an array + if (!jsonObj.get("orderReports").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderReports` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("orderReports").toString())); + } + + // validate the optional field `orderReports` (array) + for (int i = 0; i < jsonArrayorderReports.size(); i++) { + OrderListPlaceOpoResponseResultOrderReportsInner.validateJsonElement( + jsonArrayorderReports.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListPlaceOpoResponseResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListPlaceOpoResponseResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderListPlaceOpoResponseResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListPlaceOpoResponseResult value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListPlaceOpoResponseResult read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListPlaceOpoResponseResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListPlaceOpoResponseResult + * @throws IOException if the JSON string is invalid with respect to + * OrderListPlaceOpoResponseResult + */ + public static OrderListPlaceOpoResponseResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListPlaceOpoResponseResult.class); + } + + /** + * Convert an instance of OrderListPlaceOpoResponseResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResultOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResultOrderReportsInner.java new file mode 100644 index 00000000..640532be --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResultOrderReportsInner.java @@ -0,0 +1,964 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListPlaceOpoResponseResultOrderReportsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListPlaceOpoResponseResultOrderReportsInner extends BaseDTO { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public static final String SERIALIZED_NAME_TRANSACT_TIME = "transactTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACT_TIME) + @jakarta.annotation.Nullable + private Long transactTime; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; + + @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) + @jakarta.annotation.Nullable + private String executedQty; + + public static final String SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY = "origQuoteOrderQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY) + @jakarta.annotation.Nullable + private String origQuoteOrderQty; + + public static final String SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY = "cummulativeQuoteQty"; + + @SerializedName(SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY) + @jakarta.annotation.Nullable + private String cummulativeQuoteQty; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_WORKING_TIME = "workingTime"; + + @SerializedName(SERIALIZED_NAME_WORKING_TIME) + @jakarta.annotation.Nullable + private Long workingTime; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QTY) + @jakarta.annotation.Nullable + private String origQty; + + public OrderListPlaceOpoResponseResultOrderReportsInner() {} + + public OrderListPlaceOpoResponseResultOrderReportsInner 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 OrderListPlaceOpoResponseResultOrderReportsInner orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner orderListId( + @jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner transactTime( + @jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + return this; + } + + /** + * Get transactTime + * + * @return transactTime + */ + @jakarta.annotation.Nullable + public Long getTransactTime() { + return transactTime; + } + + public void setTransactTime(@jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner 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 OrderListPlaceOpoResponseResultOrderReportsInner executedQty( + @jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + return this; + } + + /** + * Get executedQty + * + * @return executedQty + */ + @jakarta.annotation.Nullable + public String getExecutedQty() { + return executedQty; + } + + public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner origQuoteOrderQty( + @jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + return this; + } + + /** + * Get origQuoteOrderQty + * + * @return origQuoteOrderQty + */ + @jakarta.annotation.Nullable + public String getOrigQuoteOrderQty() { + return origQuoteOrderQty; + } + + public void setOrigQuoteOrderQty(@jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner cummulativeQuoteQty( + @jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + return this; + } + + /** + * Get cummulativeQuoteQty + * + * @return cummulativeQuoteQty + */ + @jakarta.annotation.Nullable + public String getCummulativeQuoteQty() { + return cummulativeQuoteQty; + } + + public void setCummulativeQuoteQty(@jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner status( + @jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner 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 OrderListPlaceOpoResponseResultOrderReportsInner type( + @jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner 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 OrderListPlaceOpoResponseResultOrderReportsInner workingTime( + @jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + return this; + } + + /** + * Get workingTime + * + * @return workingTime + */ + @jakarta.annotation.Nullable + public Long getWorkingTime() { + return workingTime; + } + + public void setWorkingTime(@jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + } + + public OrderListPlaceOpoResponseResultOrderReportsInner 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 OrderListPlaceOpoResponseResultOrderReportsInner origQty( + @jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + return this; + } + + /** + * Get origQty + * + * @return origQty + */ + @jakarta.annotation.Nullable + public String getOrigQty() { + return origQty; + } + + public void setOrigQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListPlaceOpoResponseResultOrderReportsInner + orderListPlaceOpoResponseResultOrderReportsInner = + (OrderListPlaceOpoResponseResultOrderReportsInner) o; + return Objects.equals(this.symbol, orderListPlaceOpoResponseResultOrderReportsInner.symbol) + && Objects.equals( + this.orderId, orderListPlaceOpoResponseResultOrderReportsInner.orderId) + && Objects.equals( + this.orderListId, + orderListPlaceOpoResponseResultOrderReportsInner.orderListId) + && Objects.equals( + this.clientOrderId, + orderListPlaceOpoResponseResultOrderReportsInner.clientOrderId) + && Objects.equals( + this.transactTime, + orderListPlaceOpoResponseResultOrderReportsInner.transactTime) + && Objects.equals( + this.price, orderListPlaceOpoResponseResultOrderReportsInner.price) + && Objects.equals( + this.executedQty, + orderListPlaceOpoResponseResultOrderReportsInner.executedQty) + && Objects.equals( + this.origQuoteOrderQty, + orderListPlaceOpoResponseResultOrderReportsInner.origQuoteOrderQty) + && Objects.equals( + this.cummulativeQuoteQty, + orderListPlaceOpoResponseResultOrderReportsInner.cummulativeQuoteQty) + && Objects.equals( + this.status, orderListPlaceOpoResponseResultOrderReportsInner.status) + && Objects.equals( + this.timeInForce, + orderListPlaceOpoResponseResultOrderReportsInner.timeInForce) + && Objects.equals(this.type, orderListPlaceOpoResponseResultOrderReportsInner.type) + && Objects.equals(this.side, orderListPlaceOpoResponseResultOrderReportsInner.side) + && Objects.equals( + this.workingTime, + orderListPlaceOpoResponseResultOrderReportsInner.workingTime) + && Objects.equals( + this.selfTradePreventionMode, + orderListPlaceOpoResponseResultOrderReportsInner.selfTradePreventionMode) + && Objects.equals( + this.origQty, orderListPlaceOpoResponseResultOrderReportsInner.origQty); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + orderId, + orderListId, + clientOrderId, + transactTime, + price, + executedQty, + origQuoteOrderQty, + cummulativeQuoteQty, + status, + timeInForce, + type, + side, + workingTime, + selfTradePreventionMode, + origQty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListPlaceOpoResponseResultOrderReportsInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" transactTime: ").append(toIndentedString(transactTime)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); + sb.append(" origQuoteOrderQty: ").append(toIndentedString(origQuoteOrderQty)).append("\n"); + sb.append(" cummulativeQuoteQty: ") + .append(toIndentedString(cummulativeQuoteQty)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" workingTime: ").append(toIndentedString(workingTime)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + Long orderIdValue = getOrderId(); + if (orderIdValue != null) { + String orderIdValueAsString = orderIdValue.toString(); + valMap.put("orderId", orderIdValueAsString); + } + Long orderListIdValue = getOrderListId(); + if (orderListIdValue != null) { + String orderListIdValueAsString = orderListIdValue.toString(); + valMap.put("orderListId", orderListIdValueAsString); + } + String clientOrderIdValue = getClientOrderId(); + if (clientOrderIdValue != null) { + String clientOrderIdValueAsString = clientOrderIdValue.toString(); + valMap.put("clientOrderId", clientOrderIdValueAsString); + } + Long transactTimeValue = getTransactTime(); + if (transactTimeValue != null) { + String transactTimeValueAsString = transactTimeValue.toString(); + valMap.put("transactTime", transactTimeValueAsString); + } + String priceValue = getPrice(); + if (priceValue != null) { + String priceValueAsString = priceValue.toString(); + valMap.put("price", priceValueAsString); + } + String executedQtyValue = getExecutedQty(); + if (executedQtyValue != null) { + String executedQtyValueAsString = executedQtyValue.toString(); + valMap.put("executedQty", executedQtyValueAsString); + } + String origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + if (origQuoteOrderQtyValue != null) { + String origQuoteOrderQtyValueAsString = origQuoteOrderQtyValue.toString(); + valMap.put("origQuoteOrderQty", origQuoteOrderQtyValueAsString); + } + String cummulativeQuoteQtyValue = getCummulativeQuoteQty(); + if (cummulativeQuoteQtyValue != null) { + String cummulativeQuoteQtyValueAsString = cummulativeQuoteQtyValue.toString(); + valMap.put("cummulativeQuoteQty", cummulativeQuoteQtyValueAsString); + } + String statusValue = getStatus(); + if (statusValue != null) { + String statusValueAsString = statusValue.toString(); + valMap.put("status", statusValueAsString); + } + String timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + String timeInForceValueAsString = timeInForceValue.toString(); + valMap.put("timeInForce", timeInForceValueAsString); + } + String typeValue = getType(); + if (typeValue != null) { + String typeValueAsString = typeValue.toString(); + valMap.put("type", typeValueAsString); + } + String sideValue = getSide(); + if (sideValue != null) { + String sideValueAsString = sideValue.toString(); + valMap.put("side", sideValueAsString); + } + Long workingTimeValue = getWorkingTime(); + if (workingTimeValue != null) { + String workingTimeValueAsString = workingTimeValue.toString(); + valMap.put("workingTime", workingTimeValueAsString); + } + String selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); + } + String origQtyValue = getOrigQty(); + if (origQtyValue != null) { + String origQtyValueAsString = origQtyValue.toString(); + valMap.put("origQty", origQtyValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object orderIdValue = getOrderId(); + if (orderIdValue != null) { + valMap.put("orderId", orderIdValue); + } + Object orderListIdValue = getOrderListId(); + if (orderListIdValue != null) { + valMap.put("orderListId", orderListIdValue); + } + Object clientOrderIdValue = getClientOrderId(); + if (clientOrderIdValue != null) { + valMap.put("clientOrderId", clientOrderIdValue); + } + Object transactTimeValue = getTransactTime(); + if (transactTimeValue != null) { + valMap.put("transactTime", transactTimeValue); + } + Object priceValue = getPrice(); + if (priceValue != null) { + valMap.put("price", priceValue); + } + Object executedQtyValue = getExecutedQty(); + if (executedQtyValue != null) { + valMap.put("executedQty", executedQtyValue); + } + Object origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + if (origQuoteOrderQtyValue != null) { + valMap.put("origQuoteOrderQty", origQuoteOrderQtyValue); + } + Object cummulativeQuoteQtyValue = getCummulativeQuoteQty(); + if (cummulativeQuoteQtyValue != null) { + valMap.put("cummulativeQuoteQty", cummulativeQuoteQtyValue); + } + Object statusValue = getStatus(); + if (statusValue != null) { + valMap.put("status", statusValue); + } + Object timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + valMap.put("timeInForce", timeInForceValue); + } + Object typeValue = getType(); + if (typeValue != null) { + valMap.put("type", typeValue); + } + Object sideValue = getSide(); + if (sideValue != null) { + valMap.put("side", sideValue); + } + Object workingTimeValue = getWorkingTime(); + if (workingTimeValue != null) { + valMap.put("workingTime", workingTimeValue); + } + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); + } + Object origQtyValue = getOrigQty(); + if (origQtyValue != null) { + valMap.put("origQty", origQtyValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("orderListId"); + openapiFields.add("clientOrderId"); + openapiFields.add("transactTime"); + openapiFields.add("price"); + openapiFields.add("executedQty"); + openapiFields.add("origQuoteOrderQty"); + openapiFields.add("cummulativeQuoteQty"); + openapiFields.add("status"); + openapiFields.add("timeInForce"); + openapiFields.add("type"); + openapiFields.add("side"); + openapiFields.add("workingTime"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("origQty"); + + // 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 + * OrderListPlaceOpoResponseResultOrderReportsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListPlaceOpoResponseResultOrderReportsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " OrderListPlaceOpoResponseResultOrderReportsInner is not" + + " found in the empty JSON string", + OrderListPlaceOpoResponseResultOrderReportsInner + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderListPlaceOpoResponseResultOrderReportsInner.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderListPlaceOpoResponseResultOrderReportsInner`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) + && !jsonObj.get("executedQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executedQty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executedQty").toString())); + } + if ((jsonObj.get("origQuoteOrderQty") != null + && !jsonObj.get("origQuoteOrderQty").isJsonNull()) + && !jsonObj.get("origQuoteOrderQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQuoteOrderQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origQuoteOrderQty").toString())); + } + if ((jsonObj.get("cummulativeQuoteQty") != null + && !jsonObj.get("cummulativeQuoteQty").isJsonNull()) + && !jsonObj.get("cummulativeQuoteQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cummulativeQuoteQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("cummulativeQuoteQty").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) + && !jsonObj.get("origQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("origQty").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListPlaceOpoResponseResultOrderReportsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'OrderListPlaceOpoResponseResultOrderReportsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(OrderListPlaceOpoResponseResultOrderReportsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + OrderListPlaceOpoResponseResultOrderReportsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListPlaceOpoResponseResultOrderReportsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListPlaceOpoResponseResultOrderReportsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListPlaceOpoResponseResultOrderReportsInner + * @throws IOException if the JSON string is invalid with respect to + * OrderListPlaceOpoResponseResultOrderReportsInner + */ + public static OrderListPlaceOpoResponseResultOrderReportsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, OrderListPlaceOpoResponseResultOrderReportsInner.class); + } + + /** + * Convert an instance of OrderListPlaceOpoResponseResultOrderReportsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResultOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResultOrdersInner.java new file mode 100644 index 00000000..b7a0fc13 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpoResponseResultOrdersInner.java @@ -0,0 +1,341 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListPlaceOpoResponseResultOrdersInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListPlaceOpoResponseResultOrdersInner extends BaseDTO { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public OrderListPlaceOpoResponseResultOrdersInner() {} + + public OrderListPlaceOpoResponseResultOrdersInner 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 OrderListPlaceOpoResponseResultOrdersInner orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderListPlaceOpoResponseResultOrdersInner clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListPlaceOpoResponseResultOrdersInner orderListPlaceOpoResponseResultOrdersInner = + (OrderListPlaceOpoResponseResultOrdersInner) o; + return Objects.equals(this.symbol, orderListPlaceOpoResponseResultOrdersInner.symbol) + && Objects.equals(this.orderId, orderListPlaceOpoResponseResultOrdersInner.orderId) + && Objects.equals( + this.clientOrderId, + orderListPlaceOpoResponseResultOrdersInner.clientOrderId); + } + + @Override + public int hashCode() { + return Objects.hash(symbol, orderId, clientOrderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListPlaceOpoResponseResultOrdersInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + Long orderIdValue = getOrderId(); + if (orderIdValue != null) { + String orderIdValueAsString = orderIdValue.toString(); + valMap.put("orderId", orderIdValueAsString); + } + String clientOrderIdValue = getClientOrderId(); + if (clientOrderIdValue != null) { + String clientOrderIdValueAsString = clientOrderIdValue.toString(); + valMap.put("clientOrderId", clientOrderIdValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object orderIdValue = getOrderId(); + if (orderIdValue != null) { + valMap.put("orderId", orderIdValue); + } + Object clientOrderIdValue = getClientOrderId(); + if (clientOrderIdValue != null) { + valMap.put("clientOrderId", clientOrderIdValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("clientOrderId"); + + // 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 + * OrderListPlaceOpoResponseResultOrdersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListPlaceOpoResponseResultOrdersInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " OrderListPlaceOpoResponseResultOrdersInner is not found in" + + " the empty JSON string", + OrderListPlaceOpoResponseResultOrdersInner.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderListPlaceOpoResponseResultOrdersInner.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderListPlaceOpoResponseResultOrdersInner` properties." + + " JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListPlaceOpoResponseResultOrdersInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'OrderListPlaceOpoResponseResultOrdersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderListPlaceOpoResponseResultOrdersInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, OrderListPlaceOpoResponseResultOrdersInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListPlaceOpoResponseResultOrdersInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListPlaceOpoResponseResultOrdersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListPlaceOpoResponseResultOrdersInner + * @throws IOException if the JSON string is invalid with respect to + * OrderListPlaceOpoResponseResultOrdersInner + */ + public static OrderListPlaceOpoResponseResultOrdersInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, OrderListPlaceOpoResponseResultOrdersInner.class); + } + + /** + * Convert an instance of OrderListPlaceOpoResponseResultOrdersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoRequest.java new file mode 100644 index 00000000..b27f3dee --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoRequest.java @@ -0,0 +1,2168 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListPlaceOpocoRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListPlaceOpocoRequest extends BaseDTO { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public static final String SERIALIZED_NAME_LIST_CLIENT_ORDER_ID = "listClientOrderId"; + + @SerializedName(SERIALIZED_NAME_LIST_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String listClientOrderId; + + 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_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nonnull + private WorkingType workingType; + + public static final String SERIALIZED_NAME_WORKING_SIDE = "workingSide"; + + @SerializedName(SERIALIZED_NAME_WORKING_SIDE) + @jakarta.annotation.Nonnull + private WorkingSide workingSide; + + public static final String SERIALIZED_NAME_WORKING_CLIENT_ORDER_ID = "workingClientOrderId"; + + @SerializedName(SERIALIZED_NAME_WORKING_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String workingClientOrderId; + + public static final String SERIALIZED_NAME_WORKING_PRICE = "workingPrice"; + + @SerializedName(SERIALIZED_NAME_WORKING_PRICE) + @jakarta.annotation.Nonnull + private Double workingPrice; + + public static final String SERIALIZED_NAME_WORKING_QUANTITY = "workingQuantity"; + + @SerializedName(SERIALIZED_NAME_WORKING_QUANTITY) + @jakarta.annotation.Nonnull + private Double workingQuantity; + + public static final String SERIALIZED_NAME_WORKING_ICEBERG_QTY = "workingIcebergQty"; + + @SerializedName(SERIALIZED_NAME_WORKING_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double workingIcebergQty; + + public static final String SERIALIZED_NAME_WORKING_TIME_IN_FORCE = "workingTimeInForce"; + + @SerializedName(SERIALIZED_NAME_WORKING_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private WorkingTimeInForce workingTimeInForce; + + public static final String SERIALIZED_NAME_WORKING_STRATEGY_ID = "workingStrategyId"; + + @SerializedName(SERIALIZED_NAME_WORKING_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long workingStrategyId; + + public static final String SERIALIZED_NAME_WORKING_STRATEGY_TYPE = "workingStrategyType"; + + @SerializedName(SERIALIZED_NAME_WORKING_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer workingStrategyType; + + public static final String SERIALIZED_NAME_WORKING_PEG_PRICE_TYPE = "workingPegPriceType"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private WorkingPegPriceType workingPegPriceType; + + public static final String SERIALIZED_NAME_WORKING_PEG_OFFSET_TYPE = "workingPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private WorkingPegOffsetType workingPegOffsetType; + + public static final String SERIALIZED_NAME_WORKING_PEG_OFFSET_VALUE = "workingPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_WORKING_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer workingPegOffsetValue; + + public static final String SERIALIZED_NAME_PENDING_SIDE = "pendingSide"; + + @SerializedName(SERIALIZED_NAME_PENDING_SIDE) + @jakarta.annotation.Nonnull + private PendingSide pendingSide; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_TYPE = "pendingAboveType"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_TYPE) + @jakarta.annotation.Nonnull + private PendingAboveType pendingAboveType; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_CLIENT_ORDER_ID = + "pendingAboveClientOrderId"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String pendingAboveClientOrderId; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_PRICE = "pendingAbovePrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_PRICE) + @jakarta.annotation.Nullable + private Double pendingAbovePrice; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_STOP_PRICE = "pendingAboveStopPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_STOP_PRICE) + @jakarta.annotation.Nullable + private Double pendingAboveStopPrice; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_TRAILING_DELTA = + "pendingAboveTrailingDelta"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_TRAILING_DELTA) + @jakarta.annotation.Nullable + private Double pendingAboveTrailingDelta; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_ICEBERG_QTY = "pendingAboveIcebergQty"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double pendingAboveIcebergQty; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_TIME_IN_FORCE = + "pendingAboveTimeInForce"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private PendingAboveTimeInForce pendingAboveTimeInForce; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_STRATEGY_ID = "pendingAboveStrategyId"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long pendingAboveStrategyId; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_STRATEGY_TYPE = + "pendingAboveStrategyType"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer pendingAboveStrategyType; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_PEG_PRICE_TYPE = + "pendingAbovePegPriceType"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PendingAbovePegPriceType pendingAbovePegPriceType; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_PEG_OFFSET_TYPE = + "pendingAbovePegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PendingAbovePegOffsetType pendingAbovePegOffsetType; + + public static final String SERIALIZED_NAME_PENDING_ABOVE_PEG_OFFSET_VALUE = + "pendingAbovePegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PENDING_ABOVE_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pendingAbovePegOffsetValue; + + public static final String SERIALIZED_NAME_PENDING_BELOW_TYPE = "pendingBelowType"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_TYPE) + @jakarta.annotation.Nullable + private PendingBelowType pendingBelowType; + + public static final String SERIALIZED_NAME_PENDING_BELOW_CLIENT_ORDER_ID = + "pendingBelowClientOrderId"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String pendingBelowClientOrderId; + + public static final String SERIALIZED_NAME_PENDING_BELOW_PRICE = "pendingBelowPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_PRICE) + @jakarta.annotation.Nullable + private Double pendingBelowPrice; + + public static final String SERIALIZED_NAME_PENDING_BELOW_STOP_PRICE = "pendingBelowStopPrice"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_STOP_PRICE) + @jakarta.annotation.Nullable + private Double pendingBelowStopPrice; + + public static final String SERIALIZED_NAME_PENDING_BELOW_TRAILING_DELTA = + "pendingBelowTrailingDelta"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_TRAILING_DELTA) + @jakarta.annotation.Nullable + private Double pendingBelowTrailingDelta; + + public static final String SERIALIZED_NAME_PENDING_BELOW_ICEBERG_QTY = "pendingBelowIcebergQty"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_ICEBERG_QTY) + @jakarta.annotation.Nullable + private Double pendingBelowIcebergQty; + + public static final String SERIALIZED_NAME_PENDING_BELOW_TIME_IN_FORCE = + "pendingBelowTimeInForce"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private PendingBelowTimeInForce pendingBelowTimeInForce; + + public static final String SERIALIZED_NAME_PENDING_BELOW_STRATEGY_ID = "pendingBelowStrategyId"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_STRATEGY_ID) + @jakarta.annotation.Nullable + private Long pendingBelowStrategyId; + + public static final String SERIALIZED_NAME_PENDING_BELOW_STRATEGY_TYPE = + "pendingBelowStrategyType"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_STRATEGY_TYPE) + @jakarta.annotation.Nullable + private Integer pendingBelowStrategyType; + + public static final String SERIALIZED_NAME_PENDING_BELOW_PEG_PRICE_TYPE = + "pendingBelowPegPriceType"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PendingBelowPegPriceType pendingBelowPegPriceType; + + public static final String SERIALIZED_NAME_PENDING_BELOW_PEG_OFFSET_TYPE = + "pendingBelowPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PendingBelowPegOffsetType pendingBelowPegOffsetType; + + public static final String SERIALIZED_NAME_PENDING_BELOW_PEG_OFFSET_VALUE = + "pendingBelowPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PENDING_BELOW_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pendingBelowPegOffsetValue; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Double recvWindow; + + public OrderListPlaceOpocoRequest() {} + + public OrderListPlaceOpocoRequest 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 OrderListPlaceOpocoRequest listClientOrderId( + @jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + return this; + } + + /** + * Get listClientOrderId + * + * @return listClientOrderId + */ + @jakarta.annotation.Nullable + public String getListClientOrderId() { + return listClientOrderId; + } + + public void setListClientOrderId(@jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + } + + public OrderListPlaceOpocoRequest 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 OrderListPlaceOpocoRequest 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 OrderListPlaceOpocoRequest workingType( + @jakarta.annotation.Nonnull WorkingType workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public WorkingType getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nonnull WorkingType workingType) { + this.workingType = workingType; + } + + public OrderListPlaceOpocoRequest workingSide( + @jakarta.annotation.Nonnull WorkingSide workingSide) { + this.workingSide = workingSide; + return this; + } + + /** + * Get workingSide + * + * @return workingSide + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public WorkingSide getWorkingSide() { + return workingSide; + } + + public void setWorkingSide(@jakarta.annotation.Nonnull WorkingSide workingSide) { + this.workingSide = workingSide; + } + + public OrderListPlaceOpocoRequest workingClientOrderId( + @jakarta.annotation.Nullable String workingClientOrderId) { + this.workingClientOrderId = workingClientOrderId; + return this; + } + + /** + * Get workingClientOrderId + * + * @return workingClientOrderId + */ + @jakarta.annotation.Nullable + public String getWorkingClientOrderId() { + return workingClientOrderId; + } + + public void setWorkingClientOrderId(@jakarta.annotation.Nullable String workingClientOrderId) { + this.workingClientOrderId = workingClientOrderId; + } + + public OrderListPlaceOpocoRequest workingPrice( + @jakarta.annotation.Nonnull Double workingPrice) { + this.workingPrice = workingPrice; + return this; + } + + /** + * Get workingPrice + * + * @return workingPrice + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getWorkingPrice() { + return workingPrice; + } + + public void setWorkingPrice(@jakarta.annotation.Nonnull Double workingPrice) { + this.workingPrice = workingPrice; + } + + public OrderListPlaceOpocoRequest workingQuantity( + @jakarta.annotation.Nonnull Double workingQuantity) { + this.workingQuantity = workingQuantity; + return this; + } + + /** + * Get workingQuantity + * + * @return workingQuantity + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getWorkingQuantity() { + return workingQuantity; + } + + public void setWorkingQuantity(@jakarta.annotation.Nonnull Double workingQuantity) { + this.workingQuantity = workingQuantity; + } + + public OrderListPlaceOpocoRequest workingIcebergQty( + @jakarta.annotation.Nullable Double workingIcebergQty) { + this.workingIcebergQty = workingIcebergQty; + return this; + } + + /** + * Get workingIcebergQty + * + * @return workingIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getWorkingIcebergQty() { + return workingIcebergQty; + } + + public void setWorkingIcebergQty(@jakarta.annotation.Nullable Double workingIcebergQty) { + this.workingIcebergQty = workingIcebergQty; + } + + public OrderListPlaceOpocoRequest workingTimeInForce( + @jakarta.annotation.Nullable WorkingTimeInForce workingTimeInForce) { + this.workingTimeInForce = workingTimeInForce; + return this; + } + + /** + * Get workingTimeInForce + * + * @return workingTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public WorkingTimeInForce getWorkingTimeInForce() { + return workingTimeInForce; + } + + public void setWorkingTimeInForce( + @jakarta.annotation.Nullable WorkingTimeInForce workingTimeInForce) { + this.workingTimeInForce = workingTimeInForce; + } + + public OrderListPlaceOpocoRequest workingStrategyId( + @jakarta.annotation.Nullable Long workingStrategyId) { + this.workingStrategyId = workingStrategyId; + return this; + } + + /** + * Get workingStrategyId + * + * @return workingStrategyId + */ + @jakarta.annotation.Nullable + public Long getWorkingStrategyId() { + return workingStrategyId; + } + + public void setWorkingStrategyId(@jakarta.annotation.Nullable Long workingStrategyId) { + this.workingStrategyId = workingStrategyId; + } + + public OrderListPlaceOpocoRequest workingStrategyType( + @jakarta.annotation.Nullable Integer workingStrategyType) { + this.workingStrategyType = workingStrategyType; + return this; + } + + /** + * Get workingStrategyType + * + * @return workingStrategyType + */ + @jakarta.annotation.Nullable + public Integer getWorkingStrategyType() { + return workingStrategyType; + } + + public void setWorkingStrategyType(@jakarta.annotation.Nullable Integer workingStrategyType) { + this.workingStrategyType = workingStrategyType; + } + + public OrderListPlaceOpocoRequest workingPegPriceType( + @jakarta.annotation.Nullable WorkingPegPriceType workingPegPriceType) { + this.workingPegPriceType = workingPegPriceType; + return this; + } + + /** + * Get workingPegPriceType + * + * @return workingPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingPegPriceType getWorkingPegPriceType() { + return workingPegPriceType; + } + + public void setWorkingPegPriceType( + @jakarta.annotation.Nullable WorkingPegPriceType workingPegPriceType) { + this.workingPegPriceType = workingPegPriceType; + } + + public OrderListPlaceOpocoRequest workingPegOffsetType( + @jakarta.annotation.Nullable WorkingPegOffsetType workingPegOffsetType) { + this.workingPegOffsetType = workingPegOffsetType; + return this; + } + + /** + * Get workingPegOffsetType + * + * @return workingPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingPegOffsetType getWorkingPegOffsetType() { + return workingPegOffsetType; + } + + public void setWorkingPegOffsetType( + @jakarta.annotation.Nullable WorkingPegOffsetType workingPegOffsetType) { + this.workingPegOffsetType = workingPegOffsetType; + } + + public OrderListPlaceOpocoRequest workingPegOffsetValue( + @jakarta.annotation.Nullable Integer workingPegOffsetValue) { + this.workingPegOffsetValue = workingPegOffsetValue; + return this; + } + + /** + * Get workingPegOffsetValue + * + * @return workingPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getWorkingPegOffsetValue() { + return workingPegOffsetValue; + } + + public void setWorkingPegOffsetValue( + @jakarta.annotation.Nullable Integer workingPegOffsetValue) { + this.workingPegOffsetValue = workingPegOffsetValue; + } + + public OrderListPlaceOpocoRequest pendingSide( + @jakarta.annotation.Nonnull PendingSide pendingSide) { + this.pendingSide = pendingSide; + return this; + } + + /** + * Get pendingSide + * + * @return pendingSide + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public PendingSide getPendingSide() { + return pendingSide; + } + + public void setPendingSide(@jakarta.annotation.Nonnull PendingSide pendingSide) { + this.pendingSide = pendingSide; + } + + public OrderListPlaceOpocoRequest pendingAboveType( + @jakarta.annotation.Nonnull PendingAboveType pendingAboveType) { + this.pendingAboveType = pendingAboveType; + return this; + } + + /** + * Get pendingAboveType + * + * @return pendingAboveType + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public PendingAboveType getPendingAboveType() { + return pendingAboveType; + } + + public void setPendingAboveType(@jakarta.annotation.Nonnull PendingAboveType pendingAboveType) { + this.pendingAboveType = pendingAboveType; + } + + public OrderListPlaceOpocoRequest pendingAboveClientOrderId( + @jakarta.annotation.Nullable String pendingAboveClientOrderId) { + this.pendingAboveClientOrderId = pendingAboveClientOrderId; + return this; + } + + /** + * Get pendingAboveClientOrderId + * + * @return pendingAboveClientOrderId + */ + @jakarta.annotation.Nullable + public String getPendingAboveClientOrderId() { + return pendingAboveClientOrderId; + } + + public void setPendingAboveClientOrderId( + @jakarta.annotation.Nullable String pendingAboveClientOrderId) { + this.pendingAboveClientOrderId = pendingAboveClientOrderId; + } + + public OrderListPlaceOpocoRequest pendingAbovePrice( + @jakarta.annotation.Nullable Double pendingAbovePrice) { + this.pendingAbovePrice = pendingAbovePrice; + return this; + } + + /** + * Get pendingAbovePrice + * + * @return pendingAbovePrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingAbovePrice() { + return pendingAbovePrice; + } + + public void setPendingAbovePrice(@jakarta.annotation.Nullable Double pendingAbovePrice) { + this.pendingAbovePrice = pendingAbovePrice; + } + + public OrderListPlaceOpocoRequest pendingAboveStopPrice( + @jakarta.annotation.Nullable Double pendingAboveStopPrice) { + this.pendingAboveStopPrice = pendingAboveStopPrice; + return this; + } + + /** + * Get pendingAboveStopPrice + * + * @return pendingAboveStopPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingAboveStopPrice() { + return pendingAboveStopPrice; + } + + public void setPendingAboveStopPrice( + @jakarta.annotation.Nullable Double pendingAboveStopPrice) { + this.pendingAboveStopPrice = pendingAboveStopPrice; + } + + public OrderListPlaceOpocoRequest pendingAboveTrailingDelta( + @jakarta.annotation.Nullable Double pendingAboveTrailingDelta) { + this.pendingAboveTrailingDelta = pendingAboveTrailingDelta; + return this; + } + + /** + * Get pendingAboveTrailingDelta + * + * @return pendingAboveTrailingDelta + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingAboveTrailingDelta() { + return pendingAboveTrailingDelta; + } + + public void setPendingAboveTrailingDelta( + @jakarta.annotation.Nullable Double pendingAboveTrailingDelta) { + this.pendingAboveTrailingDelta = pendingAboveTrailingDelta; + } + + public OrderListPlaceOpocoRequest pendingAboveIcebergQty( + @jakarta.annotation.Nullable Double pendingAboveIcebergQty) { + this.pendingAboveIcebergQty = pendingAboveIcebergQty; + return this; + } + + /** + * Get pendingAboveIcebergQty + * + * @return pendingAboveIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingAboveIcebergQty() { + return pendingAboveIcebergQty; + } + + public void setPendingAboveIcebergQty( + @jakarta.annotation.Nullable Double pendingAboveIcebergQty) { + this.pendingAboveIcebergQty = pendingAboveIcebergQty; + } + + public OrderListPlaceOpocoRequest pendingAboveTimeInForce( + @jakarta.annotation.Nullable PendingAboveTimeInForce pendingAboveTimeInForce) { + this.pendingAboveTimeInForce = pendingAboveTimeInForce; + return this; + } + + /** + * Get pendingAboveTimeInForce + * + * @return pendingAboveTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public PendingAboveTimeInForce getPendingAboveTimeInForce() { + return pendingAboveTimeInForce; + } + + public void setPendingAboveTimeInForce( + @jakarta.annotation.Nullable PendingAboveTimeInForce pendingAboveTimeInForce) { + this.pendingAboveTimeInForce = pendingAboveTimeInForce; + } + + public OrderListPlaceOpocoRequest pendingAboveStrategyId( + @jakarta.annotation.Nullable Long pendingAboveStrategyId) { + this.pendingAboveStrategyId = pendingAboveStrategyId; + return this; + } + + /** + * Get pendingAboveStrategyId + * + * @return pendingAboveStrategyId + */ + @jakarta.annotation.Nullable + public Long getPendingAboveStrategyId() { + return pendingAboveStrategyId; + } + + public void setPendingAboveStrategyId( + @jakarta.annotation.Nullable Long pendingAboveStrategyId) { + this.pendingAboveStrategyId = pendingAboveStrategyId; + } + + public OrderListPlaceOpocoRequest pendingAboveStrategyType( + @jakarta.annotation.Nullable Integer pendingAboveStrategyType) { + this.pendingAboveStrategyType = pendingAboveStrategyType; + return this; + } + + /** + * Get pendingAboveStrategyType + * + * @return pendingAboveStrategyType + */ + @jakarta.annotation.Nullable + public Integer getPendingAboveStrategyType() { + return pendingAboveStrategyType; + } + + public void setPendingAboveStrategyType( + @jakarta.annotation.Nullable Integer pendingAboveStrategyType) { + this.pendingAboveStrategyType = pendingAboveStrategyType; + } + + public OrderListPlaceOpocoRequest pendingAbovePegPriceType( + @jakarta.annotation.Nullable PendingAbovePegPriceType pendingAbovePegPriceType) { + this.pendingAbovePegPriceType = pendingAbovePegPriceType; + return this; + } + + /** + * Get pendingAbovePegPriceType + * + * @return pendingAbovePegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PendingAbovePegPriceType getPendingAbovePegPriceType() { + return pendingAbovePegPriceType; + } + + public void setPendingAbovePegPriceType( + @jakarta.annotation.Nullable PendingAbovePegPriceType pendingAbovePegPriceType) { + this.pendingAbovePegPriceType = pendingAbovePegPriceType; + } + + public OrderListPlaceOpocoRequest pendingAbovePegOffsetType( + @jakarta.annotation.Nullable PendingAbovePegOffsetType pendingAbovePegOffsetType) { + this.pendingAbovePegOffsetType = pendingAbovePegOffsetType; + return this; + } + + /** + * Get pendingAbovePegOffsetType + * + * @return pendingAbovePegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PendingAbovePegOffsetType getPendingAbovePegOffsetType() { + return pendingAbovePegOffsetType; + } + + public void setPendingAbovePegOffsetType( + @jakarta.annotation.Nullable PendingAbovePegOffsetType pendingAbovePegOffsetType) { + this.pendingAbovePegOffsetType = pendingAbovePegOffsetType; + } + + public OrderListPlaceOpocoRequest pendingAbovePegOffsetValue( + @jakarta.annotation.Nullable Integer pendingAbovePegOffsetValue) { + this.pendingAbovePegOffsetValue = pendingAbovePegOffsetValue; + return this; + } + + /** + * Get pendingAbovePegOffsetValue + * + * @return pendingAbovePegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPendingAbovePegOffsetValue() { + return pendingAbovePegOffsetValue; + } + + public void setPendingAbovePegOffsetValue( + @jakarta.annotation.Nullable Integer pendingAbovePegOffsetValue) { + this.pendingAbovePegOffsetValue = pendingAbovePegOffsetValue; + } + + public OrderListPlaceOpocoRequest pendingBelowType( + @jakarta.annotation.Nullable PendingBelowType pendingBelowType) { + this.pendingBelowType = pendingBelowType; + return this; + } + + /** + * Get pendingBelowType + * + * @return pendingBelowType + */ + @jakarta.annotation.Nullable + @Valid + public PendingBelowType getPendingBelowType() { + return pendingBelowType; + } + + public void setPendingBelowType( + @jakarta.annotation.Nullable PendingBelowType pendingBelowType) { + this.pendingBelowType = pendingBelowType; + } + + public OrderListPlaceOpocoRequest pendingBelowClientOrderId( + @jakarta.annotation.Nullable String pendingBelowClientOrderId) { + this.pendingBelowClientOrderId = pendingBelowClientOrderId; + return this; + } + + /** + * Get pendingBelowClientOrderId + * + * @return pendingBelowClientOrderId + */ + @jakarta.annotation.Nullable + public String getPendingBelowClientOrderId() { + return pendingBelowClientOrderId; + } + + public void setPendingBelowClientOrderId( + @jakarta.annotation.Nullable String pendingBelowClientOrderId) { + this.pendingBelowClientOrderId = pendingBelowClientOrderId; + } + + public OrderListPlaceOpocoRequest pendingBelowPrice( + @jakarta.annotation.Nullable Double pendingBelowPrice) { + this.pendingBelowPrice = pendingBelowPrice; + return this; + } + + /** + * Get pendingBelowPrice + * + * @return pendingBelowPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingBelowPrice() { + return pendingBelowPrice; + } + + public void setPendingBelowPrice(@jakarta.annotation.Nullable Double pendingBelowPrice) { + this.pendingBelowPrice = pendingBelowPrice; + } + + public OrderListPlaceOpocoRequest pendingBelowStopPrice( + @jakarta.annotation.Nullable Double pendingBelowStopPrice) { + this.pendingBelowStopPrice = pendingBelowStopPrice; + return this; + } + + /** + * Get pendingBelowStopPrice + * + * @return pendingBelowStopPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingBelowStopPrice() { + return pendingBelowStopPrice; + } + + public void setPendingBelowStopPrice( + @jakarta.annotation.Nullable Double pendingBelowStopPrice) { + this.pendingBelowStopPrice = pendingBelowStopPrice; + } + + public OrderListPlaceOpocoRequest pendingBelowTrailingDelta( + @jakarta.annotation.Nullable Double pendingBelowTrailingDelta) { + this.pendingBelowTrailingDelta = pendingBelowTrailingDelta; + return this; + } + + /** + * Get pendingBelowTrailingDelta + * + * @return pendingBelowTrailingDelta + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingBelowTrailingDelta() { + return pendingBelowTrailingDelta; + } + + public void setPendingBelowTrailingDelta( + @jakarta.annotation.Nullable Double pendingBelowTrailingDelta) { + this.pendingBelowTrailingDelta = pendingBelowTrailingDelta; + } + + public OrderListPlaceOpocoRequest pendingBelowIcebergQty( + @jakarta.annotation.Nullable Double pendingBelowIcebergQty) { + this.pendingBelowIcebergQty = pendingBelowIcebergQty; + return this; + } + + /** + * Get pendingBelowIcebergQty + * + * @return pendingBelowIcebergQty + */ + @jakarta.annotation.Nullable + @Valid + public Double getPendingBelowIcebergQty() { + return pendingBelowIcebergQty; + } + + public void setPendingBelowIcebergQty( + @jakarta.annotation.Nullable Double pendingBelowIcebergQty) { + this.pendingBelowIcebergQty = pendingBelowIcebergQty; + } + + public OrderListPlaceOpocoRequest pendingBelowTimeInForce( + @jakarta.annotation.Nullable PendingBelowTimeInForce pendingBelowTimeInForce) { + this.pendingBelowTimeInForce = pendingBelowTimeInForce; + return this; + } + + /** + * Get pendingBelowTimeInForce + * + * @return pendingBelowTimeInForce + */ + @jakarta.annotation.Nullable + @Valid + public PendingBelowTimeInForce getPendingBelowTimeInForce() { + return pendingBelowTimeInForce; + } + + public void setPendingBelowTimeInForce( + @jakarta.annotation.Nullable PendingBelowTimeInForce pendingBelowTimeInForce) { + this.pendingBelowTimeInForce = pendingBelowTimeInForce; + } + + public OrderListPlaceOpocoRequest pendingBelowStrategyId( + @jakarta.annotation.Nullable Long pendingBelowStrategyId) { + this.pendingBelowStrategyId = pendingBelowStrategyId; + return this; + } + + /** + * Get pendingBelowStrategyId + * + * @return pendingBelowStrategyId + */ + @jakarta.annotation.Nullable + public Long getPendingBelowStrategyId() { + return pendingBelowStrategyId; + } + + public void setPendingBelowStrategyId( + @jakarta.annotation.Nullable Long pendingBelowStrategyId) { + this.pendingBelowStrategyId = pendingBelowStrategyId; + } + + public OrderListPlaceOpocoRequest pendingBelowStrategyType( + @jakarta.annotation.Nullable Integer pendingBelowStrategyType) { + this.pendingBelowStrategyType = pendingBelowStrategyType; + return this; + } + + /** + * Get pendingBelowStrategyType + * + * @return pendingBelowStrategyType + */ + @jakarta.annotation.Nullable + public Integer getPendingBelowStrategyType() { + return pendingBelowStrategyType; + } + + public void setPendingBelowStrategyType( + @jakarta.annotation.Nullable Integer pendingBelowStrategyType) { + this.pendingBelowStrategyType = pendingBelowStrategyType; + } + + public OrderListPlaceOpocoRequest pendingBelowPegPriceType( + @jakarta.annotation.Nullable PendingBelowPegPriceType pendingBelowPegPriceType) { + this.pendingBelowPegPriceType = pendingBelowPegPriceType; + return this; + } + + /** + * Get pendingBelowPegPriceType + * + * @return pendingBelowPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PendingBelowPegPriceType getPendingBelowPegPriceType() { + return pendingBelowPegPriceType; + } + + public void setPendingBelowPegPriceType( + @jakarta.annotation.Nullable PendingBelowPegPriceType pendingBelowPegPriceType) { + this.pendingBelowPegPriceType = pendingBelowPegPriceType; + } + + public OrderListPlaceOpocoRequest pendingBelowPegOffsetType( + @jakarta.annotation.Nullable PendingBelowPegOffsetType pendingBelowPegOffsetType) { + this.pendingBelowPegOffsetType = pendingBelowPegOffsetType; + return this; + } + + /** + * Get pendingBelowPegOffsetType + * + * @return pendingBelowPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PendingBelowPegOffsetType getPendingBelowPegOffsetType() { + return pendingBelowPegOffsetType; + } + + public void setPendingBelowPegOffsetType( + @jakarta.annotation.Nullable PendingBelowPegOffsetType pendingBelowPegOffsetType) { + this.pendingBelowPegOffsetType = pendingBelowPegOffsetType; + } + + public OrderListPlaceOpocoRequest pendingBelowPegOffsetValue( + @jakarta.annotation.Nullable Integer pendingBelowPegOffsetValue) { + this.pendingBelowPegOffsetValue = pendingBelowPegOffsetValue; + return this; + } + + /** + * Get pendingBelowPegOffsetValue + * + * @return pendingBelowPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPendingBelowPegOffsetValue() { + return pendingBelowPegOffsetValue; + } + + public void setPendingBelowPegOffsetValue( + @jakarta.annotation.Nullable Integer pendingBelowPegOffsetValue) { + this.pendingBelowPegOffsetValue = pendingBelowPegOffsetValue; + } + + public OrderListPlaceOpocoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + @Valid + public Double getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListPlaceOpocoRequest orderListPlaceOpocoRequest = (OrderListPlaceOpocoRequest) o; + return Objects.equals(this.symbol, orderListPlaceOpocoRequest.symbol) + && Objects.equals( + this.listClientOrderId, orderListPlaceOpocoRequest.listClientOrderId) + && Objects.equals( + this.newOrderRespType, orderListPlaceOpocoRequest.newOrderRespType) + && Objects.equals( + this.selfTradePreventionMode, + orderListPlaceOpocoRequest.selfTradePreventionMode) + && Objects.equals(this.workingType, orderListPlaceOpocoRequest.workingType) + && Objects.equals(this.workingSide, orderListPlaceOpocoRequest.workingSide) + && Objects.equals( + this.workingClientOrderId, orderListPlaceOpocoRequest.workingClientOrderId) + && Objects.equals(this.workingPrice, orderListPlaceOpocoRequest.workingPrice) + && Objects.equals(this.workingQuantity, orderListPlaceOpocoRequest.workingQuantity) + && Objects.equals( + this.workingIcebergQty, orderListPlaceOpocoRequest.workingIcebergQty) + && Objects.equals( + this.workingTimeInForce, orderListPlaceOpocoRequest.workingTimeInForce) + && Objects.equals( + this.workingStrategyId, orderListPlaceOpocoRequest.workingStrategyId) + && Objects.equals( + this.workingStrategyType, orderListPlaceOpocoRequest.workingStrategyType) + && Objects.equals( + this.workingPegPriceType, orderListPlaceOpocoRequest.workingPegPriceType) + && Objects.equals( + this.workingPegOffsetType, orderListPlaceOpocoRequest.workingPegOffsetType) + && Objects.equals( + this.workingPegOffsetValue, + orderListPlaceOpocoRequest.workingPegOffsetValue) + && Objects.equals(this.pendingSide, orderListPlaceOpocoRequest.pendingSide) + && Objects.equals( + this.pendingAboveType, orderListPlaceOpocoRequest.pendingAboveType) + && Objects.equals( + this.pendingAboveClientOrderId, + orderListPlaceOpocoRequest.pendingAboveClientOrderId) + && Objects.equals( + this.pendingAbovePrice, orderListPlaceOpocoRequest.pendingAbovePrice) + && Objects.equals( + this.pendingAboveStopPrice, + orderListPlaceOpocoRequest.pendingAboveStopPrice) + && Objects.equals( + this.pendingAboveTrailingDelta, + orderListPlaceOpocoRequest.pendingAboveTrailingDelta) + && Objects.equals( + this.pendingAboveIcebergQty, + orderListPlaceOpocoRequest.pendingAboveIcebergQty) + && Objects.equals( + this.pendingAboveTimeInForce, + orderListPlaceOpocoRequest.pendingAboveTimeInForce) + && Objects.equals( + this.pendingAboveStrategyId, + orderListPlaceOpocoRequest.pendingAboveStrategyId) + && Objects.equals( + this.pendingAboveStrategyType, + orderListPlaceOpocoRequest.pendingAboveStrategyType) + && Objects.equals( + this.pendingAbovePegPriceType, + orderListPlaceOpocoRequest.pendingAbovePegPriceType) + && Objects.equals( + this.pendingAbovePegOffsetType, + orderListPlaceOpocoRequest.pendingAbovePegOffsetType) + && Objects.equals( + this.pendingAbovePegOffsetValue, + orderListPlaceOpocoRequest.pendingAbovePegOffsetValue) + && Objects.equals( + this.pendingBelowType, orderListPlaceOpocoRequest.pendingBelowType) + && Objects.equals( + this.pendingBelowClientOrderId, + orderListPlaceOpocoRequest.pendingBelowClientOrderId) + && Objects.equals( + this.pendingBelowPrice, orderListPlaceOpocoRequest.pendingBelowPrice) + && Objects.equals( + this.pendingBelowStopPrice, + orderListPlaceOpocoRequest.pendingBelowStopPrice) + && Objects.equals( + this.pendingBelowTrailingDelta, + orderListPlaceOpocoRequest.pendingBelowTrailingDelta) + && Objects.equals( + this.pendingBelowIcebergQty, + orderListPlaceOpocoRequest.pendingBelowIcebergQty) + && Objects.equals( + this.pendingBelowTimeInForce, + orderListPlaceOpocoRequest.pendingBelowTimeInForce) + && Objects.equals( + this.pendingBelowStrategyId, + orderListPlaceOpocoRequest.pendingBelowStrategyId) + && Objects.equals( + this.pendingBelowStrategyType, + orderListPlaceOpocoRequest.pendingBelowStrategyType) + && Objects.equals( + this.pendingBelowPegPriceType, + orderListPlaceOpocoRequest.pendingBelowPegPriceType) + && Objects.equals( + this.pendingBelowPegOffsetType, + orderListPlaceOpocoRequest.pendingBelowPegOffsetType) + && Objects.equals( + this.pendingBelowPegOffsetValue, + orderListPlaceOpocoRequest.pendingBelowPegOffsetValue) + && Objects.equals(this.recvWindow, orderListPlaceOpocoRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + listClientOrderId, + newOrderRespType, + selfTradePreventionMode, + workingType, + workingSide, + workingClientOrderId, + workingPrice, + workingQuantity, + workingIcebergQty, + workingTimeInForce, + workingStrategyId, + workingStrategyType, + workingPegPriceType, + workingPegOffsetType, + workingPegOffsetValue, + pendingSide, + pendingAboveType, + pendingAboveClientOrderId, + pendingAbovePrice, + pendingAboveStopPrice, + pendingAboveTrailingDelta, + pendingAboveIcebergQty, + pendingAboveTimeInForce, + pendingAboveStrategyId, + pendingAboveStrategyType, + pendingAbovePegPriceType, + pendingAbovePegOffsetType, + pendingAbovePegOffsetValue, + pendingBelowType, + pendingBelowClientOrderId, + pendingBelowPrice, + pendingBelowStopPrice, + pendingBelowTrailingDelta, + pendingBelowIcebergQty, + pendingBelowTimeInForce, + pendingBelowStrategyId, + pendingBelowStrategyType, + pendingBelowPegPriceType, + pendingBelowPegOffsetType, + pendingBelowPegOffsetValue, + recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListPlaceOpocoRequest {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" listClientOrderId: ").append(toIndentedString(listClientOrderId)).append("\n"); + sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" workingSide: ").append(toIndentedString(workingSide)).append("\n"); + sb.append(" workingClientOrderId: ") + .append(toIndentedString(workingClientOrderId)) + .append("\n"); + sb.append(" workingPrice: ").append(toIndentedString(workingPrice)).append("\n"); + sb.append(" workingQuantity: ").append(toIndentedString(workingQuantity)).append("\n"); + sb.append(" workingIcebergQty: ").append(toIndentedString(workingIcebergQty)).append("\n"); + sb.append(" workingTimeInForce: ") + .append(toIndentedString(workingTimeInForce)) + .append("\n"); + sb.append(" workingStrategyId: ").append(toIndentedString(workingStrategyId)).append("\n"); + sb.append(" workingStrategyType: ") + .append(toIndentedString(workingStrategyType)) + .append("\n"); + sb.append(" workingPegPriceType: ") + .append(toIndentedString(workingPegPriceType)) + .append("\n"); + sb.append(" workingPegOffsetType: ") + .append(toIndentedString(workingPegOffsetType)) + .append("\n"); + sb.append(" workingPegOffsetValue: ") + .append(toIndentedString(workingPegOffsetValue)) + .append("\n"); + sb.append(" pendingSide: ").append(toIndentedString(pendingSide)).append("\n"); + sb.append(" pendingAboveType: ").append(toIndentedString(pendingAboveType)).append("\n"); + sb.append(" pendingAboveClientOrderId: ") + .append(toIndentedString(pendingAboveClientOrderId)) + .append("\n"); + sb.append(" pendingAbovePrice: ").append(toIndentedString(pendingAbovePrice)).append("\n"); + sb.append(" pendingAboveStopPrice: ") + .append(toIndentedString(pendingAboveStopPrice)) + .append("\n"); + sb.append(" pendingAboveTrailingDelta: ") + .append(toIndentedString(pendingAboveTrailingDelta)) + .append("\n"); + sb.append(" pendingAboveIcebergQty: ") + .append(toIndentedString(pendingAboveIcebergQty)) + .append("\n"); + sb.append(" pendingAboveTimeInForce: ") + .append(toIndentedString(pendingAboveTimeInForce)) + .append("\n"); + sb.append(" pendingAboveStrategyId: ") + .append(toIndentedString(pendingAboveStrategyId)) + .append("\n"); + sb.append(" pendingAboveStrategyType: ") + .append(toIndentedString(pendingAboveStrategyType)) + .append("\n"); + sb.append(" pendingAbovePegPriceType: ") + .append(toIndentedString(pendingAbovePegPriceType)) + .append("\n"); + sb.append(" pendingAbovePegOffsetType: ") + .append(toIndentedString(pendingAbovePegOffsetType)) + .append("\n"); + sb.append(" pendingAbovePegOffsetValue: ") + .append(toIndentedString(pendingAbovePegOffsetValue)) + .append("\n"); + sb.append(" pendingBelowType: ").append(toIndentedString(pendingBelowType)).append("\n"); + sb.append(" pendingBelowClientOrderId: ") + .append(toIndentedString(pendingBelowClientOrderId)) + .append("\n"); + sb.append(" pendingBelowPrice: ").append(toIndentedString(pendingBelowPrice)).append("\n"); + sb.append(" pendingBelowStopPrice: ") + .append(toIndentedString(pendingBelowStopPrice)) + .append("\n"); + sb.append(" pendingBelowTrailingDelta: ") + .append(toIndentedString(pendingBelowTrailingDelta)) + .append("\n"); + sb.append(" pendingBelowIcebergQty: ") + .append(toIndentedString(pendingBelowIcebergQty)) + .append("\n"); + sb.append(" pendingBelowTimeInForce: ") + .append(toIndentedString(pendingBelowTimeInForce)) + .append("\n"); + sb.append(" pendingBelowStrategyId: ") + .append(toIndentedString(pendingBelowStrategyId)) + .append("\n"); + sb.append(" pendingBelowStrategyType: ") + .append(toIndentedString(pendingBelowStrategyType)) + .append("\n"); + sb.append(" pendingBelowPegPriceType: ") + .append(toIndentedString(pendingBelowPegPriceType)) + .append("\n"); + sb.append(" pendingBelowPegOffsetType: ") + .append(toIndentedString(pendingBelowPegOffsetType)) + .append("\n"); + sb.append(" pendingBelowPegOffsetValue: ") + .append(toIndentedString(pendingBelowPegOffsetValue)) + .append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + String listClientOrderIdValue = getListClientOrderId(); + if (listClientOrderIdValue != null) { + String listClientOrderIdValueAsString = listClientOrderIdValue.toString(); + valMap.put("listClientOrderId", listClientOrderIdValueAsString); + } + NewOrderRespType newOrderRespTypeValue = getNewOrderRespType(); + if (newOrderRespTypeValue != null) { + String newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); + valMap.put("newOrderRespType", newOrderRespTypeValueAsString); + } + SelfTradePreventionMode selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); + } + WorkingType workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + String workingTypeValueAsString = workingTypeValue.toString(); + valMap.put("workingType", workingTypeValueAsString); + } + WorkingSide workingSideValue = getWorkingSide(); + if (workingSideValue != null) { + String workingSideValueAsString = workingSideValue.toString(); + valMap.put("workingSide", workingSideValueAsString); + } + String workingClientOrderIdValue = getWorkingClientOrderId(); + if (workingClientOrderIdValue != null) { + String workingClientOrderIdValueAsString = workingClientOrderIdValue.toString(); + valMap.put("workingClientOrderId", workingClientOrderIdValueAsString); + } + Double workingPriceValue = getWorkingPrice(); + if (workingPriceValue != null) { + String workingPriceValueAsString = + DecimalFormatter.getFormatter().format(workingPriceValue); + valMap.put("workingPrice", workingPriceValueAsString); + } + Double workingQuantityValue = getWorkingQuantity(); + if (workingQuantityValue != null) { + String workingQuantityValueAsString = + DecimalFormatter.getFormatter().format(workingQuantityValue); + valMap.put("workingQuantity", workingQuantityValueAsString); + } + Double workingIcebergQtyValue = getWorkingIcebergQty(); + if (workingIcebergQtyValue != null) { + String workingIcebergQtyValueAsString = + DecimalFormatter.getFormatter().format(workingIcebergQtyValue); + valMap.put("workingIcebergQty", workingIcebergQtyValueAsString); + } + WorkingTimeInForce workingTimeInForceValue = getWorkingTimeInForce(); + if (workingTimeInForceValue != null) { + String workingTimeInForceValueAsString = workingTimeInForceValue.toString(); + valMap.put("workingTimeInForce", workingTimeInForceValueAsString); + } + Long workingStrategyIdValue = getWorkingStrategyId(); + if (workingStrategyIdValue != null) { + String workingStrategyIdValueAsString = workingStrategyIdValue.toString(); + valMap.put("workingStrategyId", workingStrategyIdValueAsString); + } + Integer workingStrategyTypeValue = getWorkingStrategyType(); + if (workingStrategyTypeValue != null) { + String workingStrategyTypeValueAsString = workingStrategyTypeValue.toString(); + valMap.put("workingStrategyType", workingStrategyTypeValueAsString); + } + WorkingPegPriceType workingPegPriceTypeValue = getWorkingPegPriceType(); + if (workingPegPriceTypeValue != null) { + String workingPegPriceTypeValueAsString = workingPegPriceTypeValue.toString(); + valMap.put("workingPegPriceType", workingPegPriceTypeValueAsString); + } + WorkingPegOffsetType workingPegOffsetTypeValue = getWorkingPegOffsetType(); + if (workingPegOffsetTypeValue != null) { + String workingPegOffsetTypeValueAsString = workingPegOffsetTypeValue.toString(); + valMap.put("workingPegOffsetType", workingPegOffsetTypeValueAsString); + } + Integer workingPegOffsetValueValue = getWorkingPegOffsetValue(); + if (workingPegOffsetValueValue != null) { + String workingPegOffsetValueValueAsString = workingPegOffsetValueValue.toString(); + valMap.put("workingPegOffsetValue", workingPegOffsetValueValueAsString); + } + PendingSide pendingSideValue = getPendingSide(); + if (pendingSideValue != null) { + String pendingSideValueAsString = pendingSideValue.toString(); + valMap.put("pendingSide", pendingSideValueAsString); + } + PendingAboveType pendingAboveTypeValue = getPendingAboveType(); + if (pendingAboveTypeValue != null) { + String pendingAboveTypeValueAsString = pendingAboveTypeValue.toString(); + valMap.put("pendingAboveType", pendingAboveTypeValueAsString); + } + String pendingAboveClientOrderIdValue = getPendingAboveClientOrderId(); + if (pendingAboveClientOrderIdValue != null) { + String pendingAboveClientOrderIdValueAsString = + pendingAboveClientOrderIdValue.toString(); + valMap.put("pendingAboveClientOrderId", pendingAboveClientOrderIdValueAsString); + } + Double pendingAbovePriceValue = getPendingAbovePrice(); + if (pendingAbovePriceValue != null) { + String pendingAbovePriceValueAsString = + DecimalFormatter.getFormatter().format(pendingAbovePriceValue); + valMap.put("pendingAbovePrice", pendingAbovePriceValueAsString); + } + Double pendingAboveStopPriceValue = getPendingAboveStopPrice(); + if (pendingAboveStopPriceValue != null) { + String pendingAboveStopPriceValueAsString = + DecimalFormatter.getFormatter().format(pendingAboveStopPriceValue); + valMap.put("pendingAboveStopPrice", pendingAboveStopPriceValueAsString); + } + Double pendingAboveTrailingDeltaValue = getPendingAboveTrailingDelta(); + if (pendingAboveTrailingDeltaValue != null) { + String pendingAboveTrailingDeltaValueAsString = + DecimalFormatter.getFormatter().format(pendingAboveTrailingDeltaValue); + valMap.put("pendingAboveTrailingDelta", pendingAboveTrailingDeltaValueAsString); + } + Double pendingAboveIcebergQtyValue = getPendingAboveIcebergQty(); + if (pendingAboveIcebergQtyValue != null) { + String pendingAboveIcebergQtyValueAsString = + DecimalFormatter.getFormatter().format(pendingAboveIcebergQtyValue); + valMap.put("pendingAboveIcebergQty", pendingAboveIcebergQtyValueAsString); + } + PendingAboveTimeInForce pendingAboveTimeInForceValue = getPendingAboveTimeInForce(); + if (pendingAboveTimeInForceValue != null) { + String pendingAboveTimeInForceValueAsString = pendingAboveTimeInForceValue.toString(); + valMap.put("pendingAboveTimeInForce", pendingAboveTimeInForceValueAsString); + } + Long pendingAboveStrategyIdValue = getPendingAboveStrategyId(); + if (pendingAboveStrategyIdValue != null) { + String pendingAboveStrategyIdValueAsString = pendingAboveStrategyIdValue.toString(); + valMap.put("pendingAboveStrategyId", pendingAboveStrategyIdValueAsString); + } + Integer pendingAboveStrategyTypeValue = getPendingAboveStrategyType(); + if (pendingAboveStrategyTypeValue != null) { + String pendingAboveStrategyTypeValueAsString = pendingAboveStrategyTypeValue.toString(); + valMap.put("pendingAboveStrategyType", pendingAboveStrategyTypeValueAsString); + } + PendingAbovePegPriceType pendingAbovePegPriceTypeValue = getPendingAbovePegPriceType(); + if (pendingAbovePegPriceTypeValue != null) { + String pendingAbovePegPriceTypeValueAsString = pendingAbovePegPriceTypeValue.toString(); + valMap.put("pendingAbovePegPriceType", pendingAbovePegPriceTypeValueAsString); + } + PendingAbovePegOffsetType pendingAbovePegOffsetTypeValue = getPendingAbovePegOffsetType(); + if (pendingAbovePegOffsetTypeValue != null) { + String pendingAbovePegOffsetTypeValueAsString = + pendingAbovePegOffsetTypeValue.toString(); + valMap.put("pendingAbovePegOffsetType", pendingAbovePegOffsetTypeValueAsString); + } + Integer pendingAbovePegOffsetValueValue = getPendingAbovePegOffsetValue(); + if (pendingAbovePegOffsetValueValue != null) { + String pendingAbovePegOffsetValueValueAsString = + pendingAbovePegOffsetValueValue.toString(); + valMap.put("pendingAbovePegOffsetValue", pendingAbovePegOffsetValueValueAsString); + } + PendingBelowType pendingBelowTypeValue = getPendingBelowType(); + if (pendingBelowTypeValue != null) { + String pendingBelowTypeValueAsString = pendingBelowTypeValue.toString(); + valMap.put("pendingBelowType", pendingBelowTypeValueAsString); + } + String pendingBelowClientOrderIdValue = getPendingBelowClientOrderId(); + if (pendingBelowClientOrderIdValue != null) { + String pendingBelowClientOrderIdValueAsString = + pendingBelowClientOrderIdValue.toString(); + valMap.put("pendingBelowClientOrderId", pendingBelowClientOrderIdValueAsString); + } + Double pendingBelowPriceValue = getPendingBelowPrice(); + if (pendingBelowPriceValue != null) { + String pendingBelowPriceValueAsString = + DecimalFormatter.getFormatter().format(pendingBelowPriceValue); + valMap.put("pendingBelowPrice", pendingBelowPriceValueAsString); + } + Double pendingBelowStopPriceValue = getPendingBelowStopPrice(); + if (pendingBelowStopPriceValue != null) { + String pendingBelowStopPriceValueAsString = + DecimalFormatter.getFormatter().format(pendingBelowStopPriceValue); + valMap.put("pendingBelowStopPrice", pendingBelowStopPriceValueAsString); + } + Double pendingBelowTrailingDeltaValue = getPendingBelowTrailingDelta(); + if (pendingBelowTrailingDeltaValue != null) { + String pendingBelowTrailingDeltaValueAsString = + DecimalFormatter.getFormatter().format(pendingBelowTrailingDeltaValue); + valMap.put("pendingBelowTrailingDelta", pendingBelowTrailingDeltaValueAsString); + } + Double pendingBelowIcebergQtyValue = getPendingBelowIcebergQty(); + if (pendingBelowIcebergQtyValue != null) { + String pendingBelowIcebergQtyValueAsString = + DecimalFormatter.getFormatter().format(pendingBelowIcebergQtyValue); + valMap.put("pendingBelowIcebergQty", pendingBelowIcebergQtyValueAsString); + } + PendingBelowTimeInForce pendingBelowTimeInForceValue = getPendingBelowTimeInForce(); + if (pendingBelowTimeInForceValue != null) { + String pendingBelowTimeInForceValueAsString = pendingBelowTimeInForceValue.toString(); + valMap.put("pendingBelowTimeInForce", pendingBelowTimeInForceValueAsString); + } + Long pendingBelowStrategyIdValue = getPendingBelowStrategyId(); + if (pendingBelowStrategyIdValue != null) { + String pendingBelowStrategyIdValueAsString = pendingBelowStrategyIdValue.toString(); + valMap.put("pendingBelowStrategyId", pendingBelowStrategyIdValueAsString); + } + Integer pendingBelowStrategyTypeValue = getPendingBelowStrategyType(); + if (pendingBelowStrategyTypeValue != null) { + String pendingBelowStrategyTypeValueAsString = pendingBelowStrategyTypeValue.toString(); + valMap.put("pendingBelowStrategyType", pendingBelowStrategyTypeValueAsString); + } + PendingBelowPegPriceType pendingBelowPegPriceTypeValue = getPendingBelowPegPriceType(); + if (pendingBelowPegPriceTypeValue != null) { + String pendingBelowPegPriceTypeValueAsString = pendingBelowPegPriceTypeValue.toString(); + valMap.put("pendingBelowPegPriceType", pendingBelowPegPriceTypeValueAsString); + } + PendingBelowPegOffsetType pendingBelowPegOffsetTypeValue = getPendingBelowPegOffsetType(); + if (pendingBelowPegOffsetTypeValue != null) { + String pendingBelowPegOffsetTypeValueAsString = + pendingBelowPegOffsetTypeValue.toString(); + valMap.put("pendingBelowPegOffsetType", pendingBelowPegOffsetTypeValueAsString); + } + Integer pendingBelowPegOffsetValueValue = getPendingBelowPegOffsetValue(); + if (pendingBelowPegOffsetValueValue != null) { + String pendingBelowPegOffsetValueValueAsString = + pendingBelowPegOffsetValueValue.toString(); + valMap.put("pendingBelowPegOffsetValue", pendingBelowPegOffsetValueValueAsString); + } + Double recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); + valMap.put("recvWindow", recvWindowValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object listClientOrderIdValue = getListClientOrderId(); + if (listClientOrderIdValue != null) { + valMap.put("listClientOrderId", listClientOrderIdValue); + } + Object newOrderRespTypeValue = getNewOrderRespType(); + if (newOrderRespTypeValue != null) { + valMap.put("newOrderRespType", newOrderRespTypeValue); + } + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); + } + Object workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + valMap.put("workingType", workingTypeValue); + } + Object workingSideValue = getWorkingSide(); + if (workingSideValue != null) { + valMap.put("workingSide", workingSideValue); + } + Object workingClientOrderIdValue = getWorkingClientOrderId(); + if (workingClientOrderIdValue != null) { + valMap.put("workingClientOrderId", workingClientOrderIdValue); + } + Object workingPriceValue = getWorkingPrice(); + if (workingPriceValue != null) { + valMap.put("workingPrice", workingPriceValue); + } + Object workingQuantityValue = getWorkingQuantity(); + if (workingQuantityValue != null) { + valMap.put("workingQuantity", workingQuantityValue); + } + Object workingIcebergQtyValue = getWorkingIcebergQty(); + if (workingIcebergQtyValue != null) { + valMap.put("workingIcebergQty", workingIcebergQtyValue); + } + Object workingTimeInForceValue = getWorkingTimeInForce(); + if (workingTimeInForceValue != null) { + valMap.put("workingTimeInForce", workingTimeInForceValue); + } + Object workingStrategyIdValue = getWorkingStrategyId(); + if (workingStrategyIdValue != null) { + valMap.put("workingStrategyId", workingStrategyIdValue); + } + Object workingStrategyTypeValue = getWorkingStrategyType(); + if (workingStrategyTypeValue != null) { + valMap.put("workingStrategyType", workingStrategyTypeValue); + } + Object workingPegPriceTypeValue = getWorkingPegPriceType(); + if (workingPegPriceTypeValue != null) { + valMap.put("workingPegPriceType", workingPegPriceTypeValue); + } + Object workingPegOffsetTypeValue = getWorkingPegOffsetType(); + if (workingPegOffsetTypeValue != null) { + valMap.put("workingPegOffsetType", workingPegOffsetTypeValue); + } + Object workingPegOffsetValueValue = getWorkingPegOffsetValue(); + if (workingPegOffsetValueValue != null) { + valMap.put("workingPegOffsetValue", workingPegOffsetValueValue); + } + Object pendingSideValue = getPendingSide(); + if (pendingSideValue != null) { + valMap.put("pendingSide", pendingSideValue); + } + Object pendingAboveTypeValue = getPendingAboveType(); + if (pendingAboveTypeValue != null) { + valMap.put("pendingAboveType", pendingAboveTypeValue); + } + Object pendingAboveClientOrderIdValue = getPendingAboveClientOrderId(); + if (pendingAboveClientOrderIdValue != null) { + valMap.put("pendingAboveClientOrderId", pendingAboveClientOrderIdValue); + } + Object pendingAbovePriceValue = getPendingAbovePrice(); + if (pendingAbovePriceValue != null) { + valMap.put("pendingAbovePrice", pendingAbovePriceValue); + } + Object pendingAboveStopPriceValue = getPendingAboveStopPrice(); + if (pendingAboveStopPriceValue != null) { + valMap.put("pendingAboveStopPrice", pendingAboveStopPriceValue); + } + Object pendingAboveTrailingDeltaValue = getPendingAboveTrailingDelta(); + if (pendingAboveTrailingDeltaValue != null) { + valMap.put("pendingAboveTrailingDelta", pendingAboveTrailingDeltaValue); + } + Object pendingAboveIcebergQtyValue = getPendingAboveIcebergQty(); + if (pendingAboveIcebergQtyValue != null) { + valMap.put("pendingAboveIcebergQty", pendingAboveIcebergQtyValue); + } + Object pendingAboveTimeInForceValue = getPendingAboveTimeInForce(); + if (pendingAboveTimeInForceValue != null) { + valMap.put("pendingAboveTimeInForce", pendingAboveTimeInForceValue); + } + Object pendingAboveStrategyIdValue = getPendingAboveStrategyId(); + if (pendingAboveStrategyIdValue != null) { + valMap.put("pendingAboveStrategyId", pendingAboveStrategyIdValue); + } + Object pendingAboveStrategyTypeValue = getPendingAboveStrategyType(); + if (pendingAboveStrategyTypeValue != null) { + valMap.put("pendingAboveStrategyType", pendingAboveStrategyTypeValue); + } + Object pendingAbovePegPriceTypeValue = getPendingAbovePegPriceType(); + if (pendingAbovePegPriceTypeValue != null) { + valMap.put("pendingAbovePegPriceType", pendingAbovePegPriceTypeValue); + } + Object pendingAbovePegOffsetTypeValue = getPendingAbovePegOffsetType(); + if (pendingAbovePegOffsetTypeValue != null) { + valMap.put("pendingAbovePegOffsetType", pendingAbovePegOffsetTypeValue); + } + Object pendingAbovePegOffsetValueValue = getPendingAbovePegOffsetValue(); + if (pendingAbovePegOffsetValueValue != null) { + valMap.put("pendingAbovePegOffsetValue", pendingAbovePegOffsetValueValue); + } + Object pendingBelowTypeValue = getPendingBelowType(); + if (pendingBelowTypeValue != null) { + valMap.put("pendingBelowType", pendingBelowTypeValue); + } + Object pendingBelowClientOrderIdValue = getPendingBelowClientOrderId(); + if (pendingBelowClientOrderIdValue != null) { + valMap.put("pendingBelowClientOrderId", pendingBelowClientOrderIdValue); + } + Object pendingBelowPriceValue = getPendingBelowPrice(); + if (pendingBelowPriceValue != null) { + valMap.put("pendingBelowPrice", pendingBelowPriceValue); + } + Object pendingBelowStopPriceValue = getPendingBelowStopPrice(); + if (pendingBelowStopPriceValue != null) { + valMap.put("pendingBelowStopPrice", pendingBelowStopPriceValue); + } + Object pendingBelowTrailingDeltaValue = getPendingBelowTrailingDelta(); + if (pendingBelowTrailingDeltaValue != null) { + valMap.put("pendingBelowTrailingDelta", pendingBelowTrailingDeltaValue); + } + Object pendingBelowIcebergQtyValue = getPendingBelowIcebergQty(); + if (pendingBelowIcebergQtyValue != null) { + valMap.put("pendingBelowIcebergQty", pendingBelowIcebergQtyValue); + } + Object pendingBelowTimeInForceValue = getPendingBelowTimeInForce(); + if (pendingBelowTimeInForceValue != null) { + valMap.put("pendingBelowTimeInForce", pendingBelowTimeInForceValue); + } + Object pendingBelowStrategyIdValue = getPendingBelowStrategyId(); + if (pendingBelowStrategyIdValue != null) { + valMap.put("pendingBelowStrategyId", pendingBelowStrategyIdValue); + } + Object pendingBelowStrategyTypeValue = getPendingBelowStrategyType(); + if (pendingBelowStrategyTypeValue != null) { + valMap.put("pendingBelowStrategyType", pendingBelowStrategyTypeValue); + } + Object pendingBelowPegPriceTypeValue = getPendingBelowPegPriceType(); + if (pendingBelowPegPriceTypeValue != null) { + valMap.put("pendingBelowPegPriceType", pendingBelowPegPriceTypeValue); + } + Object pendingBelowPegOffsetTypeValue = getPendingBelowPegOffsetType(); + if (pendingBelowPegOffsetTypeValue != null) { + valMap.put("pendingBelowPegOffsetType", pendingBelowPegOffsetTypeValue); + } + Object pendingBelowPegOffsetValueValue = getPendingBelowPegOffsetValue(); + if (pendingBelowPegOffsetValueValue != null) { + valMap.put("pendingBelowPegOffsetValue", pendingBelowPegOffsetValueValue); + } + Object recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + valMap.put("recvWindow", recvWindowValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("listClientOrderId"); + openapiFields.add("newOrderRespType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("workingSide"); + openapiFields.add("workingClientOrderId"); + openapiFields.add("workingPrice"); + openapiFields.add("workingQuantity"); + openapiFields.add("workingIcebergQty"); + openapiFields.add("workingTimeInForce"); + openapiFields.add("workingStrategyId"); + openapiFields.add("workingStrategyType"); + openapiFields.add("workingPegPriceType"); + openapiFields.add("workingPegOffsetType"); + openapiFields.add("workingPegOffsetValue"); + openapiFields.add("pendingSide"); + openapiFields.add("pendingAboveType"); + openapiFields.add("pendingAboveClientOrderId"); + openapiFields.add("pendingAbovePrice"); + openapiFields.add("pendingAboveStopPrice"); + openapiFields.add("pendingAboveTrailingDelta"); + openapiFields.add("pendingAboveIcebergQty"); + openapiFields.add("pendingAboveTimeInForce"); + openapiFields.add("pendingAboveStrategyId"); + openapiFields.add("pendingAboveStrategyType"); + openapiFields.add("pendingAbovePegPriceType"); + openapiFields.add("pendingAbovePegOffsetType"); + openapiFields.add("pendingAbovePegOffsetValue"); + openapiFields.add("pendingBelowType"); + openapiFields.add("pendingBelowClientOrderId"); + openapiFields.add("pendingBelowPrice"); + openapiFields.add("pendingBelowStopPrice"); + openapiFields.add("pendingBelowTrailingDelta"); + openapiFields.add("pendingBelowIcebergQty"); + openapiFields.add("pendingBelowTimeInForce"); + openapiFields.add("pendingBelowStrategyId"); + openapiFields.add("pendingBelowStrategyType"); + openapiFields.add("pendingBelowPegPriceType"); + openapiFields.add("pendingBelowPegOffsetType"); + openapiFields.add("pendingBelowPegOffsetValue"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("symbol"); + openapiRequiredFields.add("workingType"); + openapiRequiredFields.add("workingSide"); + openapiRequiredFields.add("workingPrice"); + openapiRequiredFields.add("workingQuantity"); + openapiRequiredFields.add("pendingSide"); + openapiRequiredFields.add("pendingAboveType"); + } + + /** + * 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 OrderListPlaceOpocoRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListPlaceOpocoRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListPlaceOpocoRequest is not" + + " found in the empty JSON string", + OrderListPlaceOpocoRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderListPlaceOpocoRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderListPlaceOpocoRequest` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrderListPlaceOpocoRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("listClientOrderId") != null + && !jsonObj.get("listClientOrderId").isJsonNull()) + && !jsonObj.get("listClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listClientOrderId").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")); + } + // validate the required field `workingType` + WorkingType.validateJsonElement(jsonObj.get("workingType")); + // validate the required field `workingSide` + WorkingSide.validateJsonElement(jsonObj.get("workingSide")); + if ((jsonObj.get("workingClientOrderId") != null + && !jsonObj.get("workingClientOrderId").isJsonNull()) + && !jsonObj.get("workingClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingClientOrderId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("workingClientOrderId").toString())); + } + // validate the optional field `workingTimeInForce` + if (jsonObj.get("workingTimeInForce") != null + && !jsonObj.get("workingTimeInForce").isJsonNull()) { + WorkingTimeInForce.validateJsonElement(jsonObj.get("workingTimeInForce")); + } + // validate the optional field `workingPegPriceType` + if (jsonObj.get("workingPegPriceType") != null + && !jsonObj.get("workingPegPriceType").isJsonNull()) { + WorkingPegPriceType.validateJsonElement(jsonObj.get("workingPegPriceType")); + } + // validate the optional field `workingPegOffsetType` + if (jsonObj.get("workingPegOffsetType") != null + && !jsonObj.get("workingPegOffsetType").isJsonNull()) { + WorkingPegOffsetType.validateJsonElement(jsonObj.get("workingPegOffsetType")); + } + // validate the required field `pendingSide` + PendingSide.validateJsonElement(jsonObj.get("pendingSide")); + // validate the required field `pendingAboveType` + PendingAboveType.validateJsonElement(jsonObj.get("pendingAboveType")); + if ((jsonObj.get("pendingAboveClientOrderId") != null + && !jsonObj.get("pendingAboveClientOrderId").isJsonNull()) + && !jsonObj.get("pendingAboveClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pendingAboveClientOrderId` to be a primitive type" + + " in the JSON string but got `%s`", + jsonObj.get("pendingAboveClientOrderId").toString())); + } + // validate the optional field `pendingAboveTimeInForce` + if (jsonObj.get("pendingAboveTimeInForce") != null + && !jsonObj.get("pendingAboveTimeInForce").isJsonNull()) { + PendingAboveTimeInForce.validateJsonElement(jsonObj.get("pendingAboveTimeInForce")); + } + // validate the optional field `pendingAbovePegPriceType` + if (jsonObj.get("pendingAbovePegPriceType") != null + && !jsonObj.get("pendingAbovePegPriceType").isJsonNull()) { + PendingAbovePegPriceType.validateJsonElement(jsonObj.get("pendingAbovePegPriceType")); + } + // validate the optional field `pendingAbovePegOffsetType` + if (jsonObj.get("pendingAbovePegOffsetType") != null + && !jsonObj.get("pendingAbovePegOffsetType").isJsonNull()) { + PendingAbovePegOffsetType.validateJsonElement(jsonObj.get("pendingAbovePegOffsetType")); + } + // validate the optional field `pendingBelowType` + if (jsonObj.get("pendingBelowType") != null + && !jsonObj.get("pendingBelowType").isJsonNull()) { + PendingBelowType.validateJsonElement(jsonObj.get("pendingBelowType")); + } + if ((jsonObj.get("pendingBelowClientOrderId") != null + && !jsonObj.get("pendingBelowClientOrderId").isJsonNull()) + && !jsonObj.get("pendingBelowClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pendingBelowClientOrderId` to be a primitive type" + + " in the JSON string but got `%s`", + jsonObj.get("pendingBelowClientOrderId").toString())); + } + // validate the optional field `pendingBelowTimeInForce` + if (jsonObj.get("pendingBelowTimeInForce") != null + && !jsonObj.get("pendingBelowTimeInForce").isJsonNull()) { + PendingBelowTimeInForce.validateJsonElement(jsonObj.get("pendingBelowTimeInForce")); + } + // validate the optional field `pendingBelowPegPriceType` + if (jsonObj.get("pendingBelowPegPriceType") != null + && !jsonObj.get("pendingBelowPegPriceType").isJsonNull()) { + PendingBelowPegPriceType.validateJsonElement(jsonObj.get("pendingBelowPegPriceType")); + } + // validate the optional field `pendingBelowPegOffsetType` + if (jsonObj.get("pendingBelowPegOffsetType") != null + && !jsonObj.get("pendingBelowPegOffsetType").isJsonNull()) { + PendingBelowPegOffsetType.validateJsonElement(jsonObj.get("pendingBelowPegOffsetType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListPlaceOpocoRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListPlaceOpocoRequest' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderListPlaceOpocoRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListPlaceOpocoRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListPlaceOpocoRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListPlaceOpocoRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListPlaceOpocoRequest + * @throws IOException if the JSON string is invalid with respect to OrderListPlaceOpocoRequest + */ + public static OrderListPlaceOpocoRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListPlaceOpocoRequest.class); + } + + /** + * Convert an instance of OrderListPlaceOpocoRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponse.java similarity index 65% rename from clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponse.java index f1e2cea4..a956a4d5 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -28,9 +27,7 @@ import jakarta.validation.constraints.*; import java.io.IOException; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -38,11 +35,11 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** UserDataStreamStartResponse */ +/** OrderListPlaceOpocoResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class UserDataStreamStartResponse extends BaseDTO { +public class OrderListPlaceOpocoResponse extends BaseDTO { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -59,17 +56,11 @@ public class UserDataStreamStartResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RESULT) @jakarta.annotation.Nullable - private UserDataStreamStartResponseResult result; + private OrderListPlaceOpocoResponseResult result; - public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; + public OrderListPlaceOpocoResponse() {} - @SerializedName(SERIALIZED_NAME_RATE_LIMITS) - @jakarta.annotation.Nullable - private List<@Valid RateLimits> rateLimits; - - public UserDataStreamStartResponse() {} - - public UserDataStreamStartResponse id(@jakarta.annotation.Nullable String id) { + public OrderListPlaceOpocoResponse id(@jakarta.annotation.Nullable String id) { this.id = id; return this; } @@ -88,7 +79,7 @@ public void setId(@jakarta.annotation.Nullable String id) { this.id = id; } - public UserDataStreamStartResponse status(@jakarta.annotation.Nullable Long status) { + public OrderListPlaceOpocoResponse status(@jakarta.annotation.Nullable Long status) { this.status = status; return this; } @@ -107,8 +98,8 @@ public void setStatus(@jakarta.annotation.Nullable Long status) { this.status = status; } - public UserDataStreamStartResponse result( - @jakarta.annotation.Nullable UserDataStreamStartResponseResult result) { + public OrderListPlaceOpocoResponse result( + @jakarta.annotation.Nullable OrderListPlaceOpocoResponseResult result) { this.result = result; return this; } @@ -120,43 +111,14 @@ public UserDataStreamStartResponse result( */ @jakarta.annotation.Nullable @Valid - public UserDataStreamStartResponseResult getResult() { + public OrderListPlaceOpocoResponseResult getResult() { return result; } - public void setResult(@jakarta.annotation.Nullable UserDataStreamStartResponseResult result) { + public void setResult(@jakarta.annotation.Nullable OrderListPlaceOpocoResponseResult result) { this.result = result; } - public UserDataStreamStartResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { - this.rateLimits = rateLimits; - return this; - } - - public UserDataStreamStartResponse addRateLimitsItem(RateLimits rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - - /** - * Get rateLimits - * - * @return rateLimits - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid RateLimits> getRateLimits() { - return rateLimits; - } - - public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { - this.rateLimits = rateLimits; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -165,26 +127,24 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - UserDataStreamStartResponse userDataStreamStartResponse = (UserDataStreamStartResponse) o; - return Objects.equals(this.id, userDataStreamStartResponse.id) - && Objects.equals(this.status, userDataStreamStartResponse.status) - && Objects.equals(this.result, userDataStreamStartResponse.result) - && Objects.equals(this.rateLimits, userDataStreamStartResponse.rateLimits); + OrderListPlaceOpocoResponse orderListPlaceOpocoResponse = (OrderListPlaceOpocoResponse) o; + return Objects.equals(this.id, orderListPlaceOpocoResponse.id) + && Objects.equals(this.status, orderListPlaceOpocoResponse.status) + && Objects.equals(this.result, orderListPlaceOpocoResponse.result); } @Override public int hashCode() { - return Objects.hash(id, status, result, rateLimits); + return Objects.hash(id, status, result); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class UserDataStreamStartResponse {\n"); + sb.append("class OrderListPlaceOpocoResponse {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" result: ").append(toIndentedString(result)).append("\n"); - sb.append(" rateLimits: ").append(toIndentedString(rateLimits)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,16 +163,11 @@ public String toUrlQueryString() { String statusValueAsString = statusValue.toString(); valMap.put("status", statusValueAsString); } - UserDataStreamStartResponseResult resultValue = getResult(); + OrderListPlaceOpocoResponseResult resultValue = getResult(); if (resultValue != null) { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid RateLimits> rateLimitsValue = getRateLimits(); - if (rateLimitsValue != null) { - String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); - valMap.put("rateLimits", rateLimitsValueAsString); - } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -236,10 +191,6 @@ public Map toMap() { if (resultValue != null) { valMap.put("result", resultValue); } - Object rateLimitsValue = getRateLimits(); - if (rateLimitsValue != null) { - valMap.put("rateLimits", rateLimitsValue); - } valMap.put("timestamp", getTimestamp()); return valMap; @@ -269,7 +220,6 @@ private String toIndentedString(Object o) { openapiFields.add("id"); openapiFields.add("status"); openapiFields.add("result"); - openapiFields.add("rateLimits"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -280,28 +230,28 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * UserDataStreamStartResponse + * OrderListPlaceOpocoResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!UserDataStreamStartResponse.openapiRequiredFields + if (!OrderListPlaceOpocoResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in UserDataStreamStartResponse is not" + "The required field(s) %s in OrderListPlaceOpocoResponse is not" + " found in the empty JSON string", - UserDataStreamStartResponse.openapiRequiredFields.toString())); + OrderListPlaceOpocoResponse.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!UserDataStreamStartResponse.openapiFields.contains(entry.getKey())) { + if (!OrderListPlaceOpocoResponse.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `UserDataStreamStartResponse` properties. JSON: %s", + + " `OrderListPlaceOpocoResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -316,26 +266,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `result` if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { - UserDataStreamStartResponseResult.validateJsonElement(jsonObj.get("result")); - } - if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { - JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); - if (jsonArrayrateLimits != null) { - // ensure the json data is an array - if (!jsonObj.get("rateLimits").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimits` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimits").toString())); - } - - // validate the optional field `rateLimits` (array) - for (int i = 0; i < jsonArrayrateLimits.size(); i++) { - RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } + OrderListPlaceOpocoResponseResult.validateJsonElement(jsonObj.get("result")); } } @@ -343,25 +274,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserDataStreamStartResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserDataStreamStartResponse' and its + if (!OrderListPlaceOpocoResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListPlaceOpocoResponse' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UserDataStreamStartResponse.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderListPlaceOpocoResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, UserDataStreamStartResponse value) + public void write(JsonWriter out, OrderListPlaceOpocoResponse value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public UserDataStreamStartResponse read(JsonReader in) throws IOException { + public OrderListPlaceOpocoResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -371,18 +302,18 @@ public UserDataStreamStartResponse read(JsonReader in) throws IOException { } /** - * Create an instance of UserDataStreamStartResponse given an JSON string + * Create an instance of OrderListPlaceOpocoResponse given an JSON string * * @param jsonString JSON string - * @return An instance of UserDataStreamStartResponse - * @throws IOException if the JSON string is invalid with respect to UserDataStreamStartResponse + * @return An instance of OrderListPlaceOpocoResponse + * @throws IOException if the JSON string is invalid with respect to OrderListPlaceOpocoResponse */ - public static UserDataStreamStartResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserDataStreamStartResponse.class); + public static OrderListPlaceOpocoResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListPlaceOpocoResponse.class); } /** - * Convert an instance of UserDataStreamStartResponse to an JSON string + * Convert an instance of OrderListPlaceOpocoResponse to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResult.java new file mode 100644 index 00000000..cae711a2 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResult.java @@ -0,0 +1,670 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListPlaceOpocoResponseResult */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListPlaceOpocoResponseResult extends BaseDTO { + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CONTINGENCY_TYPE = "contingencyType"; + + @SerializedName(SERIALIZED_NAME_CONTINGENCY_TYPE) + @jakarta.annotation.Nullable + private String contingencyType; + + public static final String SERIALIZED_NAME_LIST_STATUS_TYPE = "listStatusType"; + + @SerializedName(SERIALIZED_NAME_LIST_STATUS_TYPE) + @jakarta.annotation.Nullable + private String listStatusType; + + public static final String SERIALIZED_NAME_LIST_ORDER_STATUS = "listOrderStatus"; + + @SerializedName(SERIALIZED_NAME_LIST_ORDER_STATUS) + @jakarta.annotation.Nullable + private String listOrderStatus; + + public static final String SERIALIZED_NAME_LIST_CLIENT_ORDER_ID = "listClientOrderId"; + + @SerializedName(SERIALIZED_NAME_LIST_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String listClientOrderId; + + public static final String SERIALIZED_NAME_TRANSACTION_TIME = "transactionTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACTION_TIME) + @jakarta.annotation.Nullable + private Long transactionTime; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDERS = "orders"; + + @SerializedName(SERIALIZED_NAME_ORDERS) + @jakarta.annotation.Nullable + private List<@Valid OrderListPlaceOpocoResponseResultOrdersInner> orders; + + public static final String SERIALIZED_NAME_ORDER_REPORTS = "orderReports"; + + @SerializedName(SERIALIZED_NAME_ORDER_REPORTS) + @jakarta.annotation.Nullable + private List<@Valid OrderListPlaceOpocoResponseResultOrderReportsInner> orderReports; + + public OrderListPlaceOpocoResponseResult() {} + + public OrderListPlaceOpocoResponseResult orderListId( + @jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderListPlaceOpocoResponseResult contingencyType( + @jakarta.annotation.Nullable String contingencyType) { + this.contingencyType = contingencyType; + return this; + } + + /** + * Get contingencyType + * + * @return contingencyType + */ + @jakarta.annotation.Nullable + public String getContingencyType() { + return contingencyType; + } + + public void setContingencyType(@jakarta.annotation.Nullable String contingencyType) { + this.contingencyType = contingencyType; + } + + public OrderListPlaceOpocoResponseResult listStatusType( + @jakarta.annotation.Nullable String listStatusType) { + this.listStatusType = listStatusType; + return this; + } + + /** + * Get listStatusType + * + * @return listStatusType + */ + @jakarta.annotation.Nullable + public String getListStatusType() { + return listStatusType; + } + + public void setListStatusType(@jakarta.annotation.Nullable String listStatusType) { + this.listStatusType = listStatusType; + } + + public OrderListPlaceOpocoResponseResult listOrderStatus( + @jakarta.annotation.Nullable String listOrderStatus) { + this.listOrderStatus = listOrderStatus; + return this; + } + + /** + * Get listOrderStatus + * + * @return listOrderStatus + */ + @jakarta.annotation.Nullable + public String getListOrderStatus() { + return listOrderStatus; + } + + public void setListOrderStatus(@jakarta.annotation.Nullable String listOrderStatus) { + this.listOrderStatus = listOrderStatus; + } + + public OrderListPlaceOpocoResponseResult listClientOrderId( + @jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + return this; + } + + /** + * Get listClientOrderId + * + * @return listClientOrderId + */ + @jakarta.annotation.Nullable + public String getListClientOrderId() { + return listClientOrderId; + } + + public void setListClientOrderId(@jakarta.annotation.Nullable String listClientOrderId) { + this.listClientOrderId = listClientOrderId; + } + + public OrderListPlaceOpocoResponseResult transactionTime( + @jakarta.annotation.Nullable Long transactionTime) { + this.transactionTime = transactionTime; + return this; + } + + /** + * Get transactionTime + * + * @return transactionTime + */ + @jakarta.annotation.Nullable + public Long getTransactionTime() { + return transactionTime; + } + + public void setTransactionTime(@jakarta.annotation.Nullable Long transactionTime) { + this.transactionTime = transactionTime; + } + + public OrderListPlaceOpocoResponseResult 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 OrderListPlaceOpocoResponseResult orders( + @jakarta.annotation.Nullable + List<@Valid OrderListPlaceOpocoResponseResultOrdersInner> orders) { + this.orders = orders; + return this; + } + + public OrderListPlaceOpocoResponseResult addOrdersItem( + OrderListPlaceOpocoResponseResultOrdersInner ordersItem) { + if (this.orders == null) { + this.orders = new ArrayList<>(); + } + this.orders.add(ordersItem); + return this; + } + + /** + * Get orders + * + * @return orders + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OrderListPlaceOpocoResponseResultOrdersInner> getOrders() { + return orders; + } + + public void setOrders( + @jakarta.annotation.Nullable + List<@Valid OrderListPlaceOpocoResponseResultOrdersInner> orders) { + this.orders = orders; + } + + public OrderListPlaceOpocoResponseResult orderReports( + @jakarta.annotation.Nullable + List<@Valid OrderListPlaceOpocoResponseResultOrderReportsInner> orderReports) { + this.orderReports = orderReports; + return this; + } + + public OrderListPlaceOpocoResponseResult addOrderReportsItem( + OrderListPlaceOpocoResponseResultOrderReportsInner orderReportsItem) { + if (this.orderReports == null) { + this.orderReports = new ArrayList<>(); + } + this.orderReports.add(orderReportsItem); + return this; + } + + /** + * Get orderReports + * + * @return orderReports + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid OrderListPlaceOpocoResponseResultOrderReportsInner> getOrderReports() { + return orderReports; + } + + public void setOrderReports( + @jakarta.annotation.Nullable + List<@Valid OrderListPlaceOpocoResponseResultOrderReportsInner> orderReports) { + this.orderReports = orderReports; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListPlaceOpocoResponseResult orderListPlaceOpocoResponseResult = + (OrderListPlaceOpocoResponseResult) o; + return Objects.equals(this.orderListId, orderListPlaceOpocoResponseResult.orderListId) + && Objects.equals( + this.contingencyType, orderListPlaceOpocoResponseResult.contingencyType) + && Objects.equals( + this.listStatusType, orderListPlaceOpocoResponseResult.listStatusType) + && Objects.equals( + this.listOrderStatus, orderListPlaceOpocoResponseResult.listOrderStatus) + && Objects.equals( + this.listClientOrderId, orderListPlaceOpocoResponseResult.listClientOrderId) + && Objects.equals( + this.transactionTime, orderListPlaceOpocoResponseResult.transactionTime) + && Objects.equals(this.symbol, orderListPlaceOpocoResponseResult.symbol) + && Objects.equals(this.orders, orderListPlaceOpocoResponseResult.orders) + && Objects.equals( + this.orderReports, orderListPlaceOpocoResponseResult.orderReports); + } + + @Override + public int hashCode() { + return Objects.hash( + orderListId, + contingencyType, + listStatusType, + listOrderStatus, + listClientOrderId, + transactionTime, + symbol, + orders, + orderReports); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListPlaceOpocoResponseResult {\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" contingencyType: ").append(toIndentedString(contingencyType)).append("\n"); + sb.append(" listStatusType: ").append(toIndentedString(listStatusType)).append("\n"); + sb.append(" listOrderStatus: ").append(toIndentedString(listOrderStatus)).append("\n"); + sb.append(" listClientOrderId: ").append(toIndentedString(listClientOrderId)).append("\n"); + sb.append(" transactionTime: ").append(toIndentedString(transactionTime)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orders: ").append(toIndentedString(orders)).append("\n"); + sb.append(" orderReports: ").append(toIndentedString(orderReports)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long orderListIdValue = getOrderListId(); + if (orderListIdValue != null) { + String orderListIdValueAsString = orderListIdValue.toString(); + valMap.put("orderListId", orderListIdValueAsString); + } + String contingencyTypeValue = getContingencyType(); + if (contingencyTypeValue != null) { + String contingencyTypeValueAsString = contingencyTypeValue.toString(); + valMap.put("contingencyType", contingencyTypeValueAsString); + } + String listStatusTypeValue = getListStatusType(); + if (listStatusTypeValue != null) { + String listStatusTypeValueAsString = listStatusTypeValue.toString(); + valMap.put("listStatusType", listStatusTypeValueAsString); + } + String listOrderStatusValue = getListOrderStatus(); + if (listOrderStatusValue != null) { + String listOrderStatusValueAsString = listOrderStatusValue.toString(); + valMap.put("listOrderStatus", listOrderStatusValueAsString); + } + String listClientOrderIdValue = getListClientOrderId(); + if (listClientOrderIdValue != null) { + String listClientOrderIdValueAsString = listClientOrderIdValue.toString(); + valMap.put("listClientOrderId", listClientOrderIdValueAsString); + } + Long transactionTimeValue = getTransactionTime(); + if (transactionTimeValue != null) { + String transactionTimeValueAsString = transactionTimeValue.toString(); + valMap.put("transactionTime", transactionTimeValueAsString); + } + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + List<@Valid OrderListPlaceOpocoResponseResultOrdersInner> ordersValue = getOrders(); + if (ordersValue != null) { + String ordersValueAsString = JSON.getGson().toJson(ordersValue); + valMap.put("orders", ordersValueAsString); + } + List<@Valid OrderListPlaceOpocoResponseResultOrderReportsInner> orderReportsValue = + getOrderReports(); + if (orderReportsValue != null) { + String orderReportsValueAsString = JSON.getGson().toJson(orderReportsValue); + valMap.put("orderReports", orderReportsValueAsString); + } + + 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 orderListIdValue = getOrderListId(); + if (orderListIdValue != null) { + valMap.put("orderListId", orderListIdValue); + } + Object contingencyTypeValue = getContingencyType(); + if (contingencyTypeValue != null) { + valMap.put("contingencyType", contingencyTypeValue); + } + Object listStatusTypeValue = getListStatusType(); + if (listStatusTypeValue != null) { + valMap.put("listStatusType", listStatusTypeValue); + } + Object listOrderStatusValue = getListOrderStatus(); + if (listOrderStatusValue != null) { + valMap.put("listOrderStatus", listOrderStatusValue); + } + Object listClientOrderIdValue = getListClientOrderId(); + if (listClientOrderIdValue != null) { + valMap.put("listClientOrderId", listClientOrderIdValue); + } + Object transactionTimeValue = getTransactionTime(); + if (transactionTimeValue != null) { + valMap.put("transactionTime", transactionTimeValue); + } + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object ordersValue = getOrders(); + if (ordersValue != null) { + valMap.put("orders", ordersValue); + } + Object orderReportsValue = getOrderReports(); + if (orderReportsValue != null) { + valMap.put("orderReports", orderReportsValue); + } + + 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("orderListId"); + openapiFields.add("contingencyType"); + openapiFields.add("listStatusType"); + openapiFields.add("listOrderStatus"); + openapiFields.add("listClientOrderId"); + openapiFields.add("transactionTime"); + openapiFields.add("symbol"); + openapiFields.add("orders"); + openapiFields.add("orderReports"); + + // 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 + * OrderListPlaceOpocoResponseResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListPlaceOpocoResponseResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderListPlaceOpocoResponseResult is" + + " not found in the empty JSON string", + OrderListPlaceOpocoResponseResult.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderListPlaceOpocoResponseResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderListPlaceOpocoResponseResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) + && !jsonObj.get("contingencyType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `contingencyType` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("contingencyType").toString())); + } + if ((jsonObj.get("listStatusType") != null && !jsonObj.get("listStatusType").isJsonNull()) + && !jsonObj.get("listStatusType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listStatusType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("listStatusType").toString())); + } + if ((jsonObj.get("listOrderStatus") != null && !jsonObj.get("listOrderStatus").isJsonNull()) + && !jsonObj.get("listOrderStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listOrderStatus` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listOrderStatus").toString())); + } + if ((jsonObj.get("listClientOrderId") != null + && !jsonObj.get("listClientOrderId").isJsonNull()) + && !jsonObj.get("listClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listClientOrderId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("listClientOrderId").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("orders") != null && !jsonObj.get("orders").isJsonNull()) { + JsonArray jsonArrayorders = jsonObj.getAsJsonArray("orders"); + if (jsonArrayorders != null) { + // ensure the json data is an array + if (!jsonObj.get("orders").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orders` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("orders").toString())); + } + + // validate the optional field `orders` (array) + for (int i = 0; i < jsonArrayorders.size(); i++) { + OrderListPlaceOpocoResponseResultOrdersInner.validateJsonElement( + jsonArrayorders.get(i)); + } + ; + } + } + if (jsonObj.get("orderReports") != null && !jsonObj.get("orderReports").isJsonNull()) { + JsonArray jsonArrayorderReports = jsonObj.getAsJsonArray("orderReports"); + if (jsonArrayorderReports != null) { + // ensure the json data is an array + if (!jsonObj.get("orderReports").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderReports` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("orderReports").toString())); + } + + // validate the optional field `orderReports` (array) + for (int i = 0; i < jsonArrayorderReports.size(); i++) { + OrderListPlaceOpocoResponseResultOrderReportsInner.validateJsonElement( + jsonArrayorderReports.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListPlaceOpocoResponseResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderListPlaceOpocoResponseResult' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderListPlaceOpocoResponseResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderListPlaceOpocoResponseResult value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListPlaceOpocoResponseResult read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListPlaceOpocoResponseResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListPlaceOpocoResponseResult + * @throws IOException if the JSON string is invalid with respect to + * OrderListPlaceOpocoResponseResult + */ + public static OrderListPlaceOpocoResponseResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderListPlaceOpocoResponseResult.class); + } + + /** + * Convert an instance of OrderListPlaceOpocoResponseResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResultOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResultOrderReportsInner.java new file mode 100644 index 00000000..150a875d --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResultOrderReportsInner.java @@ -0,0 +1,1018 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListPlaceOpocoResponseResultOrderReportsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListPlaceOpocoResponseResultOrderReportsInner extends BaseDTO { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; + + @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) + @jakarta.annotation.Nullable + private Long orderListId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public static final String SERIALIZED_NAME_TRANSACT_TIME = "transactTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACT_TIME) + @jakarta.annotation.Nullable + private Long transactTime; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; + + @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) + @jakarta.annotation.Nullable + private String executedQty; + + public static final String SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY = "origQuoteOrderQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY) + @jakarta.annotation.Nullable + private String origQuoteOrderQty; + + public static final String SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY = "cummulativeQuoteQty"; + + @SerializedName(SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY) + @jakarta.annotation.Nullable + private String cummulativeQuoteQty; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_WORKING_TIME = "workingTime"; + + @SerializedName(SERIALIZED_NAME_WORKING_TIME) + @jakarta.annotation.Nullable + private Long workingTime; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_STOP_PRICE = "stopPrice"; + + @SerializedName(SERIALIZED_NAME_STOP_PRICE) + @jakarta.annotation.Nullable + private String stopPrice; + + public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QTY) + @jakarta.annotation.Nullable + private String origQty; + + public OrderListPlaceOpocoResponseResultOrderReportsInner() {} + + public OrderListPlaceOpocoResponseResultOrderReportsInner 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 OrderListPlaceOpocoResponseResultOrderReportsInner orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner orderListId( + @jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + return this; + } + + /** + * Get orderListId + * + * @return orderListId + */ + @jakarta.annotation.Nullable + public Long getOrderListId() { + return orderListId; + } + + public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { + this.orderListId = orderListId; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner transactTime( + @jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + return this; + } + + /** + * Get transactTime + * + * @return transactTime + */ + @jakarta.annotation.Nullable + public Long getTransactTime() { + return transactTime; + } + + public void setTransactTime(@jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner 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 OrderListPlaceOpocoResponseResultOrderReportsInner executedQty( + @jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + return this; + } + + /** + * Get executedQty + * + * @return executedQty + */ + @jakarta.annotation.Nullable + public String getExecutedQty() { + return executedQty; + } + + public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner origQuoteOrderQty( + @jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + return this; + } + + /** + * Get origQuoteOrderQty + * + * @return origQuoteOrderQty + */ + @jakarta.annotation.Nullable + public String getOrigQuoteOrderQty() { + return origQuoteOrderQty; + } + + public void setOrigQuoteOrderQty(@jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner cummulativeQuoteQty( + @jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + return this; + } + + /** + * Get cummulativeQuoteQty + * + * @return cummulativeQuoteQty + */ + @jakarta.annotation.Nullable + public String getCummulativeQuoteQty() { + return cummulativeQuoteQty; + } + + public void setCummulativeQuoteQty(@jakarta.annotation.Nullable String cummulativeQuoteQty) { + this.cummulativeQuoteQty = cummulativeQuoteQty; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner status( + @jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner 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 OrderListPlaceOpocoResponseResultOrderReportsInner type( + @jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner 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 OrderListPlaceOpocoResponseResultOrderReportsInner workingTime( + @jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + return this; + } + + /** + * Get workingTime + * + * @return workingTime + */ + @jakarta.annotation.Nullable + public Long getWorkingTime() { + return workingTime; + } + + public void setWorkingTime(@jakarta.annotation.Nullable Long workingTime) { + this.workingTime = workingTime; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner 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 OrderListPlaceOpocoResponseResultOrderReportsInner stopPrice( + @jakarta.annotation.Nullable String stopPrice) { + this.stopPrice = stopPrice; + return this; + } + + /** + * Get stopPrice + * + * @return stopPrice + */ + @jakarta.annotation.Nullable + public String getStopPrice() { + return stopPrice; + } + + public void setStopPrice(@jakarta.annotation.Nullable String stopPrice) { + this.stopPrice = stopPrice; + } + + public OrderListPlaceOpocoResponseResultOrderReportsInner origQty( + @jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + return this; + } + + /** + * Get origQty + * + * @return origQty + */ + @jakarta.annotation.Nullable + public String getOrigQty() { + return origQty; + } + + public void setOrigQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListPlaceOpocoResponseResultOrderReportsInner + orderListPlaceOpocoResponseResultOrderReportsInner = + (OrderListPlaceOpocoResponseResultOrderReportsInner) o; + return Objects.equals( + this.symbol, orderListPlaceOpocoResponseResultOrderReportsInner.symbol) + && Objects.equals( + this.orderId, orderListPlaceOpocoResponseResultOrderReportsInner.orderId) + && Objects.equals( + this.orderListId, + orderListPlaceOpocoResponseResultOrderReportsInner.orderListId) + && Objects.equals( + this.clientOrderId, + orderListPlaceOpocoResponseResultOrderReportsInner.clientOrderId) + && Objects.equals( + this.transactTime, + orderListPlaceOpocoResponseResultOrderReportsInner.transactTime) + && Objects.equals( + this.price, orderListPlaceOpocoResponseResultOrderReportsInner.price) + && Objects.equals( + this.executedQty, + orderListPlaceOpocoResponseResultOrderReportsInner.executedQty) + && Objects.equals( + this.origQuoteOrderQty, + orderListPlaceOpocoResponseResultOrderReportsInner.origQuoteOrderQty) + && Objects.equals( + this.cummulativeQuoteQty, + orderListPlaceOpocoResponseResultOrderReportsInner.cummulativeQuoteQty) + && Objects.equals( + this.status, orderListPlaceOpocoResponseResultOrderReportsInner.status) + && Objects.equals( + this.timeInForce, + orderListPlaceOpocoResponseResultOrderReportsInner.timeInForce) + && Objects.equals( + this.type, orderListPlaceOpocoResponseResultOrderReportsInner.type) + && Objects.equals( + this.side, orderListPlaceOpocoResponseResultOrderReportsInner.side) + && Objects.equals( + this.workingTime, + orderListPlaceOpocoResponseResultOrderReportsInner.workingTime) + && Objects.equals( + this.selfTradePreventionMode, + orderListPlaceOpocoResponseResultOrderReportsInner.selfTradePreventionMode) + && Objects.equals( + this.stopPrice, + orderListPlaceOpocoResponseResultOrderReportsInner.stopPrice) + && Objects.equals( + this.origQty, orderListPlaceOpocoResponseResultOrderReportsInner.origQty); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + orderId, + orderListId, + clientOrderId, + transactTime, + price, + executedQty, + origQuoteOrderQty, + cummulativeQuoteQty, + status, + timeInForce, + type, + side, + workingTime, + selfTradePreventionMode, + stopPrice, + origQty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListPlaceOpocoResponseResultOrderReportsInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" transactTime: ").append(toIndentedString(transactTime)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); + sb.append(" origQuoteOrderQty: ").append(toIndentedString(origQuoteOrderQty)).append("\n"); + sb.append(" cummulativeQuoteQty: ") + .append(toIndentedString(cummulativeQuoteQty)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" workingTime: ").append(toIndentedString(workingTime)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); + sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + Long orderIdValue = getOrderId(); + if (orderIdValue != null) { + String orderIdValueAsString = orderIdValue.toString(); + valMap.put("orderId", orderIdValueAsString); + } + Long orderListIdValue = getOrderListId(); + if (orderListIdValue != null) { + String orderListIdValueAsString = orderListIdValue.toString(); + valMap.put("orderListId", orderListIdValueAsString); + } + String clientOrderIdValue = getClientOrderId(); + if (clientOrderIdValue != null) { + String clientOrderIdValueAsString = clientOrderIdValue.toString(); + valMap.put("clientOrderId", clientOrderIdValueAsString); + } + Long transactTimeValue = getTransactTime(); + if (transactTimeValue != null) { + String transactTimeValueAsString = transactTimeValue.toString(); + valMap.put("transactTime", transactTimeValueAsString); + } + String priceValue = getPrice(); + if (priceValue != null) { + String priceValueAsString = priceValue.toString(); + valMap.put("price", priceValueAsString); + } + String executedQtyValue = getExecutedQty(); + if (executedQtyValue != null) { + String executedQtyValueAsString = executedQtyValue.toString(); + valMap.put("executedQty", executedQtyValueAsString); + } + String origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + if (origQuoteOrderQtyValue != null) { + String origQuoteOrderQtyValueAsString = origQuoteOrderQtyValue.toString(); + valMap.put("origQuoteOrderQty", origQuoteOrderQtyValueAsString); + } + String cummulativeQuoteQtyValue = getCummulativeQuoteQty(); + if (cummulativeQuoteQtyValue != null) { + String cummulativeQuoteQtyValueAsString = cummulativeQuoteQtyValue.toString(); + valMap.put("cummulativeQuoteQty", cummulativeQuoteQtyValueAsString); + } + String statusValue = getStatus(); + if (statusValue != null) { + String statusValueAsString = statusValue.toString(); + valMap.put("status", statusValueAsString); + } + String timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + String timeInForceValueAsString = timeInForceValue.toString(); + valMap.put("timeInForce", timeInForceValueAsString); + } + String typeValue = getType(); + if (typeValue != null) { + String typeValueAsString = typeValue.toString(); + valMap.put("type", typeValueAsString); + } + String sideValue = getSide(); + if (sideValue != null) { + String sideValueAsString = sideValue.toString(); + valMap.put("side", sideValueAsString); + } + Long workingTimeValue = getWorkingTime(); + if (workingTimeValue != null) { + String workingTimeValueAsString = workingTimeValue.toString(); + valMap.put("workingTime", workingTimeValueAsString); + } + String selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); + } + String stopPriceValue = getStopPrice(); + if (stopPriceValue != null) { + String stopPriceValueAsString = stopPriceValue.toString(); + valMap.put("stopPrice", stopPriceValueAsString); + } + String origQtyValue = getOrigQty(); + if (origQtyValue != null) { + String origQtyValueAsString = origQtyValue.toString(); + valMap.put("origQty", origQtyValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object orderIdValue = getOrderId(); + if (orderIdValue != null) { + valMap.put("orderId", orderIdValue); + } + Object orderListIdValue = getOrderListId(); + if (orderListIdValue != null) { + valMap.put("orderListId", orderListIdValue); + } + Object clientOrderIdValue = getClientOrderId(); + if (clientOrderIdValue != null) { + valMap.put("clientOrderId", clientOrderIdValue); + } + Object transactTimeValue = getTransactTime(); + if (transactTimeValue != null) { + valMap.put("transactTime", transactTimeValue); + } + Object priceValue = getPrice(); + if (priceValue != null) { + valMap.put("price", priceValue); + } + Object executedQtyValue = getExecutedQty(); + if (executedQtyValue != null) { + valMap.put("executedQty", executedQtyValue); + } + Object origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + if (origQuoteOrderQtyValue != null) { + valMap.put("origQuoteOrderQty", origQuoteOrderQtyValue); + } + Object cummulativeQuoteQtyValue = getCummulativeQuoteQty(); + if (cummulativeQuoteQtyValue != null) { + valMap.put("cummulativeQuoteQty", cummulativeQuoteQtyValue); + } + Object statusValue = getStatus(); + if (statusValue != null) { + valMap.put("status", statusValue); + } + Object timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + valMap.put("timeInForce", timeInForceValue); + } + Object typeValue = getType(); + if (typeValue != null) { + valMap.put("type", typeValue); + } + Object sideValue = getSide(); + if (sideValue != null) { + valMap.put("side", sideValue); + } + Object workingTimeValue = getWorkingTime(); + if (workingTimeValue != null) { + valMap.put("workingTime", workingTimeValue); + } + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); + } + Object stopPriceValue = getStopPrice(); + if (stopPriceValue != null) { + valMap.put("stopPrice", stopPriceValue); + } + Object origQtyValue = getOrigQty(); + if (origQtyValue != null) { + valMap.put("origQty", origQtyValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("orderListId"); + openapiFields.add("clientOrderId"); + openapiFields.add("transactTime"); + openapiFields.add("price"); + openapiFields.add("executedQty"); + openapiFields.add("origQuoteOrderQty"); + openapiFields.add("cummulativeQuoteQty"); + openapiFields.add("status"); + openapiFields.add("timeInForce"); + openapiFields.add("type"); + openapiFields.add("side"); + openapiFields.add("workingTime"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("stopPrice"); + openapiFields.add("origQty"); + + // 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 + * OrderListPlaceOpocoResponseResultOrderReportsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListPlaceOpocoResponseResultOrderReportsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " OrderListPlaceOpocoResponseResultOrderReportsInner is not" + + " found in the empty JSON string", + OrderListPlaceOpocoResponseResultOrderReportsInner + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderListPlaceOpocoResponseResultOrderReportsInner.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderListPlaceOpocoResponseResultOrderReportsInner`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) + && !jsonObj.get("executedQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executedQty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executedQty").toString())); + } + if ((jsonObj.get("origQuoteOrderQty") != null + && !jsonObj.get("origQuoteOrderQty").isJsonNull()) + && !jsonObj.get("origQuoteOrderQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQuoteOrderQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origQuoteOrderQty").toString())); + } + if ((jsonObj.get("cummulativeQuoteQty") != null + && !jsonObj.get("cummulativeQuoteQty").isJsonNull()) + && !jsonObj.get("cummulativeQuoteQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cummulativeQuoteQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("cummulativeQuoteQty").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("stopPrice") != null && !jsonObj.get("stopPrice").isJsonNull()) + && !jsonObj.get("stopPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stopPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stopPrice").toString())); + } + if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) + && !jsonObj.get("origQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("origQty").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListPlaceOpocoResponseResultOrderReportsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'OrderListPlaceOpocoResponseResultOrderReportsInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + OrderListPlaceOpocoResponseResultOrderReportsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + OrderListPlaceOpocoResponseResultOrderReportsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListPlaceOpocoResponseResultOrderReportsInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListPlaceOpocoResponseResultOrderReportsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListPlaceOpocoResponseResultOrderReportsInner + * @throws IOException if the JSON string is invalid with respect to + * OrderListPlaceOpocoResponseResultOrderReportsInner + */ + public static OrderListPlaceOpocoResponseResultOrderReportsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, OrderListPlaceOpocoResponseResultOrderReportsInner.class); + } + + /** + * Convert an instance of OrderListPlaceOpocoResponseResultOrderReportsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResultOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResultOrdersInner.java new file mode 100644 index 00000000..027bbe11 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOpocoResponseResultOrdersInner.java @@ -0,0 +1,343 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderListPlaceOpocoResponseResultOrdersInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderListPlaceOpocoResponseResultOrdersInner extends BaseDTO { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public OrderListPlaceOpocoResponseResultOrdersInner() {} + + public OrderListPlaceOpocoResponseResultOrdersInner 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 OrderListPlaceOpocoResponseResultOrdersInner orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public OrderListPlaceOpocoResponseResultOrdersInner clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderListPlaceOpocoResponseResultOrdersInner orderListPlaceOpocoResponseResultOrdersInner = + (OrderListPlaceOpocoResponseResultOrdersInner) o; + return Objects.equals(this.symbol, orderListPlaceOpocoResponseResultOrdersInner.symbol) + && Objects.equals( + this.orderId, orderListPlaceOpocoResponseResultOrdersInner.orderId) + && Objects.equals( + this.clientOrderId, + orderListPlaceOpocoResponseResultOrdersInner.clientOrderId); + } + + @Override + public int hashCode() { + return Objects.hash(symbol, orderId, clientOrderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderListPlaceOpocoResponseResultOrdersInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + Long orderIdValue = getOrderId(); + if (orderIdValue != null) { + String orderIdValueAsString = orderIdValue.toString(); + valMap.put("orderId", orderIdValueAsString); + } + String clientOrderIdValue = getClientOrderId(); + if (clientOrderIdValue != null) { + String clientOrderIdValueAsString = clientOrderIdValue.toString(); + valMap.put("clientOrderId", clientOrderIdValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object orderIdValue = getOrderId(); + if (orderIdValue != null) { + valMap.put("orderId", orderIdValue); + } + Object clientOrderIdValue = getClientOrderId(); + if (clientOrderIdValue != null) { + valMap.put("clientOrderId", clientOrderIdValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("orderId"); + openapiFields.add("clientOrderId"); + + // 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 + * OrderListPlaceOpocoResponseResultOrdersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderListPlaceOpocoResponseResultOrdersInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " OrderListPlaceOpocoResponseResultOrdersInner is not found" + + " in the empty JSON string", + OrderListPlaceOpocoResponseResultOrdersInner.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderListPlaceOpocoResponseResultOrdersInner.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderListPlaceOpocoResponseResultOrdersInner` properties." + + " JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderListPlaceOpocoResponseResultOrdersInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'OrderListPlaceOpocoResponseResultOrdersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(OrderListPlaceOpocoResponseResultOrdersInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, OrderListPlaceOpocoResponseResultOrdersInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderListPlaceOpocoResponseResultOrdersInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderListPlaceOpocoResponseResultOrdersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderListPlaceOpocoResponseResultOrdersInner + * @throws IOException if the JSON string is invalid with respect to + * OrderListPlaceOpocoResponseResultOrdersInner + */ + public static OrderListPlaceOpocoResponseResultOrdersInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, OrderListPlaceOpocoResponseResultOrdersInner.class); + } + + /** + * Convert an instance of OrderListPlaceOpocoResponseResultOrdersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrRequest.java index bc3ba43e..16dc7d6b 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrRequest.java @@ -58,6 +58,12 @@ public class Ticker24hrRequest extends BaseDTO { @jakarta.annotation.Nullable private TickerType tickerType; + public static final String SERIALIZED_NAME_SYMBOL_STATUS = "symbolStatus"; + + @SerializedName(SERIALIZED_NAME_SYMBOL_STATUS) + @jakarta.annotation.Nullable + private SymbolStatus symbolStatus; + public Ticker24hrRequest() {} public Ticker24hrRequest symbol(@jakarta.annotation.Nullable String symbol) { @@ -119,6 +125,26 @@ public void setTickerType(@jakarta.annotation.Nullable TickerType tickerType) { this.tickerType = tickerType; } + public Ticker24hrRequest symbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + return this; + } + + /** + * Get symbolStatus + * + * @return symbolStatus + */ + @jakarta.annotation.Nullable + @Valid + public SymbolStatus getSymbolStatus() { + return symbolStatus; + } + + public void setSymbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -130,12 +156,13 @@ public boolean equals(Object o) { Ticker24hrRequest ticker24hrRequest = (Ticker24hrRequest) o; return Objects.equals(this.symbol, ticker24hrRequest.symbol) && Objects.equals(this.symbols, ticker24hrRequest.symbols) - && Objects.equals(this.tickerType, ticker24hrRequest.tickerType); + && Objects.equals(this.tickerType, ticker24hrRequest.tickerType) + && Objects.equals(this.symbolStatus, ticker24hrRequest.symbolStatus); } @Override public int hashCode() { - return Objects.hash(symbol, symbols, tickerType); + return Objects.hash(symbol, symbols, tickerType, symbolStatus); } @Override @@ -145,6 +172,7 @@ public String toString() { sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" symbols: ").append(toIndentedString(symbols)).append("\n"); sb.append(" tickerType: ").append(toIndentedString(tickerType)).append("\n"); + sb.append(" symbolStatus: ").append(toIndentedString(symbolStatus)).append("\n"); sb.append("}"); return sb.toString(); } @@ -168,6 +196,11 @@ public String toUrlQueryString() { String tickerTypeValueAsString = tickerTypeValue.toString(); valMap.put("tickerType", tickerTypeValueAsString); } + SymbolStatus symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + String symbolStatusValueAsString = symbolStatusValue.toString(); + valMap.put("symbolStatus", symbolStatusValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -191,6 +224,10 @@ public Map toMap() { if (tickerTypeValue != null) { valMap.put("tickerType", tickerTypeValue); } + Object symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + valMap.put("symbolStatus", symbolStatusValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -220,6 +257,7 @@ private String toIndentedString(Object o) { openapiFields.add("symbol"); openapiFields.add("symbols"); openapiFields.add("tickerType"); + openapiFields.add("symbolStatus"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -267,6 +305,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("tickerType") != null && !jsonObj.get("tickerType").isJsonNull()) { TickerType.validateJsonElement(jsonObj.get("tickerType")); } + // validate the optional field `symbolStatus` + if (jsonObj.get("symbolStatus") != null && !jsonObj.get("symbolStatus").isJsonNull()) { + SymbolStatus.validateJsonElement(jsonObj.get("symbolStatus")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookRequest.java index 12ec1f98..939e574e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookRequest.java @@ -52,6 +52,12 @@ public class TickerBookRequest extends BaseDTO { @jakarta.annotation.Nullable private Symbols symbols; + public static final String SERIALIZED_NAME_SYMBOL_STATUS = "symbolStatus"; + + @SerializedName(SERIALIZED_NAME_SYMBOL_STATUS) + @jakarta.annotation.Nullable + private SymbolStatus symbolStatus; + public TickerBookRequest() {} public TickerBookRequest symbol(@jakarta.annotation.Nullable String symbol) { @@ -93,6 +99,26 @@ public void setSymbols(@jakarta.annotation.Nullable Symbols symbols) { this.symbols = symbols; } + public TickerBookRequest symbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + return this; + } + + /** + * Get symbolStatus + * + * @return symbolStatus + */ + @jakarta.annotation.Nullable + @Valid + public SymbolStatus getSymbolStatus() { + return symbolStatus; + } + + public void setSymbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -103,12 +129,13 @@ public boolean equals(Object o) { } TickerBookRequest tickerBookRequest = (TickerBookRequest) o; return Objects.equals(this.symbol, tickerBookRequest.symbol) - && Objects.equals(this.symbols, tickerBookRequest.symbols); + && Objects.equals(this.symbols, tickerBookRequest.symbols) + && Objects.equals(this.symbolStatus, tickerBookRequest.symbolStatus); } @Override public int hashCode() { - return Objects.hash(symbol, symbols); + return Objects.hash(symbol, symbols, symbolStatus); } @Override @@ -117,6 +144,7 @@ public String toString() { sb.append("class TickerBookRequest {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" symbols: ").append(toIndentedString(symbols)).append("\n"); + sb.append(" symbolStatus: ").append(toIndentedString(symbolStatus)).append("\n"); sb.append("}"); return sb.toString(); } @@ -135,6 +163,11 @@ public String toUrlQueryString() { String symbolsValueAsString = JSON.getGson().toJson(symbolsValue); valMap.put("symbols", symbolsValueAsString); } + SymbolStatus symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + String symbolStatusValueAsString = symbolStatusValue.toString(); + valMap.put("symbolStatus", symbolStatusValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -154,6 +187,10 @@ public Map toMap() { if (symbolsValue != null) { valMap.put("symbols", symbolsValue); } + Object symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + valMap.put("symbolStatus", symbolStatusValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -182,6 +219,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("symbol"); openapiFields.add("symbols"); + openapiFields.add("symbolStatus"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -225,6 +263,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + // validate the optional field `symbolStatus` + if (jsonObj.get("symbolStatus") != null && !jsonObj.get("symbolStatus").isJsonNull()) { + SymbolStatus.validateJsonElement(jsonObj.get("symbolStatus")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceRequest.java index 4c2f3fdd..db167947 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceRequest.java @@ -52,6 +52,12 @@ public class TickerPriceRequest extends BaseDTO { @jakarta.annotation.Nullable private Symbols symbols; + public static final String SERIALIZED_NAME_SYMBOL_STATUS = "symbolStatus"; + + @SerializedName(SERIALIZED_NAME_SYMBOL_STATUS) + @jakarta.annotation.Nullable + private SymbolStatus symbolStatus; + public TickerPriceRequest() {} public TickerPriceRequest symbol(@jakarta.annotation.Nullable String symbol) { @@ -93,6 +99,26 @@ public void setSymbols(@jakarta.annotation.Nullable Symbols symbols) { this.symbols = symbols; } + public TickerPriceRequest symbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + return this; + } + + /** + * Get symbolStatus + * + * @return symbolStatus + */ + @jakarta.annotation.Nullable + @Valid + public SymbolStatus getSymbolStatus() { + return symbolStatus; + } + + public void setSymbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -103,12 +129,13 @@ public boolean equals(Object o) { } TickerPriceRequest tickerPriceRequest = (TickerPriceRequest) o; return Objects.equals(this.symbol, tickerPriceRequest.symbol) - && Objects.equals(this.symbols, tickerPriceRequest.symbols); + && Objects.equals(this.symbols, tickerPriceRequest.symbols) + && Objects.equals(this.symbolStatus, tickerPriceRequest.symbolStatus); } @Override public int hashCode() { - return Objects.hash(symbol, symbols); + return Objects.hash(symbol, symbols, symbolStatus); } @Override @@ -117,6 +144,7 @@ public String toString() { sb.append("class TickerPriceRequest {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" symbols: ").append(toIndentedString(symbols)).append("\n"); + sb.append(" symbolStatus: ").append(toIndentedString(symbolStatus)).append("\n"); sb.append("}"); return sb.toString(); } @@ -135,6 +163,11 @@ public String toUrlQueryString() { String symbolsValueAsString = JSON.getGson().toJson(symbolsValue); valMap.put("symbols", symbolsValueAsString); } + SymbolStatus symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + String symbolStatusValueAsString = symbolStatusValue.toString(); + valMap.put("symbolStatus", symbolStatusValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -154,6 +187,10 @@ public Map toMap() { if (symbolsValue != null) { valMap.put("symbols", symbolsValue); } + Object symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + valMap.put("symbolStatus", symbolStatusValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -182,6 +219,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("symbol"); openapiFields.add("symbols"); + openapiFields.add("symbolStatus"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -225,6 +263,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + // validate the optional field `symbolStatus` + if (jsonObj.get("symbolStatus") != null && !jsonObj.get("symbolStatus").isJsonNull()) { + SymbolStatus.validateJsonElement(jsonObj.get("symbolStatus")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerRequest.java index befb1c6f..d32dacf6 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerRequest.java @@ -64,6 +64,12 @@ public class TickerRequest extends BaseDTO { @jakarta.annotation.Nullable private WindowSize windowSize; + public static final String SERIALIZED_NAME_SYMBOL_STATUS = "symbolStatus"; + + @SerializedName(SERIALIZED_NAME_SYMBOL_STATUS) + @jakarta.annotation.Nullable + private SymbolStatus symbolStatus; + public TickerRequest() {} public TickerRequest symbol(@jakarta.annotation.Nullable String symbol) { @@ -145,6 +151,26 @@ public void setWindowSize(@jakarta.annotation.Nullable WindowSize windowSize) { this.windowSize = windowSize; } + public TickerRequest symbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + return this; + } + + /** + * Get symbolStatus + * + * @return symbolStatus + */ + @jakarta.annotation.Nullable + @Valid + public SymbolStatus getSymbolStatus() { + return symbolStatus; + } + + public void setSymbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -157,12 +183,13 @@ public boolean equals(Object o) { return Objects.equals(this.symbol, tickerRequest.symbol) && Objects.equals(this.symbols, tickerRequest.symbols) && Objects.equals(this.tickerType, tickerRequest.tickerType) - && Objects.equals(this.windowSize, tickerRequest.windowSize); + && Objects.equals(this.windowSize, tickerRequest.windowSize) + && Objects.equals(this.symbolStatus, tickerRequest.symbolStatus); } @Override public int hashCode() { - return Objects.hash(symbol, symbols, tickerType, windowSize); + return Objects.hash(symbol, symbols, tickerType, windowSize, symbolStatus); } @Override @@ -173,6 +200,7 @@ public String toString() { sb.append(" symbols: ").append(toIndentedString(symbols)).append("\n"); sb.append(" tickerType: ").append(toIndentedString(tickerType)).append("\n"); sb.append(" windowSize: ").append(toIndentedString(windowSize)).append("\n"); + sb.append(" symbolStatus: ").append(toIndentedString(symbolStatus)).append("\n"); sb.append("}"); return sb.toString(); } @@ -201,6 +229,11 @@ public String toUrlQueryString() { String windowSizeValueAsString = windowSizeValue.toString(); valMap.put("windowSize", windowSizeValueAsString); } + SymbolStatus symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + String symbolStatusValueAsString = symbolStatusValue.toString(); + valMap.put("symbolStatus", symbolStatusValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -228,6 +261,10 @@ public Map toMap() { if (windowSizeValue != null) { valMap.put("windowSize", windowSizeValue); } + Object symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + valMap.put("symbolStatus", symbolStatusValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -258,6 +295,7 @@ private String toIndentedString(Object o) { openapiFields.add("symbols"); openapiFields.add("tickerType"); openapiFields.add("windowSize"); + openapiFields.add("symbolStatus"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -309,6 +347,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("windowSize") != null && !jsonObj.get("windowSize").isJsonNull()) { WindowSize.validateJsonElement(jsonObj.get("windowSize")); } + // validate the optional field `symbolStatus` + if (jsonObj.get("symbolStatus") != null && !jsonObj.get("symbolStatus").isJsonNull()) { + SymbolStatus.validateJsonElement(jsonObj.get("symbolStatus")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayRequest.java index 111d4152..70715c89 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayRequest.java @@ -64,6 +64,12 @@ public class TickerTradingDayRequest extends BaseDTO { @jakarta.annotation.Nullable private TickerType tickerType; + public static final String SERIALIZED_NAME_SYMBOL_STATUS = "symbolStatus"; + + @SerializedName(SERIALIZED_NAME_SYMBOL_STATUS) + @jakarta.annotation.Nullable + private SymbolStatus symbolStatus; + public TickerTradingDayRequest() {} public TickerTradingDayRequest symbol(@jakarta.annotation.Nullable String symbol) { @@ -144,6 +150,27 @@ public void setTickerType(@jakarta.annotation.Nullable TickerType tickerType) { this.tickerType = tickerType; } + public TickerTradingDayRequest symbolStatus( + @jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + return this; + } + + /** + * Get symbolStatus + * + * @return symbolStatus + */ + @jakarta.annotation.Nullable + @Valid + public SymbolStatus getSymbolStatus() { + return symbolStatus; + } + + public void setSymbolStatus(@jakarta.annotation.Nullable SymbolStatus symbolStatus) { + this.symbolStatus = symbolStatus; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -156,12 +183,13 @@ public boolean equals(Object o) { return Objects.equals(this.symbol, tickerTradingDayRequest.symbol) && Objects.equals(this.symbols, tickerTradingDayRequest.symbols) && Objects.equals(this.timeZone, tickerTradingDayRequest.timeZone) - && Objects.equals(this.tickerType, tickerTradingDayRequest.tickerType); + && Objects.equals(this.tickerType, tickerTradingDayRequest.tickerType) + && Objects.equals(this.symbolStatus, tickerTradingDayRequest.symbolStatus); } @Override public int hashCode() { - return Objects.hash(symbol, symbols, timeZone, tickerType); + return Objects.hash(symbol, symbols, timeZone, tickerType, symbolStatus); } @Override @@ -172,6 +200,7 @@ public String toString() { sb.append(" symbols: ").append(toIndentedString(symbols)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); sb.append(" tickerType: ").append(toIndentedString(tickerType)).append("\n"); + sb.append(" symbolStatus: ").append(toIndentedString(symbolStatus)).append("\n"); sb.append("}"); return sb.toString(); } @@ -200,6 +229,11 @@ public String toUrlQueryString() { String tickerTypeValueAsString = tickerTypeValue.toString(); valMap.put("tickerType", tickerTypeValueAsString); } + SymbolStatus symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + String symbolStatusValueAsString = symbolStatusValue.toString(); + valMap.put("symbolStatus", symbolStatusValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -227,6 +261,10 @@ public Map toMap() { if (tickerTypeValue != null) { valMap.put("tickerType", tickerTypeValue); } + Object symbolStatusValue = getSymbolStatus(); + if (symbolStatusValue != null) { + valMap.put("symbolStatus", symbolStatusValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -257,6 +295,7 @@ private String toIndentedString(Object o) { openapiFields.add("symbols"); openapiFields.add("timeZone"); openapiFields.add("tickerType"); + openapiFields.add("symbolStatus"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -312,6 +351,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("tickerType") != null && !jsonObj.get("tickerType").isJsonNull()) { TickerType.validateJsonElement(jsonObj.get("tickerType")); } + // validate the optional field `symbolStatus` + if (jsonObj.get("symbolStatus") != null && !jsonObj.get("symbolStatus").isJsonNull()) { + SymbolStatus.validateJsonElement(jsonObj.get("symbolStatus")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamEventsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamEventsResponse.java index 23f3d9d5..c3a8b5d0 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamEventsResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamEventsResponse.java @@ -55,8 +55,6 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter(this, TypeToken.get(ExecutionReport.class)); final TypeAdapter adapterListStatus = gson.getDelegateAdapter(this, TypeToken.get(ListStatus.class)); - final TypeAdapter adapterListenKeyExpired = - gson.getDelegateAdapter(this, TypeToken.get(ListenKeyExpired.class)); final TypeAdapter adapterEventStreamTerminated = gson.getDelegateAdapter(this, TypeToken.get(EventStreamTerminated.class)); final TypeAdapter adapterExternalLockUpdate = @@ -105,14 +103,6 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `ListenKeyExpired` - if (value.getActualInstance() instanceof ListenKeyExpired) { - JsonElement element = - adapterListenKeyExpired.toJsonTree( - (ListenKeyExpired) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } // check if the actual instance is of the type `EventStreamTerminated` if (value.getActualInstance() instanceof EventStreamTerminated) { JsonElement element = @@ -132,7 +122,7 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) throw new IOException( "Failed to serialize as the type doesn't match oneOf schemas:" + " BalanceUpdate, EventStreamTerminated, ExecutionReport," - + " ExternalLockUpdate, ListStatus, ListenKeyExpired," + + " ExternalLockUpdate, ListStatus," + " OutboundAccountPosition"); } @@ -185,12 +175,6 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { newUserDataStreamEventsResponse.setActualInstance( deserialized); return newUserDataStreamEventsResponse; - case "listenKeyExpired": - deserialized = - adapterListenKeyExpired.fromJsonTree(jsonObject); - newUserDataStreamEventsResponse.setActualInstance( - deserialized); - return newUserDataStreamEventsResponse; case "outboundAccountPosition": deserialized = adapterOutboundAccountPosition.fromJsonTree( @@ -209,9 +193,8 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { + " Possible values: balanceUpdate" + " eventStreamTerminated" + " executionReport externalLockUpdate" - + " listStatus listenKeyExpired" - + " outboundAccountPosition. Falling" - + " back to String.", + + " listStatus outboundAccountPosition." + + " Falling back to String.", jsonObject.get("e").getAsString())); } } @@ -298,27 +281,6 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { "Input data does not match schema 'ListStatus'", e); } - // deserialize ListenKeyExpired - try { - // validate the JSON object to see if any exception is thrown - ListenKeyExpired.validateJsonElement(jsonElement); - actualAdapter = adapterListenKeyExpired; - match++; - log.log( - Level.FINER, - "Input data matches schema 'ListenKeyExpired'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ListenKeyExpired failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ListenKeyExpired'", - e); - } // deserialize EventStreamTerminated try { // validate the JSON object to see if any exception is thrown @@ -398,7 +360,6 @@ public UserDataStreamEventsResponse(Object o) { schemas.put("BalanceUpdate", BalanceUpdate.class); schemas.put("ExecutionReport", ExecutionReport.class); schemas.put("ListStatus", ListStatus.class); - schemas.put("ListenKeyExpired", ListenKeyExpired.class); schemas.put("EventStreamTerminated", EventStreamTerminated.class); schemas.put("ExternalLockUpdate", ExternalLockUpdate.class); } @@ -411,7 +372,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid * against the oneOf child schemas: BalanceUpdate, EventStreamTerminated, ExecutionReport, - * ExternalLockUpdate, ListStatus, ListenKeyExpired, OutboundAccountPosition + * ExternalLockUpdate, ListStatus, OutboundAccountPosition * *

It could be an instance of the 'oneOf' schemas. */ @@ -437,11 +398,6 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof ListenKeyExpired) { - super.setActualInstance(instance); - return; - } - if (instance instanceof EventStreamTerminated) { super.setActualInstance(instance); return; @@ -454,16 +410,15 @@ public void setActualInstance(Object instance) { throw new RuntimeException( "Invalid instance type. Must be BalanceUpdate, EventStreamTerminated," - + " ExecutionReport, ExternalLockUpdate, ListStatus, ListenKeyExpired," - + " OutboundAccountPosition"); + + " ExecutionReport, ExternalLockUpdate, ListStatus, OutboundAccountPosition"); } /** * Get the actual instance, which can be the following: BalanceUpdate, EventStreamTerminated, - * ExecutionReport, ExternalLockUpdate, ListStatus, ListenKeyExpired, OutboundAccountPosition + * ExecutionReport, ExternalLockUpdate, ListStatus, OutboundAccountPosition * * @return The actual instance (BalanceUpdate, EventStreamTerminated, ExecutionReport, - * ExternalLockUpdate, ListStatus, ListenKeyExpired, OutboundAccountPosition) + * ExternalLockUpdate, ListStatus, OutboundAccountPosition) */ @SuppressWarnings("unchecked") @Override @@ -515,17 +470,6 @@ public ListStatus getListStatus() throws ClassCastException { return (ListStatus) super.getActualInstance(); } - /** - * Get the actual instance of `ListenKeyExpired`. If the actual instance is not - * `ListenKeyExpired`, the ClassCastException will be thrown. - * - * @return The actual instance of `ListenKeyExpired` - * @throws ClassCastException if the instance is not `ListenKeyExpired` - */ - public ListenKeyExpired getListenKeyExpired() throws ClassCastException { - return (ListenKeyExpired) super.getActualInstance(); - } - /** * Get the actual instance of `EventStreamTerminated`. If the actual instance is not * `EventStreamTerminated`, the ClassCastException will be thrown. @@ -601,17 +545,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Deserialization for ListStatus failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with ListenKeyExpired - try { - ListenKeyExpired.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ListenKeyExpired failed with `%s`.", - e.getMessage())); - // continue to the next one - } // validate the json string with EventStreamTerminated try { EventStreamTerminated.validateJsonElement(jsonElement); @@ -639,10 +572,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti String.format( "The JSON string is invalid for UserDataStreamEventsResponse with oneOf" + " schemas: BalanceUpdate, EventStreamTerminated, ExecutionReport," - + " ExternalLockUpdate, ListStatus, ListenKeyExpired," - + " OutboundAccountPosition. %d class(es) match the result," - + " expected 1. Detailed failure message for oneOf schemas: %s." - + " JSON: %s", + + " ExternalLockUpdate, ListStatus, OutboundAccountPosition. %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/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingRequest.java deleted file mode 100644 index 7cf1e1ff..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingRequest.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.websocket.api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** UserDataStreamPingRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class UserDataStreamPingRequest extends BaseDTO { - public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; - - @SerializedName(SERIALIZED_NAME_LISTEN_KEY) - @jakarta.annotation.Nonnull - private String listenKey; - - public UserDataStreamPingRequest() {} - - public UserDataStreamPingRequest listenKey(@jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; - return this; - } - - /** - * Get listenKey - * - * @return listenKey - */ - @jakarta.annotation.Nonnull - @NotNull - public String getListenKey() { - return listenKey; - } - - public void setListenKey(@jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserDataStreamPingRequest userDataStreamPingRequest = (UserDataStreamPingRequest) o; - return Objects.equals(this.listenKey, userDataStreamPingRequest.listenKey); - } - - @Override - public int hashCode() { - return Objects.hash(listenKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserDataStreamPingRequest {\n"); - sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String listenKeyValue = getListenKey(); - if (listenKeyValue != null) { - String listenKeyValueAsString = listenKeyValue.toString(); - valMap.put("listenKey", listenKeyValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object listenKeyValue = getListenKey(); - if (listenKeyValue != null) { - valMap.put("listenKey", listenKeyValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("listenKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("listenKey"); - } - - /** - * 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 UserDataStreamPingRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserDataStreamPingRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UserDataStreamPingRequest is not found" - + " in the empty JSON string", - UserDataStreamPingRequest.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserDataStreamPingRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UserDataStreamPingRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserDataStreamPingRequest.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("listenKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `listenKey` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("listenKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserDataStreamPingRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserDataStreamPingRequest' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UserDataStreamPingRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UserDataStreamPingRequest value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserDataStreamPingRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UserDataStreamPingRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserDataStreamPingRequest - * @throws IOException if the JSON string is invalid with respect to UserDataStreamPingRequest - */ - public static UserDataStreamPingRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserDataStreamPingRequest.class); - } - - /** - * Convert an instance of UserDataStreamPingRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java deleted file mode 100644 index f15e7af1..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.websocket.api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** UserDataStreamPingResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class UserDataStreamPingResponse extends BaseDTO { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @jakarta.annotation.Nullable - private String id; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private Long status; - - public static final String SERIALIZED_NAME_RESPONSE = "response"; - - @SerializedName(SERIALIZED_NAME_RESPONSE) - @jakarta.annotation.Nullable - private Object response; - - public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMITS) - @jakarta.annotation.Nullable - private List<@Valid RateLimits> rateLimits; - - public UserDataStreamPingResponse() {} - - public UserDataStreamPingResponse id(@jakarta.annotation.Nullable String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @jakarta.annotation.Nullable - public String getId() { - return id; - } - - public void setId(@jakarta.annotation.Nullable String id) { - this.id = id; - } - - public UserDataStreamPingResponse status(@jakarta.annotation.Nullable Long status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public Long getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable Long status) { - this.status = status; - } - - public UserDataStreamPingResponse response(@jakarta.annotation.Nullable Object response) { - this.response = response; - return this; - } - - /** - * Get response - * - * @return response - */ - @jakarta.annotation.Nullable - public Object getResponse() { - return response; - } - - public void setResponse(@jakarta.annotation.Nullable Object response) { - this.response = response; - } - - public UserDataStreamPingResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { - this.rateLimits = rateLimits; - return this; - } - - public UserDataStreamPingResponse addRateLimitsItem(RateLimits rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - - /** - * Get rateLimits - * - * @return rateLimits - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid RateLimits> getRateLimits() { - return rateLimits; - } - - public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { - this.rateLimits = rateLimits; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserDataStreamPingResponse userDataStreamPingResponse = (UserDataStreamPingResponse) o; - return Objects.equals(this.id, userDataStreamPingResponse.id) - && Objects.equals(this.status, userDataStreamPingResponse.status) - && Objects.equals(this.response, userDataStreamPingResponse.response) - && Objects.equals(this.rateLimits, userDataStreamPingResponse.rateLimits); - } - - @Override - public int hashCode() { - return Objects.hash(id, status, response, rateLimits); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserDataStreamPingResponse {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - sb.append(" rateLimits: ").append(toIndentedString(rateLimits)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String idValue = getId(); - if (idValue != null) { - String idValueAsString = idValue.toString(); - valMap.put("id", idValueAsString); - } - Long statusValue = getStatus(); - if (statusValue != null) { - String statusValueAsString = statusValue.toString(); - valMap.put("status", statusValueAsString); - } - Object responseValue = getResponse(); - if (responseValue != null) { - String responseValueAsString = responseValue.toString(); - valMap.put("response", responseValueAsString); - } - List<@Valid RateLimits> rateLimitsValue = getRateLimits(); - if (rateLimitsValue != null) { - String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); - valMap.put("rateLimits", rateLimitsValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object idValue = getId(); - if (idValue != null) { - valMap.put("id", idValue); - } - Object statusValue = getStatus(); - if (statusValue != null) { - valMap.put("status", statusValue); - } - Object responseValue = getResponse(); - if (responseValue != null) { - valMap.put("response", responseValue); - } - Object rateLimitsValue = getRateLimits(); - if (rateLimitsValue != null) { - valMap.put("rateLimits", rateLimitsValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("status"); - openapiFields.add("response"); - openapiFields.add("rateLimits"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserDataStreamPingResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserDataStreamPingResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UserDataStreamPingResponse is not" - + " found in the empty JSON string", - UserDataStreamPingResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserDataStreamPingResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UserDataStreamPingResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { - JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); - if (jsonArrayrateLimits != null) { - // ensure the json data is an array - if (!jsonObj.get("rateLimits").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimits` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimits").toString())); - } - - // validate the optional field `rateLimits` (array) - for (int i = 0; i < jsonArrayrateLimits.size(); i++) { - RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserDataStreamPingResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserDataStreamPingResponse' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UserDataStreamPingResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UserDataStreamPingResponse value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserDataStreamPingResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UserDataStreamPingResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserDataStreamPingResponse - * @throws IOException if the JSON string is invalid with respect to UserDataStreamPingResponse - */ - public static UserDataStreamPingResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserDataStreamPingResponse.class); - } - - /** - * Convert an instance of UserDataStreamPingResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponseResult.java deleted file mode 100644 index d5a0fa2c..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponseResult.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.websocket.api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** UserDataStreamStartResponseResult */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class UserDataStreamStartResponseResult extends BaseDTO { - public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; - - @SerializedName(SERIALIZED_NAME_LISTEN_KEY) - @jakarta.annotation.Nullable - private String listenKey; - - public UserDataStreamStartResponseResult() {} - - public UserDataStreamStartResponseResult listenKey( - @jakarta.annotation.Nullable String listenKey) { - this.listenKey = listenKey; - return this; - } - - /** - * Get listenKey - * - * @return listenKey - */ - @jakarta.annotation.Nullable - public String getListenKey() { - return listenKey; - } - - public void setListenKey(@jakarta.annotation.Nullable String listenKey) { - this.listenKey = listenKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserDataStreamStartResponseResult userDataStreamStartResponseResult = - (UserDataStreamStartResponseResult) o; - return Objects.equals(this.listenKey, userDataStreamStartResponseResult.listenKey); - } - - @Override - public int hashCode() { - return Objects.hash(listenKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserDataStreamStartResponseResult {\n"); - sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String listenKeyValue = getListenKey(); - if (listenKeyValue != null) { - String listenKeyValueAsString = listenKeyValue.toString(); - valMap.put("listenKey", listenKeyValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object listenKeyValue = getListenKey(); - if (listenKeyValue != null) { - valMap.put("listenKey", listenKeyValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("listenKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UserDataStreamStartResponseResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserDataStreamStartResponseResult.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UserDataStreamStartResponseResult is" - + " not found in the empty JSON string", - UserDataStreamStartResponseResult.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserDataStreamStartResponseResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UserDataStreamStartResponseResult` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) - && !jsonObj.get("listenKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `listenKey` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("listenKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserDataStreamStartResponseResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserDataStreamStartResponseResult' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UserDataStreamStartResponseResult.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UserDataStreamStartResponseResult value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserDataStreamStartResponseResult read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UserDataStreamStartResponseResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserDataStreamStartResponseResult - * @throws IOException if the JSON string is invalid with respect to - * UserDataStreamStartResponseResult - */ - public static UserDataStreamStartResponseResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserDataStreamStartResponseResult.class); - } - - /** - * Convert an instance of UserDataStreamStartResponseResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopRequest.java deleted file mode 100644 index 3f3eadd3..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopRequest.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.websocket.api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** UserDataStreamStopRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class UserDataStreamStopRequest extends BaseDTO { - public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; - - @SerializedName(SERIALIZED_NAME_LISTEN_KEY) - @jakarta.annotation.Nonnull - private String listenKey; - - public UserDataStreamStopRequest() {} - - public UserDataStreamStopRequest listenKey(@jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; - return this; - } - - /** - * Get listenKey - * - * @return listenKey - */ - @jakarta.annotation.Nonnull - @NotNull - public String getListenKey() { - return listenKey; - } - - public void setListenKey(@jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserDataStreamStopRequest userDataStreamStopRequest = (UserDataStreamStopRequest) o; - return Objects.equals(this.listenKey, userDataStreamStopRequest.listenKey); - } - - @Override - public int hashCode() { - return Objects.hash(listenKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserDataStreamStopRequest {\n"); - sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String listenKeyValue = getListenKey(); - if (listenKeyValue != null) { - String listenKeyValueAsString = listenKeyValue.toString(); - valMap.put("listenKey", listenKeyValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object listenKeyValue = getListenKey(); - if (listenKeyValue != null) { - valMap.put("listenKey", listenKeyValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("listenKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("listenKey"); - } - - /** - * 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 UserDataStreamStopRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserDataStreamStopRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UserDataStreamStopRequest is not found" - + " in the empty JSON string", - UserDataStreamStopRequest.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserDataStreamStopRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UserDataStreamStopRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserDataStreamStopRequest.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("listenKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `listenKey` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("listenKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserDataStreamStopRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserDataStreamStopRequest' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UserDataStreamStopRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UserDataStreamStopRequest value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserDataStreamStopRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UserDataStreamStopRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserDataStreamStopRequest - * @throws IOException if the JSON string is invalid with respect to UserDataStreamStopRequest - */ - public static UserDataStreamStopRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserDataStreamStopRequest.class); - } - - /** - * Convert an instance of UserDataStreamStopRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java index 9e6f053e..0ac1bdc1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java @@ -378,12 +378,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model .AllMiniTickerResponseInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.stream.model.AllTickerResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.stream.model.AllTickerResponseInner - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.AssetFilters .CustomTypeAdapterFactory()); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java index 61f6bfa4..c45a7229 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 @@ -13,7 +13,6 @@ import com.binance.connector.client.spot.websocket.stream.model.AllMarketRollingWindowTickerRequest; import com.binance.connector.client.spot.websocket.stream.model.AllMarketRollingWindowTickerResponse; import com.binance.connector.client.spot.websocket.stream.model.AllMiniTickerResponse; -import com.binance.connector.client.spot.websocket.stream.model.AllTickerResponse; import com.binance.connector.client.spot.websocket.stream.model.AvgPriceRequest; import com.binance.connector.client.spot.websocket.stream.model.AvgPriceResponse; import com.binance.connector.client.spot.websocket.stream.model.BookTickerRequest; @@ -39,7 +38,7 @@ public class SpotWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-spot/7.0.0 (Java/%s; %s; %s)", + "binance-spot/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; @@ -80,10 +79,6 @@ public StreamBlockingQueueWrapper allMiniTicker() throws return webSocketStreamsApi.allMiniTicker(); } - public StreamBlockingQueueWrapper allTicker() throws ApiException { - return webSocketStreamsApi.allTicker(); - } - public StreamBlockingQueueWrapper avgPrice(AvgPriceRequest avgPriceRequest) throws ApiException { return webSocketStreamsApi.avgPrice(avgPriceRequest); 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 173c04b7..2fb38975 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 @@ -23,7 +23,6 @@ import com.binance.connector.client.spot.websocket.stream.model.AllMarketRollingWindowTickerRequest; import com.binance.connector.client.spot.websocket.stream.model.AllMarketRollingWindowTickerResponse; import com.binance.connector.client.spot.websocket.stream.model.AllMiniTickerResponse; -import com.binance.connector.client.spot.websocket.stream.model.AllTickerResponse; import com.binance.connector.client.spot.websocket.stream.model.AvgPriceRequest; import com.binance.connector.client.spot.websocket.stream.model.AvgPriceResponse; import com.binance.connector.client.spot.websocket.stream.model.BookTickerRequest; @@ -278,56 +277,6 @@ public StreamBlockingQueue allMiniTickerRaw() throws ApiException { @SuppressWarnings("rawtypes") private void allMiniTickerValidateBeforeCall() throws ApiException {} - /** - * WebSocket All Market Tickers Stream 24hr rolling window ticker statistics for all symbols - * that changed in an array. These are NOT the statistics of the UTC day, but a 24hr rolling - * window for the previous 24hrs. Note that only tickers that have changed will be present in - * the array. - * - * @return AllTickerResponse - * @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 Market Tickers Stream -
- * - * @see WebSocket - * All Market Tickers Stream Documentation - */ - public StreamBlockingQueueWrapper allTicker() throws ApiException { - StreamBlockingQueue queue = allTickerRaw(); - - TypeToken typeToken = new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue allTickerRaw() throws ApiException { - allTickerValidateBeforeCall(); - - String methodName = "/!ticker@arr".substring(1); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void allTickerValidateBeforeCall() throws ApiException {} - /** * WebSocket Average Price Average price streams push changes in the average price over a fixed * time interval. diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AllTickerResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AllTickerResponse.java deleted file mode 100644 index 94f4ebd1..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AllTickerResponse.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Binance Spot WebSocket Streams - * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.stream.model; - -import com.binance.connector.client.spot.websocket.stream.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** AllTickerResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class AllTickerResponse extends ArrayList { - public AllTickerResponse() {} - - @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 AllTickerResponse {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AllTickerResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AllTickerResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AllTickerResponse is not found in the" - + " empty JSON string", - AllTickerResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllTickerResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllTickerResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AllTickerResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AllTickerResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AllTickerResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AllTickerResponse value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); - elementAdapter.write(out, obj); - } - - @Override - public AllTickerResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AllTickerResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AllTickerResponse - * @throws IOException if the JSON string is invalid with respect to AllTickerResponse - */ - public static AllTickerResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AllTickerResponse.class); - } - - /** - * Convert an instance of AllTickerResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AllTickerResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AllTickerResponseInner.java deleted file mode 100644 index c05effb8..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AllTickerResponseInner.java +++ /dev/null @@ -1,1205 +0,0 @@ -/* - * Binance Spot WebSocket Streams - * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.stream.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.websocket.stream.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** AllTickerResponseInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class AllTickerResponseInner extends BaseDTO { - public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; - - @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) - @jakarta.annotation.Nullable - private String eLowerCase; - - public static final String SERIALIZED_NAME_E = "E"; - - @SerializedName(SERIALIZED_NAME_E) - @jakarta.annotation.Nullable - private Long E; - - public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; - - @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) - @jakarta.annotation.Nullable - private String sLowerCase; - - public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; - - @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) - @jakarta.annotation.Nullable - private String pLowerCase; - - public static final String SERIALIZED_NAME_P = "P"; - - @SerializedName(SERIALIZED_NAME_P) - @jakarta.annotation.Nullable - private String P; - - public static final String SERIALIZED_NAME_W_LOWER_CASE = "w"; - - @SerializedName(SERIALIZED_NAME_W_LOWER_CASE) - @jakarta.annotation.Nullable - private String wLowerCase; - - public static final String SERIALIZED_NAME_X_LOWER_CASE = "x"; - - @SerializedName(SERIALIZED_NAME_X_LOWER_CASE) - @jakarta.annotation.Nullable - private String xLowerCase; - - public static final String SERIALIZED_NAME_C_LOWER_CASE = "c"; - - @SerializedName(SERIALIZED_NAME_C_LOWER_CASE) - @jakarta.annotation.Nullable - private String cLowerCase; - - public static final String SERIALIZED_NAME_Q = "Q"; - - @SerializedName(SERIALIZED_NAME_Q) - @jakarta.annotation.Nullable - private String Q; - - public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; - - @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) - @jakarta.annotation.Nullable - private String bLowerCase; - - public static final String SERIALIZED_NAME_B = "B"; - - @SerializedName(SERIALIZED_NAME_B) - @jakarta.annotation.Nullable - private String B; - - public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; - - @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) - @jakarta.annotation.Nullable - private String aLowerCase; - - public static final String SERIALIZED_NAME_A = "A"; - - @SerializedName(SERIALIZED_NAME_A) - @jakarta.annotation.Nullable - private String A; - - public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; - - @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) - @jakarta.annotation.Nullable - private String oLowerCase; - - public static final String SERIALIZED_NAME_H_LOWER_CASE = "h"; - - @SerializedName(SERIALIZED_NAME_H_LOWER_CASE) - @jakarta.annotation.Nullable - private String hLowerCase; - - public static final String SERIALIZED_NAME_L_LOWER_CASE = "l"; - - @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) - @jakarta.annotation.Nullable - private String lLowerCase; - - public static final String SERIALIZED_NAME_V_LOWER_CASE = "v"; - - @SerializedName(SERIALIZED_NAME_V_LOWER_CASE) - @jakarta.annotation.Nullable - private String vLowerCase; - - public static final String SERIALIZED_NAME_Q_LOWER_CASE = "q"; - - @SerializedName(SERIALIZED_NAME_Q_LOWER_CASE) - @jakarta.annotation.Nullable - private String qLowerCase; - - public static final String SERIALIZED_NAME_O = "O"; - - @SerializedName(SERIALIZED_NAME_O) - @jakarta.annotation.Nullable - private Long O; - - public static final String SERIALIZED_NAME_C = "C"; - - @SerializedName(SERIALIZED_NAME_C) - @jakarta.annotation.Nullable - private Long C; - - public static final String SERIALIZED_NAME_F = "F"; - - @SerializedName(SERIALIZED_NAME_F) - @jakarta.annotation.Nullable - private Long F; - - public static final String SERIALIZED_NAME_L = "L"; - - @SerializedName(SERIALIZED_NAME_L) - @jakarta.annotation.Nullable - private Long L; - - public static final String SERIALIZED_NAME_N_LOWER_CASE = "n"; - - @SerializedName(SERIALIZED_NAME_N_LOWER_CASE) - @jakarta.annotation.Nullable - private Long nLowerCase; - - public AllTickerResponseInner() {} - - public AllTickerResponseInner eLowerCase(@jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; - return this; - } - - /** - * Get eLowerCase - * - * @return eLowerCase - */ - @jakarta.annotation.Nullable - public String geteLowerCase() { - return eLowerCase; - } - - public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; - } - - public AllTickerResponseInner 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 AllTickerResponseInner 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 AllTickerResponseInner 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 AllTickerResponseInner P(@jakarta.annotation.Nullable String P) { - this.P = P; - return this; - } - - /** - * Get P - * - * @return P - */ - @jakarta.annotation.Nullable - public String getP() { - return P; - } - - public void setP(@jakarta.annotation.Nullable String P) { - this.P = P; - } - - public AllTickerResponseInner wLowerCase(@jakarta.annotation.Nullable String wLowerCase) { - this.wLowerCase = wLowerCase; - return this; - } - - /** - * Get wLowerCase - * - * @return wLowerCase - */ - @jakarta.annotation.Nullable - public String getwLowerCase() { - return wLowerCase; - } - - public void setwLowerCase(@jakarta.annotation.Nullable String wLowerCase) { - this.wLowerCase = wLowerCase; - } - - public AllTickerResponseInner xLowerCase(@jakarta.annotation.Nullable String xLowerCase) { - this.xLowerCase = xLowerCase; - return this; - } - - /** - * Get xLowerCase - * - * @return xLowerCase - */ - @jakarta.annotation.Nullable - public String getxLowerCase() { - return xLowerCase; - } - - public void setxLowerCase(@jakarta.annotation.Nullable String xLowerCase) { - this.xLowerCase = xLowerCase; - } - - public AllTickerResponseInner cLowerCase(@jakarta.annotation.Nullable String cLowerCase) { - this.cLowerCase = cLowerCase; - return this; - } - - /** - * Get cLowerCase - * - * @return cLowerCase - */ - @jakarta.annotation.Nullable - public String getcLowerCase() { - return cLowerCase; - } - - public void setcLowerCase(@jakarta.annotation.Nullable String cLowerCase) { - this.cLowerCase = cLowerCase; - } - - public AllTickerResponseInner Q(@jakarta.annotation.Nullable String Q) { - this.Q = Q; - return this; - } - - /** - * Get Q - * - * @return Q - */ - @jakarta.annotation.Nullable - public String getQ() { - return Q; - } - - public void setQ(@jakarta.annotation.Nullable String Q) { - this.Q = Q; - } - - public AllTickerResponseInner bLowerCase(@jakarta.annotation.Nullable String bLowerCase) { - this.bLowerCase = bLowerCase; - return this; - } - - /** - * Get bLowerCase - * - * @return bLowerCase - */ - @jakarta.annotation.Nullable - public String getbLowerCase() { - return bLowerCase; - } - - public void setbLowerCase(@jakarta.annotation.Nullable String bLowerCase) { - this.bLowerCase = bLowerCase; - } - - public AllTickerResponseInner B(@jakarta.annotation.Nullable String B) { - this.B = B; - return this; - } - - /** - * Get B - * - * @return B - */ - @jakarta.annotation.Nullable - public String getB() { - return B; - } - - public void setB(@jakarta.annotation.Nullable String B) { - this.B = B; - } - - public AllTickerResponseInner aLowerCase(@jakarta.annotation.Nullable String aLowerCase) { - this.aLowerCase = aLowerCase; - return this; - } - - /** - * Get aLowerCase - * - * @return aLowerCase - */ - @jakarta.annotation.Nullable - public String getaLowerCase() { - return aLowerCase; - } - - public void setaLowerCase(@jakarta.annotation.Nullable String aLowerCase) { - this.aLowerCase = aLowerCase; - } - - public AllTickerResponseInner A(@jakarta.annotation.Nullable String A) { - this.A = A; - return this; - } - - /** - * Get A - * - * @return A - */ - @jakarta.annotation.Nullable - public String getA() { - return A; - } - - public void setA(@jakarta.annotation.Nullable String A) { - this.A = A; - } - - public AllTickerResponseInner 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 AllTickerResponseInner hLowerCase(@jakarta.annotation.Nullable String hLowerCase) { - this.hLowerCase = hLowerCase; - return this; - } - - /** - * Get hLowerCase - * - * @return hLowerCase - */ - @jakarta.annotation.Nullable - public String gethLowerCase() { - return hLowerCase; - } - - public void sethLowerCase(@jakarta.annotation.Nullable String hLowerCase) { - this.hLowerCase = hLowerCase; - } - - public AllTickerResponseInner lLowerCase(@jakarta.annotation.Nullable String lLowerCase) { - this.lLowerCase = lLowerCase; - return this; - } - - /** - * Get lLowerCase - * - * @return lLowerCase - */ - @jakarta.annotation.Nullable - public String getlLowerCase() { - return lLowerCase; - } - - public void setlLowerCase(@jakarta.annotation.Nullable String lLowerCase) { - this.lLowerCase = lLowerCase; - } - - public AllTickerResponseInner vLowerCase(@jakarta.annotation.Nullable String vLowerCase) { - this.vLowerCase = vLowerCase; - return this; - } - - /** - * Get vLowerCase - * - * @return vLowerCase - */ - @jakarta.annotation.Nullable - public String getvLowerCase() { - return vLowerCase; - } - - public void setvLowerCase(@jakarta.annotation.Nullable String vLowerCase) { - this.vLowerCase = vLowerCase; - } - - public AllTickerResponseInner 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 AllTickerResponseInner O(@jakarta.annotation.Nullable Long O) { - this.O = O; - return this; - } - - /** - * Get O - * - * @return O - */ - @jakarta.annotation.Nullable - public Long getO() { - return O; - } - - public void setO(@jakarta.annotation.Nullable Long O) { - this.O = O; - } - - public AllTickerResponseInner C(@jakarta.annotation.Nullable Long C) { - this.C = C; - return this; - } - - /** - * Get C - * - * @return C - */ - @jakarta.annotation.Nullable - public Long getC() { - return C; - } - - public void setC(@jakarta.annotation.Nullable Long C) { - this.C = C; - } - - public AllTickerResponseInner F(@jakarta.annotation.Nullable Long F) { - this.F = F; - return this; - } - - /** - * Get F - * - * @return F - */ - @jakarta.annotation.Nullable - public Long getF() { - return F; - } - - public void setF(@jakarta.annotation.Nullable Long F) { - this.F = F; - } - - public AllTickerResponseInner L(@jakarta.annotation.Nullable Long L) { - this.L = L; - return this; - } - - /** - * Get L - * - * @return L - */ - @jakarta.annotation.Nullable - public Long getL() { - return L; - } - - public void setL(@jakarta.annotation.Nullable Long L) { - this.L = L; - } - - public AllTickerResponseInner nLowerCase(@jakarta.annotation.Nullable Long nLowerCase) { - this.nLowerCase = nLowerCase; - return this; - } - - /** - * Get nLowerCase - * - * @return nLowerCase - */ - @jakarta.annotation.Nullable - public Long getnLowerCase() { - return nLowerCase; - } - - public void setnLowerCase(@jakarta.annotation.Nullable Long nLowerCase) { - this.nLowerCase = nLowerCase; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AllTickerResponseInner allTickerResponseInner = (AllTickerResponseInner) o; - return Objects.equals(this.eLowerCase, allTickerResponseInner.eLowerCase) - && Objects.equals(this.E, allTickerResponseInner.E) - && Objects.equals(this.sLowerCase, allTickerResponseInner.sLowerCase) - && Objects.equals(this.pLowerCase, allTickerResponseInner.pLowerCase) - && Objects.equals(this.P, allTickerResponseInner.P) - && Objects.equals(this.wLowerCase, allTickerResponseInner.wLowerCase) - && Objects.equals(this.xLowerCase, allTickerResponseInner.xLowerCase) - && Objects.equals(this.cLowerCase, allTickerResponseInner.cLowerCase) - && Objects.equals(this.Q, allTickerResponseInner.Q) - && Objects.equals(this.bLowerCase, allTickerResponseInner.bLowerCase) - && Objects.equals(this.B, allTickerResponseInner.B) - && Objects.equals(this.aLowerCase, allTickerResponseInner.aLowerCase) - && Objects.equals(this.A, allTickerResponseInner.A) - && Objects.equals(this.oLowerCase, allTickerResponseInner.oLowerCase) - && Objects.equals(this.hLowerCase, allTickerResponseInner.hLowerCase) - && Objects.equals(this.lLowerCase, allTickerResponseInner.lLowerCase) - && Objects.equals(this.vLowerCase, allTickerResponseInner.vLowerCase) - && Objects.equals(this.qLowerCase, allTickerResponseInner.qLowerCase) - && Objects.equals(this.O, allTickerResponseInner.O) - && Objects.equals(this.C, allTickerResponseInner.C) - && Objects.equals(this.F, allTickerResponseInner.F) - && Objects.equals(this.L, allTickerResponseInner.L) - && Objects.equals(this.nLowerCase, allTickerResponseInner.nLowerCase); - } - - @Override - public int hashCode() { - return Objects.hash( - eLowerCase, - E, - sLowerCase, - pLowerCase, - P, - wLowerCase, - xLowerCase, - cLowerCase, - Q, - bLowerCase, - B, - aLowerCase, - A, - oLowerCase, - hLowerCase, - lLowerCase, - vLowerCase, - qLowerCase, - O, - C, - F, - L, - nLowerCase); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AllTickerResponseInner {\n"); - sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); - sb.append(" E: ").append(toIndentedString(E)).append("\n"); - sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); - sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); - sb.append(" P: ").append(toIndentedString(P)).append("\n"); - sb.append(" wLowerCase: ").append(toIndentedString(wLowerCase)).append("\n"); - sb.append(" xLowerCase: ").append(toIndentedString(xLowerCase)).append("\n"); - sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); - sb.append(" Q: ").append(toIndentedString(Q)).append("\n"); - sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); - sb.append(" B: ").append(toIndentedString(B)).append("\n"); - sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); - sb.append(" A: ").append(toIndentedString(A)).append("\n"); - sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); - sb.append(" hLowerCase: ").append(toIndentedString(hLowerCase)).append("\n"); - sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).append("\n"); - sb.append(" vLowerCase: ").append(toIndentedString(vLowerCase)).append("\n"); - sb.append(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); - sb.append(" O: ").append(toIndentedString(O)).append("\n"); - sb.append(" C: ").append(toIndentedString(C)).append("\n"); - sb.append(" F: ").append(toIndentedString(F)).append("\n"); - sb.append(" L: ").append(toIndentedString(L)).append("\n"); - sb.append(" nLowerCase: ").append(toIndentedString(nLowerCase)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - String eLowerCaseValueAsString = eLowerCaseValue.toString(); - valMap.put("eLowerCase", eLowerCaseValueAsString); - } - Long EValue = getE(); - if (EValue != null) { - String EValueAsString = EValue.toString(); - valMap.put("E", EValueAsString); - } - String sLowerCaseValue = getsLowerCase(); - if (sLowerCaseValue != null) { - String sLowerCaseValueAsString = sLowerCaseValue.toString(); - valMap.put("sLowerCase", sLowerCaseValueAsString); - } - String pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - String pLowerCaseValueAsString = pLowerCaseValue.toString(); - valMap.put("pLowerCase", pLowerCaseValueAsString); - } - String PValue = getP(); - if (PValue != null) { - String PValueAsString = PValue.toString(); - valMap.put("P", PValueAsString); - } - String wLowerCaseValue = getwLowerCase(); - if (wLowerCaseValue != null) { - String wLowerCaseValueAsString = wLowerCaseValue.toString(); - valMap.put("wLowerCase", wLowerCaseValueAsString); - } - String xLowerCaseValue = getxLowerCase(); - if (xLowerCaseValue != null) { - String xLowerCaseValueAsString = xLowerCaseValue.toString(); - valMap.put("xLowerCase", xLowerCaseValueAsString); - } - String cLowerCaseValue = getcLowerCase(); - if (cLowerCaseValue != null) { - String cLowerCaseValueAsString = cLowerCaseValue.toString(); - valMap.put("cLowerCase", cLowerCaseValueAsString); - } - String QValue = getQ(); - if (QValue != null) { - String QValueAsString = QValue.toString(); - valMap.put("Q", QValueAsString); - } - String bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - String bLowerCaseValueAsString = bLowerCaseValue.toString(); - valMap.put("bLowerCase", bLowerCaseValueAsString); - } - String BValue = getB(); - if (BValue != null) { - String BValueAsString = BValue.toString(); - valMap.put("B", BValueAsString); - } - String aLowerCaseValue = getaLowerCase(); - if (aLowerCaseValue != null) { - String aLowerCaseValueAsString = aLowerCaseValue.toString(); - valMap.put("aLowerCase", aLowerCaseValueAsString); - } - String AValue = getA(); - if (AValue != null) { - String AValueAsString = AValue.toString(); - valMap.put("A", AValueAsString); - } - String oLowerCaseValue = getoLowerCase(); - if (oLowerCaseValue != null) { - String oLowerCaseValueAsString = oLowerCaseValue.toString(); - valMap.put("oLowerCase", oLowerCaseValueAsString); - } - String hLowerCaseValue = gethLowerCase(); - if (hLowerCaseValue != null) { - String hLowerCaseValueAsString = hLowerCaseValue.toString(); - valMap.put("hLowerCase", hLowerCaseValueAsString); - } - String lLowerCaseValue = getlLowerCase(); - if (lLowerCaseValue != null) { - String lLowerCaseValueAsString = lLowerCaseValue.toString(); - valMap.put("lLowerCase", lLowerCaseValueAsString); - } - String vLowerCaseValue = getvLowerCase(); - if (vLowerCaseValue != null) { - String vLowerCaseValueAsString = vLowerCaseValue.toString(); - valMap.put("vLowerCase", vLowerCaseValueAsString); - } - String qLowerCaseValue = getqLowerCase(); - if (qLowerCaseValue != null) { - String qLowerCaseValueAsString = qLowerCaseValue.toString(); - valMap.put("qLowerCase", qLowerCaseValueAsString); - } - Long OValue = getO(); - if (OValue != null) { - String OValueAsString = OValue.toString(); - valMap.put("O", OValueAsString); - } - Long CValue = getC(); - if (CValue != null) { - String CValueAsString = CValue.toString(); - valMap.put("C", CValueAsString); - } - Long FValue = getF(); - if (FValue != null) { - String FValueAsString = FValue.toString(); - valMap.put("F", FValueAsString); - } - Long LValue = getL(); - if (LValue != null) { - String LValueAsString = LValue.toString(); - valMap.put("L", LValueAsString); - } - Long nLowerCaseValue = getnLowerCase(); - if (nLowerCaseValue != null) { - String nLowerCaseValueAsString = nLowerCaseValue.toString(); - valMap.put("nLowerCase", nLowerCaseValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - valMap.put("eLowerCase", eLowerCaseValue); - } - Object EValue = getE(); - if (EValue != null) { - valMap.put("E", EValue); - } - Object sLowerCaseValue = getsLowerCase(); - if (sLowerCaseValue != null) { - valMap.put("sLowerCase", sLowerCaseValue); - } - Object pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - valMap.put("pLowerCase", pLowerCaseValue); - } - Object PValue = getP(); - if (PValue != null) { - valMap.put("P", PValue); - } - Object wLowerCaseValue = getwLowerCase(); - if (wLowerCaseValue != null) { - valMap.put("wLowerCase", wLowerCaseValue); - } - Object xLowerCaseValue = getxLowerCase(); - if (xLowerCaseValue != null) { - valMap.put("xLowerCase", xLowerCaseValue); - } - Object cLowerCaseValue = getcLowerCase(); - if (cLowerCaseValue != null) { - valMap.put("cLowerCase", cLowerCaseValue); - } - Object QValue = getQ(); - if (QValue != null) { - valMap.put("Q", QValue); - } - Object bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - valMap.put("bLowerCase", bLowerCaseValue); - } - Object BValue = getB(); - if (BValue != null) { - valMap.put("B", BValue); - } - Object aLowerCaseValue = getaLowerCase(); - if (aLowerCaseValue != null) { - valMap.put("aLowerCase", aLowerCaseValue); - } - Object AValue = getA(); - if (AValue != null) { - valMap.put("A", AValue); - } - Object oLowerCaseValue = getoLowerCase(); - if (oLowerCaseValue != null) { - valMap.put("oLowerCase", oLowerCaseValue); - } - Object hLowerCaseValue = gethLowerCase(); - if (hLowerCaseValue != null) { - valMap.put("hLowerCase", hLowerCaseValue); - } - Object lLowerCaseValue = getlLowerCase(); - if (lLowerCaseValue != null) { - valMap.put("lLowerCase", lLowerCaseValue); - } - Object vLowerCaseValue = getvLowerCase(); - if (vLowerCaseValue != null) { - valMap.put("vLowerCase", vLowerCaseValue); - } - Object qLowerCaseValue = getqLowerCase(); - if (qLowerCaseValue != null) { - valMap.put("qLowerCase", qLowerCaseValue); - } - Object OValue = getO(); - if (OValue != null) { - valMap.put("O", OValue); - } - Object CValue = getC(); - if (CValue != null) { - valMap.put("C", CValue); - } - Object FValue = getF(); - if (FValue != null) { - valMap.put("F", FValue); - } - Object LValue = getL(); - if (LValue != null) { - valMap.put("L", LValue); - } - Object nLowerCaseValue = getnLowerCase(); - if (nLowerCaseValue != null) { - valMap.put("nLowerCase", nLowerCaseValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("e"); - openapiFields.add("E"); - openapiFields.add("s"); - openapiFields.add("p"); - openapiFields.add("P"); - openapiFields.add("w"); - openapiFields.add("x"); - openapiFields.add("c"); - openapiFields.add("Q"); - openapiFields.add("b"); - openapiFields.add("B"); - openapiFields.add("a"); - openapiFields.add("A"); - openapiFields.add("o"); - openapiFields.add("h"); - openapiFields.add("l"); - openapiFields.add("v"); - openapiFields.add("q"); - openapiFields.add("O"); - openapiFields.add("C"); - openapiFields.add("F"); - openapiFields.add("L"); - openapiFields.add("n"); - - // 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 AllTickerResponseInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AllTickerResponseInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AllTickerResponseInner is not found in" - + " the empty JSON string", - AllTickerResponseInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllTickerResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllTickerResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) - && !jsonObj.get("e").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `e` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("e").toString())); - } - if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) - && !jsonObj.get("s").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `s` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("s").toString())); - } - if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) - && !jsonObj.get("p").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `p` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("p").toString())); - } - 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("w") != null && !jsonObj.get("w").isJsonNull()) - && !jsonObj.get("w").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `w` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("w").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("c") != null && !jsonObj.get("c").isJsonNull()) - && !jsonObj.get("c").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `c` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("c").toString())); - } - if ((jsonObj.get("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("b") != null && !jsonObj.get("b").isJsonNull()) - && !jsonObj.get("b").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `b` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("b").toString())); - } - if ((jsonObj.get("B") != null && !jsonObj.get("B").isJsonNull()) - && !jsonObj.get("B").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `B` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("B").toString())); - } - if ((jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) - && !jsonObj.get("a").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `a` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("a").toString())); - } - if ((jsonObj.get("A") != null && !jsonObj.get("A").isJsonNull()) - && !jsonObj.get("A").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `A` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("A").toString())); - } - if ((jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) - && !jsonObj.get("o").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `o` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("o").toString())); - } - if ((jsonObj.get("h") != null && !jsonObj.get("h").isJsonNull()) - && !jsonObj.get("h").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `h` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("h").toString())); - } - if ((jsonObj.get("l") != null && !jsonObj.get("l").isJsonNull()) - && !jsonObj.get("l").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `l` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("l").toString())); - } - if ((jsonObj.get("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("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())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AllTickerResponseInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AllTickerResponseInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AllTickerResponseInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AllTickerResponseInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AllTickerResponseInner read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AllTickerResponseInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of AllTickerResponseInner - * @throws IOException if the JSON string is invalid with respect to AllTickerResponseInner - */ - public static AllTickerResponseInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AllTickerResponseInner.class); - } - - /** - * Convert an instance of AllTickerResponseInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/MarketApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/MarketApiTest.java index 1580487d..f9f8b4ae 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/MarketApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/MarketApiTest.java @@ -30,6 +30,7 @@ import com.binance.connector.client.spot.rest.model.HistoricalTradesResponse; import com.binance.connector.client.spot.rest.model.Interval; import com.binance.connector.client.spot.rest.model.KlinesResponse; +import com.binance.connector.client.spot.rest.model.SymbolStatus; import com.binance.connector.client.spot.rest.model.Symbols; import com.binance.connector.client.spot.rest.model.Ticker24hrResponse; import com.binance.connector.client.spot.rest.model.TickerBookTickerResponse; @@ -154,7 +155,8 @@ public void avgPriceTest() throws ApiException, CryptoException { public void depthTest() throws ApiException, CryptoException { String symbol = "BNBUSDT"; Integer limit = 500; - ApiResponse response = api.depth(symbol, limit); + SymbolStatus symbolStatus = null; + ApiResponse response = api.depth(symbol, limit, symbolStatus); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -262,7 +264,8 @@ public void tickerTest() throws ApiException, CryptoException { Symbols symbols = null; WindowSize windowSize = WindowSize.WINDOW_SIZE_1m; TickerType type = TickerType.FULL; - ApiResponse response = api.ticker(symbol, symbols, windowSize, type); + SymbolStatus symbolStatus = null; + ApiResponse response = api.ticker(symbol, symbols, windowSize, type, symbolStatus); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -297,7 +300,8 @@ public void ticker24hrTest() throws ApiException, CryptoException { String symbol = "BNBUSDT"; Symbols symbols = null; TickerType type = TickerType.FULL; - ApiResponse response = api.ticker24hr(symbol, symbols, type); + SymbolStatus symbolStatus = null; + ApiResponse response = api.ticker24hr(symbol, symbols, type, symbolStatus); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -327,7 +331,8 @@ public void ticker24hrTest() throws ApiException, CryptoException { public void tickerBookTickerTest() throws ApiException, CryptoException { String symbol = "BNBUSDT"; Symbols symbols = null; - ApiResponse response = api.tickerBookTicker(symbol, symbols); + SymbolStatus symbolStatus = null; + ApiResponse response = api.tickerBookTicker(symbol, symbols, symbolStatus); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -357,7 +362,8 @@ public void tickerBookTickerTest() throws ApiException, CryptoException { public void tickerPriceTest() throws ApiException, CryptoException { String symbol = "BNBUSDT"; Symbols symbols = null; - ApiResponse response = api.tickerPrice(symbol, symbols); + SymbolStatus symbolStatus = null; + ApiResponse response = api.tickerPrice(symbol, symbols, symbolStatus); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -385,8 +391,9 @@ public void tickerTradingDayTest() throws ApiException, CryptoException { Symbols symbols = null; String timeZone = ""; TickerType type = TickerType.FULL; + SymbolStatus symbolStatus = null; ApiResponse response = - api.tickerTradingDay(symbol, symbols, timeZone, type); + api.tickerTradingDay(symbol, symbols, timeZone, type, symbolStatus); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/UserDataStreamApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/UserDataStreamApiTest.java deleted file mode 100644 index ce920eef..00000000 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/UserDataStreamApiTest.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.rest.api; - -import static org.junit.Assert.assertEquals; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.auth.BinanceAuthenticationFactory; -import com.binance.connector.client.common.auth.SignatureAuthentication; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.sign.HmacSignatureGenerator; -import com.binance.connector.client.common.sign.SignatureGenerator; -import com.binance.connector.client.spot.rest.model.NewUserDataStreamResponse; -import com.binance.connector.client.spot.rest.model.PutUserDataStreamRequest; -import okhttp3.Call; -import okhttp3.Request; -import org.bouncycastle.crypto.CryptoException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; - -/** API tests for UserdatastreamApi */ -public class UserDataStreamApiTest { - - private UserDataStreamApi api; - private ApiClient apiClientSpy; - private SignatureGenerator signatureGeneratorSpy; - - @BeforeEach - public void initApiClient() throws ApiException { - ClientConfiguration clientConfiguration = new ClientConfiguration(); - clientConfiguration.setUrl("http://localhost:8080"); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setSecretKey("secretKey"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - HmacSignatureGenerator signatureGenerator = - new HmacSignatureGenerator(signatureConfiguration.getSecretKey()); - signatureGeneratorSpy = Mockito.spy(signatureGenerator); - SignatureAuthentication signatureAuthentication = - new SignatureAuthentication( - signatureConfiguration.getApiKey(), signatureGeneratorSpy); - SignatureAuthentication authenticationSpy = Mockito.spy(signatureAuthentication); - Mockito.doReturn("1736393892000").when(authenticationSpy).buildTimestamp(); - - BinanceAuthenticationFactory factoryMock = Mockito.mock(BinanceAuthenticationFactory.class); - Mockito.doReturn(authenticationSpy) - .when(factoryMock) - .getAuthentication(signatureConfiguration); - - ApiClient apiClient = new ApiClient(clientConfiguration, factoryMock); - - apiClientSpy = Mockito.spy(apiClient); - Mockito.doReturn(new ApiResponse<>(200, null)) - .when(apiClientSpy) - .execute(Mockito.any(), Mockito.any(java.lang.reflect.Type.class)); - Mockito.doReturn(new ApiResponse<>(200, null)).when(apiClientSpy).execute(Mockito.any()); - Mockito.doReturn("1736393892000").when(apiClientSpy).buildTimestamp(); - - api = new UserDataStreamApi(apiClientSpy); - } - - /** - * Close user data stream - * - *

Close out a user data stream. Weight: 2 - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteUserDataStreamTest() throws ApiException, CryptoException { - String listenKey = "listenKey"; - api.deleteUserDataStream(listenKey); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/api/v3/userDataStream", actualRequest.url().encodedPath()); - } - - /** - * Start user data stream - * - *

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is - * sent. Weight: 2 - * - * @throws ApiException if the Api call fails - */ - @Test - public void newUserDataStreamTest() throws ApiException, CryptoException { - ApiResponse response = api.newUserDataStream(); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/api/v3/userDataStream", actualRequest.url().encodedPath()); - } - - /** - * Keepalive user data stream - * - *

Keepalive a user data stream to prevent a time out. User data streams will close after 60 - * minutes. It's recommended to send a ping about every 30 minutes. Weight: 2 - * - * @throws ApiException if the Api call fails - */ - @Test - public void putUserDataStreamTest() throws ApiException, CryptoException { - PutUserDataStreamRequest putUserDataStreamRequest = new PutUserDataStreamRequest(); - - putUserDataStreamRequest.listenKey("listenKey"); - - api.putUserDataStream(putUserDataStreamRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/api/v3/userDataStream", actualRequest.url().encodedPath()); - } -} diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java index 2d250425..f69ffffa 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java @@ -20,11 +20,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseRequestDTO; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingRequest; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingResponse; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStartResponse; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopRequest; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeResponse; @@ -86,102 +81,6 @@ public void initApiClient() throws Exception { Mockito.doReturn("eaf3292c-64b6-4c04-ad4f-4ca2608b42b4").when(api).getRequestID(); } - /** - * WebSocket Ping user data stream - * - *

Ping a user data stream to keep it alive. User data streams close automatically after 60 - * minutes, even if you're listening to them on WebSocket Streams. In order to keep the - * stream open, you have to regularly send pings using the `userDataStream.ping` - * request. It is recommended to send a ping once every 30 minutes. Weight: 2 - * - * @throws ApiException if the Api call fails - */ - @Test - public void userDataStreamPingTest() throws ApiException, URISyntaxException, IOException { - UserDataStreamPingRequest userDataStreamPingRequest = new UserDataStreamPingRequest(); - userDataStreamPingRequest.setListenKey("ABCDEF123456"); - CompletableFuture response = - api.userDataStreamPing(userDataStreamPingRequest); - ArgumentCaptor> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO requestWrapperDTO = - callArgumentCaptor.getValue(); - UserDataStreamPingRequest params = requestWrapperDTO.getParams(); - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - UserDataStreamApiTest.class.getResource( - "/expected/api/UserDataStreamApi/userDataStream.ping-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * WebSocket Start user data stream - * - *

Start a new user data stream. Weight: 2 - * - * @throws ApiException if the Api call fails - */ - @Test - public void userDataStreamStartTest() throws ApiException, URISyntaxException, IOException { - CompletableFuture response = api.userDataStreamStart(); - ArgumentCaptor> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO requestWrapperDTO = - callArgumentCaptor.getValue(); - BaseRequestDTO params = requestWrapperDTO.getParams(); - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - UserDataStreamApiTest.class.getResource( - "/expected/api/UserDataStreamApi/userDataStream.start-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * WebSocket Stop user data stream - * - *

Explicitly stop and close the user data stream. Weight: 2 - * - * @throws ApiException if the Api call fails - */ - @Test - public void userDataStreamStopTest() throws ApiException, URISyntaxException, IOException { - UserDataStreamStopRequest userDataStreamStopRequest = new UserDataStreamStopRequest(); - userDataStreamStopRequest.setListenKey("ABCDEF123456"); - CompletableFuture response = - api.userDataStreamStop(userDataStreamStopRequest); - ArgumentCaptor> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO requestWrapperDTO = - callArgumentCaptor.getValue(); - UserDataStreamStopRequest params = requestWrapperDTO.getParams(); - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - UserDataStreamApiTest.class.getResource( - "/expected/api/UserDataStreamApi/userDataStream.stop-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - /** * WebSocket Subscribe to User Data Stream * diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApiTest.java index a94ebdf3..24d62644 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApiTest.java @@ -24,7 +24,6 @@ import com.binance.connector.client.spot.websocket.stream.model.AllMarketRollingWindowTickerRequest; import com.binance.connector.client.spot.websocket.stream.model.AllMarketRollingWindowTickerResponse; import com.binance.connector.client.spot.websocket.stream.model.AllMiniTickerResponse; -import com.binance.connector.client.spot.websocket.stream.model.AllTickerResponse; import com.binance.connector.client.spot.websocket.stream.model.AvgPriceRequest; import com.binance.connector.client.spot.websocket.stream.model.AvgPriceResponse; import com.binance.connector.client.spot.websocket.stream.model.BookTickerRequest; @@ -205,37 +204,6 @@ public void allMiniTickerTest() throws ApiException, URISyntaxException, IOExcep JSONAssert.assertEquals(expectedJson, sentPayload, true); } - /** - * WebSocket All Market Tickers Stream - * - *

24hr rolling window ticker statistics for all symbols that changed in an array. These are - * NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note - * that only tickers that have changed will be present in the array. - * - * @throws ApiException if the Api call fails - */ - @Test - public void allTickerTest() throws ApiException, URISyntaxException, IOException { - StreamBlockingQueueWrapper response = api.allTicker(); - ArgumentCaptor, AllTickerResponse>> callArgumentCaptor = - ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, AllTickerResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebSocketStreamsApiTest.class.getResource( - "/expected/stream/WebSocketStreamsApi/!ticker@arr-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - /** * WebSocket Average Price * diff --git a/examples/spot/pom.xml b/examples/spot/pom.xml index 4a045c3b..dd6d102c 100644 --- a/examples/spot/pom.xml +++ b/examples/spot/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-spot - 7.0.0 + 8.0.0 \ No newline at end of file diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/DepthExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/DepthExample.java index 897bdf7c..d608288c 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/DepthExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/DepthExample.java @@ -19,6 +19,7 @@ import com.binance.connector.client.spot.rest.SpotRestApiUtil; import com.binance.connector.client.spot.rest.api.SpotRestApi; import com.binance.connector.client.spot.rest.model.DepthResponse; +import com.binance.connector.client.spot.rest.model.SymbolStatus; /** API examples for MarketApi */ public class DepthExample { @@ -47,7 +48,8 @@ public SpotRestApi getApi() { public void depthExample() throws ApiException { String symbol = "BNBUSDT"; Integer limit = 500; - ApiResponse response = getApi().depth(symbol, limit); + SymbolStatus symbolStatus = SymbolStatus.TRADING; + ApiResponse response = getApi().depth(symbol, limit, symbolStatus); System.out.println(response.getData()); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/Ticker24hrExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/Ticker24hrExample.java index 04586032..cc6d9c6b 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/Ticker24hrExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/Ticker24hrExample.java @@ -18,6 +18,7 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.spot.rest.SpotRestApiUtil; import com.binance.connector.client.spot.rest.api.SpotRestApi; +import com.binance.connector.client.spot.rest.model.SymbolStatus; import com.binance.connector.client.spot.rest.model.Symbols; import com.binance.connector.client.spot.rest.model.Ticker24hrResponse; import com.binance.connector.client.spot.rest.model.TickerType; @@ -59,7 +60,9 @@ public void ticker24hrExample() throws ApiException { String symbol = "BNBUSDT"; Symbols symbols = null; TickerType type = TickerType.FULL; - ApiResponse response = getApi().ticker24hr(symbol, symbols, type); + SymbolStatus symbolStatus = SymbolStatus.TRADING; + ApiResponse response = + getApi().ticker24hr(symbol, symbols, type, symbolStatus); System.out.println(response.getData()); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerBookTickerExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerBookTickerExample.java index 88162cc1..06d1ab18 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerBookTickerExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerBookTickerExample.java @@ -18,6 +18,7 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.spot.rest.SpotRestApiUtil; import com.binance.connector.client.spot.rest.api.SpotRestApi; +import com.binance.connector.client.spot.rest.model.SymbolStatus; import com.binance.connector.client.spot.rest.model.Symbols; import com.binance.connector.client.spot.rest.model.TickerBookTickerResponse; @@ -53,7 +54,9 @@ public SpotRestApi getApi() { public void tickerBookTickerExample() throws ApiException { String symbol = "BNBUSDT"; Symbols symbols = null; - ApiResponse response = getApi().tickerBookTicker(symbol, symbols); + SymbolStatus symbolStatus = SymbolStatus.TRADING; + ApiResponse response = + getApi().tickerBookTicker(symbol, symbols, symbolStatus); System.out.println(response.getData()); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerExample.java index 3ff96235..745465cd 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerExample.java @@ -18,6 +18,7 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.spot.rest.SpotRestApiUtil; import com.binance.connector.client.spot.rest.api.SpotRestApi; +import com.binance.connector.client.spot.rest.model.SymbolStatus; import com.binance.connector.client.spot.rest.model.Symbols; import com.binance.connector.client.spot.rest.model.TickerResponse; import com.binance.connector.client.spot.rest.model.TickerType; @@ -53,7 +54,9 @@ public void tickerExample() throws ApiException { Symbols symbols = null; WindowSize windowSize = WindowSize.WINDOW_SIZE_1m; TickerType type = TickerType.FULL; - ApiResponse response = getApi().ticker(symbol, symbols, windowSize, type); + SymbolStatus symbolStatus = SymbolStatus.TRADING; + ApiResponse response = + getApi().ticker(symbol, symbols, windowSize, type, symbolStatus); System.out.println(response.getData()); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerPriceExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerPriceExample.java index db067602..36f85fb3 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerPriceExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerPriceExample.java @@ -18,6 +18,7 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.spot.rest.SpotRestApiUtil; import com.binance.connector.client.spot.rest.api.SpotRestApi; +import com.binance.connector.client.spot.rest.model.SymbolStatus; import com.binance.connector.client.spot.rest.model.Symbols; import com.binance.connector.client.spot.rest.model.TickerPriceResponse; @@ -53,7 +54,9 @@ public SpotRestApi getApi() { public void tickerPriceExample() throws ApiException { String symbol = "BNBUSDT"; Symbols symbols = null; - ApiResponse response = getApi().tickerPrice(symbol, symbols); + SymbolStatus symbolStatus = SymbolStatus.TRADING; + ApiResponse response = + getApi().tickerPrice(symbol, symbols, symbolStatus); System.out.println(response.getData()); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerTradingDayExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerTradingDayExample.java index 04112253..87cb60bf 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerTradingDayExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/market/TickerTradingDayExample.java @@ -18,6 +18,7 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.spot.rest.SpotRestApiUtil; import com.binance.connector.client.spot.rest.api.SpotRestApi; +import com.binance.connector.client.spot.rest.model.SymbolStatus; import com.binance.connector.client.spot.rest.model.Symbols; import com.binance.connector.client.spot.rest.model.TickerTradingDayResponse; import com.binance.connector.client.spot.rest.model.TickerType; @@ -52,8 +53,9 @@ public void tickerTradingDayExample() throws ApiException { Symbols symbols = null; String timeZone = ""; TickerType type = TickerType.FULL; + SymbolStatus symbolStatus = SymbolStatus.TRADING; ApiResponse response = - getApi().tickerTradingDay(symbol, symbols, timeZone, type); + getApi().tickerTradingDay(symbol, symbols, timeZone, type, symbolStatus); System.out.println(response.getData()); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOpoExample.java similarity index 52% rename from examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOpoExample.java index 3c872340..b80b4559 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOpoExample.java @@ -10,17 +10,23 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.rest.userdatastream; +package com.binance.connector.client.spot.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.spot.rest.SpotRestApiUtil; import com.binance.connector.client.spot.rest.api.SpotRestApi; -import com.binance.connector.client.spot.rest.model.PutUserDataStreamRequest; +import com.binance.connector.client.spot.rest.model.OrderListOpoRequest; +import com.binance.connector.client.spot.rest.model.OrderListOpoResponse; +import com.binance.connector.client.spot.rest.model.PendingSide; +import com.binance.connector.client.spot.rest.model.PendingType; +import com.binance.connector.client.spot.rest.model.WorkingSide; +import com.binance.connector.client.spot.rest.model.WorkingType; -/** API examples for UserDataStreamApi */ -public class PutUserDataStreamExample { +/** API examples for TradeApi */ +public class OrderListOpoExample { private SpotRestApi api; public SpotRestApi getApi() { @@ -36,17 +42,23 @@ public SpotRestApi getApi() { } /** - * Keepalive user data stream + * New Order List - OPO * - *

Keepalive a user data stream to prevent a time out. User data streams will close after 60 - * minutes. It's recommended to send a ping about every 30 minutes. This request does not - * require `signature`. Weight: 2 + *

Place an [OPO](./faqs/opo.md). * OPOs add 2 orders to the EXCHANGE_MAX_NUM_ORDERS filter + * and MAX_NUM_ORDERS filter. Weight: 1 Unfilled Order Count: 2 * * @throws ApiException if the Api call fails */ - public void putUserDataStreamExample() throws ApiException { - PutUserDataStreamRequest putUserDataStreamRequest = new PutUserDataStreamRequest(); - putUserDataStreamRequest.listenKey("listenKey"); - getApi().putUserDataStream(putUserDataStreamRequest); + public void orderListOpoExample() throws ApiException { + OrderListOpoRequest orderListOpoRequest = new OrderListOpoRequest(); + orderListOpoRequest.symbol("BNBUSDT"); + orderListOpoRequest.workingType(WorkingType.LIMIT); + orderListOpoRequest.workingSide(WorkingSide.BUY); + orderListOpoRequest.workingPrice(1.0d); + orderListOpoRequest.workingQuantity(1.0d); + orderListOpoRequest.pendingType(PendingType.LIMIT); + orderListOpoRequest.pendingSide(PendingSide.BUY); + ApiResponse response = getApi().orderListOpo(orderListOpoRequest); + System.out.println(response.getData()); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/NewUserDataStreamExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOpocoExample.java similarity index 56% rename from examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/NewUserDataStreamExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOpocoExample.java index 4eab09e9..09b6324a 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/NewUserDataStreamExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOpocoExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.rest.userdatastream; +package com.binance.connector.client.spot.rest.trade; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -18,10 +18,15 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.spot.rest.SpotRestApiUtil; import com.binance.connector.client.spot.rest.api.SpotRestApi; -import com.binance.connector.client.spot.rest.model.NewUserDataStreamResponse; +import com.binance.connector.client.spot.rest.model.OrderListOpocoRequest; +import com.binance.connector.client.spot.rest.model.OrderListOpocoResponse; +import com.binance.connector.client.spot.rest.model.PendingAboveType; +import com.binance.connector.client.spot.rest.model.PendingSide; +import com.binance.connector.client.spot.rest.model.WorkingSide; +import com.binance.connector.client.spot.rest.model.WorkingType; -/** API examples for UserDataStreamApi */ -public class NewUserDataStreamExample { +/** API examples for TradeApi */ +public class OrderListOpocoExample { private SpotRestApi api; public SpotRestApi getApi() { @@ -37,15 +42,23 @@ public SpotRestApi getApi() { } /** - * Start user data stream + * New Order List - OPOCO * - *

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is - * sent. This request does not require `signature`. Weight: 2 + *

Place an [OPOCO](./faqs/opo.md). Weight: 1 Unfilled Order Count: 3 * * @throws ApiException if the Api call fails */ - public void newUserDataStreamExample() throws ApiException { - ApiResponse response = getApi().newUserDataStream(); + public void orderListOpocoExample() throws ApiException { + OrderListOpocoRequest orderListOpocoRequest = new OrderListOpocoRequest(); + orderListOpocoRequest.symbol("BNBUSDT"); + orderListOpocoRequest.workingType(WorkingType.LIMIT); + orderListOpocoRequest.workingSide(WorkingSide.BUY); + orderListOpocoRequest.workingPrice(1.0d); + orderListOpocoRequest.workingQuantity(1.0d); + orderListOpocoRequest.pendingSide(PendingSide.BUY); + orderListOpocoRequest.pendingAboveType(PendingAboveType.STOP_LOSS_LIMIT); + ApiResponse response = + getApi().orderListOpoco(orderListOpocoRequest); System.out.println(response.getData()); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/DeleteUserDataStreamExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/DeleteUserDataStreamExample.java deleted file mode 100644 index b6520ec2..00000000 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/DeleteUserDataStreamExample.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.rest.userdatastream; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.spot.rest.SpotRestApiUtil; -import com.binance.connector.client.spot.rest.api.SpotRestApi; - -/** API examples for UserDataStreamApi */ -public class DeleteUserDataStreamExample { - private SpotRestApi api; - - public SpotRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = SpotRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new SpotRestApi(clientConfiguration); - } - return api; - } - - /** - * Close user data stream - * - *

Close out a user data stream. Weight: 2 - * - * @throws ApiException if the Api call fails - */ - public void deleteUserDataStreamExample() throws ApiException { - String listenKey = "listenKey"; - getApi().deleteUserDataStream(listenKey); - } -} diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyFiltersExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyFiltersExample.java index 5a219a60..8af31d58 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyFiltersExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyFiltersExample.java @@ -44,8 +44,8 @@ public SpotWebSocketApi getApi() { * WebSocket Query Relevant Filters * *

Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This - * is the only endpoint that shows if an account has `MAX_ASSET` filters applied to - * it. Weight: 40 + * is the only method that shows if an account has `MAX_ASSET` filters applied to it. + * Weight: 40 */ public void myFiltersExampleAsync() { MyFiltersRequest myFiltersRequest = new MyFiltersRequest(); @@ -65,8 +65,8 @@ public void myFiltersExampleAsync() { * WebSocket Query Relevant Filters * *

Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This - * is the only endpoint that shows if an account has `MAX_ASSET` filters applied to - * it. Weight: 40 + * is the only method that shows if an account has `MAX_ASSET` filters applied to it. + * Weight: 40 */ public void myFiltersExampleSync() { MyFiltersRequest myFiltersRequest = new MyFiltersRequest(); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpoExample.java new file mode 100644 index 00000000..81c77a08 --- /dev/null +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpoExample.java @@ -0,0 +1,94 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.trade; + +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.spot.websocket.api.SpotWebSocketApiUtil; +import com.binance.connector.client.spot.websocket.api.api.SpotWebSocketApi; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpoRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpoResponse; +import com.binance.connector.client.spot.websocket.api.model.PendingSide; +import com.binance.connector.client.spot.websocket.api.model.PendingType; +import com.binance.connector.client.spot.websocket.api.model.WorkingSide; +import com.binance.connector.client.spot.websocket.api.model.WorkingType; +import java.util.concurrent.CompletableFuture; + +/** API examples for TradeApi */ +public class OrderListPlaceOpoExample { + private SpotWebSocketApi api; + + public SpotWebSocketApi getApi() { + if (api == null) { + WebSocketClientConfiguration clientConfiguration = + SpotWebSocketApiUtil.getClientConfiguration(); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("/path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SpotWebSocketApi(clientConfiguration); + } + return api; + } + + /** + * WebSocket OPO + * + *

Place an [OPO](./faqs/opo.md). * OPOs add 2 orders to the EXCHANGE_MAX_NUM_ORDERS filter + * and MAX_NUM_ORDERS filter. Weight: 1 Unfilled Order Count: 2 + */ + public void orderListPlaceOpoExampleAsync() { + OrderListPlaceOpoRequest orderListPlaceOpoRequest = new OrderListPlaceOpoRequest(); + orderListPlaceOpoRequest.symbol("BNBUSDT"); + orderListPlaceOpoRequest.workingType(WorkingType.LIMIT); + orderListPlaceOpoRequest.workingSide(WorkingSide.BUY); + orderListPlaceOpoRequest.workingPrice(1.0d); + orderListPlaceOpoRequest.workingQuantity(1.0d); + orderListPlaceOpoRequest.pendingType(PendingType.LIMIT); + orderListPlaceOpoRequest.pendingSide(PendingSide.BUY); + CompletableFuture future = + getApi().orderListPlaceOpo(orderListPlaceOpoRequest); + future.handle( + (response, error) -> { + if (error != null) { + System.err.println(error); + } + System.out.println(response); + return response; + }); + } + + /** + * WebSocket OPO + * + *

Place an [OPO](./faqs/opo.md). * OPOs add 2 orders to the EXCHANGE_MAX_NUM_ORDERS filter + * and MAX_NUM_ORDERS filter. Weight: 1 Unfilled Order Count: 2 + */ + public void orderListPlaceOpoExampleSync() { + OrderListPlaceOpoRequest orderListPlaceOpoRequest = new OrderListPlaceOpoRequest(); + orderListPlaceOpoRequest.symbol("BNBUSDT"); + orderListPlaceOpoRequest.workingType(WorkingType.LIMIT); + orderListPlaceOpoRequest.workingSide(WorkingSide.BUY); + orderListPlaceOpoRequest.workingPrice(1.0d); + orderListPlaceOpoRequest.workingQuantity(1.0d); + orderListPlaceOpoRequest.pendingType(PendingType.LIMIT); + orderListPlaceOpoRequest.pendingSide(PendingSide.BUY); + CompletableFuture future = + getApi().orderListPlaceOpo(orderListPlaceOpoRequest); + OrderListPlaceOpoResponse response = future.join(); + System.out.println(response); + } +} diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpocoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpocoExample.java new file mode 100644 index 00000000..5e81d6bb --- /dev/null +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOpocoExample.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.spot.websocket.api.trade; + +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.spot.websocket.api.SpotWebSocketApiUtil; +import com.binance.connector.client.spot.websocket.api.api.SpotWebSocketApi; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpocoRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOpocoResponse; +import com.binance.connector.client.spot.websocket.api.model.PendingAboveType; +import com.binance.connector.client.spot.websocket.api.model.PendingSide; +import com.binance.connector.client.spot.websocket.api.model.WorkingSide; +import com.binance.connector.client.spot.websocket.api.model.WorkingType; +import java.util.concurrent.CompletableFuture; + +/** API examples for TradeApi */ +public class OrderListPlaceOpocoExample { + private SpotWebSocketApi api; + + public SpotWebSocketApi getApi() { + if (api == null) { + WebSocketClientConfiguration clientConfiguration = + SpotWebSocketApiUtil.getClientConfiguration(); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("/path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SpotWebSocketApi(clientConfiguration); + } + return api; + } + + /** + * WebSocket OPOCO + * + *

Place an [OPOCO](./faqs/opo.md). Weight: 1 Unfilled Order Count: 3 + */ + public void orderListPlaceOpocoExampleAsync() { + OrderListPlaceOpocoRequest orderListPlaceOpocoRequest = new OrderListPlaceOpocoRequest(); + orderListPlaceOpocoRequest.symbol("BNBUSDT"); + orderListPlaceOpocoRequest.workingType(WorkingType.LIMIT); + orderListPlaceOpocoRequest.workingSide(WorkingSide.BUY); + orderListPlaceOpocoRequest.workingPrice(1.0d); + orderListPlaceOpocoRequest.workingQuantity(1.0d); + orderListPlaceOpocoRequest.pendingSide(PendingSide.BUY); + orderListPlaceOpocoRequest.pendingAboveType(PendingAboveType.STOP_LOSS_LIMIT); + CompletableFuture future = + getApi().orderListPlaceOpoco(orderListPlaceOpocoRequest); + future.handle( + (response, error) -> { + if (error != null) { + System.err.println(error); + } + System.out.println(response); + return response; + }); + } + + /** + * WebSocket OPOCO + * + *

Place an [OPOCO](./faqs/opo.md). Weight: 1 Unfilled Order Count: 3 + */ + public void orderListPlaceOpocoExampleSync() { + OrderListPlaceOpocoRequest orderListPlaceOpocoRequest = new OrderListPlaceOpocoRequest(); + orderListPlaceOpocoRequest.symbol("BNBUSDT"); + orderListPlaceOpocoRequest.workingType(WorkingType.LIMIT); + orderListPlaceOpocoRequest.workingSide(WorkingSide.BUY); + orderListPlaceOpocoRequest.workingPrice(1.0d); + orderListPlaceOpocoRequest.workingQuantity(1.0d); + orderListPlaceOpocoRequest.pendingSide(PendingSide.BUY); + orderListPlaceOpocoRequest.pendingAboveType(PendingAboveType.STOP_LOSS_LIMIT); + CompletableFuture future = + getApi().orderListPlaceOpoco(orderListPlaceOpocoRequest); + OrderListPlaceOpocoResponse response = future.join(); + System.out.println(response); + } +} diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java deleted file mode 100644 index 608645fa..00000000 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.api.userdatastream; - -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.spot.websocket.api.SpotWebSocketApiUtil; -import com.binance.connector.client.spot.websocket.api.api.SpotWebSocketApi; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingRequest; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamPingResponse; -import java.util.concurrent.CompletableFuture; - -/** API examples for UserDataStreamApi */ -public class UserDataStreamPingExample { - private SpotWebSocketApi api; - - public SpotWebSocketApi getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - SpotWebSocketApiUtil.getClientConfiguration(); - // if you want the connection to be auto logged on: - // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests - clientConfiguration.setAutoLogon(true); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("/path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new SpotWebSocketApi(clientConfiguration); - } - return api; - } - - /** - * WebSocket Ping user data stream - * - *

Ping a user data stream to keep it alive. User data streams close automatically after 60 - * minutes, even if you're listening to them on WebSocket Streams. In order to keep the - * stream open, you have to regularly send pings using the `userDataStream.ping` - * request. It is recommended to send a ping once every 30 minutes. This request does not - * require `signature`. Weight: 2 - */ - public void userDataStreamPingExampleAsync() { - UserDataStreamPingRequest userDataStreamPingRequest = new UserDataStreamPingRequest(); - userDataStreamPingRequest.listenKey("listenKey"); - CompletableFuture future = - getApi().userDataStreamPing(userDataStreamPingRequest); - future.handle( - (response, error) -> { - if (error != null) { - System.err.println(error); - } - System.out.println(response); - return response; - }); - } - - /** - * WebSocket Ping user data stream - * - *

Ping a user data stream to keep it alive. User data streams close automatically after 60 - * minutes, even if you're listening to them on WebSocket Streams. In order to keep the - * stream open, you have to regularly send pings using the `userDataStream.ping` - * request. It is recommended to send a ping once every 30 minutes. This request does not - * require `signature`. Weight: 2 - */ - public void userDataStreamPingExampleSync() { - UserDataStreamPingRequest userDataStreamPingRequest = new UserDataStreamPingRequest(); - userDataStreamPingRequest.listenKey("listenKey"); - CompletableFuture future = - getApi().userDataStreamPing(userDataStreamPingRequest); - UserDataStreamPingResponse response = future.join(); - System.out.println(response); - } -} diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java deleted file mode 100644 index 1345fc92..00000000 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.api.userdatastream; - -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.spot.websocket.api.SpotWebSocketApiUtil; -import com.binance.connector.client.spot.websocket.api.api.SpotWebSocketApi; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStartResponse; -import java.util.concurrent.CompletableFuture; - -/** API examples for UserDataStreamApi */ -public class UserDataStreamStartExample { - private SpotWebSocketApi api; - - public SpotWebSocketApi getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - SpotWebSocketApiUtil.getClientConfiguration(); - // if you want the connection to be auto logged on: - // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests - clientConfiguration.setAutoLogon(true); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("/path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new SpotWebSocketApi(clientConfiguration); - } - return api; - } - - /** - * WebSocket Start user data stream - * - *

Start a new user data stream. Note the stream will close in 60 minutes unless - * `userDataStream.ping` requests are sent regularly. This request does not require - * `signature`. Weight: 2 - */ - public void userDataStreamStartExampleAsync() { - CompletableFuture future = getApi().userDataStreamStart(); - future.handle( - (response, error) -> { - if (error != null) { - System.err.println(error); - } - System.out.println(response); - return response; - }); - } - - /** - * WebSocket Start user data stream - * - *

Start a new user data stream. Note the stream will close in 60 minutes unless - * `userDataStream.ping` requests are sent regularly. This request does not require - * `signature`. Weight: 2 - */ - public void userDataStreamStartExampleSync() { - CompletableFuture future = getApi().userDataStreamStart(); - UserDataStreamStartResponse response = future.join(); - System.out.println(response); - } -} diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java deleted file mode 100644 index c056e2ce..00000000 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.api.userdatastream; - -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.spot.websocket.api.SpotWebSocketApiUtil; -import com.binance.connector.client.spot.websocket.api.api.SpotWebSocketApi; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopRequest; -import com.binance.connector.client.spot.websocket.api.model.UserDataStreamStopResponse; -import java.util.concurrent.CompletableFuture; - -/** API examples for UserDataStreamApi */ -public class UserDataStreamStopExample { - private SpotWebSocketApi api; - - public SpotWebSocketApi getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - SpotWebSocketApiUtil.getClientConfiguration(); - // if you want the connection to be auto logged on: - // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests - clientConfiguration.setAutoLogon(true); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("/path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new SpotWebSocketApi(clientConfiguration); - } - return api; - } - - /** - * WebSocket Stop user data stream - * - *

Explicitly stop and close the user data stream. This request does not require - * `signature`. Weight: 2 - */ - public void userDataStreamStopExampleAsync() { - UserDataStreamStopRequest userDataStreamStopRequest = new UserDataStreamStopRequest(); - userDataStreamStopRequest.listenKey("listenKey"); - CompletableFuture future = - getApi().userDataStreamStop(userDataStreamStopRequest); - future.handle( - (response, error) -> { - if (error != null) { - System.err.println(error); - } - System.out.println(response); - return response; - }); - } - - /** - * WebSocket Stop user data stream - * - *

Explicitly stop and close the user data stream. This request does not require - * `signature`. Weight: 2 - */ - public void userDataStreamStopExampleSync() { - UserDataStreamStopRequest userDataStreamStopRequest = new UserDataStreamStopRequest(); - userDataStreamStopRequest.listenKey("listenKey"); - CompletableFuture future = - getApi().userDataStreamStop(userDataStreamStopRequest); - UserDataStreamStopResponse response = future.join(); - System.out.println(response); - } -} diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/websocketstreams/AllTickerExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/websocketstreams/AllTickerExample.java deleted file mode 100644 index c3b00cd3..00000000 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/websocketstreams/AllTickerExample.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.stream.websocketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.spot.websocket.stream.SpotWebSocketStreamsUtil; -import com.binance.connector.client.spot.websocket.stream.api.SpotWebSocketStreams; -import com.binance.connector.client.spot.websocket.stream.model.AllTickerResponse; - -/** API examples for WebSocketStreamsApi */ -public class AllTickerExample { - private SpotWebSocketStreams api; - - public SpotWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - SpotWebSocketStreamsUtil.getClientConfiguration(); - api = new SpotWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * WebSocket All Market Tickers Stream - * - *

24hr rolling window ticker statistics for all symbols that changed in an array. These are - * NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note - * that only tickers that have changed will be present in the array. - * - * @throws ApiException if the Api call fails - */ - public void allTickerExample() throws ApiException, InterruptedException { - StreamBlockingQueueWrapper response = getApi().allTicker(); - while (true) { - System.out.println(response.take()); - } - } -}