diff --git a/MIGRATION.md b/MIGRATION.md index 63977197..3b26f8ea 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -37,7 +37,7 @@ For Spot (Spot package): io.github.binance binance-spot - 5.0.1 + 6.0.0 ``` diff --git a/README.md b/README.md index 60f2940d..a211c7a8 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Each connector is published as a separate maven dependency. For example: io.github.binance binance-spot - 5.0.1 + 6.0.0 ``` diff --git a/clients/common/CHANGELOG.md b/clients/common/CHANGELOG.md index 8c497c65..d87ae09a 100644 --- a/clients/common/CHANGELOG.md +++ b/clients/common/CHANGELOG.md @@ -1,14 +1,27 @@ # Changelog +## 2.0.1 - 2025-08-20 + +- Inject session log on and log out method names. +- Auto re-logon after reconnect. + +## 2.0.0 - 2025-08-07 + +- authNames param as Set instead of array of String. + +## 1.4.0 - 2025-07-17 + +- Handle streams through WebSocket API + ## 1.3.0 - 2025-07-08 - Support custom headers for REST API requests (`customHeaders` option on `ClientConfiguration`). - Added `messageMaxSize` configuration for websocket. -- Added getter for `RateLimits` in `ApiResponse` +- Added getter for `RateLimits` in `ApiResponse`. ## 1.2.0 - 2025-05-13 -- Add proxy authentication for websocket +- Add proxy authentication for websocket. ## 1.1.0 - 2025-05-02 @@ -17,4 +30,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release. \ No newline at end of file diff --git a/clients/common/pom.xml b/clients/common/pom.xml index 71df5d61..44994fae 100644 --- a/clients/common/pom.xml +++ b/clients/common/pom.xml @@ -10,6 +10,6 @@ binance-common common - 2.0.0 + 2.0.1 jar \ No newline at end of file diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionInterface.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionInterface.java index 1fd08a00..e7e759f0 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionInterface.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionInterface.java @@ -2,6 +2,8 @@ import com.binance.connector.client.common.websocket.dtos.ApiRequestWrapperDTO; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; + +import java.util.List; import java.util.concurrent.BlockingQueue; public interface ConnectionInterface { @@ -16,4 +18,9 @@ public interface ConnectionInterface { void setUserAgent(String userAgent); boolean isConnected(); + + void setLogonMethods(List logonMethods); + + void setLogoutMethods(List logoutMethods); + } diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionWrapper.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionWrapper.java index 4c745656..6c466c44 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionWrapper.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/ConnectionWrapper.java @@ -10,7 +10,7 @@ import com.binance.connector.client.common.websocket.dtos.ApiRequestWrapperDTO; import com.binance.connector.client.common.websocket.dtos.BaseRequestDTO; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; -import com.binance.connector.client.common.websocket.dtos.SessionLogonResponse; +import com.binance.connector.client.common.websocket.dtos.SessionResponse; import com.binance.connector.client.common.websocket.service.DeserializeExclusionStrategy; import com.binance.connector.client.common.websocket.service.SerializeExclusionStrategy; import com.google.gson.Gson; @@ -64,13 +64,13 @@ public class ConnectionWrapper implements WebSocketListener, ConnectionInterface // -2015 for wrong API Keys, -1022 for wrong signature private static final List ERROR_CODE_WRONG_CREDENTIALS = Arrays.asList(-2015, -1022); - private static final String LOGON_METHOD = "session.logon"; - private static final String LOGOUT_METHOD = "session.logout"; - protected Map pendingRequest = new HashMap<>(); protected Session session; protected Session oldSession; + protected List logonMethods = new ArrayList<>(); + protected List logoutMethods = new ArrayList<>(); + private String userAgent = String.format( "binance-connector-java/1.0.0 (Java/%s; %s; %s)", @@ -193,7 +193,7 @@ public void connect() { public void connect(Consumer customCallback) throws IOException, URISyntaxException, InterruptedException { pendingReconnect = false; - boolean autoLogon = configuration.getAutoLogon(); + boolean autoLogon = !logonMethods.isEmpty() && (configuration.getAutoLogon() || isLoggedOn); // For LogOn mode, we need the logon to be completed before changing the session countDownLatch = new CountDownLatch(autoLogon ? 1 : 0); @@ -399,12 +399,12 @@ public void logOn(Session session) throws CryptoException { .build(); build.setSignature(signatureGenerator.signAsString(build.toString())); - RequestWrapperDTO request = - new RequestWrapperDTO.Builder() + RequestWrapperDTO request = + new RequestWrapperDTO.Builder() .id(UUID.randomUUID().toString()) - .method("session.logon") + .method(logonMethods.get(0)) .params(build) - .responseType(SessionLogonResponse.class) + .responseType(SessionResponse.class) .build(); request.getResponseCallback() @@ -462,13 +462,13 @@ public void onWebSocketText(String message) { Object responseResult = gson.fromJson(root, responseType); pendingRequest.remove(id); - if (LOGON_METHOD.equals(requestWrapperDTO.getMethod())) { + if (this.logonMethods.contains(requestWrapperDTO.getMethod())) { if (obj.get("status").getAsInt() == 200) { isLoggedOn = true; } } - if (LOGOUT_METHOD.equals(requestWrapperDTO.getMethod())) { + if (this.logoutMethods.contains(requestWrapperDTO.getMethod())) { if (obj.get("status").getAsInt() == 200) { isLoggedOn = false; } @@ -509,6 +509,16 @@ public boolean isConnected() { return session != null && session.isOpen(); } + @Override + public void setLogonMethods(List logonMethods) { + this.logonMethods = logonMethods; + } + + @Override + public void setLogoutMethods(List logoutMethods) { + this.logoutMethods = logoutMethods; + } + public URI getUri(String uri) throws URISyntaxException { URI oldUri = new URI(uri); diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/PoolConnectionWrapper.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/PoolConnectionWrapper.java index 250e7ece..1651930c 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/PoolConnectionWrapper.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/adapter/PoolConnectionWrapper.java @@ -5,7 +5,10 @@ import com.binance.connector.client.common.websocket.dtos.ApiRequestWrapperDTO; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; import com.google.gson.Gson; + +import java.util.ArrayList; import java.util.LinkedList; +import java.util.List; import java.util.ListIterator; import java.util.Timer; import java.util.TimerTask; @@ -22,6 +25,9 @@ public class PoolConnectionWrapper implements ConnectionInterface { "binance-connector-java/1.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + protected List logonMethod = new ArrayList<>(); + protected List logoutMethod = new ArrayList<>(); + public PoolConnectionWrapper(WebSocketClientConfiguration clientConfiguration) { this(clientConfiguration, null); } @@ -73,6 +79,8 @@ public void run() { public void connect() { for (ConnectionWrapper connectionWrapper : connectionList) { connectionWrapper.setUserAgent(userAgent); + connectionWrapper.setLogonMethods(logonMethod); + connectionWrapper.setLogoutMethods(logoutMethod); connectionWrapper.connect(); } isConnected = true; @@ -113,7 +121,19 @@ public ConnectionWrapper getConnection() { } @Override - public void setUserAgent(String userAgent) {} + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + @Override + public void setLogonMethods(List logonMethods) { + this.logonMethod = logonMethods; + } + + @Override + public void setLogoutMethods(List logoutMethods) { + this.logoutMethod = logoutMethods; + } @Override public boolean isConnected() { diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/BaseRequestDTO.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/BaseRequestDTO.java index 105258cd..22a462b3 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/BaseRequestDTO.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/BaseRequestDTO.java @@ -39,7 +39,7 @@ public void setTimestamp(String timestamp) { } public String toUrlQueryString() { - return "timestamp=" + getTimestamp(); + return "apiKey=" + apiKey + "×tamp=" + timestamp; } @Override diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionResponse.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionResponse.java new file mode 100644 index 00000000..746e5099 --- /dev/null +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionResponse.java @@ -0,0 +1,337 @@ +/* + * Binance Public Spot WebSocket API + * OpenAPI Specifications for the Binance Public 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.common.websocket.dtos; + +import com.binance.connector.client.common.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 java.io.IOException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.HashSet; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; + +/** SessionLogonResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.11.0") +public class SessionResponse extends BaseDTO { + private static final int DIFF_TILL_POSITION_INDEX = 1; + private static final int MAX_DECIMAL_DIGITS = 30; + private static DecimalFormat df; + 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 Integer status; + + public static final String SERIALIZED_NAME_RESULT = "result"; + + @SerializedName(SERIALIZED_NAME_RESULT) + @jakarta.annotation.Nullable + private Object result; + + public SessionResponse() {} + + public SessionResponse 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 SessionResponse status(@jakarta.annotation.Nullable Integer status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public Integer getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable Integer status) { + this.status = status; + } + + public SessionResponse result( + @jakarta.annotation.Nullable Object result) { + this.result = result; + return this; + } + + /** + * Get result + * + * @return result + */ + @jakarta.annotation.Nullable + @Valid + public Object getResult() { + return result; + } + + public void setResult(@jakarta.annotation.Nullable Object result) { + this.result = result; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionResponse sessionLogonResponse = (SessionResponse) o; + return Objects.equals(this.id, sessionLogonResponse.id) + && Objects.equals(this.status, sessionLogonResponse.status) + && Objects.equals(this.result, sessionLogonResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, result); + } + + @Override + public String toString() { + String sb = + "class SessionLogonResponse {\n" + + " id: " + + toIndentedString(id) + + "\n" + + " status: " + + toIndentedString(status) + + "\n" + + " result: " + + toIndentedString(result) + + "\n" + + "}"; + return sb; + } + + public String toUrlQueryString() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object idValue = getId(); + if (idValue != null) { + String idValueAsString = ""; + idValueAsString = idValue.toString(); + valMap.put("id", urlEncode(idValueAsString)); + } + Object statusValue = getStatus(); + if (statusValue != null) { + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + valMap.put("status", urlEncode(statusValueAsString)); + } + Object resultValue = getResult(); + if (resultValue != null) { + String resultValueAsString = ""; + resultValueAsString = resultValue.toString(); + valMap.put("result", urlEncode(resultValueAsString)); + } + valMap.put("timestamp", getTimestamp()); + return 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 resultValue = getResult(); + if (resultValue != null) { + valMap.put("result", resultValue); + } + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String urlEncode(String s) { + return URLEncoder.encode(s, StandardCharsets.UTF_8); + } + + /** + * 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 "); + } + + private static final HashSet openapiFields; + private static final HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("status"); + openapiFields.add("result"); + + // 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 SessionLogonResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SessionLogonResponse is not found in" + + " the empty JSON string", + SessionResponse.openapiRequiredFields)); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SessionLogonResponse` properties. JSON: %s", + entry.getKey(), jsonElement)); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionLogonResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SessionResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SessionLogonResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionLogonResponse + * @throws IOException if the JSON string is invalid with respect to SessionLogonResponse + */ + public static SessionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionResponse.class); + } + + /** + * Convert an instance of SessionLogonResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } + + private static DecimalFormat getFormatter() { + if (null == df) { + // Overrides the default Locale + DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.ENGLISH); + df = new DecimalFormat("#,##0.###", symbols); + df.setMaximumFractionDigits(MAX_DECIMAL_DIGITS); + df.setGroupingUsed(false); + } + return df; + } +} diff --git a/clients/spot/CHANGELOG.md b/clients/spot/CHANGELOG.md index 6e908f7e..cf63d782 100644 --- a/clients/spot/CHANGELOG.md +++ b/clients/spot/CHANGELOG.md @@ -1,6 +1,320 @@ # Changelog +## 6.0.0 - 2025-08-21 + +### Added (2) + +#### WebSocket API + +- `sessionSubscriptions()` (`session.subscriptions` method) +- `userDataStreamSubscribeSignature()` (`userDataStream.subscribe.signature` method) + +### Changed (82) + +- Update `binance/common` module to version `2.0.1`. + +#### REST API + +- Added parameter `abovePegOffsetType` + - affected methods: + - `orderListOco()` (`POST /api/v3/orderList/oco`) +- Added parameter `abovePegOffsetValue` + - affected methods: + - `orderListOco()` (`POST /api/v3/orderList/oco`) +- Added parameter `abovePegPriceType` + - affected methods: + - `orderListOco()` (`POST /api/v3/orderList/oco`) +- Added parameter `belowPegOffsetType` + - affected methods: + - `orderListOco()` (`POST /api/v3/orderList/oco`) +- Added parameter `belowPegOffsetValue` + - affected methods: + - `orderListOco()` (`POST /api/v3/orderList/oco`) +- Added parameter `belowPegPriceType` + - affected methods: + - `orderListOco()` (`POST /api/v3/orderList/oco`) +- Added parameter `icebergQty` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `newClientOrderId` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `newOrderRespType` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `pegOffsetType` + - affected methods: + - `newOrder()` (`POST /api/v3/order`) + - `orderCancelReplace()` (`POST /api/v3/order/cancelReplace`) + - `orderTest()` (`POST /api/v3/order/test`) +- Added parameter `pegOffsetValue` + - affected methods: + - `newOrder()` (`POST /api/v3/order`) + - `orderCancelReplace()` (`POST /api/v3/order/cancelReplace`) + - `orderTest()` (`POST /api/v3/order/test`) +- Added parameter `pegPriceType` + - affected methods: + - `newOrder()` (`POST /api/v3/order`) + - `orderCancelReplace()` (`POST /api/v3/order/cancelReplace`) + - `orderTest()` (`POST /api/v3/order/test`) +- Added parameter `pendingAbovePegOffsetType` + - affected methods: + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) +- Added parameter `pendingAbovePegOffsetValue` + - affected methods: + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) +- Added parameter `pendingAbovePegPriceType` + - affected methods: + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) +- Added parameter `pendingBelowPegOffsetType` + - affected methods: + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) +- Added parameter `pendingBelowPegOffsetValue` + - affected methods: + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) +- Added parameter `pendingBelowPegPriceType` + - affected methods: + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) +- Added parameter `pendingPegOffsetType` + - affected methods: + - `orderListOto()` (`POST /api/v3/orderList/oto`) +- Added parameter `pendingPegOffsetValue` + - affected methods: + - `orderListOto()` (`POST /api/v3/orderList/oto`) +- Added parameter `pendingPegPriceType` + - affected methods: + - `orderListOto()` (`POST /api/v3/orderList/oto`) +- Added parameter `price` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `quantity` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `recvWindow` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `selfTradePreventionMode` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `side` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `strategyId` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `strategyType` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `symbol` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `timeInForce` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `type` + - affected methods: + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Added parameter `workingPegOffsetType` + - affected methods: + - `orderListOto()` (`POST /api/v3/orderList/oto`) + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) +- Added parameter `workingPegOffsetValue` + - affected methods: + - `orderListOto()` (`POST /api/v3/orderList/oto`) + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) +- Added parameter `workingPegPriceType` + - affected methods: + - `orderListOto()` (`POST /api/v3/orderList/oto`) + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) +- Modified parameter `computeCommissionRates`: + - affected methods: + - `orderTest()` (`POST /api/v3/order/test`) + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) + +- Modified response for `accountCommission()` method (`GET /api/v3/account/commission`): + - property `specialCommission` added + +- Modified response for `exchangeInfo()` method (`GET /api/v3/exchangeInfo`): + - `exchangeFilters`: item property `maxNumOrderAmends` added + - `exchangeFilters`: item property `maxNumOrderLists` added + - `symbols`: item property `pegInstructionsAllowed` added + - `symbols`.`filters`: item property `maxNumOrderAmends` added + - `symbols`.`filters`: item property `maxNumOrderLists` added + +- Modified response for `orderTest()` method (`POST /api/v3/order/test`): + - property `specialCommissionForOrder` added + +#### WebSocket API + +- Added parameter `abovePegOffsetType` + - affected methods: + - `orderListPlaceOco()` (`orderList.place.oco` method) +- Added parameter `abovePegOffsetValue` + - affected methods: + - `orderListPlaceOco()` (`orderList.place.oco` method) +- Added parameter `abovePegPriceType` + - affected methods: + - `orderListPlaceOco()` (`orderList.place.oco` method) +- Added parameter `belowPegOffsetType` + - affected methods: + - `orderListPlaceOco()` (`orderList.place.oco` method) +- Added parameter `belowPegOffsetValue` + - affected methods: + - `orderListPlaceOco()` (`orderList.place.oco` method) +- Added parameter `belowPegPriceType` + - affected methods: + - `orderListPlaceOco()` (`orderList.place.oco` method) +- Added parameter `icebergQty` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `newClientOrderId` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `newOrderRespType` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `pegOffsetType` + - affected methods: + - `orderCancelReplace()` (`order.cancelReplace` method) + - `orderPlace()` (`order.place` method) + - `orderTest()` (`order.test` method) +- Added parameter `pegOffsetValue` + - affected methods: + - `orderCancelReplace()` (`order.cancelReplace` method) + - `orderPlace()` (`order.place` method) + - `orderTest()` (`order.test` method) +- Added parameter `pegPriceType` + - affected methods: + - `orderCancelReplace()` (`order.cancelReplace` method) + - `orderPlace()` (`order.place` method) + - `orderTest()` (`order.test` method) +- Added parameter `pendingAbovePegOffsetType` + - affected methods: + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) +- Added parameter `pendingAbovePegOffsetValue` + - affected methods: + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) +- Added parameter `pendingAbovePegPriceType` + - affected methods: + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) +- Added parameter `pendingBelowPegOffsetType` + - affected methods: + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) +- Added parameter `pendingBelowPegOffsetValue` + - affected methods: + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) +- Added parameter `pendingBelowPegPriceType` + - affected methods: + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) +- Added parameter `pendingPegOffsetType` + - affected methods: + - `orderListPlaceOto()` (`orderList.place.oto` method) +- Added parameter `pendingPegOffsetValue` + - affected methods: + - `orderListPlaceOto()` (`orderList.place.oto` method) +- Added parameter `pendingPegPriceType` + - affected methods: + - `orderListPlaceOto()` (`orderList.place.oto` method) +- Added parameter `price` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `quantity` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `quoteOrderQty` + - affected methods: + - `orderTest()` (`order.test` method) +- Added parameter `recvWindow` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `selfTradePreventionMode` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `side` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `stopPrice` + - affected methods: + - `orderTest()` (`order.test` method) +- Added parameter `strategyId` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `strategyType` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `subscriptionId` + - affected methods: + - `userDataStreamUnsubscribe()` (`userDataStream.unsubscribe` method) +- Added parameter `symbol` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `timeInForce` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `trailingDelta` + - affected methods: + - `orderTest()` (`order.test` method) +- Added parameter `type` + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Added parameter `workingPegOffsetType` + - affected methods: + - `orderListPlaceOto()` (`orderList.place.oto` method) + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) +- Added parameter `workingPegOffsetValue` + - affected methods: + - `orderListPlaceOto()` (`orderList.place.oto` method) + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) +- Added parameter `workingPegPriceType` + - affected methods: + - `orderListPlaceOto()` (`orderList.place.oto` method) + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) +- Modified parameter `cancelOrderId`: + - format `int32` → `int64` + - affected methods: + - `orderCancelReplace()` (`order.cancelReplace` method) +- Modified parameter `computeCommissionRates`: + - affected methods: + - `orderTest()` (`order.test` method) + - `sorOrderTest()` (`sor.order.test` method) +- Modified parameter `orderId`: + - format `int32` → `int64` + - affected methods: + - `allOrders()` (`allOrders` method) + - `myTrades()` (`myTrades` method) + - `orderCancel()` (`order.cancel` method) + - `orderStatus()` (`order.status` method) + +- Modified response for `accountCommission()` method (`POST /account.commission`): + - `result`: property `specialCommission` added + +- Modified response for `exchangeInfo()` method (`POST /exchangeInfo`): + - `result`.`exchangeFilters`: item property `maxNumOrderLists` added + - `result`.`exchangeFilters`: item property `maxNumOrderAmends` added + - `result`.`symbols`: item property `pegInstructionsAllowed` added + - `result`.`symbols`.`filters`: item property `maxNumOrderLists` added + - `result`.`symbols`.`filters`: item property `maxNumOrderAmends` added + +- Modified response for `orderTest()` method (`POST /order.test`): + - `result`: property `specialCommissionForOrder` added + ## 5.0.1 - 2025-08-07 + +### Changed (2) + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/spot/docs/AbovePegOffsetType.md b/clients/spot/docs/AbovePegOffsetType.md new file mode 100644 index 00000000..7ed086f9 --- /dev/null +++ b/clients/spot/docs/AbovePegOffsetType.md @@ -0,0 +1,11 @@ + + +# AbovePegOffsetType + +## Enum + + +* `PRICE_LEVEL` (value: `"PRICE_LEVEL"`) + + + diff --git a/clients/spot/docs/AbovePegPriceType.md b/clients/spot/docs/AbovePegPriceType.md new file mode 100644 index 00000000..49da9fb0 --- /dev/null +++ b/clients/spot/docs/AbovePegPriceType.md @@ -0,0 +1,13 @@ + + +# AbovePegPriceType + +## Enum + + +* `PRIMARY_PEG` (value: `"PRIMARY_PEG"`) + +* `MARKET_PEG` (value: `"MARKET_PEG"`) + + + diff --git a/clients/spot/docs/AccountApi.md b/clients/spot/docs/AccountApi.md index 619cba2c..b5546b1e 100644 --- a/clients/spot/docs/AccountApi.md +++ b/clients/spot/docs/AccountApi.md @@ -123,7 +123,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **accountRateLimitsOrdersRequest** | [**AccountRateLimitsOrdersRequest**](AccountRateLimitsOrdersRequest.md)| | | +| **accountRateLimitsOrdersRequest** | [**AccountRateLimitsOrdersRequest**](AccountRateLimitsOrdersRequest.md)| | [optional] | ### Return type @@ -185,7 +185,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **accountStatusRequest** | [**AccountStatusRequest**](AccountStatusRequest.md)| | | +| **accountStatusRequest** | [**AccountStatusRequest**](AccountStatusRequest.md)| | [optional] | ### Return type @@ -247,7 +247,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **allOrderListsRequest** | [**AllOrderListsRequest**](AllOrderListsRequest.md)| | | +| **allOrderListsRequest** | [**AllOrderListsRequest**](AllOrderListsRequest.md)| | [optional] | ### Return type @@ -557,7 +557,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **openOrderListsStatusRequest** | [**OpenOrderListsStatusRequest**](OpenOrderListsStatusRequest.md)| | | +| **openOrderListsStatusRequest** | [**OpenOrderListsStatusRequest**](OpenOrderListsStatusRequest.md)| | [optional] | ### Return type @@ -619,7 +619,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **openOrdersStatusRequest** | [**OpenOrdersStatusRequest**](OpenOrdersStatusRequest.md)| | | +| **openOrdersStatusRequest** | [**OpenOrdersStatusRequest**](OpenOrdersStatusRequest.md)| | [optional] | ### Return type @@ -743,7 +743,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **orderListStatusRequest** | [**OrderListStatusRequest**](OrderListStatusRequest.md)| | | +| **orderListStatusRequest** | [**OrderListStatusRequest**](OrderListStatusRequest.md)| | [optional] | ### Return type diff --git a/clients/spot/docs/AccountCommissionResponseResult.md b/clients/spot/docs/AccountCommissionResponseResult.md index f1792252..aacb862f 100644 --- a/clients/spot/docs/AccountCommissionResponseResult.md +++ b/clients/spot/docs/AccountCommissionResponseResult.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | |**standardCommission** | [**AccountCommissionResponseResultStandardCommission**](AccountCommissionResponseResultStandardCommission.md) | | [optional] | +|**specialCommission** | [**AccountCommissionResponseResultSpecialCommission**](AccountCommissionResponseResultSpecialCommission.md) | | [optional] | |**taxCommission** | [**AccountCommissionResponseResultTaxCommission**](AccountCommissionResponseResultTaxCommission.md) | | [optional] | |**discount** | [**AccountCommissionResponseResultDiscount**](AccountCommissionResponseResultDiscount.md) | | [optional] | diff --git a/clients/spot/docs/AccountCommissionResponseResultSpecialCommission.md b/clients/spot/docs/AccountCommissionResponseResultSpecialCommission.md new file mode 100644 index 00000000..e7bef36e --- /dev/null +++ b/clients/spot/docs/AccountCommissionResponseResultSpecialCommission.md @@ -0,0 +1,16 @@ + + +# AccountCommissionResponseResultSpecialCommission + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**maker** | **String** | | [optional] | +|**taker** | **String** | | [optional] | +|**buyer** | **String** | | [optional] | +|**seller** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/AccountCommissionResponseSpecialCommission.md b/clients/spot/docs/AccountCommissionResponseSpecialCommission.md new file mode 100644 index 00000000..65c69083 --- /dev/null +++ b/clients/spot/docs/AccountCommissionResponseSpecialCommission.md @@ -0,0 +1,16 @@ + + +# AccountCommissionResponseSpecialCommission + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**maker** | **String** | | [optional] | +|**taker** | **String** | | [optional] | +|**buyer** | **String** | | [optional] | +|**seller** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/AuthApi.md b/clients/spot/docs/AuthApi.md index dfcdb519..911f40ef 100644 --- a/clients/spot/docs/AuthApi.md +++ b/clients/spot/docs/AuthApi.md @@ -51,7 +51,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **sessionLogonRequest** | [**SessionLogonRequest**](SessionLogonRequest.md)| | | +| **sessionLogonRequest** | [**SessionLogonRequest**](SessionLogonRequest.md)| | [optional] | ### Return type diff --git a/clients/spot/docs/BelowPegOffsetType.md b/clients/spot/docs/BelowPegOffsetType.md new file mode 100644 index 00000000..e8a89fb1 --- /dev/null +++ b/clients/spot/docs/BelowPegOffsetType.md @@ -0,0 +1,11 @@ + + +# BelowPegOffsetType + +## Enum + + +* `PRICE_LEVEL` (value: `"PRICE_LEVEL"`) + + + diff --git a/clients/spot/docs/BelowPegPriceType.md b/clients/spot/docs/BelowPegPriceType.md new file mode 100644 index 00000000..a1b47163 --- /dev/null +++ b/clients/spot/docs/BelowPegPriceType.md @@ -0,0 +1,13 @@ + + +# BelowPegPriceType + +## Enum + + +* `PRIMARY_PEG` (value: `"PRIMARY_PEG"`) + +* `MARKET_PEG` (value: `"MARKET_PEG"`) + + + diff --git a/clients/spot/docs/ExchangeFiltersInner.md b/clients/spot/docs/ExchangeFiltersInner.md index 99b87826..622b782e 100644 --- a/clients/spot/docs/ExchangeFiltersInner.md +++ b/clients/spot/docs/ExchangeFiltersInner.md @@ -35,6 +35,8 @@ |**maxTrailingAboveDelta** | **Long** | | [optional] | |**minTrailingBelowDelta** | **Long** | | [optional] | |**maxTrailingBelowDelta** | **Long** | | [optional] | +|**maxNumOrderAmends** | **Long** | | [optional] | +|**maxNumOrderLists** | **Long** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md b/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md index c2791773..1e37946b 100644 --- a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md +++ b/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md @@ -24,6 +24,7 @@ |**allowTrailingStop** | **Boolean** | | [optional] | |**cancelReplaceAllowed** | **Boolean** | | [optional] | |**amendAllowed** | **Boolean** | | [optional] | +|**pegInstructionsAllowed** | **Boolean** | | [optional] | |**isSpotTradingAllowed** | **Boolean** | | [optional] | |**isMarginTradingAllowed** | **Boolean** | | [optional] | |**filters** | **ExchangeFilters** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md b/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md index 1811c52a..cf75705c 100644 --- a/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md +++ b/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md @@ -24,6 +24,7 @@ |**allowTrailingStop** | **Boolean** | | [optional] | |**cancelReplaceAllowed** | **Boolean** | | [optional] | |**amendAllowed** | **Boolean** | | [optional] | +|**pegInstructionsAllowed** | **Boolean** | | [optional] | |**isSpotTradingAllowed** | **Boolean** | | [optional] | |**isMarginTradingAllowed** | **Boolean** | | [optional] | |**filters** | **ExchangeFilters** | | [optional] | diff --git a/clients/spot/docs/ExecutionReport.md b/clients/spot/docs/ExecutionReport.md index 8d7b30f1..080a9b48 100644 --- a/clients/spot/docs/ExecutionReport.md +++ b/clients/spot/docs/ExecutionReport.md @@ -57,6 +57,10 @@ |**aLowerCase** | **Long** | | [optional] | |**kLowerCase** | **String** | | [optional] | |**uS** | **Boolean** | | [optional] | +|**gP** | **String** | | [optional] | +|**gOT** | **String** | | [optional] | +|**gOV** | **Long** | | [optional] | +|**gp** | **String** | | [optional] | diff --git a/clients/spot/docs/NewOrderRequest.md b/clients/spot/docs/NewOrderRequest.md index 627d6506..7b2e0b78 100644 --- a/clients/spot/docs/NewOrderRequest.md +++ b/clients/spot/docs/NewOrderRequest.md @@ -22,6 +22,9 @@ |**icebergQty** | **Double** | | [optional] | |**newOrderRespType** | **NewOrderRespType** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | +|**pegPriceType** | **PegPriceType** | | [optional] | +|**pegOffsetValue** | **Integer** | | [optional] | +|**pegOffsetType** | **PegOffsetType** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderCancelReplaceRequest.md b/clients/spot/docs/OrderCancelReplaceRequest.md index 25dc0497..78e66047 100644 --- a/clients/spot/docs/OrderCancelReplaceRequest.md +++ b/clients/spot/docs/OrderCancelReplaceRequest.md @@ -28,6 +28,9 @@ |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | |**cancelRestrictions** | **CancelRestrictions** | | [optional] | |**orderRateLimitExceededMode** | **OrderRateLimitExceededMode** | | [optional] | +|**pegPriceType** | **PegPriceType** | | [optional] | +|**pegOffsetValue** | **Integer** | | [optional] | +|**pegOffsetType** | **PegOffsetType** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderListOcoRequest.md b/clients/spot/docs/OrderListOcoRequest.md index e646e526..426fd2b9 100644 --- a/clients/spot/docs/OrderListOcoRequest.md +++ b/clients/spot/docs/OrderListOcoRequest.md @@ -20,6 +20,9 @@ |**aboveTimeInForce** | **Double** | | [optional] | |**aboveStrategyId** | **Long** | | [optional] | |**aboveStrategyType** | **Integer** | | [optional] | +|**abovePegPriceType** | **AbovePegPriceType** | | [optional] | +|**abovePegOffsetType** | **AbovePegOffsetType** | | [optional] | +|**abovePegOffsetValue** | **Integer** | | [optional] | |**belowType** | **BelowType** | | | |**belowClientOrderId** | **String** | | [optional] | |**belowIcebergQty** | **Long** | | [optional] | @@ -29,6 +32,9 @@ |**belowTimeInForce** | **BelowTimeInForce** | | [optional] | |**belowStrategyId** | **Long** | | [optional] | |**belowStrategyType** | **Integer** | | [optional] | +|**belowPegPriceType** | **BelowPegPriceType** | | [optional] | +|**belowPegOffsetType** | **BelowPegOffsetType** | | [optional] | +|**belowPegOffsetValue** | **Integer** | | [optional] | |**newOrderRespType** | **NewOrderRespType** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderListOtoRequest.md b/clients/spot/docs/OrderListOtoRequest.md index 372e31c0..e4210e30 100644 --- a/clients/spot/docs/OrderListOtoRequest.md +++ b/clients/spot/docs/OrderListOtoRequest.md @@ -20,6 +20,9 @@ |**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] | @@ -31,6 +34,9 @@ |**pendingTimeInForce** | **PendingTimeInForce** | | [optional] | |**pendingStrategyId** | **Long** | | [optional] | |**pendingStrategyType** | **Integer** | | [optional] | +|**pendingPegPriceType** | **PendingPegPriceType** | | [optional] | +|**pendingPegOffsetType** | **PendingPegOffsetType** | | [optional] | +|**pendingPegOffsetValue** | **Integer** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderListOtocoRequest.md b/clients/spot/docs/OrderListOtocoRequest.md index 7bfc1aa1..e37028fb 100644 --- a/clients/spot/docs/OrderListOtocoRequest.md +++ b/clients/spot/docs/OrderListOtocoRequest.md @@ -20,6 +20,9 @@ |**workingTimeInForce** | **WorkingTimeInForce** | | [optional] | |**workingStrategyId** | **Long** | | [optional] | |**workingStrategyType** | **Integer** | | [optional] | +|**workingPegPriceType** | **WorkingPegPriceType** | | [optional] | +|**workingPegOffsetType** | **WorkingPegOffsetType** | | [optional] | +|**workingPegOffsetValue** | **Integer** | | [optional] | |**pendingSide** | **PendingSide** | | | |**pendingQuantity** | **Double** | | | |**pendingAboveType** | **PendingAboveType** | | | @@ -31,6 +34,9 @@ |**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] | @@ -40,6 +46,9 @@ |**pendingBelowTimeInForce** | **PendingBelowTimeInForce** | | [optional] | |**pendingBelowStrategyId** | **Long** | | [optional] | |**pendingBelowStrategyType** | **Integer** | | [optional] | +|**pendingBelowPegPriceType** | **PendingBelowPegPriceType** | | [optional] | +|**pendingBelowPegOffsetType** | **PendingBelowPegOffsetType** | | [optional] | +|**pendingBelowPegOffsetValue** | **Integer** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOcoRequest.md b/clients/spot/docs/OrderListPlaceOcoRequest.md index f81d0e6c..e7513692 100644 --- a/clients/spot/docs/OrderListPlaceOcoRequest.md +++ b/clients/spot/docs/OrderListPlaceOcoRequest.md @@ -20,6 +20,9 @@ |**aboveTimeInForce** | **Double** | | [optional] | |**aboveStrategyId** | **Long** | | [optional] | |**aboveStrategyType** | **Integer** | | [optional] | +|**abovePegPriceType** | **AbovePegPriceType** | | [optional] | +|**abovePegOffsetType** | **AbovePegOffsetType** | | [optional] | +|**abovePegOffsetValue** | **Integer** | | [optional] | |**belowType** | **BelowType** | | | |**belowClientOrderId** | **String** | | [optional] | |**belowIcebergQty** | **Long** | | [optional] | @@ -29,6 +32,9 @@ |**belowTimeInForce** | **BelowTimeInForce** | | [optional] | |**belowStrategyId** | **Long** | | [optional] | |**belowStrategyType** | **Integer** | | [optional] | +|**belowPegPriceType** | **BelowPegPriceType** | | [optional] | +|**belowPegOffsetType** | **BelowPegOffsetType** | | [optional] | +|**belowPegOffsetValue** | **Integer** | | [optional] | |**newOrderRespType** | **NewOrderRespType** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOtoRequest.md b/clients/spot/docs/OrderListPlaceOtoRequest.md index f2bb4bc7..55a5b4b7 100644 --- a/clients/spot/docs/OrderListPlaceOtoRequest.md +++ b/clients/spot/docs/OrderListPlaceOtoRequest.md @@ -20,6 +20,9 @@ |**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] | @@ -31,6 +34,9 @@ |**pendingTimeInForce** | **PendingTimeInForce** | | [optional] | |**pendingStrategyId** | **Long** | | [optional] | |**pendingStrategyType** | **Integer** | | [optional] | +|**pendingPegOffsetType** | **PendingPegOffsetType** | | [optional] | +|**pendingPegPriceType** | **PendingPegPriceType** | | [optional] | +|**pendingPegOffsetValue** | **Integer** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOtocoRequest.md b/clients/spot/docs/OrderListPlaceOtocoRequest.md index 05f27df9..e0c14dd1 100644 --- a/clients/spot/docs/OrderListPlaceOtocoRequest.md +++ b/clients/spot/docs/OrderListPlaceOtocoRequest.md @@ -20,6 +20,9 @@ |**workingTimeInForce** | **WorkingTimeInForce** | | [optional] | |**workingStrategyId** | **Long** | | [optional] | |**workingStrategyType** | **Integer** | | [optional] | +|**workingPegPriceType** | **WorkingPegPriceType** | | [optional] | +|**workingPegOffsetType** | **WorkingPegOffsetType** | | [optional] | +|**workingPegOffsetValue** | **Integer** | | [optional] | |**pendingSide** | **PendingSide** | | | |**pendingQuantity** | **Double** | | | |**pendingAboveType** | **PendingAboveType** | | | @@ -31,6 +34,9 @@ |**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] | @@ -40,6 +46,9 @@ |**pendingBelowTimeInForce** | **PendingBelowTimeInForce** | | [optional] | |**pendingBelowStrategyId** | **Long** | | [optional] | |**pendingBelowStrategyType** | **Integer** | | [optional] | +|**pendingBelowPegPriceType** | **PendingBelowPegPriceType** | | [optional] | +|**pendingBelowPegOffsetType** | **PendingBelowPegOffsetType** | | [optional] | +|**pendingBelowPegOffsetValue** | **Integer** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderPlaceRequest.md b/clients/spot/docs/OrderPlaceRequest.md index 356855ae..e7b73572 100644 --- a/clients/spot/docs/OrderPlaceRequest.md +++ b/clients/spot/docs/OrderPlaceRequest.md @@ -22,6 +22,9 @@ |**strategyId** | **Long** | | [optional] | |**strategyType** | **Integer** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | +|**pegPriceType** | **PegPriceType** | | [optional] | +|**pegOffsetValue** | **Integer** | | [optional] | +|**pegOffsetType** | **PegOffsetType** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderTestRequest.md b/clients/spot/docs/OrderTestRequest.md index ad0cc8e5..b49a9678 100644 --- a/clients/spot/docs/OrderTestRequest.md +++ b/clients/spot/docs/OrderTestRequest.md @@ -23,6 +23,9 @@ |**strategyId** | **Long** | | [optional] | |**strategyType** | **Integer** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | +|**pegPriceType** | **PegPriceType** | | [optional] | +|**pegOffsetValue** | **Integer** | | [optional] | +|**pegOffsetType** | **PegOffsetType** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/spot/docs/OrderTestResponseResult.md b/clients/spot/docs/OrderTestResponseResult.md index 023837a7..a0950794 100644 --- a/clients/spot/docs/OrderTestResponseResult.md +++ b/clients/spot/docs/OrderTestResponseResult.md @@ -8,6 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**standardCommissionForOrder** | [**OrderTestResponseResultStandardCommissionForOrder**](OrderTestResponseResultStandardCommissionForOrder.md) | | [optional] | +|**specialCommissionForOrder** | [**OrderTestResponseResultSpecialCommissionForOrder**](OrderTestResponseResultSpecialCommissionForOrder.md) | | [optional] | |**taxCommissionForOrder** | [**OrderTestResponseResultStandardCommissionForOrder**](OrderTestResponseResultStandardCommissionForOrder.md) | | [optional] | |**discount** | [**OrderTestResponseResultDiscount**](OrderTestResponseResultDiscount.md) | | [optional] | diff --git a/clients/spot/docs/OrderTestResponseResultSpecialCommissionForOrder.md b/clients/spot/docs/OrderTestResponseResultSpecialCommissionForOrder.md new file mode 100644 index 00000000..38d799fa --- /dev/null +++ b/clients/spot/docs/OrderTestResponseResultSpecialCommissionForOrder.md @@ -0,0 +1,14 @@ + + +# OrderTestResponseResultSpecialCommissionForOrder + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**maker** | **String** | | [optional] | +|**taker** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/OrderTestResponseSpecialCommissionForOrder.md b/clients/spot/docs/OrderTestResponseSpecialCommissionForOrder.md new file mode 100644 index 00000000..164c2818 --- /dev/null +++ b/clients/spot/docs/OrderTestResponseSpecialCommissionForOrder.md @@ -0,0 +1,14 @@ + + +# OrderTestResponseSpecialCommissionForOrder + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**maker** | **String** | | [optional] | +|**taker** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/PegOffsetType.md b/clients/spot/docs/PegOffsetType.md new file mode 100644 index 00000000..2a181795 --- /dev/null +++ b/clients/spot/docs/PegOffsetType.md @@ -0,0 +1,13 @@ + + +# PegOffsetType + +## Enum + + +* `PRICE_LEVEL` (value: `"PRICE_LEVEL"`) + +* `NON_REPRESENTABLE` (value: `"NON_REPRESENTABLE"`) + + + diff --git a/clients/spot/docs/PegPriceType.md b/clients/spot/docs/PegPriceType.md new file mode 100644 index 00000000..936bbcce --- /dev/null +++ b/clients/spot/docs/PegPriceType.md @@ -0,0 +1,15 @@ + + +# PegPriceType + +## Enum + + +* `PRIMARY_PEG` (value: `"PRIMARY_PEG"`) + +* `MARKET_PEG` (value: `"MARKET_PEG"`) + +* `NON_REPRESENTABLE` (value: `"NON_REPRESENTABLE"`) + + + diff --git a/clients/spot/docs/PendingAbovePegOffsetType.md b/clients/spot/docs/PendingAbovePegOffsetType.md new file mode 100644 index 00000000..dcdf3256 --- /dev/null +++ b/clients/spot/docs/PendingAbovePegOffsetType.md @@ -0,0 +1,11 @@ + + +# PendingAbovePegOffsetType + +## Enum + + +* `PRICE_LEVEL` (value: `"PRICE_LEVEL"`) + + + diff --git a/clients/spot/docs/PendingAbovePegPriceType.md b/clients/spot/docs/PendingAbovePegPriceType.md new file mode 100644 index 00000000..456e0cdd --- /dev/null +++ b/clients/spot/docs/PendingAbovePegPriceType.md @@ -0,0 +1,13 @@ + + +# PendingAbovePegPriceType + +## Enum + + +* `PRIMARY_PEG` (value: `"PRIMARY_PEG"`) + +* `MARKET_PEG` (value: `"MARKET_PEG"`) + + + diff --git a/clients/spot/docs/PendingBelowPegOffsetType.md b/clients/spot/docs/PendingBelowPegOffsetType.md new file mode 100644 index 00000000..e2e74001 --- /dev/null +++ b/clients/spot/docs/PendingBelowPegOffsetType.md @@ -0,0 +1,11 @@ + + +# PendingBelowPegOffsetType + +## Enum + + +* `PRICE_LEVEL` (value: `"PRICE_LEVEL"`) + + + diff --git a/clients/spot/docs/PendingBelowPegPriceType.md b/clients/spot/docs/PendingBelowPegPriceType.md new file mode 100644 index 00000000..2b01448b --- /dev/null +++ b/clients/spot/docs/PendingBelowPegPriceType.md @@ -0,0 +1,13 @@ + + +# PendingBelowPegPriceType + +## Enum + + +* `PRIMARY_PEG` (value: `"PRIMARY_PEG"`) + +* `MARKET_PEG` (value: `"MARKET_PEG"`) + + + diff --git a/clients/spot/docs/PendingPegOffsetType.md b/clients/spot/docs/PendingPegOffsetType.md new file mode 100644 index 00000000..dbcc2c2d --- /dev/null +++ b/clients/spot/docs/PendingPegOffsetType.md @@ -0,0 +1,11 @@ + + +# PendingPegOffsetType + +## Enum + + +* `PRICE_LEVEL` (value: `"PRICE_LEVEL"`) + + + diff --git a/clients/spot/docs/PendingPegPriceType.md b/clients/spot/docs/PendingPegPriceType.md new file mode 100644 index 00000000..bd40d771 --- /dev/null +++ b/clients/spot/docs/PendingPegPriceType.md @@ -0,0 +1,13 @@ + + +# PendingPegPriceType + +## Enum + + +* `PRIMARY_PEG` (value: `"PRIMARY_PEG"`) + +* `MARKET_PEG` (value: `"MARKET_PEG"`) + + + diff --git a/clients/spot/docs/SessionSubscriptionsResponse.md b/clients/spot/docs/SessionSubscriptionsResponse.md new file mode 100644 index 00000000..6e19ba69 --- /dev/null +++ b/clients/spot/docs/SessionSubscriptionsResponse.md @@ -0,0 +1,15 @@ + + +# SessionSubscriptionsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**status** | **Long** | | [optional] | +|**result** | [**List<SessionSubscriptionsResponseResultInner>**](SessionSubscriptionsResponseResultInner.md) | | [optional] | + + + diff --git a/clients/spot/docs/SessionSubscriptionsResponseResultInner.md b/clients/spot/docs/SessionSubscriptionsResponseResultInner.md new file mode 100644 index 00000000..7cbde998 --- /dev/null +++ b/clients/spot/docs/SessionSubscriptionsResponseResultInner.md @@ -0,0 +1,13 @@ + + +# SessionSubscriptionsResponseResultInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriptionId** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/SorOrderTestResponse.md b/clients/spot/docs/SorOrderTestResponse.md index a3ff2c88..c035941e 100644 --- a/clients/spot/docs/SorOrderTestResponse.md +++ b/clients/spot/docs/SorOrderTestResponse.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | -|**result** | [**OrderTestResponseResult**](OrderTestResponseResult.md) | | [optional] | +|**result** | [**SorOrderTestResponseResult**](SorOrderTestResponseResult.md) | | [optional] | |**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/SorOrderTestResponseResult.md b/clients/spot/docs/SorOrderTestResponseResult.md new file mode 100644 index 00000000..61cee159 --- /dev/null +++ b/clients/spot/docs/SorOrderTestResponseResult.md @@ -0,0 +1,15 @@ + + +# SorOrderTestResponseResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**standardCommissionForOrder** | [**OrderTestResponseResultStandardCommissionForOrder**](OrderTestResponseResultStandardCommissionForOrder.md) | | [optional] | +|**taxCommissionForOrder** | [**OrderTestResponseResultStandardCommissionForOrder**](OrderTestResponseResultStandardCommissionForOrder.md) | | [optional] | +|**discount** | [**OrderTestResponseResultDiscount**](OrderTestResponseResultDiscount.md) | | [optional] | + + + diff --git a/clients/spot/docs/UserDataStreamApi.md b/clients/spot/docs/UserDataStreamApi.md index afe3bb77..304ecce2 100644 --- a/clients/spot/docs/UserDataStreamApi.md +++ b/clients/spot/docs/UserDataStreamApi.md @@ -4,13 +4,73 @@ 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 | + +# **sessionSubscriptions** +> SessionSubscriptionsResponse sessionSubscriptions() + +WebSocket Listing all subscriptions + + Weight: 2 **Data Source**: Memory + +### 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 { + SessionSubscriptionsResponse result = apiInstance.sessionSubscriptions(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserDataStreamApi#sessionSubscriptions"); + 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 + +[**SessionSubscriptionsResponse**](SessionSubscriptionsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Listing all subscriptions | - | + # **userDataStreamPing** > UserDataStreamPingResponse userDataStreamPing(userDataStreamPingRequest) @@ -251,13 +311,71 @@ No authorization required |-------------|-------------|------------------| | **200** | Subscribe to User Data Stream | - | + +# **userDataStreamSubscribeSignature** +> UserDataStreamSubscribeSignatureResponse userDataStreamSubscribeSignature() + +WebSocket Subscribe to User Data Stream through signature subscription + + 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 { + UserDataStreamSubscribeSignatureResponse result = apiInstance.userDataStreamSubscribeSignature(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserDataStreamApi#userDataStreamSubscribeSignature"); + 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 + +[**UserDataStreamSubscribeSignatureResponse**](UserDataStreamSubscribeSignatureResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Subscribe to User Data Stream through signature subscription | - | + # **userDataStreamUnsubscribe** -> UserDataStreamUnsubscribeResponse userDataStreamUnsubscribe() +> UserDataStreamUnsubscribeResponse userDataStreamUnsubscribe(userDataStreamUnsubscribeRequest) WebSocket Unsubscribe from User Data Stream -Stop listening to the User Data Stream in the current WebSocket connection. Weight: 2 +Stop listening to the User Data Stream in the current WebSocket connection. Note that `session.logout` will only close the subscription created with `userdataStream.subscribe` but not subscriptions opened with `userDataStream.subscribe.signature`. Weight: 2 ### Example ```java @@ -274,8 +392,9 @@ public class Example { defaultClient.setBasePath("http://localhost"); UserDataStreamApi apiInstance = new UserDataStreamApi(defaultClient); + UserDataStreamUnsubscribeRequest userDataStreamUnsubscribeRequest = new UserDataStreamUnsubscribeRequest(); // UserDataStreamUnsubscribeRequest | try { - UserDataStreamUnsubscribeResponse result = apiInstance.userDataStreamUnsubscribe(); + UserDataStreamUnsubscribeResponse result = apiInstance.userDataStreamUnsubscribe(userDataStreamUnsubscribeRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserDataStreamApi#userDataStreamUnsubscribe"); @@ -289,7 +408,10 @@ public class Example { ``` ### Parameters -This endpoint does not need any parameter. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userDataStreamUnsubscribeRequest** | [**UserDataStreamUnsubscribeRequest**](UserDataStreamUnsubscribeRequest.md)| | [optional] | ### Return type @@ -301,7 +423,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details diff --git a/clients/spot/docs/UserDataStreamEventsResponse.md b/clients/spot/docs/UserDataStreamEventsResponse.md index 4085d33b..527fd351 100644 --- a/clients/spot/docs/UserDataStreamEventsResponse.md +++ b/clients/spot/docs/UserDataStreamEventsResponse.md @@ -57,6 +57,10 @@ |**bLowerCase** | **String** | | [optional] | |**kLowerCase** | **String** | | [optional] | |**uS** | **Boolean** | | [optional] | +|**gP** | **String** | | [optional] | +|**gOT** | **String** | | [optional] | +|**gOV** | **Long** | | [optional] | +|**gp** | **String** | | [optional] | |**listenKey** | **String** | | [optional] | diff --git a/clients/spot/docs/UserDataStreamSubscribeResponse.md b/clients/spot/docs/UserDataStreamSubscribeResponse.md index 7561d1a5..7f23b1dc 100644 --- a/clients/spot/docs/UserDataStreamSubscribeResponse.md +++ b/clients/spot/docs/UserDataStreamSubscribeResponse.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | -|**result** | **Object** | | [optional] | +|**result** | [**SessionSubscriptionsResponseResultInner**](SessionSubscriptionsResponseResultInner.md) | | [optional] | diff --git a/clients/spot/docs/UserDataStreamSubscribeSignatureResponse.md b/clients/spot/docs/UserDataStreamSubscribeSignatureResponse.md new file mode 100644 index 00000000..7dc41d24 --- /dev/null +++ b/clients/spot/docs/UserDataStreamSubscribeSignatureResponse.md @@ -0,0 +1,15 @@ + + +# UserDataStreamSubscribeSignatureResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**status** | **Long** | | [optional] | +|**result** | [**SessionSubscriptionsResponseResultInner**](SessionSubscriptionsResponseResultInner.md) | | [optional] | + + + diff --git a/clients/spot/docs/UserDataStreamUnsubscribeRequest.md b/clients/spot/docs/UserDataStreamUnsubscribeRequest.md new file mode 100644 index 00000000..bd80789f --- /dev/null +++ b/clients/spot/docs/UserDataStreamUnsubscribeRequest.md @@ -0,0 +1,13 @@ + + +# UserDataStreamUnsubscribeRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriptionId** | **Integer** | | [optional] | + + + diff --git a/clients/spot/docs/WorkingPegOffsetType.md b/clients/spot/docs/WorkingPegOffsetType.md new file mode 100644 index 00000000..56cada27 --- /dev/null +++ b/clients/spot/docs/WorkingPegOffsetType.md @@ -0,0 +1,11 @@ + + +# WorkingPegOffsetType + +## Enum + + +* `PRICE_LEVEL` (value: `"PRICE_LEVEL"`) + + + diff --git a/clients/spot/docs/WorkingPegPriceType.md b/clients/spot/docs/WorkingPegPriceType.md new file mode 100644 index 00000000..dac20b3c --- /dev/null +++ b/clients/spot/docs/WorkingPegPriceType.md @@ -0,0 +1,13 @@ + + +# WorkingPegPriceType + +## Enum + + +* `PRIMARY_PEG` (value: `"PRIMARY_PEG"`) + +* `MARKET_PEG` (value: `"MARKET_PEG"`) + + + diff --git a/clients/spot/docs/rest-api/migration-guide.md b/clients/spot/docs/rest-api/migration-guide.md index 04a4311d..fa8d7d4c 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 - 5.0.0 + 6.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-spot - 5.0.0 + 6.0.0 ``` diff --git a/clients/spot/example_websocket_api.md b/clients/spot/example_websocket_api.md index 1088c653..4beffa3d 100644 --- a/clients/spot/example_websocket_api.md +++ b/clients/spot/example_websocket_api.md @@ -98,6 +98,8 @@ ## UserDataStream +[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:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java#L51) [userDataStream.start](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#start-user-data-stream-user_stream) - userDataStreamStart - [UserDataStreamStartExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java#L47) @@ -106,5 +108,7 @@ [userDataStream.subscribe](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#subscribe-to-user-data-stream-user_stream) - userDataStreamSubscribe - [UserDataStreamSubscribeExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeExample.java#L49) -[userDataStream.unsubscribe](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#unsubscribe-from-user-data-stream-user_stream) - userDataStreamUnsubscribe - [UserDataStreamUnsubscribeExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java#L47) +[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.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/pom.xml b/clients/spot/pom.xml index 8e626718..af7156f0 100644 --- a/clients/spot/pom.xml +++ b/clients/spot/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-spot spot - 5.0.1 + 6.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java index 55c77988..12e92881 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 @@ -114,6 +114,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.AccountCommissionResponseDiscount .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model + .AccountCommissionResponseSpecialCommission.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model .AccountCommissionResponseStandardCommission.CustomTypeAdapterFactory()); @@ -355,6 +358,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.OrderTestResponseDiscount .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model + .OrderTestResponseSpecialCommissionForOrder.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model .OrderTestResponseStandardCommissionForOrder.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 f4e7b672..b4ec20af 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java @@ -54,7 +54,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-spot/5.0.1 (Java/%s; %s; %s)", + "binance-spot/6.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 cb66b776..e449e745 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/5.0.1 (Java/%s; %s; %s)", + "binance-spot/6.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 91864600..db3c19a1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java @@ -58,7 +58,7 @@ public class MarketApi { private static final String USER_AGENT = String.format( - "binance-spot/5.0.1 (Java/%s; %s; %s)", + "binance-spot/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java index ae12eb2c..9a8939c8 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java @@ -67,7 +67,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-spot/5.0.1 (Java/%s; %s; %s)", + "binance-spot/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; @@ -764,6 +764,18 @@ private okhttp3.Call newOrderCall(NewOrderRequest newOrderRequest) throws ApiExc "selfTradePreventionMode", newOrderRequest.getSelfTradePreventionMode()); } + if (newOrderRequest.getPegPriceType() != null) { + localVarFormParams.put("pegPriceType", newOrderRequest.getPegPriceType()); + } + + if (newOrderRequest.getPegOffsetValue() != null) { + localVarFormParams.put("pegOffsetValue", newOrderRequest.getPegOffsetValue()); + } + + if (newOrderRequest.getPegOffsetType() != null) { + localVarFormParams.put("pegOffsetType", newOrderRequest.getPegOffsetType()); + } + if (newOrderRequest.getRecvWindow() != null) { localVarFormParams.put("recvWindow", newOrderRequest.getRecvWindow()); } @@ -1174,6 +1186,18 @@ private okhttp3.Call orderCancelReplaceCall(OrderCancelReplaceRequest orderCance orderCancelReplaceRequest.getOrderRateLimitExceededMode()); } + if (orderCancelReplaceRequest.getPegPriceType() != null) { + localVarFormParams.put("pegPriceType", orderCancelReplaceRequest.getPegPriceType()); + } + + if (orderCancelReplaceRequest.getPegOffsetValue() != null) { + localVarFormParams.put("pegOffsetValue", orderCancelReplaceRequest.getPegOffsetValue()); + } + + if (orderCancelReplaceRequest.getPegOffsetType() != null) { + localVarFormParams.put("pegOffsetType", orderCancelReplaceRequest.getPegOffsetType()); + } + if (orderCancelReplaceRequest.getRecvWindow() != null) { localVarFormParams.put("recvWindow", orderCancelReplaceRequest.getRecvWindow()); } @@ -1379,6 +1403,20 @@ private okhttp3.Call orderListOcoCall(OrderListOcoRequest orderListOcoRequest) localVarFormParams.put("aboveStrategyType", orderListOcoRequest.getAboveStrategyType()); } + if (orderListOcoRequest.getAbovePegPriceType() != null) { + localVarFormParams.put("abovePegPriceType", orderListOcoRequest.getAbovePegPriceType()); + } + + if (orderListOcoRequest.getAbovePegOffsetType() != null) { + localVarFormParams.put( + "abovePegOffsetType", orderListOcoRequest.getAbovePegOffsetType()); + } + + if (orderListOcoRequest.getAbovePegOffsetValue() != null) { + localVarFormParams.put( + "abovePegOffsetValue", orderListOcoRequest.getAbovePegOffsetValue()); + } + if (orderListOcoRequest.getBelowType() != null) { localVarFormParams.put("belowType", orderListOcoRequest.getBelowType()); } @@ -1422,6 +1460,20 @@ private okhttp3.Call orderListOcoCall(OrderListOcoRequest orderListOcoRequest) localVarFormParams.put("belowStrategyType", orderListOcoRequest.getBelowStrategyType()); } + if (orderListOcoRequest.getBelowPegPriceType() != null) { + localVarFormParams.put("belowPegPriceType", orderListOcoRequest.getBelowPegPriceType()); + } + + if (orderListOcoRequest.getBelowPegOffsetType() != null) { + localVarFormParams.put( + "belowPegOffsetType", orderListOcoRequest.getBelowPegOffsetType()); + } + + if (orderListOcoRequest.getBelowPegOffsetValue() != null) { + localVarFormParams.put( + "belowPegOffsetValue", orderListOcoRequest.getBelowPegOffsetValue()); + } + if (orderListOcoRequest.getNewOrderRespType() != null) { localVarFormParams.put("newOrderRespType", orderListOcoRequest.getNewOrderRespType()); } @@ -1642,6 +1694,21 @@ private okhttp3.Call orderListOtoCall(OrderListOtoRequest orderListOtoRequest) "workingStrategyType", orderListOtoRequest.getWorkingStrategyType()); } + if (orderListOtoRequest.getWorkingPegPriceType() != null) { + localVarFormParams.put( + "workingPegPriceType", orderListOtoRequest.getWorkingPegPriceType()); + } + + if (orderListOtoRequest.getWorkingPegOffsetType() != null) { + localVarFormParams.put( + "workingPegOffsetType", orderListOtoRequest.getWorkingPegOffsetType()); + } + + if (orderListOtoRequest.getWorkingPegOffsetValue() != null) { + localVarFormParams.put( + "workingPegOffsetValue", orderListOtoRequest.getWorkingPegOffsetValue()); + } + if (orderListOtoRequest.getPendingType() != null) { localVarFormParams.put("pendingType", orderListOtoRequest.getPendingType()); } @@ -1703,6 +1770,21 @@ private okhttp3.Call orderListOtoCall(OrderListOtoRequest orderListOtoRequest) "pendingStrategyType", orderListOtoRequest.getPendingStrategyType()); } + if (orderListOtoRequest.getPendingPegPriceType() != null) { + localVarFormParams.put( + "pendingPegPriceType", orderListOtoRequest.getPendingPegPriceType()); + } + + if (orderListOtoRequest.getPendingPegOffsetType() != null) { + localVarFormParams.put( + "pendingPegOffsetType", orderListOtoRequest.getPendingPegOffsetType()); + } + + if (orderListOtoRequest.getPendingPegOffsetValue() != null) { + localVarFormParams.put( + "pendingPegOffsetValue", orderListOtoRequest.getPendingPegOffsetValue()); + } + if (orderListOtoRequest.getRecvWindow() != null) { localVarFormParams.put("recvWindow", orderListOtoRequest.getRecvWindow()); } @@ -1916,6 +1998,21 @@ private okhttp3.Call orderListOtocoCall(OrderListOtocoRequest orderListOtocoRequ "workingStrategyType", orderListOtocoRequest.getWorkingStrategyType()); } + if (orderListOtocoRequest.getWorkingPegPriceType() != null) { + localVarFormParams.put( + "workingPegPriceType", orderListOtocoRequest.getWorkingPegPriceType()); + } + + if (orderListOtocoRequest.getWorkingPegOffsetType() != null) { + localVarFormParams.put( + "workingPegOffsetType", orderListOtocoRequest.getWorkingPegOffsetType()); + } + + if (orderListOtocoRequest.getWorkingPegOffsetValue() != null) { + localVarFormParams.put( + "workingPegOffsetValue", orderListOtocoRequest.getWorkingPegOffsetValue()); + } + if (orderListOtocoRequest.getPendingSide() != null) { localVarFormParams.put("pendingSide", orderListOtocoRequest.getPendingSide()); } @@ -1981,6 +2078,24 @@ private okhttp3.Call orderListOtocoCall(OrderListOtocoRequest orderListOtocoRequ orderListOtocoRequest.getPendingAboveStrategyType()); } + if (orderListOtocoRequest.getPendingAbovePegPriceType() != null) { + localVarFormParams.put( + "pendingAbovePegPriceType", + orderListOtocoRequest.getPendingAbovePegPriceType()); + } + + if (orderListOtocoRequest.getPendingAbovePegOffsetType() != null) { + localVarFormParams.put( + "pendingAbovePegOffsetType", + orderListOtocoRequest.getPendingAbovePegOffsetType()); + } + + if (orderListOtocoRequest.getPendingAbovePegOffsetValue() != null) { + localVarFormParams.put( + "pendingAbovePegOffsetValue", + orderListOtocoRequest.getPendingAbovePegOffsetValue()); + } + if (orderListOtocoRequest.getPendingBelowType() != null) { localVarFormParams.put("pendingBelowType", orderListOtocoRequest.getPendingBelowType()); } @@ -2035,6 +2150,24 @@ private okhttp3.Call orderListOtocoCall(OrderListOtocoRequest orderListOtocoRequ orderListOtocoRequest.getPendingBelowStrategyType()); } + if (orderListOtocoRequest.getPendingBelowPegPriceType() != null) { + localVarFormParams.put( + "pendingBelowPegPriceType", + orderListOtocoRequest.getPendingBelowPegPriceType()); + } + + if (orderListOtocoRequest.getPendingBelowPegOffsetType() != null) { + localVarFormParams.put( + "pendingBelowPegOffsetType", + orderListOtocoRequest.getPendingBelowPegOffsetType()); + } + + if (orderListOtocoRequest.getPendingBelowPegOffsetValue() != null) { + localVarFormParams.put( + "pendingBelowPegOffsetValue", + orderListOtocoRequest.getPendingBelowPegOffsetValue()); + } + if (orderListOtocoRequest.getRecvWindow() != null) { localVarFormParams.put("recvWindow", orderListOtocoRequest.getRecvWindow()); } @@ -2479,6 +2612,18 @@ private okhttp3.Call orderTestCall(OrderTestRequest orderTestRequest) throws Api "selfTradePreventionMode", orderTestRequest.getSelfTradePreventionMode()); } + if (orderTestRequest.getPegPriceType() != null) { + localVarFormParams.put("pegPriceType", orderTestRequest.getPegPriceType()); + } + + if (orderTestRequest.getPegOffsetValue() != null) { + localVarFormParams.put("pegOffsetValue", orderTestRequest.getPegOffsetValue()); + } + + if (orderTestRequest.getPegOffsetType() != null) { + localVarFormParams.put("pegOffsetType", orderTestRequest.getPegOffsetType()); + } + if (orderTestRequest.getRecvWindow() != null) { localVarFormParams.put("recvWindow", orderTestRequest.getRecvWindow()); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java index 9e983ed1..dd790410 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java @@ -44,7 +44,7 @@ public class UserDataStreamApi { private static final String USER_AGENT = String.format( - "binance-spot/5.0.1 (Java/%s; %s; %s)", + "binance-spot/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AbovePegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AbovePegOffsetType.java new file mode 100644 index 00000000..bcc6172c --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AbovePegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets abovePegOffsetType */ +@JsonAdapter(AbovePegOffsetType.Adapter.class) +public enum AbovePegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + AbovePegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AbovePegOffsetType fromValue(String value) { + for (AbovePegOffsetType b : AbovePegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AbovePegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AbovePegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AbovePegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AbovePegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AbovePegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AbovePegPriceType.java new file mode 100644 index 00000000..eeda657a --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AbovePegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets abovePegPriceType */ +@JsonAdapter(AbovePegPriceType.Adapter.class) +public enum AbovePegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + AbovePegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AbovePegPriceType fromValue(String value) { + for (AbovePegPriceType b : AbovePegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AbovePegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AbovePegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AbovePegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AbovePegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponse.java index f70dd96b..aba7e325 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponse.java @@ -49,6 +49,12 @@ public class AccountCommissionResponse { @jakarta.annotation.Nullable private AccountCommissionResponseStandardCommission standardCommission; + public static final String SERIALIZED_NAME_SPECIAL_COMMISSION = "specialCommission"; + + @SerializedName(SERIALIZED_NAME_SPECIAL_COMMISSION) + @jakarta.annotation.Nullable + private AccountCommissionResponseSpecialCommission specialCommission; + public static final String SERIALIZED_NAME_TAX_COMMISSION = "taxCommission"; @SerializedName(SERIALIZED_NAME_TAX_COMMISSION) @@ -106,6 +112,30 @@ public void setStandardCommission( this.standardCommission = standardCommission; } + public AccountCommissionResponse specialCommission( + @jakarta.annotation.Nullable + AccountCommissionResponseSpecialCommission specialCommission) { + this.specialCommission = specialCommission; + return this; + } + + /** + * Get specialCommission + * + * @return specialCommission + */ + @jakarta.annotation.Nullable + @Valid + public AccountCommissionResponseSpecialCommission getSpecialCommission() { + return specialCommission; + } + + public void setSpecialCommission( + @jakarta.annotation.Nullable + AccountCommissionResponseSpecialCommission specialCommission) { + this.specialCommission = specialCommission; + } + public AccountCommissionResponse taxCommission( @jakarta.annotation.Nullable AccountCommissionResponseTaxCommission taxCommission) { this.taxCommission = taxCommission; @@ -162,13 +192,15 @@ public boolean equals(Object o) { return Objects.equals(this.symbol, accountCommissionResponse.symbol) && Objects.equals( this.standardCommission, accountCommissionResponse.standardCommission) + && Objects.equals( + this.specialCommission, accountCommissionResponse.specialCommission) && Objects.equals(this.taxCommission, accountCommissionResponse.taxCommission) && Objects.equals(this.discount, accountCommissionResponse.discount); } @Override public int hashCode() { - return Objects.hash(symbol, standardCommission, taxCommission, discount); + return Objects.hash(symbol, standardCommission, specialCommission, taxCommission, discount); } @Override @@ -179,6 +211,7 @@ public String toString() { sb.append(" standardCommission: ") .append(toIndentedString(standardCommission)) .append("\n"); + sb.append(" specialCommission: ").append(toIndentedString(specialCommission)).append("\n"); sb.append(" taxCommission: ").append(toIndentedString(taxCommission)).append("\n"); sb.append(" discount: ").append(toIndentedString(discount)).append("\n"); sb.append("}"); @@ -198,6 +231,12 @@ public String toUrlQueryString() { sb.append("standardCommission=") .append(urlEncode(standardCommissionValueAsString)) .append(""); + Object specialCommissionValue = getSpecialCommission(); + String specialCommissionValueAsString = ""; + specialCommissionValueAsString = specialCommissionValue.toString(); + sb.append("specialCommission=") + .append(urlEncode(specialCommissionValueAsString)) + .append(""); Object taxCommissionValue = getTaxCommission(); String taxCommissionValueAsString = ""; taxCommissionValueAsString = taxCommissionValue.toString(); @@ -236,6 +275,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("symbol"); openapiFields.add("standardCommission"); + openapiFields.add("specialCommission"); openapiFields.add("taxCommission"); openapiFields.add("discount"); @@ -275,6 +315,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountCommissionResponseStandardCommission.validateJsonElement( jsonObj.get("standardCommission")); } + // validate the optional field `specialCommission` + if (jsonObj.get("specialCommission") != null + && !jsonObj.get("specialCommission").isJsonNull()) { + AccountCommissionResponseSpecialCommission.validateJsonElement( + jsonObj.get("specialCommission")); + } // validate the optional field `taxCommission` if (jsonObj.get("taxCommission") != null && !jsonObj.get("taxCommission").isJsonNull()) { AccountCommissionResponseTaxCommission.validateJsonElement( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseSpecialCommission.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseSpecialCommission.java new file mode 100644 index 00000000..3f7af570 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseSpecialCommission.java @@ -0,0 +1,346 @@ +/* + * 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.*; + +/** AccountCommissionResponseSpecialCommission */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountCommissionResponseSpecialCommission { + public static final String SERIALIZED_NAME_MAKER = "maker"; + + @SerializedName(SERIALIZED_NAME_MAKER) + @jakarta.annotation.Nullable + private String maker; + + public static final String SERIALIZED_NAME_TAKER = "taker"; + + @SerializedName(SERIALIZED_NAME_TAKER) + @jakarta.annotation.Nullable + private String taker; + + public static final String SERIALIZED_NAME_BUYER = "buyer"; + + @SerializedName(SERIALIZED_NAME_BUYER) + @jakarta.annotation.Nullable + private String buyer; + + public static final String SERIALIZED_NAME_SELLER = "seller"; + + @SerializedName(SERIALIZED_NAME_SELLER) + @jakarta.annotation.Nullable + private String seller; + + public AccountCommissionResponseSpecialCommission() {} + + public AccountCommissionResponseSpecialCommission maker( + @jakarta.annotation.Nullable String maker) { + this.maker = maker; + return this; + } + + /** + * Get maker + * + * @return maker + */ + @jakarta.annotation.Nullable + public String getMaker() { + return maker; + } + + public void setMaker(@jakarta.annotation.Nullable String maker) { + this.maker = maker; + } + + public AccountCommissionResponseSpecialCommission taker( + @jakarta.annotation.Nullable String taker) { + this.taker = taker; + return this; + } + + /** + * Get taker + * + * @return taker + */ + @jakarta.annotation.Nullable + public String getTaker() { + return taker; + } + + public void setTaker(@jakarta.annotation.Nullable String taker) { + this.taker = taker; + } + + public AccountCommissionResponseSpecialCommission buyer( + @jakarta.annotation.Nullable String buyer) { + this.buyer = buyer; + return this; + } + + /** + * Get buyer + * + * @return buyer + */ + @jakarta.annotation.Nullable + public String getBuyer() { + return buyer; + } + + public void setBuyer(@jakarta.annotation.Nullable String buyer) { + this.buyer = buyer; + } + + public AccountCommissionResponseSpecialCommission seller( + @jakarta.annotation.Nullable String seller) { + this.seller = seller; + return this; + } + + /** + * Get seller + * + * @return seller + */ + @jakarta.annotation.Nullable + public String getSeller() { + return seller; + } + + public void setSeller(@jakarta.annotation.Nullable String seller) { + this.seller = seller; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountCommissionResponseSpecialCommission accountCommissionResponseSpecialCommission = + (AccountCommissionResponseSpecialCommission) o; + return Objects.equals(this.maker, accountCommissionResponseSpecialCommission.maker) + && Objects.equals(this.taker, accountCommissionResponseSpecialCommission.taker) + && Objects.equals(this.buyer, accountCommissionResponseSpecialCommission.buyer) + && Objects.equals(this.seller, accountCommissionResponseSpecialCommission.seller); + } + + @Override + public int hashCode() { + return Objects.hash(maker, taker, buyer, seller); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountCommissionResponseSpecialCommission {\n"); + sb.append(" maker: ").append(toIndentedString(maker)).append("\n"); + sb.append(" taker: ").append(toIndentedString(taker)).append("\n"); + sb.append(" buyer: ").append(toIndentedString(buyer)).append("\n"); + sb.append(" seller: ").append(toIndentedString(seller)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object makerValue = getMaker(); + String makerValueAsString = ""; + makerValueAsString = makerValue.toString(); + sb.append("maker=").append(urlEncode(makerValueAsString)).append(""); + Object takerValue = getTaker(); + String takerValueAsString = ""; + takerValueAsString = takerValue.toString(); + sb.append("taker=").append(urlEncode(takerValueAsString)).append(""); + Object buyerValue = getBuyer(); + String buyerValueAsString = ""; + buyerValueAsString = buyerValue.toString(); + sb.append("buyer=").append(urlEncode(buyerValueAsString)).append(""); + Object sellerValue = getSeller(); + String sellerValueAsString = ""; + sellerValueAsString = sellerValue.toString(); + sb.append("seller=").append(urlEncode(sellerValueAsString)).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("maker"); + openapiFields.add("taker"); + openapiFields.add("buyer"); + openapiFields.add("seller"); + + // 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 + * AccountCommissionResponseSpecialCommission + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountCommissionResponseSpecialCommission.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " AccountCommissionResponseSpecialCommission is not found in" + + " the empty JSON string", + AccountCommissionResponseSpecialCommission.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("maker") != null && !jsonObj.get("maker").isJsonNull()) + && !jsonObj.get("maker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maker` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maker").toString())); + } + if ((jsonObj.get("taker") != null && !jsonObj.get("taker").isJsonNull()) + && !jsonObj.get("taker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `taker` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("taker").toString())); + } + if ((jsonObj.get("buyer") != null && !jsonObj.get("buyer").isJsonNull()) + && !jsonObj.get("buyer").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyer` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("buyer").toString())); + } + if ((jsonObj.get("seller") != null && !jsonObj.get("seller").isJsonNull()) + && !jsonObj.get("seller").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `seller` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("seller").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountCommissionResponseSpecialCommission.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'AccountCommissionResponseSpecialCommission' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AccountCommissionResponseSpecialCommission.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AccountCommissionResponseSpecialCommission value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountCommissionResponseSpecialCommission read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountCommissionResponseSpecialCommission given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountCommissionResponseSpecialCommission + * @throws IOException if the JSON string is invalid with respect to + * AccountCommissionResponseSpecialCommission + */ + public static AccountCommissionResponseSpecialCommission fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, AccountCommissionResponseSpecialCommission.class); + } + + /** + * Convert an instance of AccountCommissionResponseSpecialCommission 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/BelowPegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/BelowPegOffsetType.java new file mode 100644 index 00000000..9a2bb317 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/BelowPegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets belowPegOffsetType */ +@JsonAdapter(BelowPegOffsetType.Adapter.class) +public enum BelowPegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + BelowPegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BelowPegOffsetType fromValue(String value) { + for (BelowPegOffsetType b : BelowPegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BelowPegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BelowPegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BelowPegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + BelowPegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/BelowPegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/BelowPegPriceType.java new file mode 100644 index 00000000..e376004f --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/BelowPegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets belowPegPriceType */ +@JsonAdapter(BelowPegPriceType.Adapter.class) +public enum BelowPegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + BelowPegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BelowPegPriceType fromValue(String value) { + for (BelowPegPriceType b : BelowPegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BelowPegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BelowPegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BelowPegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + BelowPegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java index b60b93c8..f708c799 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java @@ -204,6 +204,18 @@ public class ExchangeFiltersInner { @jakarta.annotation.Nullable private Long maxTrailingBelowDelta; + public static final String SERIALIZED_NAME_MAX_NUM_ORDER_AMENDS = "maxNumOrderAmends"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDER_AMENDS) + @jakarta.annotation.Nullable + private Long maxNumOrderAmends; + + public static final String SERIALIZED_NAME_MAX_NUM_ORDER_LISTS = "maxNumOrderLists"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDER_LISTS) + @jakarta.annotation.Nullable + private Long maxNumOrderLists; + public ExchangeFiltersInner() {} public ExchangeFiltersInner filterType(@jakarta.annotation.Nullable String filterType) { @@ -750,6 +762,46 @@ public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTraili this.maxTrailingBelowDelta = maxTrailingBelowDelta; } + public ExchangeFiltersInner maxNumOrderAmends( + @jakarta.annotation.Nullable Long maxNumOrderAmends) { + this.maxNumOrderAmends = maxNumOrderAmends; + return this; + } + + /** + * Get maxNumOrderAmends + * + * @return maxNumOrderAmends + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrderAmends() { + return maxNumOrderAmends; + } + + public void setMaxNumOrderAmends(@jakarta.annotation.Nullable Long maxNumOrderAmends) { + this.maxNumOrderAmends = maxNumOrderAmends; + } + + public ExchangeFiltersInner maxNumOrderLists( + @jakarta.annotation.Nullable Long maxNumOrderLists) { + this.maxNumOrderLists = maxNumOrderLists; + return this; + } + + /** + * Get maxNumOrderLists + * + * @return maxNumOrderLists + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrderLists() { + return maxNumOrderLists; + } + + public void setMaxNumOrderLists(@jakarta.annotation.Nullable Long maxNumOrderLists) { + this.maxNumOrderLists = maxNumOrderLists; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -791,7 +843,9 @@ public boolean equals(Object o) { && Objects.equals( this.minTrailingBelowDelta, exchangeFiltersInner.minTrailingBelowDelta) && Objects.equals( - this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta); + this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta) + && Objects.equals(this.maxNumOrderAmends, exchangeFiltersInner.maxNumOrderAmends) + && Objects.equals(this.maxNumOrderLists, exchangeFiltersInner.maxNumOrderLists); } @Override @@ -824,7 +878,9 @@ public int hashCode() { minTrailingAboveDelta, maxTrailingAboveDelta, minTrailingBelowDelta, - maxTrailingBelowDelta); + maxTrailingBelowDelta, + maxNumOrderAmends, + maxNumOrderLists); } @Override @@ -869,6 +925,8 @@ public String toString() { sb.append(" maxTrailingBelowDelta: ") .append(toIndentedString(maxTrailingBelowDelta)) .append("\n"); + sb.append(" maxNumOrderAmends: ").append(toIndentedString(maxNumOrderAmends)).append("\n"); + sb.append(" maxNumOrderLists: ").append(toIndentedString(maxNumOrderLists)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1002,6 +1060,16 @@ public String toUrlQueryString() { sb.append("maxTrailingBelowDelta=") .append(urlEncode(maxTrailingBelowDeltaValueAsString)) .append(""); + Object maxNumOrderAmendsValue = getMaxNumOrderAmends(); + String maxNumOrderAmendsValueAsString = ""; + maxNumOrderAmendsValueAsString = maxNumOrderAmendsValue.toString(); + sb.append("maxNumOrderAmends=") + .append(urlEncode(maxNumOrderAmendsValueAsString)) + .append(""); + Object maxNumOrderListsValue = getMaxNumOrderLists(); + String maxNumOrderListsValueAsString = ""; + maxNumOrderListsValueAsString = maxNumOrderListsValue.toString(); + sb.append("maxNumOrderLists=").append(urlEncode(maxNumOrderListsValueAsString)).append(""); return sb.toString(); } @@ -1058,6 +1126,8 @@ private String toIndentedString(Object o) { openapiFields.add("maxTrailingAboveDelta"); openapiFields.add("minTrailingBelowDelta"); openapiFields.add("maxTrailingBelowDelta"); + openapiFields.add("maxNumOrderAmends"); + openapiFields.add("maxNumOrderLists"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); 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 9424d66b..c78db1f2 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 @@ -146,6 +146,12 @@ public class ExchangeInfoResponseSymbolsInner { @jakarta.annotation.Nullable private Boolean amendAllowed; + public static final String SERIALIZED_NAME_PEG_INSTRUCTIONS_ALLOWED = "pegInstructionsAllowed"; + + @SerializedName(SERIALIZED_NAME_PEG_INSTRUCTIONS_ALLOWED) + @jakarta.annotation.Nullable + private Boolean pegInstructionsAllowed; + public static final String SERIALIZED_NAME_IS_SPOT_TRADING_ALLOWED = "isSpotTradingAllowed"; @SerializedName(SERIALIZED_NAME_IS_SPOT_TRADING_ALLOWED) @@ -541,6 +547,27 @@ public void setAmendAllowed(@jakarta.annotation.Nullable Boolean amendAllowed) { this.amendAllowed = amendAllowed; } + public ExchangeInfoResponseSymbolsInner pegInstructionsAllowed( + @jakarta.annotation.Nullable Boolean pegInstructionsAllowed) { + this.pegInstructionsAllowed = pegInstructionsAllowed; + return this; + } + + /** + * Get pegInstructionsAllowed + * + * @return pegInstructionsAllowed + */ + @jakarta.annotation.Nullable + public Boolean getPegInstructionsAllowed() { + return pegInstructionsAllowed; + } + + public void setPegInstructionsAllowed( + @jakarta.annotation.Nullable Boolean pegInstructionsAllowed) { + this.pegInstructionsAllowed = pegInstructionsAllowed; + } + public ExchangeInfoResponseSymbolsInner isSpotTradingAllowed( @jakarta.annotation.Nullable Boolean isSpotTradingAllowed) { this.isSpotTradingAllowed = isSpotTradingAllowed; @@ -753,6 +780,9 @@ public boolean equals(Object o) { this.cancelReplaceAllowed, exchangeInfoResponseSymbolsInner.cancelReplaceAllowed) && Objects.equals(this.amendAllowed, exchangeInfoResponseSymbolsInner.amendAllowed) + && Objects.equals( + this.pegInstructionsAllowed, + exchangeInfoResponseSymbolsInner.pegInstructionsAllowed) && Objects.equals( this.isSpotTradingAllowed, exchangeInfoResponseSymbolsInner.isSpotTradingAllowed) @@ -791,6 +821,7 @@ public int hashCode() { allowTrailingStop, cancelReplaceAllowed, amendAllowed, + pegInstructionsAllowed, isSpotTradingAllowed, isMarginTradingAllowed, filters, @@ -833,6 +864,9 @@ public String toString() { .append(toIndentedString(cancelReplaceAllowed)) .append("\n"); sb.append(" amendAllowed: ").append(toIndentedString(amendAllowed)).append("\n"); + sb.append(" pegInstructionsAllowed: ") + .append(toIndentedString(pegInstructionsAllowed)) + .append("\n"); sb.append(" isSpotTradingAllowed: ") .append(toIndentedString(isSpotTradingAllowed)) .append("\n"); @@ -940,6 +974,12 @@ public String toUrlQueryString() { String amendAllowedValueAsString = ""; amendAllowedValueAsString = amendAllowedValue.toString(); sb.append("amendAllowed=").append(urlEncode(amendAllowedValueAsString)).append(""); + Object pegInstructionsAllowedValue = getPegInstructionsAllowed(); + String pegInstructionsAllowedValueAsString = ""; + pegInstructionsAllowedValueAsString = pegInstructionsAllowedValue.toString(); + sb.append("pegInstructionsAllowed=") + .append(urlEncode(pegInstructionsAllowedValueAsString)) + .append(""); Object isSpotTradingAllowedValue = getIsSpotTradingAllowed(); String isSpotTradingAllowedValueAsString = ""; isSpotTradingAllowedValueAsString = isSpotTradingAllowedValue.toString(); @@ -1031,6 +1071,7 @@ private String toIndentedString(Object o) { openapiFields.add("allowTrailingStop"); openapiFields.add("cancelReplaceAllowed"); openapiFields.add("amendAllowed"); + openapiFields.add("pegInstructionsAllowed"); openapiFields.add("isSpotTradingAllowed"); openapiFields.add("isMarginTradingAllowed"); openapiFields.add("filters"); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderRequest.java index 7a883127..163ac1e1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderRequest.java @@ -128,6 +128,24 @@ public class NewOrderRequest { @jakarta.annotation.Nullable private SelfTradePreventionMode selfTradePreventionMode; + public static final String SERIALIZED_NAME_PEG_PRICE_TYPE = "pegPriceType"; + + @SerializedName(SERIALIZED_NAME_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PegPriceType pegPriceType; + + public static final String SERIALIZED_NAME_PEG_OFFSET_VALUE = "pegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pegOffsetValue; + + public static final String SERIALIZED_NAME_PEG_OFFSET_TYPE = "pegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PegOffsetType pegOffsetType; + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -438,6 +456,65 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } + public NewOrderRequest pegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + return this; + } + + /** + * Get pegPriceType + * + * @return pegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PegPriceType getPegPriceType() { + return pegPriceType; + } + + public void setPegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + } + + public NewOrderRequest pegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + return this; + } + + /** + * Get pegOffsetValue + * + * @return pegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPegOffsetValue() { + return pegOffsetValue; + } + + public void setPegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + } + + public NewOrderRequest pegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + return this; + } + + /** + * Get pegOffsetType + * + * @return pegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PegOffsetType getPegOffsetType() { + return pegOffsetType; + } + + public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + } + public NewOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -482,6 +559,9 @@ public boolean equals(Object o) { && Objects.equals(this.newOrderRespType, newOrderRequest.newOrderRespType) && Objects.equals( this.selfTradePreventionMode, newOrderRequest.selfTradePreventionMode) + && Objects.equals(this.pegPriceType, newOrderRequest.pegPriceType) + && Objects.equals(this.pegOffsetValue, newOrderRequest.pegOffsetValue) + && Objects.equals(this.pegOffsetType, newOrderRequest.pegOffsetType) && Objects.equals(this.recvWindow, newOrderRequest.recvWindow); } @@ -503,6 +583,9 @@ public int hashCode() { icebergQty, newOrderRespType, selfTradePreventionMode, + pegPriceType, + pegOffsetValue, + pegOffsetType, recvWindow); } @@ -527,6 +610,9 @@ public String toString() { sb.append(" selfTradePreventionMode: ") .append(toIndentedString(selfTradePreventionMode)) .append("\n"); + sb.append(" pegPriceType: ").append(toIndentedString(pegPriceType)).append("\n"); + sb.append(" pegOffsetValue: ").append(toIndentedString(pegOffsetValue)).append("\n"); + sb.append(" pegOffsetType: ").append(toIndentedString(pegOffsetType)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -597,6 +683,18 @@ public String toUrlQueryString() { sb.append("selfTradePreventionMode=") .append(urlEncode(selfTradePreventionModeValueAsString)) .append(""); + Object pegPriceTypeValue = getPegPriceType(); + String pegPriceTypeValueAsString = ""; + pegPriceTypeValueAsString = pegPriceTypeValue.toString(); + sb.append("pegPriceType=").append(urlEncode(pegPriceTypeValueAsString)).append(""); + Object pegOffsetValueValue = getPegOffsetValue(); + String pegOffsetValueValueAsString = ""; + pegOffsetValueValueAsString = pegOffsetValueValue.toString(); + sb.append("pegOffsetValue=").append(urlEncode(pegOffsetValueValueAsString)).append(""); + Object pegOffsetTypeValue = getPegOffsetType(); + String pegOffsetTypeValueAsString = ""; + pegOffsetTypeValueAsString = pegOffsetTypeValue.toString(); + sb.append("pegOffsetType=").append(urlEncode(pegOffsetTypeValueAsString)).append(""); Object recvWindowValue = getRecvWindow(); String recvWindowValueAsString = ""; recvWindowValueAsString = recvWindowValue.toString(); @@ -644,6 +742,9 @@ private String toIndentedString(Object o) { openapiFields.add("icebergQty"); openapiFields.add("newOrderRespType"); openapiFields.add("selfTradePreventionMode"); + openapiFields.add("pegPriceType"); + openapiFields.add("pegOffsetValue"); + openapiFields.add("pegOffsetType"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -715,6 +816,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { SelfTradePreventionMode.validateJsonElement(jsonObj.get("selfTradePreventionMode")); } + // validate the optional field `pegPriceType` + if (jsonObj.get("pegPriceType") != null && !jsonObj.get("pegPriceType").isJsonNull()) { + PegPriceType.validateJsonElement(jsonObj.get("pegPriceType")); + } + // validate the optional field `pegOffsetType` + if (jsonObj.get("pegOffsetType") != null && !jsonObj.get("pegOffsetType").isJsonNull()) { + PegOffsetType.validateJsonElement(jsonObj.get("pegOffsetType")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceRequest.java index 2fa2e7cf..15343af3 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceRequest.java @@ -167,6 +167,24 @@ public class OrderCancelReplaceRequest { @jakarta.annotation.Nullable private OrderRateLimitExceededMode orderRateLimitExceededMode; + public static final String SERIALIZED_NAME_PEG_PRICE_TYPE = "pegPriceType"; + + @SerializedName(SERIALIZED_NAME_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PegPriceType pegPriceType; + + public static final String SERIALIZED_NAME_PEG_OFFSET_VALUE = "pegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pegOffsetValue; + + public static final String SERIALIZED_NAME_PEG_OFFSET_TYPE = "pegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PegOffsetType pegOffsetType; + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -611,6 +629,68 @@ public void setOrderRateLimitExceededMode( this.orderRateLimitExceededMode = orderRateLimitExceededMode; } + public OrderCancelReplaceRequest pegPriceType( + @jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + return this; + } + + /** + * Get pegPriceType + * + * @return pegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PegPriceType getPegPriceType() { + return pegPriceType; + } + + public void setPegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + } + + public OrderCancelReplaceRequest pegOffsetValue( + @jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + return this; + } + + /** + * Get pegOffsetValue + * + * @return pegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPegOffsetValue() { + return pegOffsetValue; + } + + public void setPegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + } + + public OrderCancelReplaceRequest pegOffsetType( + @jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + return this; + } + + /** + * Get pegOffsetType + * + * @return pegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PegOffsetType getPegOffsetType() { + return pegOffsetType; + } + + public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + } + public OrderCancelReplaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -670,6 +750,9 @@ public boolean equals(Object o) { && Objects.equals( this.orderRateLimitExceededMode, orderCancelReplaceRequest.orderRateLimitExceededMode) + && Objects.equals(this.pegPriceType, orderCancelReplaceRequest.pegPriceType) + && Objects.equals(this.pegOffsetValue, orderCancelReplaceRequest.pegOffsetValue) + && Objects.equals(this.pegOffsetType, orderCancelReplaceRequest.pegOffsetType) && Objects.equals(this.recvWindow, orderCancelReplaceRequest.recvWindow); } @@ -697,6 +780,9 @@ public int hashCode() { selfTradePreventionMode, cancelRestrictions, orderRateLimitExceededMode, + pegPriceType, + pegOffsetValue, + pegOffsetType, recvWindow); } @@ -735,6 +821,9 @@ public String toString() { sb.append(" orderRateLimitExceededMode: ") .append(toIndentedString(orderRateLimitExceededMode)) .append("\n"); + sb.append(" pegPriceType: ").append(toIndentedString(pegPriceType)).append("\n"); + sb.append(" pegOffsetValue: ").append(toIndentedString(pegOffsetValue)).append("\n"); + sb.append(" pegOffsetType: ").append(toIndentedString(pegOffsetType)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -839,6 +928,18 @@ public String toUrlQueryString() { sb.append("orderRateLimitExceededMode=") .append(urlEncode(orderRateLimitExceededModeValueAsString)) .append(""); + Object pegPriceTypeValue = getPegPriceType(); + String pegPriceTypeValueAsString = ""; + pegPriceTypeValueAsString = pegPriceTypeValue.toString(); + sb.append("pegPriceType=").append(urlEncode(pegPriceTypeValueAsString)).append(""); + Object pegOffsetValueValue = getPegOffsetValue(); + String pegOffsetValueValueAsString = ""; + pegOffsetValueValueAsString = pegOffsetValueValue.toString(); + sb.append("pegOffsetValue=").append(urlEncode(pegOffsetValueValueAsString)).append(""); + Object pegOffsetTypeValue = getPegOffsetType(); + String pegOffsetTypeValueAsString = ""; + pegOffsetTypeValueAsString = pegOffsetTypeValue.toString(); + sb.append("pegOffsetType=").append(urlEncode(pegOffsetTypeValueAsString)).append(""); Object recvWindowValue = getRecvWindow(); String recvWindowValueAsString = ""; recvWindowValueAsString = recvWindowValue.toString(); @@ -892,6 +993,9 @@ private String toIndentedString(Object o) { openapiFields.add("selfTradePreventionMode"); openapiFields.add("cancelRestrictions"); openapiFields.add("orderRateLimitExceededMode"); + openapiFields.add("pegPriceType"); + openapiFields.add("pegOffsetValue"); + openapiFields.add("pegOffsetType"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -995,6 +1099,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderRateLimitExceededMode.validateJsonElement( jsonObj.get("orderRateLimitExceededMode")); } + // validate the optional field `pegPriceType` + if (jsonObj.get("pegPriceType") != null && !jsonObj.get("pegPriceType").isJsonNull()) { + PegPriceType.validateJsonElement(jsonObj.get("pegPriceType")); + } + // validate the optional field `pegOffsetType` + if (jsonObj.get("pegOffsetType") != null && !jsonObj.get("pegOffsetType").isJsonNull()) { + PegOffsetType.validateJsonElement(jsonObj.get("pegOffsetType")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoRequest.java index 24dfc3a2..f5cbe923 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoRequest.java @@ -115,6 +115,24 @@ public class OrderListOcoRequest { @jakarta.annotation.Nullable private Integer aboveStrategyType; + public static final String SERIALIZED_NAME_ABOVE_PEG_PRICE_TYPE = "abovePegPriceType"; + + @SerializedName(SERIALIZED_NAME_ABOVE_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private AbovePegPriceType abovePegPriceType; + + public static final String SERIALIZED_NAME_ABOVE_PEG_OFFSET_TYPE = "abovePegOffsetType"; + + @SerializedName(SERIALIZED_NAME_ABOVE_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private AbovePegOffsetType abovePegOffsetType; + + public static final String SERIALIZED_NAME_ABOVE_PEG_OFFSET_VALUE = "abovePegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_ABOVE_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer abovePegOffsetValue; + public static final String SERIALIZED_NAME_BELOW_TYPE = "belowType"; @SerializedName(SERIALIZED_NAME_BELOW_TYPE) @@ -169,6 +187,24 @@ public class OrderListOcoRequest { @jakarta.annotation.Nullable private Integer belowStrategyType; + public static final String SERIALIZED_NAME_BELOW_PEG_PRICE_TYPE = "belowPegPriceType"; + + @SerializedName(SERIALIZED_NAME_BELOW_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private BelowPegPriceType belowPegPriceType; + + public static final String SERIALIZED_NAME_BELOW_PEG_OFFSET_TYPE = "belowPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_BELOW_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private BelowPegOffsetType belowPegOffsetType; + + public static final String SERIALIZED_NAME_BELOW_PEG_OFFSET_VALUE = "belowPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_BELOW_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer belowPegOffsetValue; + public static final String SERIALIZED_NAME_NEW_ORDER_RESP_TYPE = "newOrderRespType"; @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESP_TYPE) @@ -452,6 +488,70 @@ public void setAboveStrategyType(@jakarta.annotation.Nullable Integer aboveStrat this.aboveStrategyType = aboveStrategyType; } + public OrderListOcoRequest abovePegPriceType( + @jakarta.annotation.Nullable AbovePegPriceType abovePegPriceType) { + this.abovePegPriceType = abovePegPriceType; + return this; + } + + /** + * Get abovePegPriceType + * + * @return abovePegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public AbovePegPriceType getAbovePegPriceType() { + return abovePegPriceType; + } + + public void setAbovePegPriceType( + @jakarta.annotation.Nullable AbovePegPriceType abovePegPriceType) { + this.abovePegPriceType = abovePegPriceType; + } + + public OrderListOcoRequest abovePegOffsetType( + @jakarta.annotation.Nullable AbovePegOffsetType abovePegOffsetType) { + this.abovePegOffsetType = abovePegOffsetType; + return this; + } + + /** + * Get abovePegOffsetType + * + * @return abovePegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public AbovePegOffsetType getAbovePegOffsetType() { + return abovePegOffsetType; + } + + public void setAbovePegOffsetType( + @jakarta.annotation.Nullable AbovePegOffsetType abovePegOffsetType) { + this.abovePegOffsetType = abovePegOffsetType; + } + + public OrderListOcoRequest abovePegOffsetValue( + @jakarta.annotation.Nullable Integer abovePegOffsetValue) { + this.abovePegOffsetValue = abovePegOffsetValue; + return this; + } + + /** + * Get abovePegOffsetValue + * + * @return abovePegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getAbovePegOffsetValue() { + return abovePegOffsetValue; + } + + public void setAbovePegOffsetValue(@jakarta.annotation.Nullable Integer abovePegOffsetValue) { + this.abovePegOffsetValue = abovePegOffsetValue; + } + public OrderListOcoRequest belowType(@jakarta.annotation.Nonnull BelowType belowType) { this.belowType = belowType; return this; @@ -633,6 +733,70 @@ public void setBelowStrategyType(@jakarta.annotation.Nullable Integer belowStrat this.belowStrategyType = belowStrategyType; } + public OrderListOcoRequest belowPegPriceType( + @jakarta.annotation.Nullable BelowPegPriceType belowPegPriceType) { + this.belowPegPriceType = belowPegPriceType; + return this; + } + + /** + * Get belowPegPriceType + * + * @return belowPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public BelowPegPriceType getBelowPegPriceType() { + return belowPegPriceType; + } + + public void setBelowPegPriceType( + @jakarta.annotation.Nullable BelowPegPriceType belowPegPriceType) { + this.belowPegPriceType = belowPegPriceType; + } + + public OrderListOcoRequest belowPegOffsetType( + @jakarta.annotation.Nullable BelowPegOffsetType belowPegOffsetType) { + this.belowPegOffsetType = belowPegOffsetType; + return this; + } + + /** + * Get belowPegOffsetType + * + * @return belowPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public BelowPegOffsetType getBelowPegOffsetType() { + return belowPegOffsetType; + } + + public void setBelowPegOffsetType( + @jakarta.annotation.Nullable BelowPegOffsetType belowPegOffsetType) { + this.belowPegOffsetType = belowPegOffsetType; + } + + public OrderListOcoRequest belowPegOffsetValue( + @jakarta.annotation.Nullable Integer belowPegOffsetValue) { + this.belowPegOffsetValue = belowPegOffsetValue; + return this; + } + + /** + * Get belowPegOffsetValue + * + * @return belowPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getBelowPegOffsetValue() { + return belowPegOffsetValue; + } + + public void setBelowPegOffsetValue(@jakarta.annotation.Nullable Integer belowPegOffsetValue) { + this.belowPegOffsetValue = belowPegOffsetValue; + } + public OrderListOcoRequest newOrderRespType( @jakarta.annotation.Nullable NewOrderRespType newOrderRespType) { this.newOrderRespType = newOrderRespType; @@ -718,6 +882,9 @@ public boolean equals(Object o) { && Objects.equals(this.aboveTimeInForce, orderListOcoRequest.aboveTimeInForce) && Objects.equals(this.aboveStrategyId, orderListOcoRequest.aboveStrategyId) && Objects.equals(this.aboveStrategyType, orderListOcoRequest.aboveStrategyType) + && Objects.equals(this.abovePegPriceType, orderListOcoRequest.abovePegPriceType) + && Objects.equals(this.abovePegOffsetType, orderListOcoRequest.abovePegOffsetType) + && Objects.equals(this.abovePegOffsetValue, orderListOcoRequest.abovePegOffsetValue) && Objects.equals(this.belowType, orderListOcoRequest.belowType) && Objects.equals(this.belowClientOrderId, orderListOcoRequest.belowClientOrderId) && Objects.equals(this.belowIcebergQty, orderListOcoRequest.belowIcebergQty) @@ -727,6 +894,9 @@ public boolean equals(Object o) { && Objects.equals(this.belowTimeInForce, orderListOcoRequest.belowTimeInForce) && Objects.equals(this.belowStrategyId, orderListOcoRequest.belowStrategyId) && Objects.equals(this.belowStrategyType, orderListOcoRequest.belowStrategyType) + && Objects.equals(this.belowPegPriceType, orderListOcoRequest.belowPegPriceType) + && Objects.equals(this.belowPegOffsetType, orderListOcoRequest.belowPegOffsetType) + && Objects.equals(this.belowPegOffsetValue, orderListOcoRequest.belowPegOffsetValue) && Objects.equals(this.newOrderRespType, orderListOcoRequest.newOrderRespType) && Objects.equals( this.selfTradePreventionMode, orderListOcoRequest.selfTradePreventionMode) @@ -749,6 +919,9 @@ public int hashCode() { aboveTimeInForce, aboveStrategyId, aboveStrategyType, + abovePegPriceType, + abovePegOffsetType, + abovePegOffsetValue, belowType, belowClientOrderId, belowIcebergQty, @@ -758,6 +931,9 @@ public int hashCode() { belowTimeInForce, belowStrategyId, belowStrategyType, + belowPegPriceType, + belowPegOffsetType, + belowPegOffsetValue, newOrderRespType, selfTradePreventionMode, recvWindow); @@ -784,6 +960,13 @@ public String toString() { sb.append(" aboveTimeInForce: ").append(toIndentedString(aboveTimeInForce)).append("\n"); sb.append(" aboveStrategyId: ").append(toIndentedString(aboveStrategyId)).append("\n"); sb.append(" aboveStrategyType: ").append(toIndentedString(aboveStrategyType)).append("\n"); + sb.append(" abovePegPriceType: ").append(toIndentedString(abovePegPriceType)).append("\n"); + sb.append(" abovePegOffsetType: ") + .append(toIndentedString(abovePegOffsetType)) + .append("\n"); + sb.append(" abovePegOffsetValue: ") + .append(toIndentedString(abovePegOffsetValue)) + .append("\n"); sb.append(" belowType: ").append(toIndentedString(belowType)).append("\n"); sb.append(" belowClientOrderId: ") .append(toIndentedString(belowClientOrderId)) @@ -797,6 +980,13 @@ public String toString() { sb.append(" belowTimeInForce: ").append(toIndentedString(belowTimeInForce)).append("\n"); sb.append(" belowStrategyId: ").append(toIndentedString(belowStrategyId)).append("\n"); sb.append(" belowStrategyType: ").append(toIndentedString(belowStrategyType)).append("\n"); + sb.append(" belowPegPriceType: ").append(toIndentedString(belowPegPriceType)).append("\n"); + sb.append(" belowPegOffsetType: ") + .append(toIndentedString(belowPegOffsetType)) + .append("\n"); + sb.append(" belowPegOffsetValue: ") + .append(toIndentedString(belowPegOffsetValue)) + .append("\n"); sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); sb.append(" selfTradePreventionMode: ") .append(toIndentedString(selfTradePreventionMode)) @@ -869,6 +1059,24 @@ public String toUrlQueryString() { sb.append("aboveStrategyType=") .append(urlEncode(aboveStrategyTypeValueAsString)) .append(""); + Object abovePegPriceTypeValue = getAbovePegPriceType(); + String abovePegPriceTypeValueAsString = ""; + abovePegPriceTypeValueAsString = abovePegPriceTypeValue.toString(); + sb.append("abovePegPriceType=") + .append(urlEncode(abovePegPriceTypeValueAsString)) + .append(""); + Object abovePegOffsetTypeValue = getAbovePegOffsetType(); + String abovePegOffsetTypeValueAsString = ""; + abovePegOffsetTypeValueAsString = abovePegOffsetTypeValue.toString(); + sb.append("abovePegOffsetType=") + .append(urlEncode(abovePegOffsetTypeValueAsString)) + .append(""); + Object abovePegOffsetValueValue = getAbovePegOffsetValue(); + String abovePegOffsetValueValueAsString = ""; + abovePegOffsetValueValueAsString = abovePegOffsetValueValue.toString(); + sb.append("abovePegOffsetValue=") + .append(urlEncode(abovePegOffsetValueValueAsString)) + .append(""); Object belowTypeValue = getBelowType(); String belowTypeValueAsString = ""; belowTypeValueAsString = belowTypeValue.toString(); @@ -911,6 +1119,24 @@ public String toUrlQueryString() { sb.append("belowStrategyType=") .append(urlEncode(belowStrategyTypeValueAsString)) .append(""); + Object belowPegPriceTypeValue = getBelowPegPriceType(); + String belowPegPriceTypeValueAsString = ""; + belowPegPriceTypeValueAsString = belowPegPriceTypeValue.toString(); + sb.append("belowPegPriceType=") + .append(urlEncode(belowPegPriceTypeValueAsString)) + .append(""); + Object belowPegOffsetTypeValue = getBelowPegOffsetType(); + String belowPegOffsetTypeValueAsString = ""; + belowPegOffsetTypeValueAsString = belowPegOffsetTypeValue.toString(); + sb.append("belowPegOffsetType=") + .append(urlEncode(belowPegOffsetTypeValueAsString)) + .append(""); + Object belowPegOffsetValueValue = getBelowPegOffsetValue(); + String belowPegOffsetValueValueAsString = ""; + belowPegOffsetValueValueAsString = belowPegOffsetValueValue.toString(); + sb.append("belowPegOffsetValue=") + .append(urlEncode(belowPegOffsetValueValueAsString)) + .append(""); Object newOrderRespTypeValue = getNewOrderRespType(); String newOrderRespTypeValueAsString = ""; newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); @@ -966,6 +1192,9 @@ private String toIndentedString(Object o) { openapiFields.add("aboveTimeInForce"); openapiFields.add("aboveStrategyId"); openapiFields.add("aboveStrategyType"); + openapiFields.add("abovePegPriceType"); + openapiFields.add("abovePegOffsetType"); + openapiFields.add("abovePegOffsetValue"); openapiFields.add("belowType"); openapiFields.add("belowClientOrderId"); openapiFields.add("belowIcebergQty"); @@ -975,6 +1204,9 @@ private String toIndentedString(Object o) { openapiFields.add("belowTimeInForce"); openapiFields.add("belowStrategyId"); openapiFields.add("belowStrategyType"); + openapiFields.add("belowPegPriceType"); + openapiFields.add("belowPegOffsetType"); + openapiFields.add("belowPegOffsetValue"); openapiFields.add("newOrderRespType"); openapiFields.add("selfTradePreventionMode"); openapiFields.add("recvWindow"); @@ -1045,6 +1277,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("aboveClientOrderId").toString())); } + // validate the optional field `abovePegPriceType` + if (jsonObj.get("abovePegPriceType") != null + && !jsonObj.get("abovePegPriceType").isJsonNull()) { + AbovePegPriceType.validateJsonElement(jsonObj.get("abovePegPriceType")); + } + // validate the optional field `abovePegOffsetType` + if (jsonObj.get("abovePegOffsetType") != null + && !jsonObj.get("abovePegOffsetType").isJsonNull()) { + AbovePegOffsetType.validateJsonElement(jsonObj.get("abovePegOffsetType")); + } // validate the required field `belowType` BelowType.validateJsonElement(jsonObj.get("belowType")); if ((jsonObj.get("belowClientOrderId") != null @@ -1061,6 +1303,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("belowTimeInForce").isJsonNull()) { BelowTimeInForce.validateJsonElement(jsonObj.get("belowTimeInForce")); } + // validate the optional field `belowPegPriceType` + if (jsonObj.get("belowPegPriceType") != null + && !jsonObj.get("belowPegPriceType").isJsonNull()) { + BelowPegPriceType.validateJsonElement(jsonObj.get("belowPegPriceType")); + } + // validate the optional field `belowPegOffsetType` + if (jsonObj.get("belowPegOffsetType") != null + && !jsonObj.get("belowPegOffsetType").isJsonNull()) { + BelowPegOffsetType.validateJsonElement(jsonObj.get("belowPegOffsetType")); + } // validate the optional field `newOrderRespType` if (jsonObj.get("newOrderRespType") != null && !jsonObj.get("newOrderRespType").isJsonNull()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoRequest.java index 9d6756f7..cbe56d0d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoRequest.java @@ -116,6 +116,24 @@ public class OrderListOtoRequest { @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) @@ -182,6 +200,24 @@ public class OrderListOtoRequest { @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) @@ -461,6 +497,71 @@ public void setWorkingStrategyType(@jakarta.annotation.Nullable Integer workingS this.workingStrategyType = workingStrategyType; } + public OrderListOtoRequest 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 OrderListOtoRequest 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 OrderListOtoRequest 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 OrderListOtoRequest pendingType(@jakarta.annotation.Nonnull PendingType pendingType) { this.pendingType = pendingType; return this; @@ -689,6 +790,71 @@ public void setPendingStrategyType(@jakarta.annotation.Nullable Integer pendingS this.pendingStrategyType = pendingStrategyType; } + public OrderListOtoRequest 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 OrderListOtoRequest 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 OrderListOtoRequest 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 OrderListOtoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -732,6 +898,11 @@ public boolean equals(Object o) { && Objects.equals(this.workingTimeInForce, orderListOtoRequest.workingTimeInForce) && Objects.equals(this.workingStrategyId, orderListOtoRequest.workingStrategyId) && Objects.equals(this.workingStrategyType, orderListOtoRequest.workingStrategyType) + && Objects.equals(this.workingPegPriceType, orderListOtoRequest.workingPegPriceType) + && Objects.equals( + this.workingPegOffsetType, orderListOtoRequest.workingPegOffsetType) + && Objects.equals( + this.workingPegOffsetValue, orderListOtoRequest.workingPegOffsetValue) && Objects.equals(this.pendingType, orderListOtoRequest.pendingType) && Objects.equals(this.pendingSide, orderListOtoRequest.pendingSide) && Objects.equals( @@ -745,6 +916,11 @@ public boolean equals(Object o) { && Objects.equals(this.pendingTimeInForce, orderListOtoRequest.pendingTimeInForce) && Objects.equals(this.pendingStrategyId, orderListOtoRequest.pendingStrategyId) && Objects.equals(this.pendingStrategyType, orderListOtoRequest.pendingStrategyType) + && Objects.equals(this.pendingPegPriceType, orderListOtoRequest.pendingPegPriceType) + && Objects.equals( + this.pendingPegOffsetType, orderListOtoRequest.pendingPegOffsetType) + && Objects.equals( + this.pendingPegOffsetValue, orderListOtoRequest.pendingPegOffsetValue) && Objects.equals(this.recvWindow, orderListOtoRequest.recvWindow); } @@ -764,6 +940,9 @@ public int hashCode() { workingTimeInForce, workingStrategyId, workingStrategyType, + workingPegPriceType, + workingPegOffsetType, + workingPegOffsetValue, pendingType, pendingSide, pendingClientOrderId, @@ -775,6 +954,9 @@ public int hashCode() { pendingTimeInForce, pendingStrategyId, pendingStrategyType, + pendingPegPriceType, + pendingPegOffsetType, + pendingPegOffsetValue, recvWindow); } @@ -803,6 +985,15 @@ public String toString() { 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: ") @@ -822,6 +1013,15 @@ public String toString() { 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(); @@ -896,6 +1096,24 @@ public String toUrlQueryString() { 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(); @@ -952,6 +1170,24 @@ public String toUrlQueryString() { 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(); @@ -997,6 +1233,9 @@ private String toIndentedString(Object o) { 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"); @@ -1008,6 +1247,9 @@ private String toIndentedString(Object o) { 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) @@ -1094,6 +1336,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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` @@ -1112,6 +1364,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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 { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoRequest.java index d98a8b0e..953ae947 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoRequest.java @@ -116,6 +116,24 @@ public class OrderListOtocoRequest { @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) @@ -186,6 +204,27 @@ public class OrderListOtocoRequest { @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) @@ -244,6 +283,27 @@ public class OrderListOtocoRequest { @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) @@ -524,6 +584,71 @@ public void setWorkingStrategyType(@jakarta.annotation.Nullable Integer workingS this.workingStrategyType = workingStrategyType; } + public OrderListOtocoRequest 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 OrderListOtocoRequest 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 OrderListOtocoRequest 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 OrderListOtocoRequest pendingSide(@jakarta.annotation.Nonnull PendingSide pendingSide) { this.pendingSide = pendingSide; return this; @@ -761,6 +886,71 @@ public void setPendingAboveStrategyType( this.pendingAboveStrategyType = pendingAboveStrategyType; } + public OrderListOtocoRequest 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 OrderListOtocoRequest 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 OrderListOtocoRequest 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 OrderListOtocoRequest pendingBelowType( @jakarta.annotation.Nullable PendingBelowType pendingBelowType) { this.pendingBelowType = pendingBelowType; @@ -955,6 +1145,71 @@ public void setPendingBelowStrategyType( this.pendingBelowStrategyType = pendingBelowStrategyType; } + public OrderListOtocoRequest 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 OrderListOtocoRequest 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 OrderListOtocoRequest 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 OrderListOtocoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -999,6 +1254,12 @@ public boolean equals(Object o) { && Objects.equals(this.workingStrategyId, orderListOtocoRequest.workingStrategyId) && Objects.equals( this.workingStrategyType, orderListOtocoRequest.workingStrategyType) + && Objects.equals( + this.workingPegPriceType, orderListOtocoRequest.workingPegPriceType) + && Objects.equals( + this.workingPegOffsetType, orderListOtocoRequest.workingPegOffsetType) + && Objects.equals( + this.workingPegOffsetValue, orderListOtocoRequest.workingPegOffsetValue) && Objects.equals(this.pendingSide, orderListOtocoRequest.pendingSide) && Objects.equals(this.pendingQuantity, orderListOtocoRequest.pendingQuantity) && Objects.equals(this.pendingAboveType, orderListOtocoRequest.pendingAboveType) @@ -1020,6 +1281,15 @@ public boolean equals(Object o) { && Objects.equals( this.pendingAboveStrategyType, orderListOtocoRequest.pendingAboveStrategyType) + && Objects.equals( + this.pendingAbovePegPriceType, + orderListOtocoRequest.pendingAbovePegPriceType) + && Objects.equals( + this.pendingAbovePegOffsetType, + orderListOtocoRequest.pendingAbovePegOffsetType) + && Objects.equals( + this.pendingAbovePegOffsetValue, + orderListOtocoRequest.pendingAbovePegOffsetValue) && Objects.equals(this.pendingBelowType, orderListOtocoRequest.pendingBelowType) && Objects.equals( this.pendingBelowClientOrderId, @@ -1039,6 +1309,15 @@ public boolean equals(Object o) { && Objects.equals( this.pendingBelowStrategyType, orderListOtocoRequest.pendingBelowStrategyType) + && Objects.equals( + this.pendingBelowPegPriceType, + orderListOtocoRequest.pendingBelowPegPriceType) + && Objects.equals( + this.pendingBelowPegOffsetType, + orderListOtocoRequest.pendingBelowPegOffsetType) + && Objects.equals( + this.pendingBelowPegOffsetValue, + orderListOtocoRequest.pendingBelowPegOffsetValue) && Objects.equals(this.recvWindow, orderListOtocoRequest.recvWindow); } @@ -1058,6 +1337,9 @@ public int hashCode() { workingTimeInForce, workingStrategyId, workingStrategyType, + workingPegPriceType, + workingPegOffsetType, + workingPegOffsetValue, pendingSide, pendingQuantity, pendingAboveType, @@ -1069,6 +1351,9 @@ public int hashCode() { pendingAboveTimeInForce, pendingAboveStrategyId, pendingAboveStrategyType, + pendingAbovePegPriceType, + pendingAbovePegOffsetType, + pendingAbovePegOffsetValue, pendingBelowType, pendingBelowClientOrderId, pendingBelowPrice, @@ -1078,6 +1363,9 @@ public int hashCode() { pendingBelowTimeInForce, pendingBelowStrategyId, pendingBelowStrategyType, + pendingBelowPegPriceType, + pendingBelowPegOffsetType, + pendingBelowPegOffsetValue, recvWindow); } @@ -1106,6 +1394,15 @@ public String toString() { 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(" pendingQuantity: ").append(toIndentedString(pendingQuantity)).append("\n"); sb.append(" pendingAboveType: ").append(toIndentedString(pendingAboveType)).append("\n"); @@ -1131,6 +1428,15 @@ public String toString() { 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)) @@ -1154,6 +1460,15 @@ public String toString() { 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(); @@ -1228,6 +1543,24 @@ public String toUrlQueryString() { 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(); @@ -1288,6 +1621,24 @@ public String toUrlQueryString() { 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(); @@ -1340,6 +1691,24 @@ public String toUrlQueryString() { 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(); @@ -1385,6 +1754,9 @@ private String toIndentedString(Object o) { openapiFields.add("workingTimeInForce"); openapiFields.add("workingStrategyId"); openapiFields.add("workingStrategyType"); + openapiFields.add("workingPegPriceType"); + openapiFields.add("workingPegOffsetType"); + openapiFields.add("workingPegOffsetValue"); openapiFields.add("pendingSide"); openapiFields.add("pendingQuantity"); openapiFields.add("pendingAboveType"); @@ -1396,6 +1768,9 @@ private String toIndentedString(Object o) { 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"); @@ -1405,6 +1780,9 @@ private String toIndentedString(Object o) { 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) @@ -1491,6 +1869,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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` @@ -1509,6 +1897,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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()) { @@ -1528,6 +1926,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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 { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestRequest.java index 475c16f6..cd6accca 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestRequest.java @@ -134,6 +134,24 @@ public class OrderTestRequest { @jakarta.annotation.Nullable private SelfTradePreventionMode selfTradePreventionMode; + public static final String SERIALIZED_NAME_PEG_PRICE_TYPE = "pegPriceType"; + + @SerializedName(SERIALIZED_NAME_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PegPriceType pegPriceType; + + public static final String SERIALIZED_NAME_PEG_OFFSET_VALUE = "pegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pegOffsetValue; + + public static final String SERIALIZED_NAME_PEG_OFFSET_TYPE = "pegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PegOffsetType pegOffsetType; + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -465,6 +483,66 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } + public OrderTestRequest pegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + return this; + } + + /** + * Get pegPriceType + * + * @return pegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PegPriceType getPegPriceType() { + return pegPriceType; + } + + public void setPegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + } + + public OrderTestRequest pegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + return this; + } + + /** + * Get pegOffsetValue + * + * @return pegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPegOffsetValue() { + return pegOffsetValue; + } + + public void setPegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + } + + public OrderTestRequest pegOffsetType( + @jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + return this; + } + + /** + * Get pegOffsetType + * + * @return pegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PegOffsetType getPegOffsetType() { + return pegOffsetType; + } + + public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + } + public OrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -510,6 +588,9 @@ public boolean equals(Object o) { && Objects.equals(this.newOrderRespType, orderTestRequest.newOrderRespType) && Objects.equals( this.selfTradePreventionMode, orderTestRequest.selfTradePreventionMode) + && Objects.equals(this.pegPriceType, orderTestRequest.pegPriceType) + && Objects.equals(this.pegOffsetValue, orderTestRequest.pegOffsetValue) + && Objects.equals(this.pegOffsetType, orderTestRequest.pegOffsetType) && Objects.equals(this.recvWindow, orderTestRequest.recvWindow); } @@ -532,6 +613,9 @@ public int hashCode() { icebergQty, newOrderRespType, selfTradePreventionMode, + pegPriceType, + pegOffsetValue, + pegOffsetType, recvWindow); } @@ -559,6 +643,9 @@ public String toString() { sb.append(" selfTradePreventionMode: ") .append(toIndentedString(selfTradePreventionMode)) .append("\n"); + sb.append(" pegPriceType: ").append(toIndentedString(pegPriceType)).append("\n"); + sb.append(" pegOffsetValue: ").append(toIndentedString(pegOffsetValue)).append("\n"); + sb.append(" pegOffsetType: ").append(toIndentedString(pegOffsetType)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -635,6 +722,18 @@ public String toUrlQueryString() { sb.append("selfTradePreventionMode=") .append(urlEncode(selfTradePreventionModeValueAsString)) .append(""); + Object pegPriceTypeValue = getPegPriceType(); + String pegPriceTypeValueAsString = ""; + pegPriceTypeValueAsString = pegPriceTypeValue.toString(); + sb.append("pegPriceType=").append(urlEncode(pegPriceTypeValueAsString)).append(""); + Object pegOffsetValueValue = getPegOffsetValue(); + String pegOffsetValueValueAsString = ""; + pegOffsetValueValueAsString = pegOffsetValueValue.toString(); + sb.append("pegOffsetValue=").append(urlEncode(pegOffsetValueValueAsString)).append(""); + Object pegOffsetTypeValue = getPegOffsetType(); + String pegOffsetTypeValueAsString = ""; + pegOffsetTypeValueAsString = pegOffsetTypeValue.toString(); + sb.append("pegOffsetType=").append(urlEncode(pegOffsetTypeValueAsString)).append(""); Object recvWindowValue = getRecvWindow(); String recvWindowValueAsString = ""; recvWindowValueAsString = recvWindowValue.toString(); @@ -683,6 +782,9 @@ private String toIndentedString(Object o) { openapiFields.add("icebergQty"); openapiFields.add("newOrderRespType"); openapiFields.add("selfTradePreventionMode"); + openapiFields.add("pegPriceType"); + openapiFields.add("pegOffsetValue"); + openapiFields.add("pegOffsetType"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -754,6 +856,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { SelfTradePreventionMode.validateJsonElement(jsonObj.get("selfTradePreventionMode")); } + // validate the optional field `pegPriceType` + if (jsonObj.get("pegPriceType") != null && !jsonObj.get("pegPriceType").isJsonNull()) { + PegPriceType.validateJsonElement(jsonObj.get("pegPriceType")); + } + // validate the optional field `pegOffsetType` + if (jsonObj.get("pegOffsetType") != null && !jsonObj.get("pegOffsetType").isJsonNull()) { + PegOffsetType.validateJsonElement(jsonObj.get("pegOffsetType")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponse.java index 6d7ddf92..9bb6d8db 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponse.java @@ -44,6 +44,13 @@ public class OrderTestResponse { @jakarta.annotation.Nullable private OrderTestResponseStandardCommissionForOrder standardCommissionForOrder; + public static final String SERIALIZED_NAME_SPECIAL_COMMISSION_FOR_ORDER = + "specialCommissionForOrder"; + + @SerializedName(SERIALIZED_NAME_SPECIAL_COMMISSION_FOR_ORDER) + @jakarta.annotation.Nullable + private OrderTestResponseSpecialCommissionForOrder specialCommissionForOrder; + public static final String SERIALIZED_NAME_TAX_COMMISSION_FOR_ORDER = "taxCommissionForOrder"; @SerializedName(SERIALIZED_NAME_TAX_COMMISSION_FOR_ORDER) @@ -82,6 +89,30 @@ public void setStandardCommissionForOrder( this.standardCommissionForOrder = standardCommissionForOrder; } + public OrderTestResponse specialCommissionForOrder( + @jakarta.annotation.Nullable + OrderTestResponseSpecialCommissionForOrder specialCommissionForOrder) { + this.specialCommissionForOrder = specialCommissionForOrder; + return this; + } + + /** + * Get specialCommissionForOrder + * + * @return specialCommissionForOrder + */ + @jakarta.annotation.Nullable + @Valid + public OrderTestResponseSpecialCommissionForOrder getSpecialCommissionForOrder() { + return specialCommissionForOrder; + } + + public void setSpecialCommissionForOrder( + @jakarta.annotation.Nullable + OrderTestResponseSpecialCommissionForOrder specialCommissionForOrder) { + this.specialCommissionForOrder = specialCommissionForOrder; + } + public OrderTestResponse taxCommissionForOrder( @jakarta.annotation.Nullable OrderTestResponseStandardCommissionForOrder taxCommissionForOrder) { @@ -139,6 +170,8 @@ public boolean equals(Object o) { return Objects.equals( this.standardCommissionForOrder, orderTestResponse.standardCommissionForOrder) + && Objects.equals( + this.specialCommissionForOrder, orderTestResponse.specialCommissionForOrder) && Objects.equals( this.taxCommissionForOrder, orderTestResponse.taxCommissionForOrder) && Objects.equals(this.discount, orderTestResponse.discount); @@ -146,7 +179,11 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(standardCommissionForOrder, taxCommissionForOrder, discount); + return Objects.hash( + standardCommissionForOrder, + specialCommissionForOrder, + taxCommissionForOrder, + discount); } @Override @@ -156,6 +193,9 @@ public String toString() { sb.append(" standardCommissionForOrder: ") .append(toIndentedString(standardCommissionForOrder)) .append("\n"); + sb.append(" specialCommissionForOrder: ") + .append(toIndentedString(specialCommissionForOrder)) + .append("\n"); sb.append(" taxCommissionForOrder: ") .append(toIndentedString(taxCommissionForOrder)) .append("\n"); @@ -173,6 +213,12 @@ public String toUrlQueryString() { sb.append("standardCommissionForOrder=") .append(urlEncode(standardCommissionForOrderValueAsString)) .append(""); + Object specialCommissionForOrderValue = getSpecialCommissionForOrder(); + String specialCommissionForOrderValueAsString = ""; + specialCommissionForOrderValueAsString = specialCommissionForOrderValue.toString(); + sb.append("specialCommissionForOrder=") + .append(urlEncode(specialCommissionForOrderValueAsString)) + .append(""); Object taxCommissionForOrderValue = getTaxCommissionForOrder(); String taxCommissionForOrderValueAsString = ""; taxCommissionForOrderValueAsString = taxCommissionForOrderValue.toString(); @@ -212,6 +258,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("standardCommissionForOrder"); + openapiFields.add("specialCommissionForOrder"); openapiFields.add("taxCommissionForOrder"); openapiFields.add("discount"); @@ -243,6 +290,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderTestResponseStandardCommissionForOrder.validateJsonElement( jsonObj.get("standardCommissionForOrder")); } + // validate the optional field `specialCommissionForOrder` + if (jsonObj.get("specialCommissionForOrder") != null + && !jsonObj.get("specialCommissionForOrder").isJsonNull()) { + OrderTestResponseSpecialCommissionForOrder.validateJsonElement( + jsonObj.get("specialCommissionForOrder")); + } // validate the optional field `taxCommissionForOrder` if (jsonObj.get("taxCommissionForOrder") != null && !jsonObj.get("taxCommissionForOrder").isJsonNull()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseSpecialCommissionForOrder.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseSpecialCommissionForOrder.java new file mode 100644 index 00000000..997a7e72 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseSpecialCommissionForOrder.java @@ -0,0 +1,264 @@ +/* + * 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.*; + +/** OrderTestResponseSpecialCommissionForOrder */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderTestResponseSpecialCommissionForOrder { + public static final String SERIALIZED_NAME_MAKER = "maker"; + + @SerializedName(SERIALIZED_NAME_MAKER) + @jakarta.annotation.Nullable + private String maker; + + public static final String SERIALIZED_NAME_TAKER = "taker"; + + @SerializedName(SERIALIZED_NAME_TAKER) + @jakarta.annotation.Nullable + private String taker; + + public OrderTestResponseSpecialCommissionForOrder() {} + + public OrderTestResponseSpecialCommissionForOrder maker( + @jakarta.annotation.Nullable String maker) { + this.maker = maker; + return this; + } + + /** + * Get maker + * + * @return maker + */ + @jakarta.annotation.Nullable + public String getMaker() { + return maker; + } + + public void setMaker(@jakarta.annotation.Nullable String maker) { + this.maker = maker; + } + + public OrderTestResponseSpecialCommissionForOrder taker( + @jakarta.annotation.Nullable String taker) { + this.taker = taker; + return this; + } + + /** + * Get taker + * + * @return taker + */ + @jakarta.annotation.Nullable + public String getTaker() { + return taker; + } + + public void setTaker(@jakarta.annotation.Nullable String taker) { + this.taker = taker; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderTestResponseSpecialCommissionForOrder orderTestResponseSpecialCommissionForOrder = + (OrderTestResponseSpecialCommissionForOrder) o; + return Objects.equals(this.maker, orderTestResponseSpecialCommissionForOrder.maker) + && Objects.equals(this.taker, orderTestResponseSpecialCommissionForOrder.taker); + } + + @Override + public int hashCode() { + return Objects.hash(maker, taker); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderTestResponseSpecialCommissionForOrder {\n"); + sb.append(" maker: ").append(toIndentedString(maker)).append("\n"); + sb.append(" taker: ").append(toIndentedString(taker)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object makerValue = getMaker(); + String makerValueAsString = ""; + makerValueAsString = makerValue.toString(); + sb.append("maker=").append(urlEncode(makerValueAsString)).append(""); + Object takerValue = getTaker(); + String takerValueAsString = ""; + takerValueAsString = takerValue.toString(); + sb.append("taker=").append(urlEncode(takerValueAsString)).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("maker"); + openapiFields.add("taker"); + + // 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 + * OrderTestResponseSpecialCommissionForOrder + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderTestResponseSpecialCommissionForOrder.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " OrderTestResponseSpecialCommissionForOrder is not found in" + + " the empty JSON string", + OrderTestResponseSpecialCommissionForOrder.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("maker") != null && !jsonObj.get("maker").isJsonNull()) + && !jsonObj.get("maker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maker` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maker").toString())); + } + if ((jsonObj.get("taker") != null && !jsonObj.get("taker").isJsonNull()) + && !jsonObj.get("taker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `taker` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("taker").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderTestResponseSpecialCommissionForOrder.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'OrderTestResponseSpecialCommissionForOrder' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(OrderTestResponseSpecialCommissionForOrder.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, OrderTestResponseSpecialCommissionForOrder value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderTestResponseSpecialCommissionForOrder read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderTestResponseSpecialCommissionForOrder given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderTestResponseSpecialCommissionForOrder + * @throws IOException if the JSON string is invalid with respect to + * OrderTestResponseSpecialCommissionForOrder + */ + public static OrderTestResponseSpecialCommissionForOrder fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, OrderTestResponseSpecialCommissionForOrder.class); + } + + /** + * Convert an instance of OrderTestResponseSpecialCommissionForOrder 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/PegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PegOffsetType.java new file mode 100644 index 00000000..025d1e27 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PegOffsetType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pegOffsetType */ +@JsonAdapter(PegOffsetType.Adapter.class) +public enum PegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"), + + NON_REPRESENTABLE("NON_REPRESENTABLE"); + + private String value; + + PegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PegOffsetType fromValue(String value) { + for (PegOffsetType b : PegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PegPriceType.java new file mode 100644 index 00000000..2390ffc4 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PegPriceType.java @@ -0,0 +1,75 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pegPriceType */ +@JsonAdapter(PegPriceType.Adapter.class) +public enum PegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"), + + NON_REPRESENTABLE("NON_REPRESENTABLE"); + + private String value; + + PegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PegPriceType fromValue(String value) { + for (PegPriceType b : PegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingAbovePegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingAbovePegOffsetType.java new file mode 100644 index 00000000..4202b439 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingAbovePegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingAbovePegOffsetType */ +@JsonAdapter(PendingAbovePegOffsetType.Adapter.class) +public enum PendingAbovePegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + PendingAbovePegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingAbovePegOffsetType fromValue(String value) { + for (PendingAbovePegOffsetType b : PendingAbovePegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingAbovePegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingAbovePegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingAbovePegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingAbovePegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingAbovePegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingAbovePegPriceType.java new file mode 100644 index 00000000..f70fa5ba --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingAbovePegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingAbovePegPriceType */ +@JsonAdapter(PendingAbovePegPriceType.Adapter.class) +public enum PendingAbovePegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + PendingAbovePegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingAbovePegPriceType fromValue(String value) { + for (PendingAbovePegPriceType b : PendingAbovePegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingAbovePegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingAbovePegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingAbovePegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingAbovePegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingBelowPegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingBelowPegOffsetType.java new file mode 100644 index 00000000..3069c887 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingBelowPegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingBelowPegOffsetType */ +@JsonAdapter(PendingBelowPegOffsetType.Adapter.class) +public enum PendingBelowPegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + PendingBelowPegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingBelowPegOffsetType fromValue(String value) { + for (PendingBelowPegOffsetType b : PendingBelowPegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingBelowPegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingBelowPegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingBelowPegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingBelowPegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingBelowPegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingBelowPegPriceType.java new file mode 100644 index 00000000..d03e0b0d --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingBelowPegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingBelowPegPriceType */ +@JsonAdapter(PendingBelowPegPriceType.Adapter.class) +public enum PendingBelowPegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + PendingBelowPegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingBelowPegPriceType fromValue(String value) { + for (PendingBelowPegPriceType b : PendingBelowPegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingBelowPegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingBelowPegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingBelowPegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingBelowPegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingPegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingPegOffsetType.java new file mode 100644 index 00000000..fde83dcb --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingPegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingPegOffsetType */ +@JsonAdapter(PendingPegOffsetType.Adapter.class) +public enum PendingPegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + PendingPegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingPegOffsetType fromValue(String value) { + for (PendingPegOffsetType b : PendingPegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingPegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingPegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingPegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingPegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingPegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingPegPriceType.java new file mode 100644 index 00000000..0befb3a2 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PendingPegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingPegPriceType */ +@JsonAdapter(PendingPegPriceType.Adapter.class) +public enum PendingPegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + PendingPegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingPegPriceType fromValue(String value) { + for (PendingPegPriceType b : PendingPegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingPegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingPegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingPegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingPegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/WorkingPegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/WorkingPegOffsetType.java new file mode 100644 index 00000000..cee7e7ab --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/WorkingPegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets workingPegOffsetType */ +@JsonAdapter(WorkingPegOffsetType.Adapter.class) +public enum WorkingPegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + WorkingPegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WorkingPegOffsetType fromValue(String value) { + for (WorkingPegOffsetType b : WorkingPegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WorkingPegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WorkingPegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WorkingPegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WorkingPegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/WorkingPegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/WorkingPegPriceType.java new file mode 100644 index 00000000..d53c8212 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/WorkingPegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets workingPegPriceType */ +@JsonAdapter(WorkingPegPriceType.Adapter.class) +public enum WorkingPegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + WorkingPegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WorkingPegPriceType fromValue(String value) { + for (WorkingPegPriceType b : WorkingPegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WorkingPegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WorkingPegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WorkingPegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WorkingPegPriceType.fromValue(value); + } +} 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 c14629c1..5394cfcb 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 @@ -175,6 +175,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .AccountCommissionResponseResultDiscount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .AccountCommissionResponseResultSpecialCommission + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .AccountCommissionResponseResultStandardCommission @@ -530,6 +534,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OrderTestResponseResultDiscount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .OrderTestResponseResultSpecialCommissionForOrder + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OrderTestResponseResultStandardCommissionForOrder @@ -573,6 +581,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .SessionStatusResponseResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .SessionSubscriptionsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .SessionSubscriptionsResponseResultInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.SorOrderPlaceRequest .CustomTypeAdapterFactory()); @@ -591,6 +605,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.SorOrderTestResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.SorOrderTestResponseResult + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.Symbols .CustomTypeAdapterFactory()); @@ -738,6 +755,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .UserDataStreamSubscribeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .UserDataStreamSubscribeSignatureResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .UserDataStreamUnsubscribeRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .UserDataStreamUnsubscribeResponse.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 50dee314..13db675d 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 @@ -126,7 +126,7 @@ private void accountCommissionValidateBeforeCall( * WebSocket Unfilled Order Count Query your current unfilled order count for all intervals. * Weight: 40 * - * @param accountRateLimitsOrdersRequest (required) + * @param accountRateLimitsOrdersRequest (optional) * @return AccountRateLimitsOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -190,7 +190,7 @@ private void accountRateLimitsOrdersValidateBeforeCall( /** * WebSocket Account information Query information about your account. Weight: 20 * - * @param accountStatusRequest (required) + * @param accountStatusRequest (optional) * @return AccountStatusResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -252,7 +252,7 @@ private void accountStatusValidateBeforeCall(AccountStatusRequest accountStatusR * WebSocket Account order list history Query information about all your order lists, filtered * by time range. Weight: 20 * - * @param allOrderListsRequest (required) + * @param allOrderListsRequest (optional) * @return AllOrderListsResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -569,7 +569,7 @@ private void myTradesValidateBeforeCall(MyTradesRequest myTradesRequest) throws * `userDataStream.start` request * `executionReport` user data stream event * Weight: 6 * - * @param openOrderListsStatusRequest (required) + * @param openOrderListsStatusRequest (optional) * @return OpenOrderListsStatusResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -635,7 +635,7 @@ private void openOrderListsStatusValidateBeforeCall( * Weight: Adjusted based on the number of requested symbols: | Parameter | Weight | | --------- * | ------ | | `symbol` | 6 | | none | 80 | * - * @param openOrdersStatusRequest (required) + * @param openOrdersStatusRequest (optional) * @return OpenOrdersStatusResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -759,7 +759,7 @@ private void orderAmendmentsValidateBeforeCall(OrderAmendmentsRequest orderAmend * WebSocket Query Order list Check execution status of an Order list. For execution status of * individual orders, use `order.status`. Weight: 4 * - * @param orderListStatusRequest (required) + * @param orderListStatusRequest (optional) * @return OrderListStatusResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AuthApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AuthApi.java index 15263a56..a6fe7b9f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AuthApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AuthApi.java @@ -46,7 +46,7 @@ public AuthApi(ConnectionInterface connection) { * API key can be authenticated. Calling `session.logon` multiple times changes the * current authenticated API key. Weight: 2 * - * @param sessionLogonRequest (required) + * @param sessionLogonRequest (optional) * @return SessionLogonResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body 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 7418c3ff..bb7c87aa 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 @@ -69,6 +69,7 @@ import com.binance.connector.client.spot.websocket.api.model.SessionLogonResponse; import com.binance.connector.client.spot.websocket.api.model.SessionLogoutResponse; import com.binance.connector.client.spot.websocket.api.model.SessionStatusResponse; +import com.binance.connector.client.spot.websocket.api.model.SessionSubscriptionsResponse; import com.binance.connector.client.spot.websocket.api.model.SorOrderPlaceRequest; import com.binance.connector.client.spot.websocket.api.model.SorOrderPlaceResponse; import com.binance.connector.client.spot.websocket.api.model.SorOrderTestRequest; @@ -99,13 +100,17 @@ 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; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeResponse; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.CompletableFuture; public class SpotWebSocketApi { private static final String USER_AGENT = String.format( - "binance-spot/5.0.1 (Java/%s; %s; %s)", + "binance-spot/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; @@ -124,6 +129,15 @@ public SpotWebSocketApi(WebSocketClientConfiguration configuration) { public SpotWebSocketApi(ConnectionInterface connection) { connection.setUserAgent(USER_AGENT); + List logonMethods = new ArrayList<>(); + List logoutMethods = new ArrayList<>(); + + logonMethods.add("/session.logon".substring(1)); + + logoutMethods.add("/session.logout".substring(1)); + + connection.setLogonMethods(logonMethods); + connection.setLogoutMethods(logoutMethods); if (!connection.isConnected()) { connection.connect(); } @@ -351,6 +365,11 @@ public CompletableFuture sorOrderTest( return tradeApi.sorOrderTest(sorOrderTestRequest); } + public CompletableFuture sessionSubscriptions() + throws ApiException { + return userDataStreamApi.sessionSubscriptions(); + } + public CompletableFuture userDataStreamPing( UserDataStreamPingRequest userDataStreamPingRequest) throws ApiException { return userDataStreamApi.userDataStreamPing(userDataStreamPingRequest); @@ -371,8 +390,13 @@ public CompletableFuture userDataStreamStop( return userDataStreamApi.userDataStreamSubscribe(); } - public CompletableFuture userDataStreamUnsubscribe() - throws ApiException { - return userDataStreamApi.userDataStreamUnsubscribe(); + public StreamResponse + userDataStreamSubscribeSignature() throws ApiException { + return userDataStreamApi.userDataStreamSubscribeSignature(); + } + + public CompletableFuture userDataStreamUnsubscribe( + UserDataStreamUnsubscribeRequest userDataStreamUnsubscribeRequest) throws ApiException { + return userDataStreamApi.userDataStreamUnsubscribe(userDataStreamUnsubscribeRequest); } } 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 9c03bb26..7d7623f0 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 @@ -21,6 +21,7 @@ import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; import com.binance.connector.client.spot.websocket.api.JSON; +import com.binance.connector.client.spot.websocket.api.model.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; @@ -28,6 +29,8 @@ 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; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; @@ -49,6 +52,47 @@ public UserDataStreamApi(ConnectionInterface connection) { this.connection = connection; } + /** + * WebSocket Listing all subscriptions Weight: 2 **Data Source**: Memory + * + * @return SessionSubscriptionsResponse + * @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 Listing all subscriptions -
+ * + * @see WebSocket + * Listing all subscriptions Documentation + */ + public CompletableFuture sessionSubscriptions() + throws ApiException { + sessionSubscriptionsValidateBeforeCall(); + String methodName = "/session.subscriptions".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder() + .id(getRequestID()) + .method(methodName) + .params(new BaseRequestDTO()) + .responseType(SessionSubscriptionsResponse.class) + .signed(false) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @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 @@ -271,37 +315,88 @@ private void userDataStreamStopValidateBeforeCall( private void userDataStreamSubscribeValidateBeforeCall() throws ApiException {} /** - * WebSocket Unsubscribe from User Data Stream Stop listening to the User Data Stream in the - * current WebSocket connection. Weight: 2 + * WebSocket Subscribe to User Data Stream through signature subscription Weight: 2 * - * @return UserDataStreamUnsubscribeResponse + * @return UserDataStreamSubscribeSignatureResponse * @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 Unsubscribe from User Data Stream -
200 Subscribe to User Data Stream through signature subscription -
* * @see WebSocket - * Unsubscribe from User Data Stream Documentation + * 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_data">WebSocket + * Subscribe to User Data Stream through signature subscription Documentation */ - public CompletableFuture userDataStreamUnsubscribe() - throws ApiException { - userDataStreamUnsubscribeValidateBeforeCall(); - String methodName = "/userDataStream.unsubscribe".substring(1); - ApiRequestWrapperDTO build = + public StreamResponse + userDataStreamSubscribeSignature() throws ApiException { + userDataStreamSubscribeSignatureValidateBeforeCall(); + String methodName = "/userDataStream.subscribe.signature".substring(1); + ApiRequestWrapperDTO build = new ApiRequestWrapperDTO.Builder< - BaseRequestDTO, UserDataStreamUnsubscribeResponse>() + BaseRequestDTO, UserDataStreamSubscribeSignatureResponse>() .id(getRequestID()) .method(methodName) .params(new BaseRequestDTO()) - .responseType(UserDataStreamUnsubscribeResponse.class) - .signed(false) + .responseType(UserDataStreamSubscribeSignatureResponse.class) .build(); + try { + BlockingQueue queue = connection.sendForStream(build); + TypeToken typeToken = new TypeToken<>() {}; + + return new StreamResponse<>( + build.getResponseCallback(), + new StreamBlockingQueueWrapper<>( + new StreamBlockingQueue<>(queue), typeToken, JSON.getGson())); + } catch (InterruptedException e) { + throw new ApiException(e); + } + } + + @SuppressWarnings("rawtypes") + private void userDataStreamSubscribeSignatureValidateBeforeCall() throws ApiException {} + + /** + * WebSocket Unsubscribe from User Data Stream Stop listening to the User Data Stream in the + * current WebSocket connection. Note that `session.logout` will only close the + * subscription created with `userdataStream.subscribe` but not subscriptions opened + * with `userDataStream.subscribe.signature`. Weight: 2 + * + * @param userDataStreamUnsubscribeRequest (optional) + * @return UserDataStreamUnsubscribeResponse + * @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 Unsubscribe from User Data Stream -
+ * + * @see WebSocket + * Unsubscribe from User Data Stream Documentation + */ + public CompletableFuture userDataStreamUnsubscribe( + UserDataStreamUnsubscribeRequest userDataStreamUnsubscribeRequest) throws ApiException { + userDataStreamUnsubscribeValidateBeforeCall(userDataStreamUnsubscribeRequest); + String methodName = "/userDataStream.unsubscribe".substring(1); + ApiRequestWrapperDTO + build = + new ApiRequestWrapperDTO.Builder< + UserDataStreamUnsubscribeRequest, + UserDataStreamUnsubscribeResponse>() + .id(getRequestID()) + .method(methodName) + .params(userDataStreamUnsubscribeRequest) + .responseType(UserDataStreamUnsubscribeResponse.class) + .signed(false) + .build(); + try { connection.send(build); } catch (InterruptedException e) { @@ -311,7 +406,27 @@ public CompletableFuture userDataStreamUnsubs } @SuppressWarnings("rawtypes") - private void userDataStreamUnsubscribeValidateBeforeCall() throws ApiException {} + private void userDataStreamUnsubscribeValidateBeforeCall( + UserDataStreamUnsubscribeRequest userDataStreamUnsubscribeRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(userDataStreamUnsubscribeRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } public String getRequestID() { return UUID.randomUUID().toString(); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AbovePegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AbovePegOffsetType.java new file mode 100644 index 00000000..b116a1c2 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AbovePegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets abovePegOffsetType */ +@JsonAdapter(AbovePegOffsetType.Adapter.class) +public enum AbovePegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + AbovePegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AbovePegOffsetType fromValue(String value) { + for (AbovePegOffsetType b : AbovePegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AbovePegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AbovePegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AbovePegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AbovePegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AbovePegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AbovePegPriceType.java new file mode 100644 index 00000000..3314e3ca --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AbovePegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets abovePegPriceType */ +@JsonAdapter(AbovePegPriceType.Adapter.class) +public enum AbovePegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + AbovePegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AbovePegPriceType fromValue(String value) { + for (AbovePegPriceType b : AbovePegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AbovePegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AbovePegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AbovePegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AbovePegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseResult.java index 43d0fb9e..2f07e76b 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseResult.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseResult.java @@ -52,6 +52,12 @@ public class AccountCommissionResponseResult extends BaseDTO { @jakarta.annotation.Nullable private AccountCommissionResponseResultStandardCommission standardCommission; + public static final String SERIALIZED_NAME_SPECIAL_COMMISSION = "specialCommission"; + + @SerializedName(SERIALIZED_NAME_SPECIAL_COMMISSION) + @jakarta.annotation.Nullable + private AccountCommissionResponseResultSpecialCommission specialCommission; + public static final String SERIALIZED_NAME_TAX_COMMISSION = "taxCommission"; @SerializedName(SERIALIZED_NAME_TAX_COMMISSION) @@ -109,6 +115,30 @@ public void setStandardCommission( this.standardCommission = standardCommission; } + public AccountCommissionResponseResult specialCommission( + @jakarta.annotation.Nullable + AccountCommissionResponseResultSpecialCommission specialCommission) { + this.specialCommission = specialCommission; + return this; + } + + /** + * Get specialCommission + * + * @return specialCommission + */ + @jakarta.annotation.Nullable + @Valid + public AccountCommissionResponseResultSpecialCommission getSpecialCommission() { + return specialCommission; + } + + public void setSpecialCommission( + @jakarta.annotation.Nullable + AccountCommissionResponseResultSpecialCommission specialCommission) { + this.specialCommission = specialCommission; + } + public AccountCommissionResponseResult taxCommission( @jakarta.annotation.Nullable AccountCommissionResponseResultTaxCommission taxCommission) { @@ -168,13 +198,15 @@ public boolean equals(Object o) { return Objects.equals(this.symbol, accountCommissionResponseResult.symbol) && Objects.equals( this.standardCommission, accountCommissionResponseResult.standardCommission) + && Objects.equals( + this.specialCommission, accountCommissionResponseResult.specialCommission) && Objects.equals(this.taxCommission, accountCommissionResponseResult.taxCommission) && Objects.equals(this.discount, accountCommissionResponseResult.discount); } @Override public int hashCode() { - return Objects.hash(symbol, standardCommission, taxCommission, discount); + return Objects.hash(symbol, standardCommission, specialCommission, taxCommission, discount); } @Override @@ -185,6 +217,7 @@ public String toString() { sb.append(" standardCommission: ") .append(toIndentedString(standardCommission)) .append("\n"); + sb.append(" specialCommission: ").append(toIndentedString(specialCommission)).append("\n"); sb.append(" taxCommission: ").append(toIndentedString(taxCommission)).append("\n"); sb.append(" discount: ").append(toIndentedString(discount)).append("\n"); sb.append("}"); @@ -206,6 +239,12 @@ public String toUrlQueryString() { String standardCommissionValueAsString = JSON.getGson().toJson(standardCommissionValue); valMap.put("standardCommission", standardCommissionValueAsString); } + AccountCommissionResponseResultSpecialCommission specialCommissionValue = + getSpecialCommission(); + if (specialCommissionValue != null) { + String specialCommissionValueAsString = JSON.getGson().toJson(specialCommissionValue); + valMap.put("specialCommission", specialCommissionValueAsString); + } AccountCommissionResponseResultTaxCommission taxCommissionValue = getTaxCommission(); if (taxCommissionValue != null) { String taxCommissionValueAsString = JSON.getGson().toJson(taxCommissionValue); @@ -235,6 +274,10 @@ public Map toMap() { if (standardCommissionValue != null) { valMap.put("standardCommission", standardCommissionValue); } + Object specialCommissionValue = getSpecialCommission(); + if (specialCommissionValue != null) { + valMap.put("specialCommission", specialCommissionValue); + } Object taxCommissionValue = getTaxCommission(); if (taxCommissionValue != null) { valMap.put("taxCommission", taxCommissionValue); @@ -271,6 +314,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("symbol"); openapiFields.add("standardCommission"); + openapiFields.add("specialCommission"); openapiFields.add("taxCommission"); openapiFields.add("discount"); @@ -323,6 +367,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountCommissionResponseResultStandardCommission.validateJsonElement( jsonObj.get("standardCommission")); } + // validate the optional field `specialCommission` + if (jsonObj.get("specialCommission") != null + && !jsonObj.get("specialCommission").isJsonNull()) { + AccountCommissionResponseResultSpecialCommission.validateJsonElement( + jsonObj.get("specialCommission")); + } // validate the optional field `taxCommission` if (jsonObj.get("taxCommission") != null && !jsonObj.get("taxCommission").isJsonNull()) { AccountCommissionResponseResultTaxCommission.validateJsonElement( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseResultSpecialCommission.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseResultSpecialCommission.java new file mode 100644 index 00000000..8cafef58 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseResultSpecialCommission.java @@ -0,0 +1,400 @@ +/* + * 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.*; + +/** AccountCommissionResponseResultSpecialCommission */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountCommissionResponseResultSpecialCommission extends BaseDTO { + public static final String SERIALIZED_NAME_MAKER = "maker"; + + @SerializedName(SERIALIZED_NAME_MAKER) + @jakarta.annotation.Nullable + private String maker; + + public static final String SERIALIZED_NAME_TAKER = "taker"; + + @SerializedName(SERIALIZED_NAME_TAKER) + @jakarta.annotation.Nullable + private String taker; + + public static final String SERIALIZED_NAME_BUYER = "buyer"; + + @SerializedName(SERIALIZED_NAME_BUYER) + @jakarta.annotation.Nullable + private String buyer; + + public static final String SERIALIZED_NAME_SELLER = "seller"; + + @SerializedName(SERIALIZED_NAME_SELLER) + @jakarta.annotation.Nullable + private String seller; + + public AccountCommissionResponseResultSpecialCommission() {} + + public AccountCommissionResponseResultSpecialCommission maker( + @jakarta.annotation.Nullable String maker) { + this.maker = maker; + return this; + } + + /** + * Get maker + * + * @return maker + */ + @jakarta.annotation.Nullable + public String getMaker() { + return maker; + } + + public void setMaker(@jakarta.annotation.Nullable String maker) { + this.maker = maker; + } + + public AccountCommissionResponseResultSpecialCommission taker( + @jakarta.annotation.Nullable String taker) { + this.taker = taker; + return this; + } + + /** + * Get taker + * + * @return taker + */ + @jakarta.annotation.Nullable + public String getTaker() { + return taker; + } + + public void setTaker(@jakarta.annotation.Nullable String taker) { + this.taker = taker; + } + + public AccountCommissionResponseResultSpecialCommission buyer( + @jakarta.annotation.Nullable String buyer) { + this.buyer = buyer; + return this; + } + + /** + * Get buyer + * + * @return buyer + */ + @jakarta.annotation.Nullable + public String getBuyer() { + return buyer; + } + + public void setBuyer(@jakarta.annotation.Nullable String buyer) { + this.buyer = buyer; + } + + public AccountCommissionResponseResultSpecialCommission seller( + @jakarta.annotation.Nullable String seller) { + this.seller = seller; + return this; + } + + /** + * Get seller + * + * @return seller + */ + @jakarta.annotation.Nullable + public String getSeller() { + return seller; + } + + public void setSeller(@jakarta.annotation.Nullable String seller) { + this.seller = seller; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountCommissionResponseResultSpecialCommission + accountCommissionResponseResultSpecialCommission = + (AccountCommissionResponseResultSpecialCommission) o; + return Objects.equals(this.maker, accountCommissionResponseResultSpecialCommission.maker) + && Objects.equals( + this.taker, accountCommissionResponseResultSpecialCommission.taker) + && Objects.equals( + this.buyer, accountCommissionResponseResultSpecialCommission.buyer) + && Objects.equals( + this.seller, accountCommissionResponseResultSpecialCommission.seller); + } + + @Override + public int hashCode() { + return Objects.hash(maker, taker, buyer, seller); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountCommissionResponseResultSpecialCommission {\n"); + sb.append(" maker: ").append(toIndentedString(maker)).append("\n"); + sb.append(" taker: ").append(toIndentedString(taker)).append("\n"); + sb.append(" buyer: ").append(toIndentedString(buyer)).append("\n"); + sb.append(" seller: ").append(toIndentedString(seller)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String makerValue = getMaker(); + if (makerValue != null) { + String makerValueAsString = makerValue.toString(); + valMap.put("maker", makerValueAsString); + } + String takerValue = getTaker(); + if (takerValue != null) { + String takerValueAsString = takerValue.toString(); + valMap.put("taker", takerValueAsString); + } + String buyerValue = getBuyer(); + if (buyerValue != null) { + String buyerValueAsString = buyerValue.toString(); + valMap.put("buyer", buyerValueAsString); + } + String sellerValue = getSeller(); + if (sellerValue != null) { + String sellerValueAsString = sellerValue.toString(); + valMap.put("seller", sellerValueAsString); + } + + 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 makerValue = getMaker(); + if (makerValue != null) { + valMap.put("maker", makerValue); + } + Object takerValue = getTaker(); + if (takerValue != null) { + valMap.put("taker", takerValue); + } + Object buyerValue = getBuyer(); + if (buyerValue != null) { + valMap.put("buyer", buyerValue); + } + Object sellerValue = getSeller(); + if (sellerValue != null) { + valMap.put("seller", sellerValue); + } + + 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("maker"); + openapiFields.add("taker"); + openapiFields.add("buyer"); + openapiFields.add("seller"); + + // 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 + * AccountCommissionResponseResultSpecialCommission + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountCommissionResponseResultSpecialCommission.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " AccountCommissionResponseResultSpecialCommission is not" + + " found in the empty JSON string", + AccountCommissionResponseResultSpecialCommission + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccountCommissionResponseResultSpecialCommission.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccountCommissionResponseResultSpecialCommission`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("maker") != null && !jsonObj.get("maker").isJsonNull()) + && !jsonObj.get("maker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maker` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maker").toString())); + } + if ((jsonObj.get("taker") != null && !jsonObj.get("taker").isJsonNull()) + && !jsonObj.get("taker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `taker` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("taker").toString())); + } + if ((jsonObj.get("buyer") != null && !jsonObj.get("buyer").isJsonNull()) + && !jsonObj.get("buyer").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyer` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("buyer").toString())); + } + if ((jsonObj.get("seller") != null && !jsonObj.get("seller").isJsonNull()) + && !jsonObj.get("seller").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `seller` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("seller").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountCommissionResponseResultSpecialCommission.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'AccountCommissionResponseResultSpecialCommission' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(AccountCommissionResponseResultSpecialCommission.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + AccountCommissionResponseResultSpecialCommission value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountCommissionResponseResultSpecialCommission read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountCommissionResponseResultSpecialCommission given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountCommissionResponseResultSpecialCommission + * @throws IOException if the JSON string is invalid with respect to + * AccountCommissionResponseResultSpecialCommission + */ + public static AccountCommissionResponseResultSpecialCommission fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, AccountCommissionResponseResultSpecialCommission.class); + } + + /** + * Convert an instance of AccountCommissionResponseResultSpecialCommission 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/BelowPegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BelowPegOffsetType.java new file mode 100644 index 00000000..d45db762 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BelowPegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets belowPegOffsetType */ +@JsonAdapter(BelowPegOffsetType.Adapter.class) +public enum BelowPegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + BelowPegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BelowPegOffsetType fromValue(String value) { + for (BelowPegOffsetType b : BelowPegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BelowPegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BelowPegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BelowPegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + BelowPegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BelowPegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BelowPegPriceType.java new file mode 100644 index 00000000..aa79ec1e --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BelowPegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets belowPegPriceType */ +@JsonAdapter(BelowPegPriceType.Adapter.class) +public enum BelowPegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + BelowPegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BelowPegPriceType fromValue(String value) { + for (BelowPegPriceType b : BelowPegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BelowPegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BelowPegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BelowPegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + BelowPegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java index 0cb86a93..76cf16f2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java @@ -207,6 +207,18 @@ public class ExchangeFiltersInner extends BaseDTO { @jakarta.annotation.Nullable private Long maxTrailingBelowDelta; + public static final String SERIALIZED_NAME_MAX_NUM_ORDER_AMENDS = "maxNumOrderAmends"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDER_AMENDS) + @jakarta.annotation.Nullable + private Long maxNumOrderAmends; + + public static final String SERIALIZED_NAME_MAX_NUM_ORDER_LISTS = "maxNumOrderLists"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDER_LISTS) + @jakarta.annotation.Nullable + private Long maxNumOrderLists; + public ExchangeFiltersInner() {} public ExchangeFiltersInner filterType(@jakarta.annotation.Nullable String filterType) { @@ -753,6 +765,46 @@ public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTraili this.maxTrailingBelowDelta = maxTrailingBelowDelta; } + public ExchangeFiltersInner maxNumOrderAmends( + @jakarta.annotation.Nullable Long maxNumOrderAmends) { + this.maxNumOrderAmends = maxNumOrderAmends; + return this; + } + + /** + * Get maxNumOrderAmends + * + * @return maxNumOrderAmends + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrderAmends() { + return maxNumOrderAmends; + } + + public void setMaxNumOrderAmends(@jakarta.annotation.Nullable Long maxNumOrderAmends) { + this.maxNumOrderAmends = maxNumOrderAmends; + } + + public ExchangeFiltersInner maxNumOrderLists( + @jakarta.annotation.Nullable Long maxNumOrderLists) { + this.maxNumOrderLists = maxNumOrderLists; + return this; + } + + /** + * Get maxNumOrderLists + * + * @return maxNumOrderLists + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrderLists() { + return maxNumOrderLists; + } + + public void setMaxNumOrderLists(@jakarta.annotation.Nullable Long maxNumOrderLists) { + this.maxNumOrderLists = maxNumOrderLists; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -794,7 +846,9 @@ public boolean equals(Object o) { && Objects.equals( this.minTrailingBelowDelta, exchangeFiltersInner.minTrailingBelowDelta) && Objects.equals( - this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta); + this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta) + && Objects.equals(this.maxNumOrderAmends, exchangeFiltersInner.maxNumOrderAmends) + && Objects.equals(this.maxNumOrderLists, exchangeFiltersInner.maxNumOrderLists); } @Override @@ -827,7 +881,9 @@ public int hashCode() { minTrailingAboveDelta, maxTrailingAboveDelta, minTrailingBelowDelta, - maxTrailingBelowDelta); + maxTrailingBelowDelta, + maxNumOrderAmends, + maxNumOrderLists); } @Override @@ -872,6 +928,8 @@ public String toString() { sb.append(" maxTrailingBelowDelta: ") .append(toIndentedString(maxTrailingBelowDelta)) .append("\n"); + sb.append(" maxNumOrderAmends: ").append(toIndentedString(maxNumOrderAmends)).append("\n"); + sb.append(" maxNumOrderLists: ").append(toIndentedString(maxNumOrderLists)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1020,6 +1078,16 @@ public String toUrlQueryString() { String maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValueAsString); } + Long maxNumOrderAmendsValue = getMaxNumOrderAmends(); + if (maxNumOrderAmendsValue != null) { + String maxNumOrderAmendsValueAsString = maxNumOrderAmendsValue.toString(); + valMap.put("maxNumOrderAmends", maxNumOrderAmendsValueAsString); + } + Long maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + String maxNumOrderListsValueAsString = maxNumOrderListsValue.toString(); + valMap.put("maxNumOrderLists", maxNumOrderListsValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -1143,6 +1211,14 @@ public Map toMap() { if (maxTrailingBelowDeltaValue != null) { valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValue); } + Object maxNumOrderAmendsValue = getMaxNumOrderAmends(); + if (maxNumOrderAmendsValue != null) { + valMap.put("maxNumOrderAmends", maxNumOrderAmendsValue); + } + Object maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + valMap.put("maxNumOrderLists", maxNumOrderListsValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -1197,6 +1273,8 @@ private String toIndentedString(Object o) { openapiFields.add("maxTrailingAboveDelta"); openapiFields.add("minTrailingBelowDelta"); openapiFields.add("maxTrailingBelowDelta"); + openapiFields.add("maxNumOrderAmends"); + openapiFields.add("maxNumOrderLists"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); 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 b9f38d42..25316f82 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 @@ -147,6 +147,12 @@ public class ExchangeInfoResponseResultSymbolsInner extends BaseDTO { @jakarta.annotation.Nullable private Boolean amendAllowed; + public static final String SERIALIZED_NAME_PEG_INSTRUCTIONS_ALLOWED = "pegInstructionsAllowed"; + + @SerializedName(SERIALIZED_NAME_PEG_INSTRUCTIONS_ALLOWED) + @jakarta.annotation.Nullable + private Boolean pegInstructionsAllowed; + public static final String SERIALIZED_NAME_IS_SPOT_TRADING_ALLOWED = "isSpotTradingAllowed"; @SerializedName(SERIALIZED_NAME_IS_SPOT_TRADING_ALLOWED) @@ -544,6 +550,27 @@ public void setAmendAllowed(@jakarta.annotation.Nullable Boolean amendAllowed) { this.amendAllowed = amendAllowed; } + public ExchangeInfoResponseResultSymbolsInner pegInstructionsAllowed( + @jakarta.annotation.Nullable Boolean pegInstructionsAllowed) { + this.pegInstructionsAllowed = pegInstructionsAllowed; + return this; + } + + /** + * Get pegInstructionsAllowed + * + * @return pegInstructionsAllowed + */ + @jakarta.annotation.Nullable + public Boolean getPegInstructionsAllowed() { + return pegInstructionsAllowed; + } + + public void setPegInstructionsAllowed( + @jakarta.annotation.Nullable Boolean pegInstructionsAllowed) { + this.pegInstructionsAllowed = pegInstructionsAllowed; + } + public ExchangeInfoResponseResultSymbolsInner isSpotTradingAllowed( @jakarta.annotation.Nullable Boolean isSpotTradingAllowed) { this.isSpotTradingAllowed = isSpotTradingAllowed; @@ -763,6 +790,9 @@ public boolean equals(Object o) { exchangeInfoResponseResultSymbolsInner.cancelReplaceAllowed) && Objects.equals( this.amendAllowed, exchangeInfoResponseResultSymbolsInner.amendAllowed) + && Objects.equals( + this.pegInstructionsAllowed, + exchangeInfoResponseResultSymbolsInner.pegInstructionsAllowed) && Objects.equals( this.isSpotTradingAllowed, exchangeInfoResponseResultSymbolsInner.isSpotTradingAllowed) @@ -802,6 +832,7 @@ public int hashCode() { allowTrailingStop, cancelReplaceAllowed, amendAllowed, + pegInstructionsAllowed, isSpotTradingAllowed, isMarginTradingAllowed, filters, @@ -844,6 +875,9 @@ public String toString() { .append(toIndentedString(cancelReplaceAllowed)) .append("\n"); sb.append(" amendAllowed: ").append(toIndentedString(amendAllowed)).append("\n"); + sb.append(" pegInstructionsAllowed: ") + .append(toIndentedString(pegInstructionsAllowed)) + .append("\n"); sb.append(" isSpotTradingAllowed: ") .append(toIndentedString(isSpotTradingAllowed)) .append("\n"); @@ -953,6 +987,11 @@ public String toUrlQueryString() { String amendAllowedValueAsString = amendAllowedValue.toString(); valMap.put("amendAllowed", amendAllowedValueAsString); } + Boolean pegInstructionsAllowedValue = getPegInstructionsAllowed(); + if (pegInstructionsAllowedValue != null) { + String pegInstructionsAllowedValueAsString = pegInstructionsAllowedValue.toString(); + valMap.put("pegInstructionsAllowed", pegInstructionsAllowedValueAsString); + } Boolean isSpotTradingAllowedValue = getIsSpotTradingAllowed(); if (isSpotTradingAllowedValue != null) { String isSpotTradingAllowedValueAsString = isSpotTradingAllowedValue.toString(); @@ -1072,6 +1111,10 @@ public Map toMap() { if (amendAllowedValue != null) { valMap.put("amendAllowed", amendAllowedValue); } + Object pegInstructionsAllowedValue = getPegInstructionsAllowed(); + if (pegInstructionsAllowedValue != null) { + valMap.put("pegInstructionsAllowed", pegInstructionsAllowedValue); + } Object isSpotTradingAllowedValue = getIsSpotTradingAllowed(); if (isSpotTradingAllowedValue != null) { valMap.put("isSpotTradingAllowed", isSpotTradingAllowedValue); @@ -1143,6 +1186,7 @@ private String toIndentedString(Object o) { openapiFields.add("allowTrailingStop"); openapiFields.add("cancelReplaceAllowed"); openapiFields.add("amendAllowed"); + openapiFields.add("pegInstructionsAllowed"); openapiFields.add("isSpotTradingAllowed"); openapiFields.add("isMarginTradingAllowed"); openapiFields.add("filters"); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExecutionReport.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExecutionReport.java index 14eaa8c6..ecb6dd24 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExecutionReport.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExecutionReport.java @@ -339,6 +339,30 @@ public class ExecutionReport extends BaseDTO { @jakarta.annotation.Nullable private Boolean uS; + public static final String SERIALIZED_NAME_G_P = "gP"; + + @SerializedName(SERIALIZED_NAME_G_P) + @jakarta.annotation.Nullable + private String gP; + + public static final String SERIALIZED_NAME_G_O_T = "gOT"; + + @SerializedName(SERIALIZED_NAME_G_O_T) + @jakarta.annotation.Nullable + private String gOT; + + public static final String SERIALIZED_NAME_G_O_V = "gOV"; + + @SerializedName(SERIALIZED_NAME_G_O_V) + @jakarta.annotation.Nullable + private Long gOV; + + public static final String SERIALIZED_NAME_GP = "gp"; + + @SerializedName(SERIALIZED_NAME_GP) + @jakarta.annotation.Nullable + private String gp; + public ExecutionReport() {} public ExecutionReport E(@jakarta.annotation.Nullable Long E) { @@ -1291,6 +1315,82 @@ public void setuS(@jakarta.annotation.Nullable Boolean uS) { this.uS = uS; } + public ExecutionReport gP(@jakarta.annotation.Nullable String gP) { + this.gP = gP; + return this; + } + + /** + * Get gP + * + * @return gP + */ + @jakarta.annotation.Nullable + public String getgP() { + return gP; + } + + public void setgP(@jakarta.annotation.Nullable String gP) { + this.gP = gP; + } + + public ExecutionReport gOT(@jakarta.annotation.Nullable String gOT) { + this.gOT = gOT; + return this; + } + + /** + * Get gOT + * + * @return gOT + */ + @jakarta.annotation.Nullable + public String getgOT() { + return gOT; + } + + public void setgOT(@jakarta.annotation.Nullable String gOT) { + this.gOT = gOT; + } + + public ExecutionReport gOV(@jakarta.annotation.Nullable Long gOV) { + this.gOV = gOV; + return this; + } + + /** + * Get gOV + * + * @return gOV + */ + @jakarta.annotation.Nullable + public Long getgOV() { + return gOV; + } + + public void setgOV(@jakarta.annotation.Nullable Long gOV) { + this.gOV = gOV; + } + + public ExecutionReport gp(@jakarta.annotation.Nullable String gp) { + this.gp = gp; + return this; + } + + /** + * Get gp + * + * @return gp + */ + @jakarta.annotation.Nullable + public String getGp() { + return gp; + } + + public void setGp(@jakarta.annotation.Nullable String gp) { + this.gp = gp; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -1349,7 +1449,11 @@ public boolean equals(Object o) { && Objects.equals(this.bLowerCase, executionReport.bLowerCase) && Objects.equals(this.aLowerCase, executionReport.aLowerCase) && Objects.equals(this.kLowerCase, executionReport.kLowerCase) - && Objects.equals(this.uS, executionReport.uS); + && Objects.equals(this.uS, executionReport.uS) + && Objects.equals(this.gP, executionReport.gP) + && Objects.equals(this.gOT, executionReport.gOT) + && Objects.equals(this.gOV, executionReport.gOV) + && Objects.equals(this.gp, executionReport.gp); } @Override @@ -1404,7 +1508,11 @@ public int hashCode() { bLowerCase, aLowerCase, kLowerCase, - uS); + uS, + gP, + gOT, + gOV, + gp); } @Override @@ -1461,6 +1569,10 @@ public String toString() { sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); sb.append(" kLowerCase: ").append(toIndentedString(kLowerCase)).append("\n"); sb.append(" uS: ").append(toIndentedString(uS)).append("\n"); + sb.append(" gP: ").append(toIndentedString(gP)).append("\n"); + sb.append(" gOT: ").append(toIndentedString(gOT)).append("\n"); + sb.append(" gOV: ").append(toIndentedString(gOV)).append("\n"); + sb.append(" gp: ").append(toIndentedString(gp)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1719,6 +1831,26 @@ public String toUrlQueryString() { String uSValueAsString = uSValue.toString(); valMap.put("uS", uSValueAsString); } + String gPValue = getgP(); + if (gPValue != null) { + String gPValueAsString = gPValue.toString(); + valMap.put("gP", gPValueAsString); + } + String gOTValue = getgOT(); + if (gOTValue != null) { + String gOTValueAsString = gOTValue.toString(); + valMap.put("gOT", gOTValueAsString); + } + Long gOVValue = getgOV(); + if (gOVValue != null) { + String gOVValueAsString = gOVValue.toString(); + valMap.put("gOV", gOVValueAsString); + } + String gpValue = getGp(); + if (gpValue != null) { + String gpValueAsString = gpValue.toString(); + valMap.put("gp", gpValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -1930,6 +2062,22 @@ public Map toMap() { if (uSValue != null) { valMap.put("uS", uSValue); } + Object gPValue = getgP(); + if (gPValue != null) { + valMap.put("gP", gPValue); + } + Object gOTValue = getgOT(); + if (gOTValue != null) { + valMap.put("gOT", gOTValue); + } + Object gOVValue = getgOV(); + if (gOVValue != null) { + valMap.put("gOV", gOVValue); + } + Object gpValue = getGp(); + if (gpValue != null) { + valMap.put("gp", gpValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -2006,6 +2154,10 @@ private String toIndentedString(Object o) { openapiFields.add("a"); openapiFields.add("k"); openapiFields.add("uS"); + openapiFields.add("gP"); + openapiFields.add("gOT"); + openapiFields.add("gOV"); + openapiFields.add("gp"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -2281,6 +2433,30 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("k").toString())); } + if ((jsonObj.get("gP") != null && !jsonObj.get("gP").isJsonNull()) + && !jsonObj.get("gP").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `gP` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("gP").toString())); + } + if ((jsonObj.get("gOT") != null && !jsonObj.get("gOT").isJsonNull()) + && !jsonObj.get("gOT").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `gOT` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("gOT").toString())); + } + if ((jsonObj.get("gp") != null && !jsonObj.get("gp").isJsonNull()) + && !jsonObj.get("gp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `gp` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("gp").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceRequest.java index e6d7ab15..9a4e3769 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceRequest.java @@ -171,6 +171,24 @@ public class OrderCancelReplaceRequest extends BaseDTO { @jakarta.annotation.Nullable private OrderRateLimitExceededMode orderRateLimitExceededMode; + public static final String SERIALIZED_NAME_PEG_PRICE_TYPE = "pegPriceType"; + + @SerializedName(SERIALIZED_NAME_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PegPriceType pegPriceType; + + public static final String SERIALIZED_NAME_PEG_OFFSET_VALUE = "pegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pegOffsetValue; + + public static final String SERIALIZED_NAME_PEG_OFFSET_TYPE = "pegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PegOffsetType pegOffsetType; + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -616,6 +634,68 @@ public void setOrderRateLimitExceededMode( this.orderRateLimitExceededMode = orderRateLimitExceededMode; } + public OrderCancelReplaceRequest pegPriceType( + @jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + return this; + } + + /** + * Get pegPriceType + * + * @return pegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PegPriceType getPegPriceType() { + return pegPriceType; + } + + public void setPegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + } + + public OrderCancelReplaceRequest pegOffsetValue( + @jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + return this; + } + + /** + * Get pegOffsetValue + * + * @return pegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPegOffsetValue() { + return pegOffsetValue; + } + + public void setPegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + } + + public OrderCancelReplaceRequest pegOffsetType( + @jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + return this; + } + + /** + * Get pegOffsetType + * + * @return pegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PegOffsetType getPegOffsetType() { + return pegOffsetType; + } + + public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + } + public OrderCancelReplaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -675,6 +755,9 @@ public boolean equals(Object o) { && Objects.equals( this.orderRateLimitExceededMode, orderCancelReplaceRequest.orderRateLimitExceededMode) + && Objects.equals(this.pegPriceType, orderCancelReplaceRequest.pegPriceType) + && Objects.equals(this.pegOffsetValue, orderCancelReplaceRequest.pegOffsetValue) + && Objects.equals(this.pegOffsetType, orderCancelReplaceRequest.pegOffsetType) && Objects.equals(this.recvWindow, orderCancelReplaceRequest.recvWindow); } @@ -702,6 +785,9 @@ public int hashCode() { selfTradePreventionMode, cancelRestrictions, orderRateLimitExceededMode, + pegPriceType, + pegOffsetValue, + pegOffsetType, recvWindow); } @@ -740,6 +826,9 @@ public String toString() { sb.append(" orderRateLimitExceededMode: ") .append(toIndentedString(orderRateLimitExceededMode)) .append("\n"); + sb.append(" pegPriceType: ").append(toIndentedString(pegPriceType)).append("\n"); + sb.append(" pegOffsetValue: ").append(toIndentedString(pegOffsetValue)).append("\n"); + sb.append(" pegOffsetType: ").append(toIndentedString(pegOffsetType)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -859,6 +948,21 @@ public String toUrlQueryString() { orderRateLimitExceededModeValue.toString(); valMap.put("orderRateLimitExceededMode", orderRateLimitExceededModeValueAsString); } + PegPriceType pegPriceTypeValue = getPegPriceType(); + if (pegPriceTypeValue != null) { + String pegPriceTypeValueAsString = pegPriceTypeValue.toString(); + valMap.put("pegPriceType", pegPriceTypeValueAsString); + } + Integer pegOffsetValueValue = getPegOffsetValue(); + if (pegOffsetValueValue != null) { + String pegOffsetValueValueAsString = pegOffsetValueValue.toString(); + valMap.put("pegOffsetValue", pegOffsetValueValueAsString); + } + PegOffsetType pegOffsetTypeValue = getPegOffsetType(); + if (pegOffsetTypeValue != null) { + String pegOffsetTypeValueAsString = pegOffsetTypeValue.toString(); + valMap.put("pegOffsetType", pegOffsetTypeValueAsString); + } Long recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { String recvWindowValueAsString = recvWindowValue.toString(); @@ -959,6 +1063,18 @@ public Map toMap() { if (orderRateLimitExceededModeValue != null) { valMap.put("orderRateLimitExceededMode", orderRateLimitExceededModeValue); } + Object pegPriceTypeValue = getPegPriceType(); + if (pegPriceTypeValue != null) { + valMap.put("pegPriceType", pegPriceTypeValue); + } + Object pegOffsetValueValue = getPegOffsetValue(); + if (pegOffsetValueValue != null) { + valMap.put("pegOffsetValue", pegOffsetValueValue); + } + Object pegOffsetTypeValue = getPegOffsetType(); + if (pegOffsetTypeValue != null) { + valMap.put("pegOffsetType", pegOffsetTypeValue); + } Object recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { valMap.put("recvWindow", recvWindowValue); @@ -1010,6 +1126,9 @@ private String toIndentedString(Object o) { openapiFields.add("selfTradePreventionMode"); openapiFields.add("cancelRestrictions"); openapiFields.add("orderRateLimitExceededMode"); + openapiFields.add("pegPriceType"); + openapiFields.add("pegOffsetValue"); + openapiFields.add("pegOffsetType"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -1125,6 +1244,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderRateLimitExceededMode.validateJsonElement( jsonObj.get("orderRateLimitExceededMode")); } + // validate the optional field `pegPriceType` + if (jsonObj.get("pegPriceType") != null && !jsonObj.get("pegPriceType").isJsonNull()) { + PegPriceType.validateJsonElement(jsonObj.get("pegPriceType")); + } + // validate the optional field `pegOffsetType` + if (jsonObj.get("pegOffsetType") != null && !jsonObj.get("pegOffsetType").isJsonNull()) { + PegOffsetType.validateJsonElement(jsonObj.get("pegOffsetType")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoRequest.java index 1c7b29da..ce7f7486 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoRequest.java @@ -119,6 +119,24 @@ public class OrderListPlaceOcoRequest extends BaseDTO { @jakarta.annotation.Nullable private Integer aboveStrategyType; + public static final String SERIALIZED_NAME_ABOVE_PEG_PRICE_TYPE = "abovePegPriceType"; + + @SerializedName(SERIALIZED_NAME_ABOVE_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private AbovePegPriceType abovePegPriceType; + + public static final String SERIALIZED_NAME_ABOVE_PEG_OFFSET_TYPE = "abovePegOffsetType"; + + @SerializedName(SERIALIZED_NAME_ABOVE_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private AbovePegOffsetType abovePegOffsetType; + + public static final String SERIALIZED_NAME_ABOVE_PEG_OFFSET_VALUE = "abovePegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_ABOVE_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer abovePegOffsetValue; + public static final String SERIALIZED_NAME_BELOW_TYPE = "belowType"; @SerializedName(SERIALIZED_NAME_BELOW_TYPE) @@ -173,6 +191,24 @@ public class OrderListPlaceOcoRequest extends BaseDTO { @jakarta.annotation.Nullable private Integer belowStrategyType; + public static final String SERIALIZED_NAME_BELOW_PEG_PRICE_TYPE = "belowPegPriceType"; + + @SerializedName(SERIALIZED_NAME_BELOW_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private BelowPegPriceType belowPegPriceType; + + public static final String SERIALIZED_NAME_BELOW_PEG_OFFSET_TYPE = "belowPegOffsetType"; + + @SerializedName(SERIALIZED_NAME_BELOW_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private BelowPegOffsetType belowPegOffsetType; + + public static final String SERIALIZED_NAME_BELOW_PEG_OFFSET_VALUE = "belowPegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_BELOW_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer belowPegOffsetValue; + public static final String SERIALIZED_NAME_NEW_ORDER_RESP_TYPE = "newOrderRespType"; @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESP_TYPE) @@ -459,6 +495,70 @@ public void setAboveStrategyType(@jakarta.annotation.Nullable Integer aboveStrat this.aboveStrategyType = aboveStrategyType; } + public OrderListPlaceOcoRequest abovePegPriceType( + @jakarta.annotation.Nullable AbovePegPriceType abovePegPriceType) { + this.abovePegPriceType = abovePegPriceType; + return this; + } + + /** + * Get abovePegPriceType + * + * @return abovePegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public AbovePegPriceType getAbovePegPriceType() { + return abovePegPriceType; + } + + public void setAbovePegPriceType( + @jakarta.annotation.Nullable AbovePegPriceType abovePegPriceType) { + this.abovePegPriceType = abovePegPriceType; + } + + public OrderListPlaceOcoRequest abovePegOffsetType( + @jakarta.annotation.Nullable AbovePegOffsetType abovePegOffsetType) { + this.abovePegOffsetType = abovePegOffsetType; + return this; + } + + /** + * Get abovePegOffsetType + * + * @return abovePegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public AbovePegOffsetType getAbovePegOffsetType() { + return abovePegOffsetType; + } + + public void setAbovePegOffsetType( + @jakarta.annotation.Nullable AbovePegOffsetType abovePegOffsetType) { + this.abovePegOffsetType = abovePegOffsetType; + } + + public OrderListPlaceOcoRequest abovePegOffsetValue( + @jakarta.annotation.Nullable Integer abovePegOffsetValue) { + this.abovePegOffsetValue = abovePegOffsetValue; + return this; + } + + /** + * Get abovePegOffsetValue + * + * @return abovePegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getAbovePegOffsetValue() { + return abovePegOffsetValue; + } + + public void setAbovePegOffsetValue(@jakarta.annotation.Nullable Integer abovePegOffsetValue) { + this.abovePegOffsetValue = abovePegOffsetValue; + } + public OrderListPlaceOcoRequest belowType(@jakarta.annotation.Nonnull BelowType belowType) { this.belowType = belowType; return this; @@ -643,6 +743,70 @@ public void setBelowStrategyType(@jakarta.annotation.Nullable Integer belowStrat this.belowStrategyType = belowStrategyType; } + public OrderListPlaceOcoRequest belowPegPriceType( + @jakarta.annotation.Nullable BelowPegPriceType belowPegPriceType) { + this.belowPegPriceType = belowPegPriceType; + return this; + } + + /** + * Get belowPegPriceType + * + * @return belowPegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public BelowPegPriceType getBelowPegPriceType() { + return belowPegPriceType; + } + + public void setBelowPegPriceType( + @jakarta.annotation.Nullable BelowPegPriceType belowPegPriceType) { + this.belowPegPriceType = belowPegPriceType; + } + + public OrderListPlaceOcoRequest belowPegOffsetType( + @jakarta.annotation.Nullable BelowPegOffsetType belowPegOffsetType) { + this.belowPegOffsetType = belowPegOffsetType; + return this; + } + + /** + * Get belowPegOffsetType + * + * @return belowPegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public BelowPegOffsetType getBelowPegOffsetType() { + return belowPegOffsetType; + } + + public void setBelowPegOffsetType( + @jakarta.annotation.Nullable BelowPegOffsetType belowPegOffsetType) { + this.belowPegOffsetType = belowPegOffsetType; + } + + public OrderListPlaceOcoRequest belowPegOffsetValue( + @jakarta.annotation.Nullable Integer belowPegOffsetValue) { + this.belowPegOffsetValue = belowPegOffsetValue; + return this; + } + + /** + * Get belowPegOffsetValue + * + * @return belowPegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getBelowPegOffsetValue() { + return belowPegOffsetValue; + } + + public void setBelowPegOffsetValue(@jakarta.annotation.Nullable Integer belowPegOffsetValue) { + this.belowPegOffsetValue = belowPegOffsetValue; + } + public OrderListPlaceOcoRequest newOrderRespType( @jakarta.annotation.Nullable NewOrderRespType newOrderRespType) { this.newOrderRespType = newOrderRespType; @@ -732,6 +896,12 @@ public boolean equals(Object o) { && Objects.equals(this.aboveStrategyId, orderListPlaceOcoRequest.aboveStrategyId) && Objects.equals( this.aboveStrategyType, orderListPlaceOcoRequest.aboveStrategyType) + && Objects.equals( + this.abovePegPriceType, orderListPlaceOcoRequest.abovePegPriceType) + && Objects.equals( + this.abovePegOffsetType, orderListPlaceOcoRequest.abovePegOffsetType) + && Objects.equals( + this.abovePegOffsetValue, orderListPlaceOcoRequest.abovePegOffsetValue) && Objects.equals(this.belowType, orderListPlaceOcoRequest.belowType) && Objects.equals( this.belowClientOrderId, orderListPlaceOcoRequest.belowClientOrderId) @@ -744,6 +914,12 @@ public boolean equals(Object o) { && Objects.equals(this.belowStrategyId, orderListPlaceOcoRequest.belowStrategyId) && Objects.equals( this.belowStrategyType, orderListPlaceOcoRequest.belowStrategyType) + && Objects.equals( + this.belowPegPriceType, orderListPlaceOcoRequest.belowPegPriceType) + && Objects.equals( + this.belowPegOffsetType, orderListPlaceOcoRequest.belowPegOffsetType) + && Objects.equals( + this.belowPegOffsetValue, orderListPlaceOcoRequest.belowPegOffsetValue) && Objects.equals(this.newOrderRespType, orderListPlaceOcoRequest.newOrderRespType) && Objects.equals( this.selfTradePreventionMode, @@ -767,6 +943,9 @@ public int hashCode() { aboveTimeInForce, aboveStrategyId, aboveStrategyType, + abovePegPriceType, + abovePegOffsetType, + abovePegOffsetValue, belowType, belowClientOrderId, belowIcebergQty, @@ -776,6 +955,9 @@ public int hashCode() { belowTimeInForce, belowStrategyId, belowStrategyType, + belowPegPriceType, + belowPegOffsetType, + belowPegOffsetValue, newOrderRespType, selfTradePreventionMode, recvWindow); @@ -802,6 +984,13 @@ public String toString() { sb.append(" aboveTimeInForce: ").append(toIndentedString(aboveTimeInForce)).append("\n"); sb.append(" aboveStrategyId: ").append(toIndentedString(aboveStrategyId)).append("\n"); sb.append(" aboveStrategyType: ").append(toIndentedString(aboveStrategyType)).append("\n"); + sb.append(" abovePegPriceType: ").append(toIndentedString(abovePegPriceType)).append("\n"); + sb.append(" abovePegOffsetType: ") + .append(toIndentedString(abovePegOffsetType)) + .append("\n"); + sb.append(" abovePegOffsetValue: ") + .append(toIndentedString(abovePegOffsetValue)) + .append("\n"); sb.append(" belowType: ").append(toIndentedString(belowType)).append("\n"); sb.append(" belowClientOrderId: ") .append(toIndentedString(belowClientOrderId)) @@ -815,6 +1004,13 @@ public String toString() { sb.append(" belowTimeInForce: ").append(toIndentedString(belowTimeInForce)).append("\n"); sb.append(" belowStrategyId: ").append(toIndentedString(belowStrategyId)).append("\n"); sb.append(" belowStrategyType: ").append(toIndentedString(belowStrategyType)).append("\n"); + sb.append(" belowPegPriceType: ").append(toIndentedString(belowPegPriceType)).append("\n"); + sb.append(" belowPegOffsetType: ") + .append(toIndentedString(belowPegOffsetType)) + .append("\n"); + sb.append(" belowPegOffsetValue: ") + .append(toIndentedString(belowPegOffsetValue)) + .append("\n"); sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); sb.append(" selfTradePreventionMode: ") .append(toIndentedString(selfTradePreventionMode)) @@ -896,6 +1092,21 @@ public String toUrlQueryString() { String aboveStrategyTypeValueAsString = aboveStrategyTypeValue.toString(); valMap.put("aboveStrategyType", aboveStrategyTypeValueAsString); } + AbovePegPriceType abovePegPriceTypeValue = getAbovePegPriceType(); + if (abovePegPriceTypeValue != null) { + String abovePegPriceTypeValueAsString = abovePegPriceTypeValue.toString(); + valMap.put("abovePegPriceType", abovePegPriceTypeValueAsString); + } + AbovePegOffsetType abovePegOffsetTypeValue = getAbovePegOffsetType(); + if (abovePegOffsetTypeValue != null) { + String abovePegOffsetTypeValueAsString = abovePegOffsetTypeValue.toString(); + valMap.put("abovePegOffsetType", abovePegOffsetTypeValueAsString); + } + Integer abovePegOffsetValueValue = getAbovePegOffsetValue(); + if (abovePegOffsetValueValue != null) { + String abovePegOffsetValueValueAsString = abovePegOffsetValueValue.toString(); + valMap.put("abovePegOffsetValue", abovePegOffsetValueValueAsString); + } BelowType belowTypeValue = getBelowType(); if (belowTypeValue != null) { String belowTypeValueAsString = belowTypeValue.toString(); @@ -943,6 +1154,21 @@ public String toUrlQueryString() { String belowStrategyTypeValueAsString = belowStrategyTypeValue.toString(); valMap.put("belowStrategyType", belowStrategyTypeValueAsString); } + BelowPegPriceType belowPegPriceTypeValue = getBelowPegPriceType(); + if (belowPegPriceTypeValue != null) { + String belowPegPriceTypeValueAsString = belowPegPriceTypeValue.toString(); + valMap.put("belowPegPriceType", belowPegPriceTypeValueAsString); + } + BelowPegOffsetType belowPegOffsetTypeValue = getBelowPegOffsetType(); + if (belowPegOffsetTypeValue != null) { + String belowPegOffsetTypeValueAsString = belowPegOffsetTypeValue.toString(); + valMap.put("belowPegOffsetType", belowPegOffsetTypeValueAsString); + } + Integer belowPegOffsetValueValue = getBelowPegOffsetValue(); + if (belowPegOffsetValueValue != null) { + String belowPegOffsetValueValueAsString = belowPegOffsetValueValue.toString(); + valMap.put("belowPegOffsetValue", belowPegOffsetValueValueAsString); + } NewOrderRespType newOrderRespTypeValue = getNewOrderRespType(); if (newOrderRespTypeValue != null) { String newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); @@ -1021,6 +1247,18 @@ public Map toMap() { if (aboveStrategyTypeValue != null) { valMap.put("aboveStrategyType", aboveStrategyTypeValue); } + Object abovePegPriceTypeValue = getAbovePegPriceType(); + if (abovePegPriceTypeValue != null) { + valMap.put("abovePegPriceType", abovePegPriceTypeValue); + } + Object abovePegOffsetTypeValue = getAbovePegOffsetType(); + if (abovePegOffsetTypeValue != null) { + valMap.put("abovePegOffsetType", abovePegOffsetTypeValue); + } + Object abovePegOffsetValueValue = getAbovePegOffsetValue(); + if (abovePegOffsetValueValue != null) { + valMap.put("abovePegOffsetValue", abovePegOffsetValueValue); + } Object belowTypeValue = getBelowType(); if (belowTypeValue != null) { valMap.put("belowType", belowTypeValue); @@ -1057,6 +1295,18 @@ public Map toMap() { if (belowStrategyTypeValue != null) { valMap.put("belowStrategyType", belowStrategyTypeValue); } + Object belowPegPriceTypeValue = getBelowPegPriceType(); + if (belowPegPriceTypeValue != null) { + valMap.put("belowPegPriceType", belowPegPriceTypeValue); + } + Object belowPegOffsetTypeValue = getBelowPegOffsetType(); + if (belowPegOffsetTypeValue != null) { + valMap.put("belowPegOffsetType", belowPegOffsetTypeValue); + } + Object belowPegOffsetValueValue = getBelowPegOffsetValue(); + if (belowPegOffsetValueValue != null) { + valMap.put("belowPegOffsetValue", belowPegOffsetValueValue); + } Object newOrderRespTypeValue = getNewOrderRespType(); if (newOrderRespTypeValue != null) { valMap.put("newOrderRespType", newOrderRespTypeValue); @@ -1108,6 +1358,9 @@ private String toIndentedString(Object o) { openapiFields.add("aboveTimeInForce"); openapiFields.add("aboveStrategyId"); openapiFields.add("aboveStrategyType"); + openapiFields.add("abovePegPriceType"); + openapiFields.add("abovePegOffsetType"); + openapiFields.add("abovePegOffsetValue"); openapiFields.add("belowType"); openapiFields.add("belowClientOrderId"); openapiFields.add("belowIcebergQty"); @@ -1117,6 +1370,9 @@ private String toIndentedString(Object o) { openapiFields.add("belowTimeInForce"); openapiFields.add("belowStrategyId"); openapiFields.add("belowStrategyType"); + openapiFields.add("belowPegPriceType"); + openapiFields.add("belowPegOffsetType"); + openapiFields.add("belowPegOffsetValue"); openapiFields.add("newOrderRespType"); openapiFields.add("selfTradePreventionMode"); openapiFields.add("recvWindow"); @@ -1199,6 +1455,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("aboveClientOrderId").toString())); } + // validate the optional field `abovePegPriceType` + if (jsonObj.get("abovePegPriceType") != null + && !jsonObj.get("abovePegPriceType").isJsonNull()) { + AbovePegPriceType.validateJsonElement(jsonObj.get("abovePegPriceType")); + } + // validate the optional field `abovePegOffsetType` + if (jsonObj.get("abovePegOffsetType") != null + && !jsonObj.get("abovePegOffsetType").isJsonNull()) { + AbovePegOffsetType.validateJsonElement(jsonObj.get("abovePegOffsetType")); + } // validate the required field `belowType` BelowType.validateJsonElement(jsonObj.get("belowType")); if ((jsonObj.get("belowClientOrderId") != null @@ -1215,6 +1481,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("belowTimeInForce").isJsonNull()) { BelowTimeInForce.validateJsonElement(jsonObj.get("belowTimeInForce")); } + // validate the optional field `belowPegPriceType` + if (jsonObj.get("belowPegPriceType") != null + && !jsonObj.get("belowPegPriceType").isJsonNull()) { + BelowPegPriceType.validateJsonElement(jsonObj.get("belowPegPriceType")); + } + // validate the optional field `belowPegOffsetType` + if (jsonObj.get("belowPegOffsetType") != null + && !jsonObj.get("belowPegOffsetType").isJsonNull()) { + BelowPegOffsetType.validateJsonElement(jsonObj.get("belowPegOffsetType")); + } // validate the optional field `newOrderRespType` if (jsonObj.get("newOrderRespType") != null && !jsonObj.get("newOrderRespType").isJsonNull()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoRequest.java index 54b2da69..6928f88c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoRequest.java @@ -120,6 +120,24 @@ public class OrderListPlaceOtoRequest extends BaseDTO { @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) @@ -186,6 +204,24 @@ public class OrderListPlaceOtoRequest extends BaseDTO { @jakarta.annotation.Nullable private Integer pendingStrategyType; + 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_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_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) @@ -468,6 +504,71 @@ public void setWorkingStrategyType(@jakarta.annotation.Nullable Integer workingS this.workingStrategyType = workingStrategyType; } + public OrderListPlaceOtoRequest 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 OrderListPlaceOtoRequest 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 OrderListPlaceOtoRequest 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 OrderListPlaceOtoRequest pendingType( @jakarta.annotation.Nonnull PendingType pendingType) { this.pendingType = pendingType; @@ -699,6 +800,71 @@ public void setPendingStrategyType(@jakarta.annotation.Nullable Integer pendingS this.pendingStrategyType = pendingStrategyType; } + public OrderListPlaceOtoRequest 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 OrderListPlaceOtoRequest 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 OrderListPlaceOtoRequest 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 OrderListPlaceOtoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -748,6 +914,12 @@ public boolean equals(Object o) { this.workingStrategyId, orderListPlaceOtoRequest.workingStrategyId) && Objects.equals( this.workingStrategyType, orderListPlaceOtoRequest.workingStrategyType) + && Objects.equals( + this.workingPegPriceType, orderListPlaceOtoRequest.workingPegPriceType) + && Objects.equals( + this.workingPegOffsetType, orderListPlaceOtoRequest.workingPegOffsetType) + && Objects.equals( + this.workingPegOffsetValue, orderListPlaceOtoRequest.workingPegOffsetValue) && Objects.equals(this.pendingType, orderListPlaceOtoRequest.pendingType) && Objects.equals(this.pendingSide, orderListPlaceOtoRequest.pendingSide) && Objects.equals( @@ -765,6 +937,12 @@ public boolean equals(Object o) { this.pendingStrategyId, orderListPlaceOtoRequest.pendingStrategyId) && Objects.equals( this.pendingStrategyType, orderListPlaceOtoRequest.pendingStrategyType) + && Objects.equals( + this.pendingPegOffsetType, orderListPlaceOtoRequest.pendingPegOffsetType) + && Objects.equals( + this.pendingPegPriceType, orderListPlaceOtoRequest.pendingPegPriceType) + && Objects.equals( + this.pendingPegOffsetValue, orderListPlaceOtoRequest.pendingPegOffsetValue) && Objects.equals(this.recvWindow, orderListPlaceOtoRequest.recvWindow); } @@ -784,6 +962,9 @@ public int hashCode() { workingTimeInForce, workingStrategyId, workingStrategyType, + workingPegPriceType, + workingPegOffsetType, + workingPegOffsetValue, pendingType, pendingSide, pendingClientOrderId, @@ -795,6 +976,9 @@ public int hashCode() { pendingTimeInForce, pendingStrategyId, pendingStrategyType, + pendingPegOffsetType, + pendingPegPriceType, + pendingPegOffsetValue, recvWindow); } @@ -823,6 +1007,15 @@ public String toString() { 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: ") @@ -842,6 +1035,15 @@ public String toString() { sb.append(" pendingStrategyType: ") .append(toIndentedString(pendingStrategyType)) .append("\n"); + sb.append(" pendingPegOffsetType: ") + .append(toIndentedString(pendingPegOffsetType)) + .append("\n"); + sb.append(" pendingPegPriceType: ") + .append(toIndentedString(pendingPegPriceType)) + .append("\n"); + sb.append(" pendingPegOffsetValue: ") + .append(toIndentedString(pendingPegOffsetValue)) + .append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -919,6 +1121,21 @@ public String toUrlQueryString() { 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(); @@ -979,6 +1196,21 @@ public String toUrlQueryString() { String pendingStrategyTypeValueAsString = pendingStrategyTypeValue.toString(); valMap.put("pendingStrategyType", pendingStrategyTypeValueAsString); } + PendingPegOffsetType pendingPegOffsetTypeValue = getPendingPegOffsetType(); + if (pendingPegOffsetTypeValue != null) { + String pendingPegOffsetTypeValueAsString = pendingPegOffsetTypeValue.toString(); + valMap.put("pendingPegOffsetType", pendingPegOffsetTypeValueAsString); + } + PendingPegPriceType pendingPegPriceTypeValue = getPendingPegPriceType(); + if (pendingPegPriceTypeValue != null) { + String pendingPegPriceTypeValueAsString = pendingPegPriceTypeValue.toString(); + valMap.put("pendingPegPriceType", pendingPegPriceTypeValueAsString); + } + Integer pendingPegOffsetValueValue = getPendingPegOffsetValue(); + if (pendingPegOffsetValueValue != null) { + String pendingPegOffsetValueValueAsString = pendingPegOffsetValueValue.toString(); + valMap.put("pendingPegOffsetValue", pendingPegOffsetValueValueAsString); + } Long recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { String recvWindowValueAsString = recvWindowValue.toString(); @@ -1047,6 +1279,18 @@ public Map toMap() { 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); @@ -1091,6 +1335,18 @@ public Map toMap() { if (pendingStrategyTypeValue != null) { valMap.put("pendingStrategyType", pendingStrategyTypeValue); } + Object pendingPegOffsetTypeValue = getPendingPegOffsetType(); + if (pendingPegOffsetTypeValue != null) { + valMap.put("pendingPegOffsetType", pendingPegOffsetTypeValue); + } + Object pendingPegPriceTypeValue = getPendingPegPriceType(); + if (pendingPegPriceTypeValue != null) { + valMap.put("pendingPegPriceType", pendingPegPriceTypeValue); + } + Object pendingPegOffsetValueValue = getPendingPegOffsetValue(); + if (pendingPegOffsetValueValue != null) { + valMap.put("pendingPegOffsetValue", pendingPegOffsetValueValue); + } Object recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { valMap.put("recvWindow", recvWindowValue); @@ -1134,6 +1390,9 @@ private String toIndentedString(Object o) { 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"); @@ -1145,6 +1404,9 @@ private String toIndentedString(Object o) { openapiFields.add("pendingTimeInForce"); openapiFields.add("pendingStrategyId"); openapiFields.add("pendingStrategyType"); + openapiFields.add("pendingPegOffsetType"); + openapiFields.add("pendingPegPriceType"); + openapiFields.add("pendingPegOffsetValue"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -1243,6 +1505,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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` @@ -1261,6 +1533,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("pendingTimeInForce").isJsonNull()) { PendingTimeInForce.validateJsonElement(jsonObj.get("pendingTimeInForce")); } + // validate the optional field `pendingPegOffsetType` + if (jsonObj.get("pendingPegOffsetType") != null + && !jsonObj.get("pendingPegOffsetType").isJsonNull()) { + PendingPegOffsetType.validateJsonElement(jsonObj.get("pendingPegOffsetType")); + } + // validate the optional field `pendingPegPriceType` + if (jsonObj.get("pendingPegPriceType") != null + && !jsonObj.get("pendingPegPriceType").isJsonNull()) { + PendingPegPriceType.validateJsonElement(jsonObj.get("pendingPegPriceType")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoRequest.java index 677f05b3..790afd7e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoRequest.java @@ -120,6 +120,24 @@ public class OrderListPlaceOtocoRequest extends BaseDTO { @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) @@ -190,6 +208,27 @@ public class OrderListPlaceOtocoRequest extends BaseDTO { @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) @@ -248,6 +287,27 @@ public class OrderListPlaceOtocoRequest extends BaseDTO { @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) @@ -531,6 +591,71 @@ public void setWorkingStrategyType(@jakarta.annotation.Nullable Integer workingS this.workingStrategyType = workingStrategyType; } + public OrderListPlaceOtocoRequest 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 OrderListPlaceOtocoRequest 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 OrderListPlaceOtocoRequest 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 OrderListPlaceOtocoRequest pendingSide( @jakarta.annotation.Nonnull PendingSide pendingSide) { this.pendingSide = pendingSide; @@ -769,6 +894,71 @@ public void setPendingAboveStrategyType( this.pendingAboveStrategyType = pendingAboveStrategyType; } + public OrderListPlaceOtocoRequest 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 OrderListPlaceOtocoRequest 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 OrderListPlaceOtocoRequest 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 OrderListPlaceOtocoRequest pendingBelowType( @jakarta.annotation.Nullable PendingBelowType pendingBelowType) { this.pendingBelowType = pendingBelowType; @@ -963,6 +1153,71 @@ public void setPendingBelowStrategyType( this.pendingBelowStrategyType = pendingBelowStrategyType; } + public OrderListPlaceOtocoRequest 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 OrderListPlaceOtocoRequest 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 OrderListPlaceOtocoRequest 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 OrderListPlaceOtocoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -1013,6 +1268,13 @@ public boolean equals(Object o) { this.workingStrategyId, orderListPlaceOtocoRequest.workingStrategyId) && Objects.equals( this.workingStrategyType, orderListPlaceOtocoRequest.workingStrategyType) + && Objects.equals( + this.workingPegPriceType, orderListPlaceOtocoRequest.workingPegPriceType) + && Objects.equals( + this.workingPegOffsetType, orderListPlaceOtocoRequest.workingPegOffsetType) + && Objects.equals( + this.workingPegOffsetValue, + orderListPlaceOtocoRequest.workingPegOffsetValue) && Objects.equals(this.pendingSide, orderListPlaceOtocoRequest.pendingSide) && Objects.equals(this.pendingQuantity, orderListPlaceOtocoRequest.pendingQuantity) && Objects.equals( @@ -1040,6 +1302,15 @@ public boolean equals(Object o) { && Objects.equals( this.pendingAboveStrategyType, orderListPlaceOtocoRequest.pendingAboveStrategyType) + && Objects.equals( + this.pendingAbovePegPriceType, + orderListPlaceOtocoRequest.pendingAbovePegPriceType) + && Objects.equals( + this.pendingAbovePegOffsetType, + orderListPlaceOtocoRequest.pendingAbovePegOffsetType) + && Objects.equals( + this.pendingAbovePegOffsetValue, + orderListPlaceOtocoRequest.pendingAbovePegOffsetValue) && Objects.equals( this.pendingBelowType, orderListPlaceOtocoRequest.pendingBelowType) && Objects.equals( @@ -1065,6 +1336,15 @@ public boolean equals(Object o) { && Objects.equals( this.pendingBelowStrategyType, orderListPlaceOtocoRequest.pendingBelowStrategyType) + && Objects.equals( + this.pendingBelowPegPriceType, + orderListPlaceOtocoRequest.pendingBelowPegPriceType) + && Objects.equals( + this.pendingBelowPegOffsetType, + orderListPlaceOtocoRequest.pendingBelowPegOffsetType) + && Objects.equals( + this.pendingBelowPegOffsetValue, + orderListPlaceOtocoRequest.pendingBelowPegOffsetValue) && Objects.equals(this.recvWindow, orderListPlaceOtocoRequest.recvWindow); } @@ -1084,6 +1364,9 @@ public int hashCode() { workingTimeInForce, workingStrategyId, workingStrategyType, + workingPegPriceType, + workingPegOffsetType, + workingPegOffsetValue, pendingSide, pendingQuantity, pendingAboveType, @@ -1095,6 +1378,9 @@ public int hashCode() { pendingAboveTimeInForce, pendingAboveStrategyId, pendingAboveStrategyType, + pendingAbovePegPriceType, + pendingAbovePegOffsetType, + pendingAbovePegOffsetValue, pendingBelowType, pendingBelowClientOrderId, pendingBelowPrice, @@ -1104,6 +1390,9 @@ public int hashCode() { pendingBelowTimeInForce, pendingBelowStrategyId, pendingBelowStrategyType, + pendingBelowPegPriceType, + pendingBelowPegOffsetType, + pendingBelowPegOffsetValue, recvWindow); } @@ -1132,6 +1421,15 @@ public String toString() { 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(" pendingQuantity: ").append(toIndentedString(pendingQuantity)).append("\n"); sb.append(" pendingAboveType: ").append(toIndentedString(pendingAboveType)).append("\n"); @@ -1157,6 +1455,15 @@ public String toString() { 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)) @@ -1180,6 +1487,15 @@ public String toString() { 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(); @@ -1257,6 +1573,21 @@ public String toUrlQueryString() { 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(); @@ -1318,6 +1649,23 @@ public String toUrlQueryString() { 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(); @@ -1368,6 +1716,23 @@ public String toUrlQueryString() { 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); + } Long recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { String recvWindowValueAsString = recvWindowValue.toString(); @@ -1436,6 +1801,18 @@ public Map toMap() { 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); @@ -1480,6 +1857,18 @@ public Map toMap() { 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); @@ -1516,6 +1905,18 @@ public Map toMap() { 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); @@ -1559,6 +1960,9 @@ private String toIndentedString(Object o) { openapiFields.add("workingTimeInForce"); openapiFields.add("workingStrategyId"); openapiFields.add("workingStrategyType"); + openapiFields.add("workingPegPriceType"); + openapiFields.add("workingPegOffsetType"); + openapiFields.add("workingPegOffsetValue"); openapiFields.add("pendingSide"); openapiFields.add("pendingQuantity"); openapiFields.add("pendingAboveType"); @@ -1570,6 +1974,9 @@ private String toIndentedString(Object o) { 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"); @@ -1579,6 +1986,9 @@ private String toIndentedString(Object o) { 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) @@ -1677,6 +2087,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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` @@ -1695,6 +2115,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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()) { @@ -1714,6 +2144,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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 { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceRequest.java index f6d071c6..c0f11275 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceRequest.java @@ -132,6 +132,24 @@ public class OrderPlaceRequest extends BaseDTO { @jakarta.annotation.Nullable private SelfTradePreventionMode selfTradePreventionMode; + public static final String SERIALIZED_NAME_PEG_PRICE_TYPE = "pegPriceType"; + + @SerializedName(SERIALIZED_NAME_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PegPriceType pegPriceType; + + public static final String SERIALIZED_NAME_PEG_OFFSET_VALUE = "pegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pegOffsetValue; + + public static final String SERIALIZED_NAME_PEG_OFFSET_TYPE = "pegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PegOffsetType pegOffsetType; + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -443,6 +461,66 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } + public OrderPlaceRequest pegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + return this; + } + + /** + * Get pegPriceType + * + * @return pegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PegPriceType getPegPriceType() { + return pegPriceType; + } + + public void setPegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + } + + public OrderPlaceRequest pegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + return this; + } + + /** + * Get pegOffsetValue + * + * @return pegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPegOffsetValue() { + return pegOffsetValue; + } + + public void setPegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + } + + public OrderPlaceRequest pegOffsetType( + @jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + return this; + } + + /** + * Get pegOffsetType + * + * @return pegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PegOffsetType getPegOffsetType() { + return pegOffsetType; + } + + public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + } + public OrderPlaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -487,6 +565,9 @@ public boolean equals(Object o) { && Objects.equals(this.strategyType, orderPlaceRequest.strategyType) && Objects.equals( this.selfTradePreventionMode, orderPlaceRequest.selfTradePreventionMode) + && Objects.equals(this.pegPriceType, orderPlaceRequest.pegPriceType) + && Objects.equals(this.pegOffsetValue, orderPlaceRequest.pegOffsetValue) + && Objects.equals(this.pegOffsetType, orderPlaceRequest.pegOffsetType) && Objects.equals(this.recvWindow, orderPlaceRequest.recvWindow); } @@ -508,6 +589,9 @@ public int hashCode() { strategyId, strategyType, selfTradePreventionMode, + pegPriceType, + pegOffsetValue, + pegOffsetType, recvWindow); } @@ -532,6 +616,9 @@ public String toString() { sb.append(" selfTradePreventionMode: ") .append(toIndentedString(selfTradePreventionMode)) .append("\n"); + sb.append(" pegPriceType: ").append(toIndentedString(pegPriceType)).append("\n"); + sb.append(" pegOffsetValue: ").append(toIndentedString(pegOffsetValue)).append("\n"); + sb.append(" pegOffsetType: ").append(toIndentedString(pegOffsetType)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -618,6 +705,21 @@ public String toUrlQueryString() { String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); } + PegPriceType pegPriceTypeValue = getPegPriceType(); + if (pegPriceTypeValue != null) { + String pegPriceTypeValueAsString = pegPriceTypeValue.toString(); + valMap.put("pegPriceType", pegPriceTypeValueAsString); + } + Integer pegOffsetValueValue = getPegOffsetValue(); + if (pegOffsetValueValue != null) { + String pegOffsetValueValueAsString = pegOffsetValueValue.toString(); + valMap.put("pegOffsetValue", pegOffsetValueValueAsString); + } + PegOffsetType pegOffsetTypeValue = getPegOffsetType(); + if (pegOffsetTypeValue != null) { + String pegOffsetTypeValueAsString = pegOffsetTypeValue.toString(); + valMap.put("pegOffsetType", pegOffsetTypeValueAsString); + } Long recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { String recvWindowValueAsString = recvWindowValue.toString(); @@ -694,6 +796,18 @@ public Map toMap() { if (selfTradePreventionModeValue != null) { valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); } + Object pegPriceTypeValue = getPegPriceType(); + if (pegPriceTypeValue != null) { + valMap.put("pegPriceType", pegPriceTypeValue); + } + Object pegOffsetValueValue = getPegOffsetValue(); + if (pegOffsetValueValue != null) { + valMap.put("pegOffsetValue", pegOffsetValueValue); + } + Object pegOffsetTypeValue = getPegOffsetType(); + if (pegOffsetTypeValue != null) { + valMap.put("pegOffsetType", pegOffsetTypeValue); + } Object recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { valMap.put("recvWindow", recvWindowValue); @@ -739,6 +853,9 @@ private String toIndentedString(Object o) { openapiFields.add("strategyId"); openapiFields.add("strategyType"); openapiFields.add("selfTradePreventionMode"); + openapiFields.add("pegPriceType"); + openapiFields.add("pegOffsetValue"); + openapiFields.add("pegOffsetType"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -822,6 +939,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { SelfTradePreventionMode.validateJsonElement(jsonObj.get("selfTradePreventionMode")); } + // validate the optional field `pegPriceType` + if (jsonObj.get("pegPriceType") != null && !jsonObj.get("pegPriceType").isJsonNull()) { + PegPriceType.validateJsonElement(jsonObj.get("pegPriceType")); + } + // validate the optional field `pegOffsetType` + if (jsonObj.get("pegOffsetType") != null && !jsonObj.get("pegOffsetType").isJsonNull()) { + PegOffsetType.validateJsonElement(jsonObj.get("pegOffsetType")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestRequest.java index 015f5a26..d6f0a85a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestRequest.java @@ -138,6 +138,24 @@ public class OrderTestRequest extends BaseDTO { @jakarta.annotation.Nullable private SelfTradePreventionMode selfTradePreventionMode; + public static final String SERIALIZED_NAME_PEG_PRICE_TYPE = "pegPriceType"; + + @SerializedName(SERIALIZED_NAME_PEG_PRICE_TYPE) + @jakarta.annotation.Nullable + private PegPriceType pegPriceType; + + public static final String SERIALIZED_NAME_PEG_OFFSET_VALUE = "pegOffsetValue"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_VALUE) + @jakarta.annotation.Nullable + private Integer pegOffsetValue; + + public static final String SERIALIZED_NAME_PEG_OFFSET_TYPE = "pegOffsetType"; + + @SerializedName(SERIALIZED_NAME_PEG_OFFSET_TYPE) + @jakarta.annotation.Nullable + private PegOffsetType pegOffsetType; + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -469,6 +487,66 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } + public OrderTestRequest pegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + return this; + } + + /** + * Get pegPriceType + * + * @return pegPriceType + */ + @jakarta.annotation.Nullable + @Valid + public PegPriceType getPegPriceType() { + return pegPriceType; + } + + public void setPegPriceType(@jakarta.annotation.Nullable PegPriceType pegPriceType) { + this.pegPriceType = pegPriceType; + } + + public OrderTestRequest pegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + return this; + } + + /** + * Get pegOffsetValue + * + * @return pegOffsetValue + */ + @jakarta.annotation.Nullable + public Integer getPegOffsetValue() { + return pegOffsetValue; + } + + public void setPegOffsetValue(@jakarta.annotation.Nullable Integer pegOffsetValue) { + this.pegOffsetValue = pegOffsetValue; + } + + public OrderTestRequest pegOffsetType( + @jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + return this; + } + + /** + * Get pegOffsetType + * + * @return pegOffsetType + */ + @jakarta.annotation.Nullable + @Valid + public PegOffsetType getPegOffsetType() { + return pegOffsetType; + } + + public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + } + public OrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -514,6 +592,9 @@ public boolean equals(Object o) { && Objects.equals(this.strategyType, orderTestRequest.strategyType) && Objects.equals( this.selfTradePreventionMode, orderTestRequest.selfTradePreventionMode) + && Objects.equals(this.pegPriceType, orderTestRequest.pegPriceType) + && Objects.equals(this.pegOffsetValue, orderTestRequest.pegOffsetValue) + && Objects.equals(this.pegOffsetType, orderTestRequest.pegOffsetType) && Objects.equals(this.recvWindow, orderTestRequest.recvWindow); } @@ -536,6 +617,9 @@ public int hashCode() { strategyId, strategyType, selfTradePreventionMode, + pegPriceType, + pegOffsetValue, + pegOffsetType, recvWindow); } @@ -563,6 +647,9 @@ public String toString() { sb.append(" selfTradePreventionMode: ") .append(toIndentedString(selfTradePreventionMode)) .append("\n"); + sb.append(" pegPriceType: ").append(toIndentedString(pegPriceType)).append("\n"); + sb.append(" pegOffsetValue: ").append(toIndentedString(pegOffsetValue)).append("\n"); + sb.append(" pegOffsetType: ").append(toIndentedString(pegOffsetType)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -654,6 +741,21 @@ public String toUrlQueryString() { String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); } + PegPriceType pegPriceTypeValue = getPegPriceType(); + if (pegPriceTypeValue != null) { + String pegPriceTypeValueAsString = pegPriceTypeValue.toString(); + valMap.put("pegPriceType", pegPriceTypeValueAsString); + } + Integer pegOffsetValueValue = getPegOffsetValue(); + if (pegOffsetValueValue != null) { + String pegOffsetValueValueAsString = pegOffsetValueValue.toString(); + valMap.put("pegOffsetValue", pegOffsetValueValueAsString); + } + PegOffsetType pegOffsetTypeValue = getPegOffsetType(); + if (pegOffsetTypeValue != null) { + String pegOffsetTypeValueAsString = pegOffsetTypeValue.toString(); + valMap.put("pegOffsetType", pegOffsetTypeValueAsString); + } Long recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { String recvWindowValueAsString = recvWindowValue.toString(); @@ -734,6 +836,18 @@ public Map toMap() { if (selfTradePreventionModeValue != null) { valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); } + Object pegPriceTypeValue = getPegPriceType(); + if (pegPriceTypeValue != null) { + valMap.put("pegPriceType", pegPriceTypeValue); + } + Object pegOffsetValueValue = getPegOffsetValue(); + if (pegOffsetValueValue != null) { + valMap.put("pegOffsetValue", pegOffsetValueValue); + } + Object pegOffsetTypeValue = getPegOffsetType(); + if (pegOffsetTypeValue != null) { + valMap.put("pegOffsetType", pegOffsetTypeValue); + } Object recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { valMap.put("recvWindow", recvWindowValue); @@ -780,6 +894,9 @@ private String toIndentedString(Object o) { openapiFields.add("strategyId"); openapiFields.add("strategyType"); openapiFields.add("selfTradePreventionMode"); + openapiFields.add("pegPriceType"); + openapiFields.add("pegOffsetValue"); + openapiFields.add("pegOffsetType"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -863,6 +980,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { SelfTradePreventionMode.validateJsonElement(jsonObj.get("selfTradePreventionMode")); } + // validate the optional field `pegPriceType` + if (jsonObj.get("pegPriceType") != null && !jsonObj.get("pegPriceType").isJsonNull()) { + PegPriceType.validateJsonElement(jsonObj.get("pegPriceType")); + } + // validate the optional field `pegOffsetType` + if (jsonObj.get("pegOffsetType") != null && !jsonObj.get("pegOffsetType").isJsonNull()) { + PegOffsetType.validateJsonElement(jsonObj.get("pegOffsetType")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponseResult.java index 5a3c093f..bb96e782 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponseResult.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponseResult.java @@ -47,6 +47,13 @@ public class OrderTestResponseResult extends BaseDTO { @jakarta.annotation.Nullable private OrderTestResponseResultStandardCommissionForOrder standardCommissionForOrder; + public static final String SERIALIZED_NAME_SPECIAL_COMMISSION_FOR_ORDER = + "specialCommissionForOrder"; + + @SerializedName(SERIALIZED_NAME_SPECIAL_COMMISSION_FOR_ORDER) + @jakarta.annotation.Nullable + private OrderTestResponseResultSpecialCommissionForOrder specialCommissionForOrder; + public static final String SERIALIZED_NAME_TAX_COMMISSION_FOR_ORDER = "taxCommissionForOrder"; @SerializedName(SERIALIZED_NAME_TAX_COMMISSION_FOR_ORDER) @@ -85,6 +92,30 @@ public void setStandardCommissionForOrder( this.standardCommissionForOrder = standardCommissionForOrder; } + public OrderTestResponseResult specialCommissionForOrder( + @jakarta.annotation.Nullable + OrderTestResponseResultSpecialCommissionForOrder specialCommissionForOrder) { + this.specialCommissionForOrder = specialCommissionForOrder; + return this; + } + + /** + * Get specialCommissionForOrder + * + * @return specialCommissionForOrder + */ + @jakarta.annotation.Nullable + @Valid + public OrderTestResponseResultSpecialCommissionForOrder getSpecialCommissionForOrder() { + return specialCommissionForOrder; + } + + public void setSpecialCommissionForOrder( + @jakarta.annotation.Nullable + OrderTestResponseResultSpecialCommissionForOrder specialCommissionForOrder) { + this.specialCommissionForOrder = specialCommissionForOrder; + } + public OrderTestResponseResult taxCommissionForOrder( @jakarta.annotation.Nullable OrderTestResponseResultStandardCommissionForOrder taxCommissionForOrder) { @@ -142,6 +173,9 @@ public boolean equals(Object o) { return Objects.equals( this.standardCommissionForOrder, orderTestResponseResult.standardCommissionForOrder) + && Objects.equals( + this.specialCommissionForOrder, + orderTestResponseResult.specialCommissionForOrder) && Objects.equals( this.taxCommissionForOrder, orderTestResponseResult.taxCommissionForOrder) && Objects.equals(this.discount, orderTestResponseResult.discount); @@ -149,7 +183,11 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(standardCommissionForOrder, taxCommissionForOrder, discount); + return Objects.hash( + standardCommissionForOrder, + specialCommissionForOrder, + taxCommissionForOrder, + discount); } @Override @@ -159,6 +197,9 @@ public String toString() { sb.append(" standardCommissionForOrder: ") .append(toIndentedString(standardCommissionForOrder)) .append("\n"); + sb.append(" specialCommissionForOrder: ") + .append(toIndentedString(specialCommissionForOrder)) + .append("\n"); sb.append(" taxCommissionForOrder: ") .append(toIndentedString(taxCommissionForOrder)) .append("\n"); @@ -178,6 +219,13 @@ public String toUrlQueryString() { JSON.getGson().toJson(standardCommissionForOrderValue); valMap.put("standardCommissionForOrder", standardCommissionForOrderValueAsString); } + OrderTestResponseResultSpecialCommissionForOrder specialCommissionForOrderValue = + getSpecialCommissionForOrder(); + if (specialCommissionForOrderValue != null) { + String specialCommissionForOrderValueAsString = + JSON.getGson().toJson(specialCommissionForOrderValue); + valMap.put("specialCommissionForOrder", specialCommissionForOrderValueAsString); + } OrderTestResponseResultStandardCommissionForOrder taxCommissionForOrderValue = getTaxCommissionForOrder(); if (taxCommissionForOrderValue != null) { @@ -205,6 +253,10 @@ public Map toMap() { if (standardCommissionForOrderValue != null) { valMap.put("standardCommissionForOrder", standardCommissionForOrderValue); } + Object specialCommissionForOrderValue = getSpecialCommissionForOrder(); + if (specialCommissionForOrderValue != null) { + valMap.put("specialCommissionForOrder", specialCommissionForOrderValue); + } Object taxCommissionForOrderValue = getTaxCommissionForOrder(); if (taxCommissionForOrderValue != null) { valMap.put("taxCommissionForOrder", taxCommissionForOrderValue); @@ -240,6 +292,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("standardCommissionForOrder"); + openapiFields.add("specialCommissionForOrder"); openapiFields.add("taxCommissionForOrder"); openapiFields.add("discount"); @@ -283,6 +336,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderTestResponseResultStandardCommissionForOrder.validateJsonElement( jsonObj.get("standardCommissionForOrder")); } + // validate the optional field `specialCommissionForOrder` + if (jsonObj.get("specialCommissionForOrder") != null + && !jsonObj.get("specialCommissionForOrder").isJsonNull()) { + OrderTestResponseResultSpecialCommissionForOrder.validateJsonElement( + jsonObj.get("specialCommissionForOrder")); + } // validate the optional field `taxCommissionForOrder` if (jsonObj.get("taxCommissionForOrder") != null && !jsonObj.get("taxCommissionForOrder").isJsonNull()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponseResultSpecialCommissionForOrder.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponseResultSpecialCommissionForOrder.java new file mode 100644 index 00000000..c52d458c --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponseResultSpecialCommissionForOrder.java @@ -0,0 +1,306 @@ +/* + * 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.*; + +/** OrderTestResponseResultSpecialCommissionForOrder */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderTestResponseResultSpecialCommissionForOrder extends BaseDTO { + public static final String SERIALIZED_NAME_MAKER = "maker"; + + @SerializedName(SERIALIZED_NAME_MAKER) + @jakarta.annotation.Nullable + private String maker; + + public static final String SERIALIZED_NAME_TAKER = "taker"; + + @SerializedName(SERIALIZED_NAME_TAKER) + @jakarta.annotation.Nullable + private String taker; + + public OrderTestResponseResultSpecialCommissionForOrder() {} + + public OrderTestResponseResultSpecialCommissionForOrder maker( + @jakarta.annotation.Nullable String maker) { + this.maker = maker; + return this; + } + + /** + * Get maker + * + * @return maker + */ + @jakarta.annotation.Nullable + public String getMaker() { + return maker; + } + + public void setMaker(@jakarta.annotation.Nullable String maker) { + this.maker = maker; + } + + public OrderTestResponseResultSpecialCommissionForOrder taker( + @jakarta.annotation.Nullable String taker) { + this.taker = taker; + return this; + } + + /** + * Get taker + * + * @return taker + */ + @jakarta.annotation.Nullable + public String getTaker() { + return taker; + } + + public void setTaker(@jakarta.annotation.Nullable String taker) { + this.taker = taker; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderTestResponseResultSpecialCommissionForOrder + orderTestResponseResultSpecialCommissionForOrder = + (OrderTestResponseResultSpecialCommissionForOrder) o; + return Objects.equals(this.maker, orderTestResponseResultSpecialCommissionForOrder.maker) + && Objects.equals( + this.taker, orderTestResponseResultSpecialCommissionForOrder.taker); + } + + @Override + public int hashCode() { + return Objects.hash(maker, taker); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderTestResponseResultSpecialCommissionForOrder {\n"); + sb.append(" maker: ").append(toIndentedString(maker)).append("\n"); + sb.append(" taker: ").append(toIndentedString(taker)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String makerValue = getMaker(); + if (makerValue != null) { + String makerValueAsString = makerValue.toString(); + valMap.put("maker", makerValueAsString); + } + String takerValue = getTaker(); + if (takerValue != null) { + String takerValueAsString = takerValue.toString(); + valMap.put("taker", takerValueAsString); + } + + 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 makerValue = getMaker(); + if (makerValue != null) { + valMap.put("maker", makerValue); + } + Object takerValue = getTaker(); + if (takerValue != null) { + valMap.put("taker", takerValue); + } + + 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("maker"); + openapiFields.add("taker"); + + // 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 + * OrderTestResponseResultSpecialCommissionForOrder + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderTestResponseResultSpecialCommissionForOrder.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " OrderTestResponseResultSpecialCommissionForOrder is not" + + " found in the empty JSON string", + OrderTestResponseResultSpecialCommissionForOrder + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderTestResponseResultSpecialCommissionForOrder.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderTestResponseResultSpecialCommissionForOrder`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("maker") != null && !jsonObj.get("maker").isJsonNull()) + && !jsonObj.get("maker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maker` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maker").toString())); + } + if ((jsonObj.get("taker") != null && !jsonObj.get("taker").isJsonNull()) + && !jsonObj.get("taker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `taker` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("taker").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderTestResponseResultSpecialCommissionForOrder.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'OrderTestResponseResultSpecialCommissionForOrder' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(OrderTestResponseResultSpecialCommissionForOrder.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + OrderTestResponseResultSpecialCommissionForOrder value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderTestResponseResultSpecialCommissionForOrder read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderTestResponseResultSpecialCommissionForOrder given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderTestResponseResultSpecialCommissionForOrder + * @throws IOException if the JSON string is invalid with respect to + * OrderTestResponseResultSpecialCommissionForOrder + */ + public static OrderTestResponseResultSpecialCommissionForOrder fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, OrderTestResponseResultSpecialCommissionForOrder.class); + } + + /** + * Convert an instance of OrderTestResponseResultSpecialCommissionForOrder 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/PegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PegOffsetType.java new file mode 100644 index 00000000..6104b4cb --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PegOffsetType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pegOffsetType */ +@JsonAdapter(PegOffsetType.Adapter.class) +public enum PegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"), + + NON_REPRESENTABLE("NON_REPRESENTABLE"); + + private String value; + + PegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PegOffsetType fromValue(String value) { + for (PegOffsetType b : PegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PegPriceType.java new file mode 100644 index 00000000..fa6ce298 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PegPriceType.java @@ -0,0 +1,75 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pegPriceType */ +@JsonAdapter(PegPriceType.Adapter.class) +public enum PegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"), + + NON_REPRESENTABLE("NON_REPRESENTABLE"); + + private String value; + + PegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PegPriceType fromValue(String value) { + for (PegPriceType b : PegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingAbovePegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingAbovePegOffsetType.java new file mode 100644 index 00000000..e38471a5 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingAbovePegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingAbovePegOffsetType */ +@JsonAdapter(PendingAbovePegOffsetType.Adapter.class) +public enum PendingAbovePegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + PendingAbovePegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingAbovePegOffsetType fromValue(String value) { + for (PendingAbovePegOffsetType b : PendingAbovePegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingAbovePegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingAbovePegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingAbovePegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingAbovePegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingAbovePegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingAbovePegPriceType.java new file mode 100644 index 00000000..14b49832 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingAbovePegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingAbovePegPriceType */ +@JsonAdapter(PendingAbovePegPriceType.Adapter.class) +public enum PendingAbovePegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + PendingAbovePegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingAbovePegPriceType fromValue(String value) { + for (PendingAbovePegPriceType b : PendingAbovePegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingAbovePegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingAbovePegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingAbovePegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingAbovePegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingBelowPegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingBelowPegOffsetType.java new file mode 100644 index 00000000..ae5f6ec8 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingBelowPegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingBelowPegOffsetType */ +@JsonAdapter(PendingBelowPegOffsetType.Adapter.class) +public enum PendingBelowPegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + PendingBelowPegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingBelowPegOffsetType fromValue(String value) { + for (PendingBelowPegOffsetType b : PendingBelowPegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingBelowPegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingBelowPegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingBelowPegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingBelowPegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingBelowPegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingBelowPegPriceType.java new file mode 100644 index 00000000..07baaf36 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingBelowPegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingBelowPegPriceType */ +@JsonAdapter(PendingBelowPegPriceType.Adapter.class) +public enum PendingBelowPegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + PendingBelowPegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingBelowPegPriceType fromValue(String value) { + for (PendingBelowPegPriceType b : PendingBelowPegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingBelowPegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingBelowPegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingBelowPegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingBelowPegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingPegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingPegOffsetType.java new file mode 100644 index 00000000..ba80a20b --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingPegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingPegOffsetType */ +@JsonAdapter(PendingPegOffsetType.Adapter.class) +public enum PendingPegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + PendingPegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingPegOffsetType fromValue(String value) { + for (PendingPegOffsetType b : PendingPegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingPegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingPegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingPegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingPegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingPegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingPegPriceType.java new file mode 100644 index 00000000..b72ee399 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PendingPegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets pendingPegPriceType */ +@JsonAdapter(PendingPegPriceType.Adapter.class) +public enum PendingPegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + PendingPegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PendingPegPriceType fromValue(String value) { + for (PendingPegPriceType b : PendingPegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PendingPegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PendingPegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PendingPegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PendingPegPriceType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SessionSubscriptionsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SessionSubscriptionsResponse.java new file mode 100644 index 00000000..5872066c --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SessionSubscriptionsResponse.java @@ -0,0 +1,357 @@ +/* + * 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.*; + +/** SessionSubscriptionsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SessionSubscriptionsResponse 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_RESULT = "result"; + + @SerializedName(SERIALIZED_NAME_RESULT) + @jakarta.annotation.Nullable + private List<@Valid SessionSubscriptionsResponseResultInner> result; + + public SessionSubscriptionsResponse() {} + + public SessionSubscriptionsResponse 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 SessionSubscriptionsResponse 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 SessionSubscriptionsResponse result( + @jakarta.annotation.Nullable + List<@Valid SessionSubscriptionsResponseResultInner> result) { + this.result = result; + return this; + } + + public SessionSubscriptionsResponse addResultItem( + SessionSubscriptionsResponseResultInner resultItem) { + if (this.result == null) { + this.result = new ArrayList<>(); + } + this.result.add(resultItem); + return this; + } + + /** + * Get result + * + * @return result + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid SessionSubscriptionsResponseResultInner> getResult() { + return result; + } + + public void setResult( + @jakarta.annotation.Nullable + List<@Valid SessionSubscriptionsResponseResultInner> result) { + this.result = result; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionSubscriptionsResponse sessionSubscriptionsResponse = + (SessionSubscriptionsResponse) o; + return Objects.equals(this.id, sessionSubscriptionsResponse.id) + && Objects.equals(this.status, sessionSubscriptionsResponse.status) + && Objects.equals(this.result, sessionSubscriptionsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, result); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionSubscriptionsResponse {\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("}"); + 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); + } + List<@Valid SessionSubscriptionsResponseResultInner> resultValue = getResult(); + if (resultValue != null) { + String resultValueAsString = JSON.getGson().toJson(resultValue); + valMap.put("result", resultValueAsString); + } + + 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 resultValue = getResult(); + if (resultValue != null) { + valMap.put("result", resultValue); + } + + 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("result"); + + // 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 + * SessionSubscriptionsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionSubscriptionsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SessionSubscriptionsResponse is not" + + " found in the empty JSON string", + SessionSubscriptionsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionSubscriptionsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SessionSubscriptionsResponse` 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("result") != null && !jsonObj.get("result").isJsonNull()) { + JsonArray jsonArrayresult = jsonObj.getAsJsonArray("result"); + if (jsonArrayresult != null) { + // ensure the json data is an array + if (!jsonObj.get("result").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `result` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("result").toString())); + } + + // validate the optional field `result` (array) + for (int i = 0; i < jsonArrayresult.size(); i++) { + SessionSubscriptionsResponseResultInner.validateJsonElement( + jsonArrayresult.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionSubscriptionsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionSubscriptionsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(SessionSubscriptionsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionSubscriptionsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionSubscriptionsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SessionSubscriptionsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionSubscriptionsResponse + * @throws IOException if the JSON string is invalid with respect to + * SessionSubscriptionsResponse + */ + public static SessionSubscriptionsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionSubscriptionsResponse.class); + } + + /** + * Convert an instance of SessionSubscriptionsResponse 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/SessionSubscriptionsResponseResultInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SessionSubscriptionsResponseResultInner.java new file mode 100644 index 00000000..e4447e17 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SessionSubscriptionsResponseResultInner.java @@ -0,0 +1,246 @@ +/* + * 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.*; + +/** SessionSubscriptionsResponseResultInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SessionSubscriptionsResponseResultInner extends BaseDTO { + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscriptionId"; + + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + @jakarta.annotation.Nullable + private Long subscriptionId; + + public SessionSubscriptionsResponseResultInner() {} + + public SessionSubscriptionsResponseResultInner subscriptionId( + @jakarta.annotation.Nullable Long subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get subscriptionId + * + * @return subscriptionId + */ + @jakarta.annotation.Nullable + public Long getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(@jakarta.annotation.Nullable Long subscriptionId) { + this.subscriptionId = subscriptionId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionSubscriptionsResponseResultInner sessionSubscriptionsResponseResultInner = + (SessionSubscriptionsResponseResultInner) o; + return Objects.equals( + this.subscriptionId, sessionSubscriptionsResponseResultInner.subscriptionId); + } + + @Override + public int hashCode() { + return Objects.hash(subscriptionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionSubscriptionsResponseResultInner {\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long subscriptionIdValue = getSubscriptionId(); + if (subscriptionIdValue != null) { + String subscriptionIdValueAsString = subscriptionIdValue.toString(); + valMap.put("subscriptionId", subscriptionIdValueAsString); + } + + 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 subscriptionIdValue = getSubscriptionId(); + if (subscriptionIdValue != null) { + valMap.put("subscriptionId", subscriptionIdValue); + } + + 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("subscriptionId"); + + // 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 + * SessionSubscriptionsResponseResultInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionSubscriptionsResponseResultInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " SessionSubscriptionsResponseResultInner is not found in the" + + " empty JSON string", + SessionSubscriptionsResponseResultInner.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionSubscriptionsResponseResultInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SessionSubscriptionsResponseResultInner` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionSubscriptionsResponseResultInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'SessionSubscriptionsResponseResultInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(SessionSubscriptionsResponseResultInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, SessionSubscriptionsResponseResultInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionSubscriptionsResponseResultInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SessionSubscriptionsResponseResultInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionSubscriptionsResponseResultInner + * @throws IOException if the JSON string is invalid with respect to + * SessionSubscriptionsResponseResultInner + */ + public static SessionSubscriptionsResponseResultInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, SessionSubscriptionsResponseResultInner.class); + } + + /** + * Convert an instance of SessionSubscriptionsResponseResultInner 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/SorOrderTestResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponse.java index aa92866a..bbe8726e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponse.java @@ -56,7 +56,7 @@ public class SorOrderTestResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RESULT) @jakarta.annotation.Nullable - private OrderTestResponseResult result; + private SorOrderTestResponseResult result; public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; @@ -105,7 +105,7 @@ public void setStatus(@jakarta.annotation.Nullable Long status) { } public SorOrderTestResponse result( - @jakarta.annotation.Nullable OrderTestResponseResult result) { + @jakarta.annotation.Nullable SorOrderTestResponseResult result) { this.result = result; return this; } @@ -117,11 +117,11 @@ public SorOrderTestResponse result( */ @jakarta.annotation.Nullable @Valid - public OrderTestResponseResult getResult() { + public SorOrderTestResponseResult getResult() { return result; } - public void setResult(@jakarta.annotation.Nullable OrderTestResponseResult result) { + public void setResult(@jakarta.annotation.Nullable SorOrderTestResponseResult result) { this.result = result; } @@ -191,7 +191,7 @@ public String toUrlQueryString() { String statusValueAsString = statusValue.toString(); valMap.put("status", statusValueAsString); } - OrderTestResponseResult resultValue = getResult(); + SorOrderTestResponseResult resultValue = getResult(); if (resultValue != null) { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); @@ -303,7 +303,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `result` if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { - OrderTestResponseResult.validateJsonElement(jsonObj.get("result")); + SorOrderTestResponseResult.validateJsonElement(jsonObj.get("result")); } } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponseResult.java new file mode 100644 index 00000000..c4bff1b3 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponseResult.java @@ -0,0 +1,349 @@ +/* + * 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.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.*; + +/** SorOrderTestResponseResult */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SorOrderTestResponseResult extends BaseDTO { + public static final String SERIALIZED_NAME_STANDARD_COMMISSION_FOR_ORDER = + "standardCommissionForOrder"; + + @SerializedName(SERIALIZED_NAME_STANDARD_COMMISSION_FOR_ORDER) + @jakarta.annotation.Nullable + private OrderTestResponseResultStandardCommissionForOrder standardCommissionForOrder; + + public static final String SERIALIZED_NAME_TAX_COMMISSION_FOR_ORDER = "taxCommissionForOrder"; + + @SerializedName(SERIALIZED_NAME_TAX_COMMISSION_FOR_ORDER) + @jakarta.annotation.Nullable + private OrderTestResponseResultStandardCommissionForOrder taxCommissionForOrder; + + public static final String SERIALIZED_NAME_DISCOUNT = "discount"; + + @SerializedName(SERIALIZED_NAME_DISCOUNT) + @jakarta.annotation.Nullable + private OrderTestResponseResultDiscount discount; + + public SorOrderTestResponseResult() {} + + public SorOrderTestResponseResult standardCommissionForOrder( + @jakarta.annotation.Nullable + OrderTestResponseResultStandardCommissionForOrder standardCommissionForOrder) { + this.standardCommissionForOrder = standardCommissionForOrder; + return this; + } + + /** + * Get standardCommissionForOrder + * + * @return standardCommissionForOrder + */ + @jakarta.annotation.Nullable + @Valid + public OrderTestResponseResultStandardCommissionForOrder getStandardCommissionForOrder() { + return standardCommissionForOrder; + } + + public void setStandardCommissionForOrder( + @jakarta.annotation.Nullable + OrderTestResponseResultStandardCommissionForOrder standardCommissionForOrder) { + this.standardCommissionForOrder = standardCommissionForOrder; + } + + public SorOrderTestResponseResult taxCommissionForOrder( + @jakarta.annotation.Nullable + OrderTestResponseResultStandardCommissionForOrder taxCommissionForOrder) { + this.taxCommissionForOrder = taxCommissionForOrder; + return this; + } + + /** + * Get taxCommissionForOrder + * + * @return taxCommissionForOrder + */ + @jakarta.annotation.Nullable + @Valid + public OrderTestResponseResultStandardCommissionForOrder getTaxCommissionForOrder() { + return taxCommissionForOrder; + } + + public void setTaxCommissionForOrder( + @jakarta.annotation.Nullable + OrderTestResponseResultStandardCommissionForOrder taxCommissionForOrder) { + this.taxCommissionForOrder = taxCommissionForOrder; + } + + public SorOrderTestResponseResult discount( + @jakarta.annotation.Nullable OrderTestResponseResultDiscount discount) { + this.discount = discount; + return this; + } + + /** + * Get discount + * + * @return discount + */ + @jakarta.annotation.Nullable + @Valid + public OrderTestResponseResultDiscount getDiscount() { + return discount; + } + + public void setDiscount(@jakarta.annotation.Nullable OrderTestResponseResultDiscount discount) { + this.discount = discount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SorOrderTestResponseResult sorOrderTestResponseResult = (SorOrderTestResponseResult) o; + return Objects.equals( + this.standardCommissionForOrder, + sorOrderTestResponseResult.standardCommissionForOrder) + && Objects.equals( + this.taxCommissionForOrder, + sorOrderTestResponseResult.taxCommissionForOrder) + && Objects.equals(this.discount, sorOrderTestResponseResult.discount); + } + + @Override + public int hashCode() { + return Objects.hash(standardCommissionForOrder, taxCommissionForOrder, discount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SorOrderTestResponseResult {\n"); + sb.append(" standardCommissionForOrder: ") + .append(toIndentedString(standardCommissionForOrder)) + .append("\n"); + sb.append(" taxCommissionForOrder: ") + .append(toIndentedString(taxCommissionForOrder)) + .append("\n"); + sb.append(" discount: ").append(toIndentedString(discount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + OrderTestResponseResultStandardCommissionForOrder standardCommissionForOrderValue = + getStandardCommissionForOrder(); + if (standardCommissionForOrderValue != null) { + String standardCommissionForOrderValueAsString = + JSON.getGson().toJson(standardCommissionForOrderValue); + valMap.put("standardCommissionForOrder", standardCommissionForOrderValueAsString); + } + OrderTestResponseResultStandardCommissionForOrder taxCommissionForOrderValue = + getTaxCommissionForOrder(); + if (taxCommissionForOrderValue != null) { + String taxCommissionForOrderValueAsString = + JSON.getGson().toJson(taxCommissionForOrderValue); + valMap.put("taxCommissionForOrder", taxCommissionForOrderValueAsString); + } + OrderTestResponseResultDiscount discountValue = getDiscount(); + if (discountValue != null) { + String discountValueAsString = JSON.getGson().toJson(discountValue); + valMap.put("discount", discountValueAsString); + } + + 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 standardCommissionForOrderValue = getStandardCommissionForOrder(); + if (standardCommissionForOrderValue != null) { + valMap.put("standardCommissionForOrder", standardCommissionForOrderValue); + } + Object taxCommissionForOrderValue = getTaxCommissionForOrder(); + if (taxCommissionForOrderValue != null) { + valMap.put("taxCommissionForOrder", taxCommissionForOrderValue); + } + Object discountValue = getDiscount(); + if (discountValue != null) { + valMap.put("discount", discountValue); + } + + 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("standardCommissionForOrder"); + openapiFields.add("taxCommissionForOrder"); + openapiFields.add("discount"); + + // 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 SorOrderTestResponseResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SorOrderTestResponseResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SorOrderTestResponseResult is not" + + " found in the empty JSON string", + SorOrderTestResponseResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SorOrderTestResponseResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SorOrderTestResponseResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `standardCommissionForOrder` + if (jsonObj.get("standardCommissionForOrder") != null + && !jsonObj.get("standardCommissionForOrder").isJsonNull()) { + OrderTestResponseResultStandardCommissionForOrder.validateJsonElement( + jsonObj.get("standardCommissionForOrder")); + } + // validate the optional field `taxCommissionForOrder` + if (jsonObj.get("taxCommissionForOrder") != null + && !jsonObj.get("taxCommissionForOrder").isJsonNull()) { + OrderTestResponseResultStandardCommissionForOrder.validateJsonElement( + jsonObj.get("taxCommissionForOrder")); + } + // validate the optional field `discount` + if (jsonObj.get("discount") != null && !jsonObj.get("discount").isJsonNull()) { + OrderTestResponseResultDiscount.validateJsonElement(jsonObj.get("discount")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SorOrderTestResponseResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SorOrderTestResponseResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SorOrderTestResponseResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SorOrderTestResponseResult value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SorOrderTestResponseResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SorOrderTestResponseResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of SorOrderTestResponseResult + * @throws IOException if the JSON string is invalid with respect to SorOrderTestResponseResult + */ + public static SorOrderTestResponseResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SorOrderTestResponseResult.class); + } + + /** + * Convert an instance of SorOrderTestResponseResult 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/UserDataStreamSubscribeResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamSubscribeResponse.java index 9423b528..1f179b8f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamSubscribeResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamSubscribeResponse.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; @@ -55,7 +56,7 @@ public class UserDataStreamSubscribeResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RESULT) @jakarta.annotation.Nullable - private Object result; + private SessionSubscriptionsResponseResultInner result; public UserDataStreamSubscribeResponse() {} @@ -97,7 +98,8 @@ public void setStatus(@jakarta.annotation.Nullable Long status) { this.status = status; } - public UserDataStreamSubscribeResponse result(@jakarta.annotation.Nullable Object result) { + public UserDataStreamSubscribeResponse result( + @jakarta.annotation.Nullable SessionSubscriptionsResponseResultInner result) { this.result = result; return this; } @@ -108,11 +110,13 @@ public UserDataStreamSubscribeResponse result(@jakarta.annotation.Nullable Objec * @return result */ @jakarta.annotation.Nullable - public Object getResult() { + @Valid + public SessionSubscriptionsResponseResultInner getResult() { return result; } - public void setResult(@jakarta.annotation.Nullable Object result) { + public void setResult( + @jakarta.annotation.Nullable SessionSubscriptionsResponseResultInner result) { this.result = result; } @@ -161,9 +165,9 @@ public String toUrlQueryString() { String statusValueAsString = statusValue.toString(); valMap.put("status", statusValueAsString); } - Object resultValue = getResult(); + SessionSubscriptionsResponseResultInner resultValue = getResult(); if (resultValue != null) { - String resultValueAsString = resultValue.toString(); + String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } @@ -262,6 +266,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("id").toString())); } + // validate the optional field `result` + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { + SessionSubscriptionsResponseResultInner.validateJsonElement(jsonObj.get("result")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamSubscribeSignatureResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamSubscribeSignatureResponse.java new file mode 100644 index 00000000..34eb895f --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamSubscribeSignatureResponse.java @@ -0,0 +1,335 @@ +/* + * 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.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.*; + +/** UserDataStreamSubscribeSignatureResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UserDataStreamSubscribeSignatureResponse 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_RESULT = "result"; + + @SerializedName(SERIALIZED_NAME_RESULT) + @jakarta.annotation.Nullable + private SessionSubscriptionsResponseResultInner result; + + public UserDataStreamSubscribeSignatureResponse() {} + + public UserDataStreamSubscribeSignatureResponse 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 UserDataStreamSubscribeSignatureResponse 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 UserDataStreamSubscribeSignatureResponse result( + @jakarta.annotation.Nullable SessionSubscriptionsResponseResultInner result) { + this.result = result; + return this; + } + + /** + * Get result + * + * @return result + */ + @jakarta.annotation.Nullable + @Valid + public SessionSubscriptionsResponseResultInner getResult() { + return result; + } + + public void setResult( + @jakarta.annotation.Nullable SessionSubscriptionsResponseResultInner result) { + this.result = result; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDataStreamSubscribeSignatureResponse userDataStreamSubscribeSignatureResponse = + (UserDataStreamSubscribeSignatureResponse) o; + return Objects.equals(this.id, userDataStreamSubscribeSignatureResponse.id) + && Objects.equals(this.status, userDataStreamSubscribeSignatureResponse.status) + && Objects.equals(this.result, userDataStreamSubscribeSignatureResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, result); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDataStreamSubscribeSignatureResponse {\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("}"); + 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); + } + SessionSubscriptionsResponseResultInner resultValue = getResult(); + if (resultValue != null) { + String resultValueAsString = JSON.getGson().toJson(resultValue); + valMap.put("result", resultValueAsString); + } + + 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 resultValue = getResult(); + if (resultValue != null) { + valMap.put("result", resultValue); + } + + 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("result"); + + // 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 + * UserDataStreamSubscribeSignatureResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserDataStreamSubscribeSignatureResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UserDataStreamSubscribeSignatureResponse is not found in" + + " the empty JSON string", + UserDataStreamSubscribeSignatureResponse.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserDataStreamSubscribeSignatureResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UserDataStreamSubscribeSignatureResponse` 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())); + } + // validate the optional field `result` + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { + SessionSubscriptionsResponseResultInner.validateJsonElement(jsonObj.get("result")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDataStreamSubscribeSignatureResponse.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'UserDataStreamSubscribeSignatureResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UserDataStreamSubscribeSignatureResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UserDataStreamSubscribeSignatureResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserDataStreamSubscribeSignatureResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UserDataStreamSubscribeSignatureResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDataStreamSubscribeSignatureResponse + * @throws IOException if the JSON string is invalid with respect to + * UserDataStreamSubscribeSignatureResponse + */ + public static UserDataStreamSubscribeSignatureResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UserDataStreamSubscribeSignatureResponse.class); + } + + /** + * Convert an instance of UserDataStreamSubscribeSignatureResponse 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/UserDataStreamUnsubscribeRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamUnsubscribeRequest.java new file mode 100644 index 00000000..ec0ea19d --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamUnsubscribeRequest.java @@ -0,0 +1,239 @@ +/* + * 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.*; + +/** UserDataStreamUnsubscribeRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UserDataStreamUnsubscribeRequest extends BaseDTO { + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscriptionId"; + + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + @jakarta.annotation.Nullable + private Integer subscriptionId; + + public UserDataStreamUnsubscribeRequest() {} + + public UserDataStreamUnsubscribeRequest subscriptionId( + @jakarta.annotation.Nullable Integer subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get subscriptionId + * + * @return subscriptionId + */ + @jakarta.annotation.Nullable + public Integer getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(@jakarta.annotation.Nullable Integer subscriptionId) { + this.subscriptionId = subscriptionId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDataStreamUnsubscribeRequest userDataStreamUnsubscribeRequest = + (UserDataStreamUnsubscribeRequest) o; + return Objects.equals(this.subscriptionId, userDataStreamUnsubscribeRequest.subscriptionId); + } + + @Override + public int hashCode() { + return Objects.hash(subscriptionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDataStreamUnsubscribeRequest {\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Integer subscriptionIdValue = getSubscriptionId(); + if (subscriptionIdValue != null) { + String subscriptionIdValueAsString = subscriptionIdValue.toString(); + valMap.put("subscriptionId", subscriptionIdValueAsString); + } + + 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 subscriptionIdValue = getSubscriptionId(); + if (subscriptionIdValue != null) { + valMap.put("subscriptionId", subscriptionIdValue); + } + + 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("subscriptionId"); + + // 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 + * UserDataStreamUnsubscribeRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserDataStreamUnsubscribeRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UserDataStreamUnsubscribeRequest is" + + " not found in the empty JSON string", + UserDataStreamUnsubscribeRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserDataStreamUnsubscribeRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UserDataStreamUnsubscribeRequest` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDataStreamUnsubscribeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDataStreamUnsubscribeRequest' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UserDataStreamUnsubscribeRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDataStreamUnsubscribeRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserDataStreamUnsubscribeRequest read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UserDataStreamUnsubscribeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDataStreamUnsubscribeRequest + * @throws IOException if the JSON string is invalid with respect to + * UserDataStreamUnsubscribeRequest + */ + public static UserDataStreamUnsubscribeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDataStreamUnsubscribeRequest.class); + } + + /** + * Convert an instance of UserDataStreamUnsubscribeRequest 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/WorkingPegOffsetType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/WorkingPegOffsetType.java new file mode 100644 index 00000000..e9a7b118 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/WorkingPegOffsetType.java @@ -0,0 +1,71 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets workingPegOffsetType */ +@JsonAdapter(WorkingPegOffsetType.Adapter.class) +public enum WorkingPegOffsetType { + PRICE_LEVEL("PRICE_LEVEL"); + + private String value; + + WorkingPegOffsetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WorkingPegOffsetType fromValue(String value) { + for (WorkingPegOffsetType b : WorkingPegOffsetType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WorkingPegOffsetType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WorkingPegOffsetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WorkingPegOffsetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WorkingPegOffsetType.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/WorkingPegPriceType.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/WorkingPegPriceType.java new file mode 100644 index 00000000..253c391d --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/WorkingPegPriceType.java @@ -0,0 +1,73 @@ +/* + * 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets workingPegPriceType */ +@JsonAdapter(WorkingPegPriceType.Adapter.class) +public enum WorkingPegPriceType { + PRIMARY_PEG("PRIMARY_PEG"), + + MARKET_PEG("MARKET_PEG"); + + private String value; + + WorkingPegPriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WorkingPegPriceType fromValue(String value) { + for (WorkingPegPriceType b : WorkingPegPriceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WorkingPegPriceType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WorkingPegPriceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WorkingPegPriceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WorkingPegPriceType.fromValue(value); + } +} 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 d306aa6f..a51949c7 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 @@ -39,7 +39,7 @@ public class SpotWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-spot/5.0.1 (Java/%s; %s; %s)", + "binance-spot/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java index 06f0e38f..714878e3 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java @@ -207,6 +207,18 @@ public class ExchangeFiltersInner extends BaseDTO { @jakarta.annotation.Nullable private Long maxTrailingBelowDelta; + public static final String SERIALIZED_NAME_MAX_NUM_ORDER_AMENDS = "maxNumOrderAmends"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDER_AMENDS) + @jakarta.annotation.Nullable + private Long maxNumOrderAmends; + + public static final String SERIALIZED_NAME_MAX_NUM_ORDER_LISTS = "maxNumOrderLists"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDER_LISTS) + @jakarta.annotation.Nullable + private Long maxNumOrderLists; + public ExchangeFiltersInner() {} public ExchangeFiltersInner filterType(@jakarta.annotation.Nullable String filterType) { @@ -753,6 +765,46 @@ public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTraili this.maxTrailingBelowDelta = maxTrailingBelowDelta; } + public ExchangeFiltersInner maxNumOrderAmends( + @jakarta.annotation.Nullable Long maxNumOrderAmends) { + this.maxNumOrderAmends = maxNumOrderAmends; + return this; + } + + /** + * Get maxNumOrderAmends + * + * @return maxNumOrderAmends + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrderAmends() { + return maxNumOrderAmends; + } + + public void setMaxNumOrderAmends(@jakarta.annotation.Nullable Long maxNumOrderAmends) { + this.maxNumOrderAmends = maxNumOrderAmends; + } + + public ExchangeFiltersInner maxNumOrderLists( + @jakarta.annotation.Nullable Long maxNumOrderLists) { + this.maxNumOrderLists = maxNumOrderLists; + return this; + } + + /** + * Get maxNumOrderLists + * + * @return maxNumOrderLists + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrderLists() { + return maxNumOrderLists; + } + + public void setMaxNumOrderLists(@jakarta.annotation.Nullable Long maxNumOrderLists) { + this.maxNumOrderLists = maxNumOrderLists; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -794,7 +846,9 @@ public boolean equals(Object o) { && Objects.equals( this.minTrailingBelowDelta, exchangeFiltersInner.minTrailingBelowDelta) && Objects.equals( - this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta); + this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta) + && Objects.equals(this.maxNumOrderAmends, exchangeFiltersInner.maxNumOrderAmends) + && Objects.equals(this.maxNumOrderLists, exchangeFiltersInner.maxNumOrderLists); } @Override @@ -827,7 +881,9 @@ public int hashCode() { minTrailingAboveDelta, maxTrailingAboveDelta, minTrailingBelowDelta, - maxTrailingBelowDelta); + maxTrailingBelowDelta, + maxNumOrderAmends, + maxNumOrderLists); } @Override @@ -872,6 +928,8 @@ public String toString() { sb.append(" maxTrailingBelowDelta: ") .append(toIndentedString(maxTrailingBelowDelta)) .append("\n"); + sb.append(" maxNumOrderAmends: ").append(toIndentedString(maxNumOrderAmends)).append("\n"); + sb.append(" maxNumOrderLists: ").append(toIndentedString(maxNumOrderLists)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1020,6 +1078,16 @@ public String toUrlQueryString() { String maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValueAsString); } + Long maxNumOrderAmendsValue = getMaxNumOrderAmends(); + if (maxNumOrderAmendsValue != null) { + String maxNumOrderAmendsValueAsString = maxNumOrderAmendsValue.toString(); + valMap.put("maxNumOrderAmends", maxNumOrderAmendsValueAsString); + } + Long maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + String maxNumOrderListsValueAsString = maxNumOrderListsValue.toString(); + valMap.put("maxNumOrderLists", maxNumOrderListsValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -1143,6 +1211,14 @@ public Map toMap() { if (maxTrailingBelowDeltaValue != null) { valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValue); } + Object maxNumOrderAmendsValue = getMaxNumOrderAmends(); + if (maxNumOrderAmendsValue != null) { + valMap.put("maxNumOrderAmends", maxNumOrderAmendsValue); + } + Object maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + valMap.put("maxNumOrderLists", maxNumOrderListsValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -1197,6 +1273,8 @@ private String toIndentedString(Object o) { openapiFields.add("maxTrailingAboveDelta"); openapiFields.add("minTrailingBelowDelta"); openapiFields.add("maxTrailingBelowDelta"); + openapiFields.add("maxNumOrderAmends"); + openapiFields.add("maxNumOrderLists"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); 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 9b5597ad..2d250425 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 @@ -26,6 +26,7 @@ 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; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; @@ -221,7 +222,7 @@ public void userDataStreamSubscribeTest() throws ApiException, URISyntaxExceptio public void userDataStreamUnsubscribeTest() throws ApiException, URISyntaxException, IOException { CompletableFuture response = - api.userDataStreamUnsubscribe(); + api.userDataStreamUnsubscribe(new UserDataStreamUnsubscribeRequest()); ArgumentCaptor> callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); diff --git a/examples/spot/pom.xml b/examples/spot/pom.xml index c2023406..e65e4efe 100644 --- a/examples/spot/pom.xml +++ b/examples/spot/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-spot - 5.0.1 + 6.0.0 \ No newline at end of file diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/SessionSubscriptionsExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/SessionSubscriptionsExample.java new file mode 100644 index 00000000..c32b1e15 --- /dev/null +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/SessionSubscriptionsExample.java @@ -0,0 +1,69 @@ +/* + * 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.SessionSubscriptionsResponse; +import java.util.concurrent.CompletableFuture; + +/** API examples for UserDataStreamApi */ +public class SessionSubscriptionsExample { + 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 Listing all subscriptions + * + *

Weight: 2 **Data Source**: Memory + */ + public void sessionSubscriptionsExampleAsync() { + CompletableFuture future = getApi().sessionSubscriptions(); + future.handle( + (response, error) -> { + if (error != null) { + System.err.println(error); + } + System.out.println(response); + return response; + }); + } + + /** + * WebSocket Listing all subscriptions + * + *

Weight: 2 **Data Source**: Memory + */ + public void sessionSubscriptionsExampleSync() { + CompletableFuture future = getApi().sessionSubscriptions(); + SessionSubscriptionsResponse response = future.join(); + System.out.println(response); + } +} diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java new file mode 100644 index 00000000..9f57db71 --- /dev/null +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java @@ -0,0 +1,62 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.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.common.websocket.dtos.StreamResponse; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.spot.websocket.api.SpotWebSocketApiUtil; +import com.binance.connector.client.spot.websocket.api.api.SpotWebSocketApi; +import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; +import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeSignatureResponse; + +/** API examples for UserDataStreamApi */ +public class UserDataStreamSubscribeSignatureExample { + 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 Subscribe to User Data Stream through signature subscription + * + *

Weight: 2 + */ + public void userDataStreamSubscribeSignatureExampleStream() throws InterruptedException { + StreamResponse + resp = getApi().userDataStreamSubscribeSignature(); + resp.getResponse() + .thenAccept( + responseResult -> { + System.out.println(responseResult); + }); + StreamBlockingQueueWrapper stream = resp.getStream(); + while (true) { + System.out.println(stream.take().getActualInstance()); + } + } +} diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java index 132c3a20..eace0d66 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java @@ -16,6 +16,7 @@ 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.UserDataStreamUnsubscribeRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeResponse; import java.util.concurrent.CompletableFuture; @@ -42,11 +43,16 @@ public SpotWebSocketApi getApi() { /** * WebSocket Unsubscribe from User Data Stream * - *

Stop listening to the User Data Stream in the current WebSocket connection. Weight: 2 + *

Stop listening to the User Data Stream in the current WebSocket connection. Note that + * `session.logout` will only close the subscription created with + * `userdataStream.subscribe` but not subscriptions opened with + * `userDataStream.subscribe.signature`. Weight: 2 */ public void userDataStreamUnsubscribeExampleAsync() { + UserDataStreamUnsubscribeRequest userDataStreamUnsubscribeRequest = + new UserDataStreamUnsubscribeRequest(); CompletableFuture future = - getApi().userDataStreamUnsubscribe(); + getApi().userDataStreamUnsubscribe(userDataStreamUnsubscribeRequest); future.handle( (response, error) -> { if (error != null) { @@ -60,11 +66,16 @@ public void userDataStreamUnsubscribeExampleAsync() { /** * WebSocket Unsubscribe from User Data Stream * - *

Stop listening to the User Data Stream in the current WebSocket connection. Weight: 2 + *

Stop listening to the User Data Stream in the current WebSocket connection. Note that + * `session.logout` will only close the subscription created with + * `userdataStream.subscribe` but not subscriptions opened with + * `userDataStream.subscribe.signature`. Weight: 2 */ public void userDataStreamUnsubscribeExampleSync() { + UserDataStreamUnsubscribeRequest userDataStreamUnsubscribeRequest = + new UserDataStreamUnsubscribeRequest(); CompletableFuture future = - getApi().userDataStreamUnsubscribe(); + getApi().userDataStreamUnsubscribe(userDataStreamUnsubscribeRequest); UserDataStreamUnsubscribeResponse response = future.join(); System.out.println(response); }