diff --git a/README.md b/README.md index a211c7a85..e1784859b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ Before using the connectors, ensure you have: ## Available Connectors - [binance-algo](clients/algo) - Algo Trading connector -- **Deprecated**: ~~[binance-auto-invest](clients/auto-invest) - Auto Invest connector~~ - [binance-c2c](clients/c2c) - C2C connector - [binance-convert](clients/convert) - Convert connector - [binance-copy-trading](clients/copy-trading) - Copy Trading connector diff --git a/clients/auto-invest/CHANGELOG.md b/clients/auto-invest/CHANGELOG.md deleted file mode 100644 index 1e7ccf761..000000000 --- a/clients/auto-invest/CHANGELOG.md +++ /dev/null @@ -1,11 +0,0 @@ -# Changelog - -## 1.1.0 - 2025-05-02 - -- Update `binance/common` module to version `1.1.0`. -- Adding `proxyAuthenticator` support. -- URL Encode query params. - -## 1.0.0 - 2025-04-24 - -- Initial release \ No newline at end of file diff --git a/clients/auto-invest/README.md b/clients/auto-invest/README.md deleted file mode 100644 index 89f6ecd2e..000000000 --- a/clients/auto-invest/README.md +++ /dev/null @@ -1,163 +0,0 @@ -# **DEPRECATED** - Binance Java Auto Invest Connector -## **This module is deprecated and will be removed, please do not use it.** - -[![Open Issues](https://img.shields.io/github/issues/binance/binance-connector-java)](https://github.com/binance/binance-connector-java/issues) -[![Code Style: Spotless](https://img.shields.io/badge/code%20style-spotless-ff69b4)](https://github.com/diffplug/spotless) -[![Maven Central Version](https://img.shields.io/maven-central/v/io.github.binance/binance-auto-invest)](https://central.sonatype.com/artifact/io.github.binance/binance-auto-invest) -![Java Version](https://img.shields.io/badge/Java-%3E=11-brightgreen) -[![Known Vulnerabilities](https://snyk.io/test/github/binance/binance-connector-java/badge.svg)](https://snyk.io/test/github/binance/binance-connector-java) -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) - -This is a client library for the Binance Algo API, enabling developers to interact programmatically with Binance's Algo trading platform. The library provides tools to programmatically leverage Binance in-house algorithmic trading capability to automate order execution strategy, improve execution transparency and give users smart access to the available market liquidity through the REST API: - -- [REST API](./src/main/java/com/binance/connector/client/auto_invest/rest/api) - -## Table of Contents - -- [Supported Features](#supported-features) -- [Installation](#installation) -- [Documentation](#documentation) -- [REST APIs](#rest-apis) -- [Testing](#testing) -- [Migration Guide](#migration-guide) -- [Contributing](#contributing) -- [License](#license) - -## Supported Features - -- REST API Endpoints: - - `/sapi/v1/auto-invest/*` -- Inclusion of test cases and examples for quick onboarding. - -## Installation - -To use this library, ensure your environment is running Java version **11** or newer. - -Then add dependency to pom.xml: - -```xml - - io.github.binance - binance-auto-invest - 1.1.0 - -``` - -## Documentation - -For detailed information, refer to the [Binance API Documentation](https://developers.binance.com/docs/auto_invest). - -### REST APIs - -All REST API endpoints are available through the [`rest`](./src/main/java/com/binance/connector/client/auto_invest/rest) module. Note that some endpoints require authentication using your Binance API credentials. - -```java -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -public static void main(String[] args) { - ClientConfiguration clientConfiguration = AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - AutoInvestRestApi api = new AutoInvestRestApi(clientConfiguration); -} -``` - -More examples can be found in the [`examples/rest`](./../../examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest) folder. - -#### Configuration Options - -The REST API supports the following advanced configuration options: - -- `proxy`: Proxy configuration for http client. -- `certificatePinner`: Certificate Pinner configuration for http client. -- `connectTimeout`: Timeout for requests in milliseconds (default: 1000 ms). -- `readTimeout`: Timeout for requests in milliseconds (default: 5000 ms). -- `compression`: Enable response compression (default: true). -- `retries`: Number of retry attempts for failed requests (default: 3). -- `backoff`: Delay in milliseconds between retries (default: 200 ms). -- `timeUnit`: TimeUnit to be returned by API (default MILLISECOND). -- `apiKey`: Binance API Key -- `secretKey`: Binance Secret Key, if using HMAC algorithm -- `privateKey`: RSA or ED25519 private key for authentication. -- `privateKeyPass`: Passphrase for the private key, if encrypted. - -##### Timeout - -You can configure a timeout for requests in milliseconds. If the request exceeds the specified timeout, it will be aborted. See the [Timeout example](./docs/rest-api/timeout.md) for detailed usage. - -##### Proxy - -The REST API supports HTTP/HTTPS proxy configurations. See the [Proxy example](./docs/rest-api/proxy.md) for detailed usage. - -##### Keep-Alive - -Enable HTTP keep-alive for persistent connections. See the [Keep-Alive example](./docs/rest-api/keepAlive.md) for detailed usage. - -##### Compression - -Enable or disable response compression. See the [Compression example](./docs/rest-api/compression.md) for detailed usage. - -##### Retries - -Configure the number of retry attempts and delay in milliseconds between retries for failed requests. See the [Retries example](./docs/rest-api/retries.md) for detailed usage. - -##### Key Pair Based Authentication - -The REST API supports key pair-based authentication for secure communication. You can use `RSA` or `ED25519` keys for signing requests. See the [Key Pair Based Authentication example](./docs/rest-api/key-pair-authentication.md) for detailed usage. - -##### Certificate Pinning - -To enhance security, you can use certificate pinning with the `httpsAgent` option in the configuration. This ensures the client only communicates with servers using specific certificates. See the [Certificate Pinning example](./docs/rest-api/certificate-pinning.md) for detailed usage. - -#### Error Handling - -The REST API provides detailed error types to help you handle issues effectively: - -- `ConnectorClientError`: General client error. - -See the [Error Handling example](./docs/rest-api/error-handling.md) for detailed usage. - -If `basePath` is not provided, it defaults to `https://api.binance.com`. - -## Testing - -To run the tests: - -```bash -mvn -f clients/pom.xml -pl auto-invest test -``` - -The tests cover: - -- REST API endpoints -- Signature generation - -## Migration Guide - -If you are upgrading to the new modularized structure, refer to the [Migration Guide](./docs/rest-api/migration-guide.md) for detailed steps. - -## Contributing - -Contributions are welcome! - -Since this repository contains auto-generated code, we encourage you to start by opening a GitHub issue to discuss your ideas or suggest improvements. This helps ensure that changes align with the project's goals and auto-generation processes. - -To contribute: - -1. Open a GitHub issue describing your suggestion or the bug you've identified. -2. If it's determined that changes are necessary, the maintainers will merge the changes into the main branch. - -Please ensure that all tests pass if you're making a direct contribution. Submit a pull request only after discussing and confirming the change. - -Thank you for your contributions! - -## License - -This project is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for details. \ No newline at end of file diff --git a/clients/auto-invest/docs/ChangePlanStatusRequest.md b/clients/auto-invest/docs/ChangePlanStatusRequest.md deleted file mode 100644 index 3edabb2f6..000000000 --- a/clients/auto-invest/docs/ChangePlanStatusRequest.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# ChangePlanStatusRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planId** | **Long** | | | -|**status** | **String** | | | -|**recvWindow** | **Long** | | [optional] | - - - diff --git a/clients/auto-invest/docs/ChangePlanStatusResponse.md b/clients/auto-invest/docs/ChangePlanStatusResponse.md deleted file mode 100644 index f2f1da616..000000000 --- a/clients/auto-invest/docs/ChangePlanStatusResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# ChangePlanStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planId** | **Long** | | [optional] | -|**nextExecutionDateTime** | **Long** | | [optional] | -|**status** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetListOfPlansResponse.md b/clients/auto-invest/docs/GetListOfPlansResponse.md deleted file mode 100644 index 940d586a3..000000000 --- a/clients/auto-invest/docs/GetListOfPlansResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# GetListOfPlansResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planValueInUSD** | **String** | | [optional] | -|**planValueInBTC** | **String** | | [optional] | -|**pnlInUSD** | **String** | | [optional] | -|**roi** | **String** | | [optional] | -|**plans** | [**List<GetListOfPlansResponsePlansInner>**](GetListOfPlansResponsePlansInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetListOfPlansResponse1.md b/clients/auto-invest/docs/GetListOfPlansResponse1.md deleted file mode 100644 index 8ea246f44..000000000 --- a/clients/auto-invest/docs/GetListOfPlansResponse1.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# GetListOfPlansResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planValueInUSD** | **String** | | [optional] | -|**planValueInBTC** | **String** | | [optional] | -|**pnlInUSD** | **String** | | [optional] | -|**roi** | **String** | | [optional] | -|**plans** | [**List<GetListOfPlansResponse1PlansInner>**](GetListOfPlansResponse1PlansInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetListOfPlansResponse1PlansInner.md b/clients/auto-invest/docs/GetListOfPlansResponse1PlansInner.md deleted file mode 100644 index 9695e6699..000000000 --- a/clients/auto-invest/docs/GetListOfPlansResponse1PlansInner.md +++ /dev/null @@ -1,34 +0,0 @@ - - -# GetListOfPlansResponse1PlansInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planId** | **Long** | | [optional] | -|**planType** | **String** | | [optional] | -|**editAllowed** | **String** | | [optional] | -|**creationDateTime** | **Long** | | [optional] | -|**firstExecutionDateTime** | **Long** | | [optional] | -|**nextExecutionDateTime** | **Long** | | [optional] | -|**status** | **String** | | [optional] | -|**lastUpdatedDateTime** | **Long** | | [optional] | -|**targetAsset** | **String** | | [optional] | -|**totalTargetAmount** | **String** | | [optional] | -|**sourceAsset** | **String** | | [optional] | -|**totalInvestedInUSD** | **String** | | [optional] | -|**subscriptionAmount** | **String** | | [optional] | -|**subscriptionCycle** | **String** | | [optional] | -|**subscriptionStartDay** | **String** | | [optional] | -|**subscriptionStartWeekday** | **String** | | [optional] | -|**subscriptionStartTime** | **String** | | [optional] | -|**sourceWallet** | **String** | | [optional] | -|**flexibleAllowedToUse** | **String** | | [optional] | -|**planValueInUSD** | **String** | | [optional] | -|**pnlInUSD** | **String** | | [optional] | -|**roi** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetListOfPlansResponse2.md b/clients/auto-invest/docs/GetListOfPlansResponse2.md deleted file mode 100644 index d8a964de1..000000000 --- a/clients/auto-invest/docs/GetListOfPlansResponse2.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# GetListOfPlansResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planValueInUSD** | **String** | | [optional] | -|**planValueInBTC** | **String** | | [optional] | -|**plans** | [**List<GetListOfPlansResponse2PlansInner>**](GetListOfPlansResponse2PlansInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetListOfPlansResponse2PlansInner.md b/clients/auto-invest/docs/GetListOfPlansResponse2PlansInner.md deleted file mode 100644 index 507ae375e..000000000 --- a/clients/auto-invest/docs/GetListOfPlansResponse2PlansInner.md +++ /dev/null @@ -1,30 +0,0 @@ - - -# GetListOfPlansResponse2PlansInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planId** | **Long** | | [optional] | -|**planType** | **String** | | [optional] | -|**editAllowed** | **String** | | [optional] | -|**creationDateTime** | **Long** | | [optional] | -|**firstExecutionDateTime** | **Long** | | [optional] | -|**nextExecutionDateTime** | **Long** | | [optional] | -|**status** | **String** | | [optional] | -|**lastUpdatedDateTime** | **Long** | | [optional] | -|**targetAsset** | **String** | | [optional] | -|**sourceAsset** | **String** | | [optional] | -|**totalInvestedInUSD** | **String** | | [optional] | -|**subscriptionAmount** | **String** | | [optional] | -|**subscriptionCycle** | **String** | | [optional] | -|**subscriptionStartDay** | **String** | | [optional] | -|**subscriptionStartWeekday** | **String** | | [optional] | -|**subscriptionStartTime** | **String** | | [optional] | -|**sourceWallet** | **String** | | [optional] | -|**flexibleAllowedToUse** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetListOfPlansResponsePlansInner.md b/clients/auto-invest/docs/GetListOfPlansResponsePlansInner.md deleted file mode 100644 index f0ec89517..000000000 --- a/clients/auto-invest/docs/GetListOfPlansResponsePlansInner.md +++ /dev/null @@ -1,34 +0,0 @@ - - -# GetListOfPlansResponsePlansInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planId** | **Long** | | [optional] | -|**planType** | **String** | | [optional] | -|**editAllowed** | **String** | | [optional] | -|**creationDateTime** | **Long** | | [optional] | -|**firstExecutionDateTime** | **Long** | | [optional] | -|**nextExecutionDateTime** | **Long** | | [optional] | -|**status** | **String** | | [optional] | -|**lastUpdatedDateTime** | **Long** | | [optional] | -|**targetAsset** | **String** | | [optional] | -|**totalTargetAmount** | **String** | | [optional] | -|**sourceAsset** | **String** | | [optional] | -|**totalInvestedInUSD** | **String** | | [optional] | -|**subscriptionAmount** | **String** | | [optional] | -|**subscriptionCycle** | **String** | | [optional] | -|**subscriptionStartDay** | **String** | | [optional] | -|**subscriptionStartWeekday** | **String** | | [optional] | -|**subscriptionStartTime** | **String** | | [optional] | -|**sourceWallet** | **String** | | [optional] | -|**flexibleAllowedToUse** | **String** | | [optional] | -|**planValueInUSD** | **String** | | [optional] | -|**pnlInUSD** | **String** | | [optional] | -|**roi** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetTargetAssetListResponse.md b/clients/auto-invest/docs/GetTargetAssetListResponse.md deleted file mode 100644 index d8820eb8c..000000000 --- a/clients/auto-invest/docs/GetTargetAssetListResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# GetTargetAssetListResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**targetAssets** | **List<String>** | | [optional] | -|**autoInvestAssetList** | [**List<GetTargetAssetListResponseAutoInvestAssetListInner>**](GetTargetAssetListResponseAutoInvestAssetListInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetTargetAssetListResponseAutoInvestAssetListInner.md b/clients/auto-invest/docs/GetTargetAssetListResponseAutoInvestAssetListInner.md deleted file mode 100644 index ba838194a..000000000 --- a/clients/auto-invest/docs/GetTargetAssetListResponseAutoInvestAssetListInner.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# GetTargetAssetListResponseAutoInvestAssetListInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**targetAsset** | **String** | | [optional] | -|**roiAndDimensionTypeList** | [**List<GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner>**](GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner.md b/clients/auto-invest/docs/GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner.md deleted file mode 100644 index 41629bc8a..000000000 --- a/clients/auto-invest/docs/GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**simulateRoi** | **String** | | [optional] | -|**dimensionValue** | **String** | | [optional] | -|**dimensionUnit** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/GetTargetAssetRoiDataResponseInner.md b/clients/auto-invest/docs/GetTargetAssetRoiDataResponseInner.md deleted file mode 100644 index 6bfce77fe..000000000 --- a/clients/auto-invest/docs/GetTargetAssetRoiDataResponseInner.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# GetTargetAssetRoiDataResponseInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**date** | **String** | | [optional] | -|**simulateRoi** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/IndexLinkedPlanRebalanceDetailsResponseInner.md b/clients/auto-invest/docs/IndexLinkedPlanRebalanceDetailsResponseInner.md deleted file mode 100644 index 623fe081c..000000000 --- a/clients/auto-invest/docs/IndexLinkedPlanRebalanceDetailsResponseInner.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# IndexLinkedPlanRebalanceDetailsResponseInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indexId** | **Long** | | [optional] | -|**indexName** | **String** | | [optional] | -|**rebalanceId** | **Long** | | [optional] | -|**status** | **String** | | [optional] | -|**rebalanceFee** | **String** | | [optional] | -|**rebalanceFeeUnit** | **String** | | [optional] | -|**transactionDetails** | [**List<IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner>**](IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.md b/clients/auto-invest/docs/IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.md deleted file mode 100644 index db3637f95..000000000 --- a/clients/auto-invest/docs/IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**transactionDateTime** | **Long** | | [optional] | -|**rebalanceDirection** | **String** | | [optional] | -|**rebalanceAmount** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/IndexLinkedPlanRedemptionRequest.md b/clients/auto-invest/docs/IndexLinkedPlanRedemptionRequest.md deleted file mode 100644 index 8491223f3..000000000 --- a/clients/auto-invest/docs/IndexLinkedPlanRedemptionRequest.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# IndexLinkedPlanRedemptionRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indexId** | **Long** | | | -|**requestId** | **Long** | | [optional] | -|**redemptionPercentage** | **Long** | | | -|**recvWindow** | **Long** | | [optional] | - - - diff --git a/clients/auto-invest/docs/IndexLinkedPlanRedemptionResponse.md b/clients/auto-invest/docs/IndexLinkedPlanRedemptionResponse.md deleted file mode 100644 index 0f1c77b0b..000000000 --- a/clients/auto-invest/docs/IndexLinkedPlanRedemptionResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# IndexLinkedPlanRedemptionResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**redemptionId** | **Long** | | [optional] | - - - diff --git a/clients/auto-invest/docs/IndexLinkedPlanRedemptionTradeResponse.md b/clients/auto-invest/docs/IndexLinkedPlanRedemptionTradeResponse.md deleted file mode 100644 index 40f433a47..000000000 --- a/clients/auto-invest/docs/IndexLinkedPlanRedemptionTradeResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# IndexLinkedPlanRedemptionTradeResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/auto-invest/docs/IndexLinkedPlanRedemptionTradeResponseInner.md b/clients/auto-invest/docs/IndexLinkedPlanRedemptionTradeResponseInner.md deleted file mode 100644 index 7d30886a9..000000000 --- a/clients/auto-invest/docs/IndexLinkedPlanRedemptionTradeResponseInner.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# IndexLinkedPlanRedemptionTradeResponseInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indexId** | **Long** | | [optional] | -|**indexName** | **String** | | [optional] | -|**redemptionId** | **Long** | | [optional] | -|**status** | **String** | | [optional] | -|**asset** | **String** | | [optional] | -|**amount** | **String** | | [optional] | -|**redemptionDateTime** | **Long** | | [optional] | -|**transactionFee** | **String** | | [optional] | -|**transactionFeeUnit** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/InvestmentPlanAdjustmentRequest.md b/clients/auto-invest/docs/InvestmentPlanAdjustmentRequest.md deleted file mode 100644 index 0c8c8d45f..000000000 --- a/clients/auto-invest/docs/InvestmentPlanAdjustmentRequest.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# InvestmentPlanAdjustmentRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planId** | **Long** | | | -|**subscriptionAmount** | **Double** | | | -|**subscriptionCycle** | **String** | | | -|**subscriptionStartTime** | **Long** | | | -|**sourceAsset** | **String** | | | -|**flexibleAllowedToUse** | **Boolean** | | [optional] | -|**details** | **Details** | | | -|**recvWindow** | **Long** | | [optional] | - - - diff --git a/clients/auto-invest/docs/InvestmentPlanAdjustmentResponse.md b/clients/auto-invest/docs/InvestmentPlanAdjustmentResponse.md deleted file mode 100644 index 7bf5eab21..000000000 --- a/clients/auto-invest/docs/InvestmentPlanAdjustmentResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# InvestmentPlanAdjustmentResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planId** | **Long** | | [optional] | -|**nextExecutionDateTime** | **Long** | | [optional] | - - - diff --git a/clients/auto-invest/docs/InvestmentPlanCreationRequest.md b/clients/auto-invest/docs/InvestmentPlanCreationRequest.md deleted file mode 100644 index f6c028609..000000000 --- a/clients/auto-invest/docs/InvestmentPlanCreationRequest.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# InvestmentPlanCreationRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**sourceType** | **String** | | | -|**requestId** | **Long** | | [optional] | -|**planType** | **String** | | | -|**indexId** | **Long** | | [optional] | -|**subscriptionAmount** | **Double** | | | -|**subscriptionCycle** | **String** | | | -|**subscriptionStartTime** | **Long** | | | -|**sourceAsset** | **String** | | | -|**flexibleAllowedToUse** | **Boolean** | | [optional] | -|**details** | **Details** | | | -|**recvWindow** | **Long** | | [optional] | - - - diff --git a/clients/auto-invest/docs/InvestmentPlanCreationResponse.md b/clients/auto-invest/docs/InvestmentPlanCreationResponse.md deleted file mode 100644 index 7333fb8d8..000000000 --- a/clients/auto-invest/docs/InvestmentPlanCreationResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# InvestmentPlanCreationResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planId** | **Long** | | [optional] | -|**nextExecutionDateTime** | **Long** | | [optional] | - - - diff --git a/clients/auto-invest/docs/MarketDataApi.md b/clients/auto-invest/docs/MarketDataApi.md deleted file mode 100644 index f9d0758f5..000000000 --- a/clients/auto-invest/docs/MarketDataApi.md +++ /dev/null @@ -1,410 +0,0 @@ -# MarketDataApi - -All URIs are relative to *https://api.binance.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getListOfPlans**](MarketDataApi.md#getListOfPlans) | **GET** /sapi/v1/lending/auto-invest/plan/list | Get list of plans (USER_DATA) | -| [**getTargetAssetList**](MarketDataApi.md#getTargetAssetList) | **GET** /sapi/v1/lending/auto-invest/target-asset/list | Get target asset list(USER_DATA) | -| [**getTargetAssetRoiData**](MarketDataApi.md#getTargetAssetRoiData) | **GET** /sapi/v1/lending/auto-invest/target-asset/roi/list | Get target asset ROI data | -| [**queryAllSourceAssetAndTargetAsset**](MarketDataApi.md#queryAllSourceAssetAndTargetAsset) | **GET** /sapi/v1/lending/auto-invest/all/asset | Query all source asset and target asset(USER_DATA) | -| [**queryIndexDetails**](MarketDataApi.md#queryIndexDetails) | **GET** /sapi/v1/lending/auto-invest/index/info | Query Index Details(USER_DATA) | -| [**querySourceAssetList**](MarketDataApi.md#querySourceAssetList) | **GET** /sapi/v1/lending/auto-invest/source-asset/list | Query source asset list(USER_DATA) | - - - -# **getListOfPlans** -> GetListOfPlansResponse getListOfPlans(planType, recvWindow) - -Get list of plans (USER_DATA) - -Query plan lists * max one request every 3s per account Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.MarketDataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - MarketDataApi apiInstance = new MarketDataApi(defaultClient); - String planType = "planType_example"; // String | Plan identifier - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - GetListOfPlansResponse result = apiInstance.getListOfPlans(planType, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MarketDataApi#getListOfPlans"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **planType** | **String**| Plan identifier | | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**GetListOfPlansResponse**](GetListOfPlansResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get list of plans | - | - - -# **getTargetAssetList** -> GetTargetAssetListResponse getTargetAssetList(targetAsset, size, current, recvWindow) - -Get target asset list(USER_DATA) - -Get target asset list Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.MarketDataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - MarketDataApi apiInstance = new MarketDataApi(defaultClient); - Long targetAsset = 56L; // Long | Plan identifier - Long size = 56L; // Long | Default: 8, Max:100 - Long current = 56L; // Long | Current query page. Default: 1, start from 1 - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - GetTargetAssetListResponse result = apiInstance.getTargetAssetList(targetAsset, size, current, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MarketDataApi#getTargetAssetList"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **targetAsset** | **Long**| Plan identifier | [optional] | -| **size** | **Long**| Default: 8, Max:100 | [optional] | -| **current** | **Long**| Current query page. Default: 1, start from 1 | [optional] | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**GetTargetAssetListResponse**](GetTargetAssetListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get target asset list | - | - - -# **getTargetAssetRoiData** -> GetTargetAssetRoiDataResponse getTargetAssetRoiData(targetAsset, hisRoiType, recvWindow) - -Get target asset ROI data - -ROI return list for target asset Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.MarketDataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - MarketDataApi apiInstance = new MarketDataApi(defaultClient); - String targetAsset = "targetAsset_example"; // String | e.g \"BTC\" - String hisRoiType = "hisRoiType_example"; // String | FIVE_YEAR,THREE_YEAR,ONE_YEAR,SIX_MONTH,THREE_MONTH,SEVEN_DAY - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - GetTargetAssetRoiDataResponse result = apiInstance.getTargetAssetRoiData(targetAsset, hisRoiType, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MarketDataApi#getTargetAssetRoiData"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **targetAsset** | **String**| e.g \"BTC\" | | -| **hisRoiType** | **String**| FIVE_YEAR,THREE_YEAR,ONE_YEAR,SIX_MONTH,THREE_MONTH,SEVEN_DAY | | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**GetTargetAssetRoiDataResponse**](GetTargetAssetRoiDataResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get target asset ROI data | - | - - -# **queryAllSourceAssetAndTargetAsset** -> QueryAllSourceAssetAndTargetAssetResponse queryAllSourceAssetAndTargetAsset(recvWindow) - -Query all source asset and target asset(USER_DATA) - -Query all source assets and target assets Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.MarketDataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - MarketDataApi apiInstance = new MarketDataApi(defaultClient); - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - QueryAllSourceAssetAndTargetAssetResponse result = apiInstance.queryAllSourceAssetAndTargetAsset(recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MarketDataApi#queryAllSourceAssetAndTargetAsset"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**QueryAllSourceAssetAndTargetAssetResponse**](QueryAllSourceAssetAndTargetAssetResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | all source asset and target asset | - | - - -# **queryIndexDetails** -> QueryIndexDetailsResponse queryIndexDetails(indexId, recvWindow) - -Query Index Details(USER_DATA) - -Query index details Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.MarketDataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - MarketDataApi apiInstance = new MarketDataApi(defaultClient); - Long indexId = 56L; // Long | - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - QueryIndexDetailsResponse result = apiInstance.queryIndexDetails(indexId, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MarketDataApi#queryIndexDetails"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **indexId** | **Long**| | | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**QueryIndexDetailsResponse**](QueryIndexDetailsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Index Details | - | - - -# **querySourceAssetList** -> QuerySourceAssetListResponse querySourceAssetList(usageType, targetAsset, indexId, flexibleAllowedToUse, sourceType, recvWindow) - -Query source asset list(USER_DATA) - -Query Source Asset to be used for investment Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.MarketDataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - MarketDataApi apiInstance = new MarketDataApi(defaultClient); - String usageType = "usageType_example"; // String | \"RECURRING\", \"ONE_TIME\" - Long targetAsset = 56L; // Long | Plan identifier - Long indexId = 56L; // Long | 指数identifier, value = 1 - Boolean flexibleAllowedToUse = true; // Boolean | - String sourceType = "sourceType_example"; // String | `MAIN_SITE` for Binance user,`TR` for Binance Turkey user - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - QuerySourceAssetListResponse result = apiInstance.querySourceAssetList(usageType, targetAsset, indexId, flexibleAllowedToUse, sourceType, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MarketDataApi#querySourceAssetList"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **usageType** | **String**| \"RECURRING\", \"ONE_TIME\" | | -| **targetAsset** | **Long**| Plan identifier | [optional] | -| **indexId** | **Long**| 指数identifier, value = 1 | [optional] | -| **flexibleAllowedToUse** | **Boolean**| | [optional] | -| **sourceType** | **String**| `MAIN_SITE` for Binance user,`TR` for Binance Turkey user | [optional] | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**QuerySourceAssetListResponse**](QuerySourceAssetListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | source asset list | - | - diff --git a/clients/auto-invest/docs/OneTimeTransactionRequest.md b/clients/auto-invest/docs/OneTimeTransactionRequest.md deleted file mode 100644 index e5dfe48c7..000000000 --- a/clients/auto-invest/docs/OneTimeTransactionRequest.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# OneTimeTransactionRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**sourceType** | **String** | | | -|**requestId** | **Long** | | [optional] | -|**subscriptionAmount** | **Double** | | | -|**sourceAsset** | **String** | | | -|**flexibleAllowedToUse** | **Boolean** | | [optional] | -|**planId** | **Long** | | [optional] | -|**indexId** | **Long** | | [optional] | -|**details** | **Details** | | | -|**recvWindow** | **Long** | | [optional] | - - - diff --git a/clients/auto-invest/docs/OneTimeTransactionResponse.md b/clients/auto-invest/docs/OneTimeTransactionResponse.md deleted file mode 100644 index e00a0ab61..000000000 --- a/clients/auto-invest/docs/OneTimeTransactionResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# OneTimeTransactionResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**transactionId** | **Long** | | [optional] | -|**waitSecond** | **Long** | | [optional] | - - - diff --git a/clients/auto-invest/docs/QueryAllSourceAssetAndTargetAssetResponse.md b/clients/auto-invest/docs/QueryAllSourceAssetAndTargetAssetResponse.md deleted file mode 100644 index 7f8165e80..000000000 --- a/clients/auto-invest/docs/QueryAllSourceAssetAndTargetAssetResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# QueryAllSourceAssetAndTargetAssetResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**targetAssets** | **List<String>** | | [optional] | -|**sourceAssets** | **List<String>** | | [optional] | - - - diff --git a/clients/auto-invest/docs/QueryHoldingDetailsOfThePlanResponse.md b/clients/auto-invest/docs/QueryHoldingDetailsOfThePlanResponse.md deleted file mode 100644 index e709bbdc0..000000000 --- a/clients/auto-invest/docs/QueryHoldingDetailsOfThePlanResponse.md +++ /dev/null @@ -1,27 +0,0 @@ - - -# QueryHoldingDetailsOfThePlanResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**planId** | **Long** | | [optional] | -|**planType** | **String** | | [optional] | -|**editAllowed** | **String** | | [optional] | -|**flexibleAllowedToUse** | **String** | | [optional] | -|**creationDateTime** | **Long** | | [optional] | -|**firstExecutionDateTime** | **Long** | | [optional] | -|**nextExecutionDateTime** | **Long** | | [optional] | -|**status** | **String** | | [optional] | -|**targetAsset** | **String** | | [optional] | -|**sourceAsset** | **String** | | [optional] | -|**planValueInUSD** | **String** | | [optional] | -|**pnlInUSD** | **String** | | [optional] | -|**roi** | **String** | | [optional] | -|**totalInvestedInUSD** | **String** | | [optional] | -|**details** | [**List<QueryHoldingDetailsOfThePlanResponseDetailsInner>**](QueryHoldingDetailsOfThePlanResponseDetailsInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/QueryHoldingDetailsOfThePlanResponseDetailsInner.md b/clients/auto-invest/docs/QueryHoldingDetailsOfThePlanResponseDetailsInner.md deleted file mode 100644 index df3c9f1f9..000000000 --- a/clients/auto-invest/docs/QueryHoldingDetailsOfThePlanResponseDetailsInner.md +++ /dev/null @@ -1,26 +0,0 @@ - - -# QueryHoldingDetailsOfThePlanResponseDetailsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**targetAsset** | **String** | | [optional] | -|**averagePriceInUSD** | **String** | | [optional] | -|**totalInvestedInUSD** | **String** | | [optional] | -|**purchasedAmount** | **String** | | [optional] | -|**purchasedAmountUnit** | **String** | | [optional] | -|**pnlInUSD** | **String** | | [optional] | -|**roi** | **String** | | [optional] | -|**percentage** | **String** | | [optional] | -|**assetStatus** | **String** | | [optional] | -|**availableAmount** | **String** | | [optional] | -|**availableAmountUnit** | **String** | | [optional] | -|**redeemedAmout** | **String** | | [optional] | -|**redeemedAmoutUnit** | **String** | | [optional] | -|**assetValueInUSD** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/QueryIndexDetailsResponse.md b/clients/auto-invest/docs/QueryIndexDetailsResponse.md deleted file mode 100644 index 916697051..000000000 --- a/clients/auto-invest/docs/QueryIndexDetailsResponse.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# QueryIndexDetailsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indexId** | **Long** | | [optional] | -|**indexName** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**assetAllocation** | [**List<QueryIndexDetailsResponseAssetAllocationInner>**](QueryIndexDetailsResponseAssetAllocationInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/QueryIndexDetailsResponseAssetAllocationInner.md b/clients/auto-invest/docs/QueryIndexDetailsResponseAssetAllocationInner.md deleted file mode 100644 index 60e9e3ab4..000000000 --- a/clients/auto-invest/docs/QueryIndexDetailsResponseAssetAllocationInner.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# QueryIndexDetailsResponseAssetAllocationInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**targetAsset** | **String** | | [optional] | -|**allocation** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/QueryIndexLinkedPlanPositionDetailsResponse.md b/clients/auto-invest/docs/QueryIndexLinkedPlanPositionDetailsResponse.md deleted file mode 100644 index 350d39f2b..000000000 --- a/clients/auto-invest/docs/QueryIndexLinkedPlanPositionDetailsResponse.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# QueryIndexLinkedPlanPositionDetailsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indexId** | **Long** | | [optional] | -|**totalInvestedInUSD** | **String** | | [optional] | -|**currentInvestedInUSD** | **String** | | [optional] | -|**pnlInUSD** | **String** | | [optional] | -|**roi** | **String** | | [optional] | -|**assetAllocation** | [**List<QueryIndexDetailsResponseAssetAllocationInner>**](QueryIndexDetailsResponseAssetAllocationInner.md) | | [optional] | -|**details** | [**List<QueryIndexLinkedPlanPositionDetailsResponseDetailsInner>**](QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.md b/clients/auto-invest/docs/QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.md deleted file mode 100644 index 1905d4b6e..000000000 --- a/clients/auto-invest/docs/QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# QueryIndexLinkedPlanPositionDetailsResponseDetailsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**targetAsset** | **String** | | [optional] | -|**averagePriceInUSD** | **String** | | [optional] | -|**totalInvestedInUSD** | **String** | | [optional] | -|**currentInvestedInUSD** | **String** | | [optional] | -|**purchasedAmount** | **String** | | [optional] | -|**pnlInUSD** | **String** | | [optional] | -|**roi** | **String** | | [optional] | -|**percentage** | **String** | | [optional] | -|**availableAmount** | **String** | | [optional] | -|**redeemedAmount** | **String** | | [optional] | -|**assetValueInUSD** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/QueryOneTimeTransactionStatusResponse.md b/clients/auto-invest/docs/QueryOneTimeTransactionStatusResponse.md deleted file mode 100644 index d305a0f0d..000000000 --- a/clients/auto-invest/docs/QueryOneTimeTransactionStatusResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# QueryOneTimeTransactionStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**transactionId** | **Long** | | [optional] | -|**status** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/QuerySourceAssetListResponse.md b/clients/auto-invest/docs/QuerySourceAssetListResponse.md deleted file mode 100644 index 2cd816a85..000000000 --- a/clients/auto-invest/docs/QuerySourceAssetListResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# QuerySourceAssetListResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**feeRate** | **String** | | [optional] | -|**taxRate** | **String** | | [optional] | -|**sourceAssets** | [**List<QuerySourceAssetListResponseSourceAssetsInner>**](QuerySourceAssetListResponseSourceAssetsInner.md) | | [optional] | - - - diff --git a/clients/auto-invest/docs/QuerySourceAssetListResponseSourceAssetsInner.md b/clients/auto-invest/docs/QuerySourceAssetListResponseSourceAssetsInner.md deleted file mode 100644 index 14c982673..000000000 --- a/clients/auto-invest/docs/QuerySourceAssetListResponseSourceAssetsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# QuerySourceAssetListResponseSourceAssetsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**sourceAsset** | **String** | | [optional] | -|**assetMinAmount** | **String** | | [optional] | -|**assetMaxAmount** | **String** | | [optional] | -|**scale** | **String** | | [optional] | -|**flexibleAmount** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/QuerySubscriptionTransactionHistoryResponse.md b/clients/auto-invest/docs/QuerySubscriptionTransactionHistoryResponse.md deleted file mode 100644 index 413e19b20..000000000 --- a/clients/auto-invest/docs/QuerySubscriptionTransactionHistoryResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# QuerySubscriptionTransactionHistoryResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/auto-invest/docs/QuerySubscriptionTransactionHistoryResponseInner.md b/clients/auto-invest/docs/QuerySubscriptionTransactionHistoryResponseInner.md deleted file mode 100644 index ca301efb8..000000000 --- a/clients/auto-invest/docs/QuerySubscriptionTransactionHistoryResponseInner.md +++ /dev/null @@ -1,30 +0,0 @@ - - -# QuerySubscriptionTransactionHistoryResponseInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **Long** | | [optional] | -|**targetAsset** | **String** | | [optional] | -|**planType** | **String** | | [optional] | -|**planName** | **String** | | [optional] | -|**planId** | **Long** | | [optional] | -|**transactionDateTime** | **Long** | | [optional] | -|**transactionStatus** | **String** | | [optional] | -|**failedType** | **String** | | [optional] | -|**sourceAsset** | **String** | | [optional] | -|**sourceAssetAmount** | **String** | | [optional] | -|**targetAssetAmount** | **String** | | [optional] | -|**sourceWallet** | **String** | | [optional] | -|**flexibleUsed** | **String** | | [optional] | -|**transactionFee** | **String** | | [optional] | -|**transactionFeeUnit** | **String** | | [optional] | -|**executionPrice** | **String** | | [optional] | -|**executionType** | **String** | | [optional] | -|**subscriptionCycle** | **String** | | [optional] | - - - diff --git a/clients/auto-invest/docs/TradeApi.md b/clients/auto-invest/docs/TradeApi.md deleted file mode 100644 index b2b124a66..000000000 --- a/clients/auto-invest/docs/TradeApi.md +++ /dev/null @@ -1,745 +0,0 @@ -# TradeApi - -All URIs are relative to *https://api.binance.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**changePlanStatus**](TradeApi.md#changePlanStatus) | **POST** /sapi/v1/lending/auto-invest/plan/edit-status | Change Plan Status(TRADE) | -| [**indexLinkedPlanRebalanceDetails**](TradeApi.md#indexLinkedPlanRebalanceDetails) | **GET** /sapi/v1/lending/auto-invest/rebalance/history | Index Linked Plan Rebalance Details(USER_DATA) | -| [**indexLinkedPlanRedemption**](TradeApi.md#indexLinkedPlanRedemption) | **POST** /sapi/v1/lending/auto-invest/redeem | Index Linked Plan Redemption(TRADE) | -| [**indexLinkedPlanRedemptionTrade**](TradeApi.md#indexLinkedPlanRedemptionTrade) | **GET** /sapi/v1/lending/auto-invest/redeem/history | Index Linked Plan Redemption(USER_DATA) | -| [**investmentPlanAdjustment**](TradeApi.md#investmentPlanAdjustment) | **POST** /sapi/v1/lending/auto-invest/plan/edit | Investment plan adjustment(TRADE) | -| [**investmentPlanCreation**](TradeApi.md#investmentPlanCreation) | **POST** /sapi/v1/lending/auto-invest/plan/add | Investment plan creation(USER_DATA) | -| [**oneTimeTransaction**](TradeApi.md#oneTimeTransaction) | **POST** /sapi/v1/lending/auto-invest/one-off | One Time Transaction(TRADE) | -| [**queryHoldingDetailsOfThePlan**](TradeApi.md#queryHoldingDetailsOfThePlan) | **GET** /sapi/v1/lending/auto-invest/plan/id | Query holding details of the plan(USER_DATA) | -| [**queryIndexLinkedPlanPositionDetails**](TradeApi.md#queryIndexLinkedPlanPositionDetails) | **GET** /sapi/v1/lending/auto-invest/index/user-summary | Query Index Linked Plan Position Details(USER_DATA) | -| [**queryOneTimeTransactionStatus**](TradeApi.md#queryOneTimeTransactionStatus) | **GET** /sapi/v1/lending/auto-invest/one-off/status | Query One-Time Transaction Status(USER_DATA) | -| [**querySubscriptionTransactionHistory**](TradeApi.md#querySubscriptionTransactionHistory) | **GET** /sapi/v1/lending/auto-invest/history/list | Query subscription transaction history(USER_DATA) | - - - -# **changePlanStatus** -> ChangePlanStatusResponse changePlanStatus(changePlanStatusRequest) - -Change Plan Status(TRADE) - -Change Plan Status * max one request every 3s per account Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - ChangePlanStatusRequest changePlanStatusRequest = new ChangePlanStatusRequest(); // ChangePlanStatusRequest | - try { - ChangePlanStatusResponse result = apiInstance.changePlanStatus(changePlanStatusRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#changePlanStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **changePlanStatusRequest** | [**ChangePlanStatusRequest**](ChangePlanStatusRequest.md)| | | - -### Return type - -[**ChangePlanStatusResponse**](ChangePlanStatusResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Change Plan Status | - | - - -# **indexLinkedPlanRebalanceDetails** -> IndexLinkedPlanRebalanceDetailsResponse indexLinkedPlanRebalanceDetails(startTime, endTime, current, size, recvWindow) - -Index Linked Plan Rebalance Details(USER_DATA) - -Get the history of Index Linked Plan Redemption transactions * Max 30 day difference between `startTime` and `endTime` * If no `startTime` and `endTime`, default to show past 30 day records Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Current query page. Default: 1, start from 1 - Long size = 56L; // Long | Default: 8, Max:100 - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - IndexLinkedPlanRebalanceDetailsResponse result = apiInstance.indexLinkedPlanRebalanceDetails(startTime, endTime, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#indexLinkedPlanRebalanceDetails"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Current query page. Default: 1, start from 1 | [optional] | -| **size** | **Long**| Default: 8, Max:100 | [optional] | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**IndexLinkedPlanRebalanceDetailsResponse**](IndexLinkedPlanRebalanceDetailsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Index Linked Plan Rebalance Details | - | - - -# **indexLinkedPlanRedemption** -> IndexLinkedPlanRedemptionResponse indexLinkedPlanRedemption(indexLinkedPlanRedemptionRequest) - -Index Linked Plan Redemption(TRADE) - -To redeem index-Linked plan holdings Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - IndexLinkedPlanRedemptionRequest indexLinkedPlanRedemptionRequest = new IndexLinkedPlanRedemptionRequest(); // IndexLinkedPlanRedemptionRequest | - try { - IndexLinkedPlanRedemptionResponse result = apiInstance.indexLinkedPlanRedemption(indexLinkedPlanRedemptionRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#indexLinkedPlanRedemption"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **indexLinkedPlanRedemptionRequest** | [**IndexLinkedPlanRedemptionRequest**](IndexLinkedPlanRedemptionRequest.md)| | | - -### Return type - -[**IndexLinkedPlanRedemptionResponse**](IndexLinkedPlanRedemptionResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Index Linked Plan Redemption | - | - - -# **indexLinkedPlanRedemptionTrade** -> IndexLinkedPlanRedemptionTradeResponse indexLinkedPlanRedemptionTrade(requestId, startTime, endTime, current, asset, size, recvWindow) - -Index Linked Plan Redemption(USER_DATA) - -Get the history of Index Linked Plan Redemption transactions * Max 30 day difference between `startTime` and `endTime` * If no `startTime` and `endTime`, default to show past 30 day records Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - Long requestId = 56L; // Long | request id - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Current query page. Default: 1, start from 1 - String asset = "asset_example"; // String | - Long size = 56L; // Long | Default: 8, Max:100 - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - IndexLinkedPlanRedemptionTradeResponse result = apiInstance.indexLinkedPlanRedemptionTrade(requestId, startTime, endTime, current, asset, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#indexLinkedPlanRedemptionTrade"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **requestId** | **Long**| request id | | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Current query page. Default: 1, start from 1 | [optional] | -| **asset** | **String**| | [optional] | -| **size** | **Long**| Default: 8, Max:100 | [optional] | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**IndexLinkedPlanRedemptionTradeResponse**](IndexLinkedPlanRedemptionTradeResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Index Linked Plan Redemption | - | - - -# **investmentPlanAdjustment** -> InvestmentPlanAdjustmentResponse investmentPlanAdjustment(investmentPlanAdjustmentRequest) - -Investment plan adjustment(TRADE) - -Query Source Asset to be used for investment * max one request every 3s per account Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - InvestmentPlanAdjustmentRequest investmentPlanAdjustmentRequest = new InvestmentPlanAdjustmentRequest(); // InvestmentPlanAdjustmentRequest | - try { - InvestmentPlanAdjustmentResponse result = apiInstance.investmentPlanAdjustment(investmentPlanAdjustmentRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#investmentPlanAdjustment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **investmentPlanAdjustmentRequest** | [**InvestmentPlanAdjustmentRequest**](InvestmentPlanAdjustmentRequest.md)| | | - -### Return type - -[**InvestmentPlanAdjustmentResponse**](InvestmentPlanAdjustmentResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Investment plan adjustment | - | - - -# **investmentPlanCreation** -> InvestmentPlanCreationResponse investmentPlanCreation(investmentPlanCreationRequest) - -Investment plan creation(USER_DATA) - -Post an investment plan creation * max one request every 3s per account Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - InvestmentPlanCreationRequest investmentPlanCreationRequest = new InvestmentPlanCreationRequest(); // InvestmentPlanCreationRequest | - try { - InvestmentPlanCreationResponse result = apiInstance.investmentPlanCreation(investmentPlanCreationRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#investmentPlanCreation"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **investmentPlanCreationRequest** | [**InvestmentPlanCreationRequest**](InvestmentPlanCreationRequest.md)| | | - -### Return type - -[**InvestmentPlanCreationResponse**](InvestmentPlanCreationResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Investment plan creation | - | - - -# **oneTimeTransaction** -> OneTimeTransactionResponse oneTimeTransaction(oneTimeTransactionRequest) - -One Time Transaction(TRADE) - -One time transaction * `planId`/`planId`/`details` must not all be null Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - OneTimeTransactionRequest oneTimeTransactionRequest = new OneTimeTransactionRequest(); // OneTimeTransactionRequest | - try { - OneTimeTransactionResponse result = apiInstance.oneTimeTransaction(oneTimeTransactionRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#oneTimeTransaction"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **oneTimeTransactionRequest** | [**OneTimeTransactionRequest**](OneTimeTransactionRequest.md)| | | - -### Return type - -[**OneTimeTransactionResponse**](OneTimeTransactionResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | One Time Transaction | - | - - -# **queryHoldingDetailsOfThePlan** -> QueryHoldingDetailsOfThePlanResponse queryHoldingDetailsOfThePlan(planId, requestId, recvWindow) - -Query holding details of the plan(USER_DATA) - -Query holding details of the plan Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - Long planId = 56L; // Long | Plan identifier - String requestId = "requestId_example"; // String | requestId when create - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - QueryHoldingDetailsOfThePlanResponse result = apiInstance.queryHoldingDetailsOfThePlan(planId, requestId, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#queryHoldingDetailsOfThePlan"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **planId** | **Long**| Plan identifier | [optional] | -| **requestId** | **String**| requestId when create | [optional] | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**QueryHoldingDetailsOfThePlanResponse**](QueryHoldingDetailsOfThePlanResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | holding details of the plan | - | - - -# **queryIndexLinkedPlanPositionDetails** -> QueryIndexLinkedPlanPositionDetailsResponse queryIndexLinkedPlanPositionDetails(indexId, recvWindow) - -Query Index Linked Plan Position Details(USER_DATA) - -Details on users Index-Linked plan position details Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - Long indexId = 56L; // Long | - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - QueryIndexLinkedPlanPositionDetailsResponse result = apiInstance.queryIndexLinkedPlanPositionDetails(indexId, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#queryIndexLinkedPlanPositionDetails"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **indexId** | **Long**| | | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**QueryIndexLinkedPlanPositionDetailsResponse**](QueryIndexLinkedPlanPositionDetailsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Index Linked Plan Position Details | - | - - -# **queryOneTimeTransactionStatus** -> QueryOneTimeTransactionStatusResponse queryOneTimeTransactionStatus(transactionId, requestId, recvWindow) - -Query One-Time Transaction Status(USER_DATA) - -Transaction status for one-time transaction Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - Long transactionId = 56L; // Long | PORTFOLIO plan's Id - String requestId = "requestId_example"; // String | requestId when create - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - QueryOneTimeTransactionStatusResponse result = apiInstance.queryOneTimeTransactionStatus(transactionId, requestId, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#queryOneTimeTransactionStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **transactionId** | **Long**| PORTFOLIO plan's Id | | -| **requestId** | **String**| requestId when create | [optional] | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**QueryOneTimeTransactionStatusResponse**](QueryOneTimeTransactionStatusResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | One-Time Transaction Status | - | - - -# **querySubscriptionTransactionHistory** -> QuerySubscriptionTransactionHistoryResponse querySubscriptionTransactionHistory(planId, startTime, endTime, targetAsset, planType, size, current, recvWindow) - -Query subscription transaction history(USER_DATA) - -Query subscription transaction history of a plan * Max span between startTime and endTime is 30days * If both startTime and endTime are null,then default is 30days Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.auto_invest.ApiClient; -import com.binance.connector.client.auto_invest.ApiException; -import com.binance.connector.client.auto_invest.Configuration; -import com.binance.connector.client.auto_invest.models.*; -import com.binance.connector.client.auto_invest.rest.api.TradeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeApi apiInstance = new TradeApi(defaultClient); - Long planId = 56L; // Long | Plan identifier - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long targetAsset = 56L; // Long | Plan identifier - Long planType = 56L; // Long | SINGLE, PORTFOLIO, INDEX, ALL - Long size = 56L; // Long | Default: 8, Max:100 - Long current = 56L; // Long | Current query page. Default: 1, start from 1 - Long recvWindow = 56L; // Long | no more than ```60000``` - try { - QuerySubscriptionTransactionHistoryResponse result = apiInstance.querySubscriptionTransactionHistory(planId, startTime, endTime, targetAsset, planType, size, current, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#querySubscriptionTransactionHistory"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **planId** | **Long**| Plan identifier | [optional] | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **targetAsset** | **Long**| Plan identifier | [optional] | -| **planType** | **Long**| SINGLE, PORTFOLIO, INDEX, ALL | [optional] | -| **size** | **Long**| Default: 8, Max:100 | [optional] | -| **current** | **Long**| Current query page. Default: 1, start from 1 | [optional] | -| **recvWindow** | **Long**| no more than ```60000``` | [optional] | - -### Return type - -[**QuerySubscriptionTransactionHistoryResponse**](QuerySubscriptionTransactionHistoryResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | subscription transaction history | - | - diff --git a/clients/auto-invest/docs/rest-api/certificate-pinning.md b/clients/auto-invest/docs/rest-api/certificate-pinning.md deleted file mode 100644 index b31b02776..000000000 --- a/clients/auto-invest/docs/rest-api/certificate-pinning.md +++ /dev/null @@ -1,31 +0,0 @@ -# Certificate Pinning -```java - import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; - import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; - import com.binance.connector.client.common.ApiException; - import com.binance.connector.client.common.ApiResponse; - import com.binance.connector.client.common.configuration.ClientConfiguration; - import com.binance.connector.client.common.configuration.SignatureConfiguration; - - // Expected pinned public key (SPKI SHA-256 hash) - // You can extract it from the certificate using openssl: - // openssl s_client -connect your-api.com:443 /dev/null | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64 - public static final String PINNED_PUBLIC_KEY = "YOUR-PINNED-PUBLIC-KEY"; - - - public static void main(String[] args) { - ClientConfiguration clientConfiguration = AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - CertificatePinner certificatePinner = new CertificatePinner.Builder() - .add("your-api.com", PINNED_PUBLIC_KEY) - .build(); - - clientConfiguration.setCertificatePinner(certificatePinner); - - AutoInvestRestApi api = new AutoInvestRestApi(clientConfiguration); - } -``` \ No newline at end of file diff --git a/clients/auto-invest/docs/rest-api/compression.md b/clients/auto-invest/docs/rest-api/compression.md deleted file mode 100644 index e087b2b5f..000000000 --- a/clients/auto-invest/docs/rest-api/compression.md +++ /dev/null @@ -1,20 +0,0 @@ -# Compression Configuration - -```java - import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; - import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; - import com.binance.connector.client.common.ApiException; - import com.binance.connector.client.common.ApiResponse; - import com.binance.connector.client.common.configuration.ClientConfiguration; - import com.binance.connector.client.common.configuration.SignatureConfiguration; - - public static void main(String[] args) { - ClientConfiguration clientConfiguration = AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - clientConfiguration.setCompression(false); //disable compression - AutoInvestRestApi api = new AutoInvestRestApi(clientConfiguration); - } -``` \ No newline at end of file diff --git a/clients/auto-invest/docs/rest-api/error-handling.md b/clients/auto-invest/docs/rest-api/error-handling.md deleted file mode 100644 index 5e157c5fd..000000000 --- a/clients/auto-invest/docs/rest-api/error-handling.md +++ /dev/null @@ -1,17 +0,0 @@ -# Error Handling - -```java - String symbol = "BNBUSDT"; - try { - ApiResponse response = getApi().accountCommission(symbol); - System.out.println(response.getData()); - } catch (ApiException exception) { - // get http code - int httpCode = exception.getCode(); - // get error message - String message = exception.getMessage(); - // headers are in lowercase - List retryafter = exception.getResponseHeaders().get("retry-after"); - System.out.println(retryafter); - } -``` \ No newline at end of file diff --git a/clients/auto-invest/docs/rest-api/key-pair-authentication.md b/clients/auto-invest/docs/rest-api/key-pair-authentication.md deleted file mode 100644 index c063e32b1..000000000 --- a/clients/auto-invest/docs/rest-api/key-pair-authentication.md +++ /dev/null @@ -1,20 +0,0 @@ -# Key Pair Based Authentication - -```java - import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; - import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; - import com.binance.connector.client.common.ApiException; - import com.binance.connector.client.common.ApiResponse; - import com.binance.connector.client.common.configuration.ClientConfiguration; - import com.binance.connector.client.common.configuration.SignatureConfiguration; - - public static void main(String[] args) { - ClientConfiguration clientConfiguration = AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); // Provide the private key directly as a string or specify the path to a private key file (e.g., '/path/to/private_key.pem') - signatureConfiguration.setPrivateKeyPass("your_passphrase"); // Optional: Required if the private key is encrypted - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - AutoInvestRestApi api = new AutoInvestRestApi(clientConfiguration); - } -``` \ No newline at end of file diff --git a/clients/auto-invest/docs/rest-api/migration-guide.md b/clients/auto-invest/docs/rest-api/migration-guide.md deleted file mode 100644 index d30c928cd..000000000 --- a/clients/auto-invest/docs/rest-api/migration-guide.md +++ /dev/null @@ -1,144 +0,0 @@ -# Migration Guide: Binance Auto Invest Connector Modularization - -With the transition to a modularized structure, the Binance Connector has been split into separate NPM libraries, each focusing on a distinct product (e.g., Auto Invest, Futures, etc.). - ---- - -## Key Changes - -1. **Package Name**: - The modularised Auto Invest Connector has been moved to a new package: - - **Old:** -```xml - - io.github.binance - binance-connector-java - 3.0.5 - -``` - **New:** -```xml - - io.github.binance - binance-auto-invest - 1.1.0 - -``` - -2**Imports**: - Update your import paths. - - **Old:** - -```java -import com.binance.connector.client.SpotClient; -``` - - **New:** - -```java -import com.binance.connector.client.auto-invest.rest.api.AutoInvestRestApi; -``` - -4. **Configuration and Client Initialization**: - The new structure keeps the existing configuration options but modularized clients into `AutoInvestRestApi`. - - **Old:** - -```java -SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); -String result = client.(parameters); -System.out.println(result); -``` - - - **New:** - -```java - ClientConfiguration clientConfiguration = AlgoRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - AutoInvestRestApi api = new AutoInvestRestApi(clientConfiguration); -``` - -5. **Examples and Documentation**: - Updated examples can be found in the new repository folders: - - REST API: `examples/auto-invest/` - ---- - -## Migration Steps - -### 1. Replace the maven dependency - -Replace the maven dependency: - -```xml - - io.github.binance - binance-connector-java - 3.0.5 - -``` - -by: - -```xml - - io.github.binance - binance-auto-invest - 1.1.0 - -``` - -### 3. Update Import Paths - -Replace all occurrences of: - -```java -import com.binance.connector.client.SpotClient; -``` - -With: - -```java -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -``` - -### 4. Update Client Initialization - -Adjust your code to use the modularized structure. For example: - -**Old:** - -```java -SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); -``` - -**New:** - -```java - ClientConfiguration clientConfiguration = AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - clientConfiguration.setCompression(false); //disable compression - AutoInvestRestApi api = new AutoInvestRestApi(clientConfiguration); -``` - -### 5. Test and Verify - -Run your application to ensure everything works as expected. Refer to the new documentation for any advanced features or configuration options. - ---- - -## Additional Notes - -- **Future Modular Packages**: Similar packages for other products (e.g., Wallet, Staking) will follow this pattern. - -For more details, refer to the updated [README](../../README.md) and [Examples](../../../../examples/). \ No newline at end of file diff --git a/clients/auto-invest/docs/rest-api/proxy.md b/clients/auto-invest/docs/rest-api/proxy.md deleted file mode 100644 index 3eb840e21..000000000 --- a/clients/auto-invest/docs/rest-api/proxy.md +++ /dev/null @@ -1,45 +0,0 @@ -# Proxy Configuration - -```java - import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; - import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; - import com.binance.connector.client.common.configuration.ClientConfiguration; - import com.binance.connector.client.common.configuration.SignatureConfiguration; - import okhttp3.Authenticator; - import okhttp3.Credentials; - import okhttp3.Request; - import okhttp3.Response; - import okhttp3.Route; - - import java.io.IOException; - import java.net.InetSocketAddress; - import java.net.Proxy; - - public static void main(String[] args) { - ClientConfiguration clientConfiguration = AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - // Create the HTTP proxy - Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", 123)); - // Add the proxy to the configuration - clientConfiguration.setProxy(proxy); - - // Create the Proxy Authenticator - Authenticator proxyAuthenticator = new Authenticator() { - @Override public Request authenticate(Route route, Response response) throws IOException { - String credential = Credentials.basic("username", "password"); - return response.request().newBuilder() - .header("Proxy-Authorization", credential) - .build(); - } - }; - - // Add the proxy authenticator to the configuration - clientConfiguration.setProxyAuthenticator(proxyAuthenticator); - - AutoInvestRestApi api = new AutoInvestRestApi(clientConfiguration); - } -``` \ No newline at end of file diff --git a/clients/auto-invest/docs/rest-api/retries.md b/clients/auto-invest/docs/rest-api/retries.md deleted file mode 100644 index 0ee2c3178..000000000 --- a/clients/auto-invest/docs/rest-api/retries.md +++ /dev/null @@ -1,25 +0,0 @@ -# Retries Configuration - -```java - import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; - import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; - import com.binance.connector.client.common.ApiException; - import com.binance.connector.client.common.ApiResponse; - import com.binance.connector.client.common.configuration.ClientConfiguration; - import com.binance.connector.client.common.configuration.SignatureConfiguration; - - public static void main(String[] args) { - ClientConfiguration clientConfiguration = AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - // Retry up to 5 times - clientConfiguration.setRetries(5); - // 500ms between retries - clientConfiguration.setBackOff(500); - - AutoInvestRestApi api = new AutoInvestRestApi(clientConfiguration); - } -``` \ No newline at end of file diff --git a/clients/auto-invest/docs/rest-api/timeout.md b/clients/auto-invest/docs/rest-api/timeout.md deleted file mode 100644 index c195045cd..000000000 --- a/clients/auto-invest/docs/rest-api/timeout.md +++ /dev/null @@ -1,25 +0,0 @@ -# Retries Configuration - -```java - import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; - import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; - import com.binance.connector.client.common.ApiException; - import com.binance.connector.client.common.ApiResponse; - import com.binance.connector.client.common.configuration.ClientConfiguration; - import com.binance.connector.client.common.configuration.SignatureConfiguration; - - public static void main(String[] args) { - ClientConfiguration clientConfiguration = AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - // Connect timeout of 500ms - clientConfiguration.setConnectTimeout(500); - // Read timeout of 1s - clientConfiguration.setReadTimeout(1000); - - AutoInvestRestApi api = new AutoInvestRestApi(clientConfiguration); - } -``` \ No newline at end of file diff --git a/clients/auto-invest/example_rest.md b/clients/auto-invest/example_rest.md deleted file mode 100644 index bf09ef7f6..000000000 --- a/clients/auto-invest/example_rest.md +++ /dev/null @@ -1,38 +0,0 @@ -## MarketData - -[GET /sapi/v1/lending/auto-invest/plan/list](https://developers.binance.com/docs/auto_invest/market-data/Get-list-of-plans) - getListOfPlans - [GetListOfPlansExample.java:47](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetListOfPlansExample.java#L47) - -[GET /sapi/v1/lending/auto-invest/target-asset/list](https://developers.binance.com/docs/auto_invest/market-data/Get-target-asset-list) - getTargetAssetList - [GetTargetAssetListExample.java:47](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetTargetAssetListExample.java#L47) - -[GET /sapi/v1/lending/auto-invest/target-asset/roi/list](https://developers.binance.com/docs/auto_invest/market-data/Get-target-asset-ROI-data) - getTargetAssetRoiData - [GetTargetAssetRoiDataExample.java:47](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetTargetAssetRoiDataExample.java#L47) - -[GET /sapi/v1/lending/auto-invest/all/asset](https://developers.binance.com/docs/auto_invest/market-data/Query-all-source-asset-and-target-asset) - queryAllSourceAssetAndTargetAsset - [QueryAllSourceAssetAndTargetAssetExample.java:47](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QueryAllSourceAssetAndTargetAssetExample.java#L47) - -[GET /sapi/v1/lending/auto-invest/index/info](https://developers.binance.com/docs/auto_invest/market-data/Query-Index-Details) - queryIndexDetails - [QueryIndexDetailsExample.java:47](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QueryIndexDetailsExample.java#L47) - -[GET /sapi/v1/lending/auto-invest/source-asset/list](https://developers.binance.com/docs/auto_invest/market-data/Query-source-asset-list) - querySourceAssetList - [QuerySourceAssetListExample.java:47](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QuerySourceAssetListExample.java#L47) - -## Trade - -[POST /sapi/v1/lending/auto-invest/plan/edit-status](https://developers.binance.com/docs/auto_invest/trade/Change-Plan-Status) - changePlanStatus - [ChangePlanStatusExample.java:48](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/ChangePlanStatusExample.java#L48) - -[GET /sapi/v1/lending/auto-invest/rebalance/history](https://developers.binance.com/docs/auto_invest/trade/Index-Linked-Plan-Rebalance-Details) - indexLinkedPlanRebalanceDetails - [IndexLinkedPlanRebalanceDetailsExample.java:49](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRebalanceDetailsExample.java#L49) - -[POST /sapi/v1/lending/auto-invest/redeem](https://developers.binance.com/docs/auto_invest/trade/Index-Linked-Plan-Redemption) - indexLinkedPlanRedemption - [IndexLinkedPlanRedemptionExample.java:48](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRedemptionExample.java#L48) - -[GET /sapi/v1/lending/auto-invest/redeem/history](https://developers.binance.com/docs/auto_invest/trade/Query-Index-Linked-Plan-Redemption) - indexLinkedPlanRedemptionTrade - [IndexLinkedPlanRedemptionTradeExample.java:49](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRedemptionTradeExample.java#L49) - -[POST /sapi/v1/lending/auto-invest/plan/edit](https://developers.binance.com/docs/auto_invest/trade/Investment-plan-adjustment) - investmentPlanAdjustment - [InvestmentPlanAdjustmentExample.java:50](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/InvestmentPlanAdjustmentExample.java#L50) - -[POST /sapi/v1/lending/auto-invest/plan/add](https://developers.binance.com/docs/auto_invest/trade/Investment-plan-creation) - investmentPlanCreation - [InvestmentPlanCreationExample.java:49](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/InvestmentPlanCreationExample.java#L49) - -[POST /sapi/v1/lending/auto-invest/one-off](https://developers.binance.com/docs/auto_invest/trade/One-Time-Transaction) - oneTimeTransaction - [OneTimeTransactionExample.java:50](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/OneTimeTransactionExample.java#L50) - -[GET /sapi/v1/lending/auto-invest/plan/id](https://developers.binance.com/docs/auto_invest/trade/Query-holding-details-of-the-plan) - queryHoldingDetailsOfThePlan - [QueryHoldingDetailsOfThePlanExample.java:47](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryHoldingDetailsOfThePlanExample.java#L47) - -[GET /sapi/v1/lending/auto-invest/index/user-summary](https://developers.binance.com/docs/auto_invest/trade/Query-Index-Linked-Plan-Position-Details) - queryIndexLinkedPlanPositionDetails - [QueryIndexLinkedPlanPositionDetailsExample.java:47](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryIndexLinkedPlanPositionDetailsExample.java#L47) - -[GET /sapi/v1/lending/auto-invest/one-off/status](https://developers.binance.com/docs/auto_invest/trade/Query-One-Time-Transaction-Status) - queryOneTimeTransactionStatus - [QueryOneTimeTransactionStatusExample.java:47](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryOneTimeTransactionStatusExample.java#L47) - -[GET /sapi/v1/lending/auto-invest/history/list](https://developers.binance.com/docs/auto_invest/trade/Query-subscription-transaction-history) - querySubscriptionTransactionHistory - [QuerySubscriptionTransactionHistoryExample.java:48](/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QuerySubscriptionTransactionHistoryExample.java#L48) - diff --git a/clients/auto-invest/pom.xml b/clients/auto-invest/pom.xml deleted file mode 100644 index 0f0bda77b..000000000 --- a/clients/auto-invest/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - 4.0.0 - binance-auto-invest - auto-invest - 1.1.0 - jar - - - io.github.binance - binance-connector-java-clients - 1.1.0 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - -parameters - - - - - - - - io.github.binance - binance-common - 1.1.0 - - - \ No newline at end of file diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/AutoInvestRestApiUtil.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/AutoInvestRestApiUtil.java deleted file mode 100644 index d36a0cfe6..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/AutoInvestRestApiUtil.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.binance.connector.client.auto_invest.rest; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.configuration.ClientConfiguration; - -public class AutoInvestRestApiUtil { - private static final String BASE_URL = "https://api.binance.com"; - private static final boolean HAS_TIME_UNIT = false; - - public static ClientConfiguration getClientConfiguration() { - ClientConfiguration clientConfiguration = new ClientConfiguration(); - if (!HAS_TIME_UNIT) { - clientConfiguration.setTimeUnit(null); - } - clientConfiguration.setUrl(BASE_URL); - return clientConfiguration; - } - - public static ApiClient getDefaultClient(ClientConfiguration configuration) { - ApiClient apiClient = new ApiClient(configuration); - apiClient.setJson(JSON.getGson()); - - return apiClient; - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/JSON.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/JSON.java deleted file mode 100644 index 0dad38c58..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/JSON.java +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest; - -import com.binance.connector.client.common.DecimalFormatter; -import com.binance.connector.client.common.websocket.service.DeserializeExclusionStrategy; -import com.binance.connector.client.common.websocket.service.SerializeExclusionStrategy; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonParseException; -import com.google.gson.JsonPrimitive; -import com.google.gson.JsonSerializer; -import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.gsonfire.GsonFireBuilder; -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Date; -import java.util.Map; -import okio.ByteString; - -/* - * A JSON utility class - * - * NOTE: in the future, this class may be converted to static, which may break - * backward-compatibility - */ -public class JSON { - private static Gson gson; - private static boolean isLenientOnJson = false; - private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = - new OffsetDateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - - @SuppressWarnings("unchecked") - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); - GsonBuilder builder = fireBuilder.createGsonBuilder(); - return builder; - } - - private static String getDiscriminatorValue( - JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if (null == element) { - throw new IllegalArgumentException( - "missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator - * value. - * - * @param classByDiscriminatorValue The map of discriminator values to Java classes. - * @param discriminatorValue The value of the OpenAPI discriminator in the input data. - * @return The Java class that implements the OpenAPI schema - */ - private static Class getClassByDiscriminator( - Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); - if (null == clazz) { - throw new IllegalArgumentException( - "cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - static { - GsonBuilder gsonBuilder = createGson(); - gsonBuilder - .registerTypeAdapter( - Double.class, - (JsonSerializer) - (src, typeOfSrc, context) -> { - DecimalFormat df = DecimalFormatter.getFormatter(); - return new JsonPrimitive(df.format(src)); - }) - .addSerializationExclusionStrategy(new SerializeExclusionStrategy()) - .addDeserializationExclusionStrategy(new DeserializeExclusionStrategy()); - gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); - gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); - gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); - gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); - gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusRequest - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.Details - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.DetailsInner - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.GetListOfPlansResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .GetListOfPlansResponsePlansInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.GetTargetAssetListResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .GetTargetAssetListResponseAutoInvestAssetListInner - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .GetTargetAssetRoiDataResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .GetTargetAssetRoiDataResponseInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .IndexLinkedPlanRebalanceDetailsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .IndexLinkedPlanRebalanceDetailsResponseInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .IndexLinkedPlanRedemptionRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .IndexLinkedPlanRedemptionResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .IndexLinkedPlanRedemptionTradeResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .IndexLinkedPlanRedemptionTradeResponseInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .InvestmentPlanAdjustmentRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .InvestmentPlanAdjustmentResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .InvestmentPlanCreationRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .InvestmentPlanCreationResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionRequest - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QueryAllSourceAssetAndTargetAssetResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QueryHoldingDetailsOfThePlanResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QueryHoldingDetailsOfThePlanResponseDetailsInner - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.QueryIndexDetailsResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QueryIndexDetailsResponseAssetAllocationInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QueryIndexLinkedPlanPositionDetailsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QueryIndexLinkedPlanPositionDetailsResponseDetailsInner - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QueryOneTimeTransactionStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model.QuerySourceAssetListResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QuerySourceAssetListResponseSourceAssetsInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QuerySubscriptionTransactionHistoryResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.auto_invest.rest.model - .QuerySubscriptionTransactionHistoryResponseInner - .CustomTypeAdapterFactory()); - gson = gsonBuilder.create(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public static Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - */ - public static void setGson(Gson gson) { - JSON.gson = gson; - } - - public static void setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public static String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public static T deserialize(String body, Type returnType) { - try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see - // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType.equals(String.class)) { - return (T) body; - } else { - throw (e); - } - } - } - - /** Gson TypeAdapter for Byte Array type */ - public static class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(ByteString.of(value).base64()); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - ByteString byteString = ByteString.decodeBase64(bytesAsBase64); - return byteString.toByteArray(); - } - } - } - - /** Gson TypeAdapter for JSR310 OffsetDateTime type */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length() - 5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } - } - - /** Gson TypeAdapter for JSR310 LocalDate type */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } - - public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - /** - * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" - * format will be used (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() {} - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date( - ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - - /** - * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be - * used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public static void setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - } - - public static void setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/api/AutoInvestRestApi.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/api/AutoInvestRestApi.java deleted file mode 100644 index b528382a3..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/api/AutoInvestRestApi.java +++ /dev/null @@ -1,511 +0,0 @@ -package com.binance.connector.client.auto_invest.rest.api; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusRequest; -import com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusResponse; -import com.binance.connector.client.auto_invest.rest.model.GetListOfPlansResponse; -import com.binance.connector.client.auto_invest.rest.model.GetTargetAssetListResponse; -import com.binance.connector.client.auto_invest.rest.model.GetTargetAssetRoiDataResponse; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRebalanceDetailsResponse; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionRequest; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionResponse; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionTradeResponse; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanAdjustmentRequest; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanAdjustmentResponse; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanCreationRequest; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanCreationResponse; -import com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionRequest; -import com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryAllSourceAssetAndTargetAssetResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryHoldingDetailsOfThePlanResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryIndexDetailsResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryIndexLinkedPlanPositionDetailsResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryOneTimeTransactionStatusResponse; -import com.binance.connector.client.auto_invest.rest.model.QuerySourceAssetListResponse; -import com.binance.connector.client.auto_invest.rest.model.QuerySubscriptionTransactionHistoryResponse; -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; - -public class AutoInvestRestApi { - - private final MarketDataApi marketDataApi; - private final TradeApi tradeApi; - - public AutoInvestRestApi(ClientConfiguration configuration) { - this(AutoInvestRestApiUtil.getDefaultClient(configuration)); - } - - public AutoInvestRestApi(ApiClient apiClient) { - this.marketDataApi = new MarketDataApi(apiClient); - this.tradeApi = new TradeApi(apiClient); - } - - /** - * Get list of plans (USER_DATA) Query plan lists * max one request every 3s per account Weight: - * 1 - * - * @param planType Plan identifier (required) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<GetListOfPlansResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get list of plans -
- * - * @see Get - * list of plans (USER_DATA) Documentation - */ - public ApiResponse getListOfPlans(String planType, Long recvWindow) - throws ApiException { - return marketDataApi.getListOfPlans(planType, recvWindow); - } - - /** - * Get target asset list(USER_DATA) Get target asset list Weight: 1 - * - * @param targetAsset Plan identifier (optional) - * @param size Default: 8, Max:100 (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<GetTargetAssetListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get target asset list -
- * - * @see Get - * target asset list(USER_DATA) Documentation - */ - public ApiResponse getTargetAssetList( - Long targetAsset, Long size, Long current, Long recvWindow) throws ApiException { - return marketDataApi.getTargetAssetList(targetAsset, size, current, recvWindow); - } - - /** - * Get target asset ROI data ROI return list for target asset Weight: 1 - * - * @param targetAsset e.g \"BTC\" (required) - * @param hisRoiType FIVE_YEAR,THREE_YEAR,ONE_YEAR,SIX_MONTH,THREE_MONTH,SEVEN_DAY (required) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<GetTargetAssetRoiDataResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get target asset ROI data -
- * - * @see Get - * target asset ROI data Documentation - */ - public ApiResponse getTargetAssetRoiData( - String targetAsset, String hisRoiType, Long recvWindow) throws ApiException { - return marketDataApi.getTargetAssetRoiData(targetAsset, hisRoiType, recvWindow); - } - - /** - * Query all source asset and target asset(USER_DATA) Query all source assets and target assets - * Weight: 1 - * - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryAllSourceAssetAndTargetAssetResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 all source asset and target asset -
- * - * @see Query - * all source asset and target asset(USER_DATA) Documentation - */ - public ApiResponse queryAllSourceAssetAndTargetAsset( - Long recvWindow) throws ApiException { - return marketDataApi.queryAllSourceAssetAndTargetAsset(recvWindow); - } - - /** - * Query Index Details(USER_DATA) Query index details Weight: 1 - * - * @param indexId (required) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryIndexDetailsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Details -
- * - * @see Query - * Index Details(USER_DATA) Documentation - */ - public ApiResponse queryIndexDetails(Long indexId, Long recvWindow) - throws ApiException { - return marketDataApi.queryIndexDetails(indexId, recvWindow); - } - - /** - * Query source asset list(USER_DATA) Query Source Asset to be used for investment Weight: 1 - * - * @param usageType \"RECURRING\", \"ONE_TIME\" (required) - * @param targetAsset Plan identifier (optional) - * @param indexId 指数identifier, value = 1 (optional) - * @param flexibleAllowedToUse (optional) - * @param sourceType `MAIN_SITE` for Binance user,`TR` for Binance Turkey - * user (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QuerySourceAssetListResponse> - * @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 source asset list -
- * - * @see Query - * source asset list(USER_DATA) Documentation - */ - public ApiResponse querySourceAssetList( - String usageType, - Long targetAsset, - Long indexId, - Boolean flexibleAllowedToUse, - String sourceType, - Long recvWindow) - throws ApiException { - return marketDataApi.querySourceAssetList( - usageType, targetAsset, indexId, flexibleAllowedToUse, sourceType, recvWindow); - } - - /** - * Change Plan Status(TRADE) Change Plan Status * max one request every 3s per account Weight: 1 - * - * @param changePlanStatusRequest (required) - * @return ApiResponse<ChangePlanStatusResponse> - * @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 Change Plan Status -
- * - * @see Change - * Plan Status(TRADE) Documentation - */ - public ApiResponse changePlanStatus( - ChangePlanStatusRequest changePlanStatusRequest) throws ApiException { - return tradeApi.changePlanStatus(changePlanStatusRequest); - } - - /** - * Index Linked Plan Rebalance Details(USER_DATA) Get the history of Index Linked Plan - * Redemption transactions * Max 30 day difference between `startTime` and - * `endTime` * If no `startTime` and `endTime`, default to show - * past 30 day records Weight: 1 - * - * @param startTime (optional) - * @param endTime (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param size Default: 8, Max:100 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<IndexLinkedPlanRebalanceDetailsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Rebalance Details -
- * - * @see Index - * Linked Plan Rebalance Details(USER_DATA) Documentation - */ - public ApiResponse indexLinkedPlanRebalanceDetails( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) - throws ApiException { - return tradeApi.indexLinkedPlanRebalanceDetails( - startTime, endTime, current, size, recvWindow); - } - - /** - * Index Linked Plan Redemption(TRADE) To redeem index-Linked plan holdings Weight: 1 - * - * @param indexLinkedPlanRedemptionRequest (required) - * @return ApiResponse<IndexLinkedPlanRedemptionResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Redemption -
- * - * @see Index - * Linked Plan Redemption(TRADE) Documentation - */ - public ApiResponse indexLinkedPlanRedemption( - IndexLinkedPlanRedemptionRequest indexLinkedPlanRedemptionRequest) throws ApiException { - return tradeApi.indexLinkedPlanRedemption(indexLinkedPlanRedemptionRequest); - } - - /** - * Index Linked Plan Redemption(USER_DATA) Get the history of Index Linked Plan Redemption - * transactions * Max 30 day difference between `startTime` and `endTime` * - * If no `startTime` and `endTime`, default to show past 30 day records - * Weight: 1 - * - * @param requestId request id (required) - * @param startTime (optional) - * @param endTime (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param asset (optional) - * @param size Default: 8, Max:100 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<IndexLinkedPlanRedemptionTradeResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Redemption -
- * - * @see Index - * Linked Plan Redemption(USER_DATA) Documentation - */ - public ApiResponse indexLinkedPlanRedemptionTrade( - Long requestId, - Long startTime, - Long endTime, - Long current, - String asset, - Long size, - Long recvWindow) - throws ApiException { - return tradeApi.indexLinkedPlanRedemptionTrade( - requestId, startTime, endTime, current, asset, size, recvWindow); - } - - /** - * Investment plan adjustment(TRADE) Query Source Asset to be used for investment * max one - * request every 3s per account Weight: 1 - * - * @param investmentPlanAdjustmentRequest (required) - * @return ApiResponse<InvestmentPlanAdjustmentResponse> - * @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 Investment plan adjustment -
- * - * @see Investment - * plan adjustment(TRADE) Documentation - */ - public ApiResponse investmentPlanAdjustment( - InvestmentPlanAdjustmentRequest investmentPlanAdjustmentRequest) throws ApiException { - return tradeApi.investmentPlanAdjustment(investmentPlanAdjustmentRequest); - } - - /** - * Investment plan creation(USER_DATA) Post an investment plan creation * max one request every - * 3s per account Weight: 1 - * - * @param investmentPlanCreationRequest (required) - * @return ApiResponse<InvestmentPlanCreationResponse> - * @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 Investment plan creation -
- * - * @see Investment - * plan creation(USER_DATA) Documentation - */ - public ApiResponse investmentPlanCreation( - InvestmentPlanCreationRequest investmentPlanCreationRequest) throws ApiException { - return tradeApi.investmentPlanCreation(investmentPlanCreationRequest); - } - - /** - * One Time Transaction(TRADE) One time transaction * - * `planId`/`planId`/`details` must not all be null Weight: 1 - * - * @param oneTimeTransactionRequest (required) - * @return ApiResponse<OneTimeTransactionResponse> - * @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 One Time Transaction -
- * - * @see One - * Time Transaction(TRADE) Documentation - */ - public ApiResponse oneTimeTransaction( - OneTimeTransactionRequest oneTimeTransactionRequest) throws ApiException { - return tradeApi.oneTimeTransaction(oneTimeTransactionRequest); - } - - /** - * Query holding details of the plan(USER_DATA) Query holding details of the plan Weight: 1 - * - * @param planId Plan identifier (optional) - * @param requestId requestId when create (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryHoldingDetailsOfThePlanResponse> - * @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 holding details of the plan -
- * - * @see Query - * holding details of the plan(USER_DATA) Documentation - */ - public ApiResponse queryHoldingDetailsOfThePlan( - Long planId, String requestId, Long recvWindow) throws ApiException { - return tradeApi.queryHoldingDetailsOfThePlan(planId, requestId, recvWindow); - } - - /** - * Query Index Linked Plan Position Details(USER_DATA) Details on users Index-Linked plan - * position details Weight: 1 - * - * @param indexId (required) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryIndexLinkedPlanPositionDetailsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Position Details -
- * - * @see Query - * Index Linked Plan Position Details(USER_DATA) Documentation - */ - public ApiResponse - queryIndexLinkedPlanPositionDetails(Long indexId, Long recvWindow) throws ApiException { - return tradeApi.queryIndexLinkedPlanPositionDetails(indexId, recvWindow); - } - - /** - * Query One-Time Transaction Status(USER_DATA) Transaction status for one-time transaction - * Weight: 1 - * - * @param transactionId PORTFOLIO plan's Id (required) - * @param requestId requestId when create (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryOneTimeTransactionStatusResponse> - * @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 One-Time Transaction Status -
- * - * @see Query - * One-Time Transaction Status(USER_DATA) Documentation - */ - public ApiResponse queryOneTimeTransactionStatus( - Long transactionId, String requestId, Long recvWindow) throws ApiException { - return tradeApi.queryOneTimeTransactionStatus(transactionId, requestId, recvWindow); - } - - /** - * Query subscription transaction history(USER_DATA) Query subscription transaction history of a - * plan * Max span between startTime and endTime is 30days * If both startTime and endTime are - * null,then default is 30days Weight: 1 - * - * @param planId Plan identifier (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param targetAsset Plan identifier (optional) - * @param planType SINGLE, PORTFOLIO, INDEX, ALL (optional) - * @param size Default: 8, Max:100 (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QuerySubscriptionTransactionHistoryResponse> - * @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 subscription transaction history -
- * - * @see Query - * subscription transaction history(USER_DATA) Documentation - */ - public ApiResponse - querySubscriptionTransactionHistory( - Long planId, - Long startTime, - Long endTime, - Long targetAsset, - Long planType, - Long size, - Long current, - Long recvWindow) - throws ApiException { - return tradeApi.querySubscriptionTransactionHistory( - planId, startTime, endTime, targetAsset, planType, size, current, recvWindow); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/api/MarketDataApi.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/api/MarketDataApi.java deleted file mode 100644 index b5335dfd1..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/api/MarketDataApi.java +++ /dev/null @@ -1,1048 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.api; - -import com.binance.connector.client.auto_invest.rest.model.GetListOfPlansResponse; -import com.binance.connector.client.auto_invest.rest.model.GetTargetAssetListResponse; -import com.binance.connector.client.auto_invest.rest.model.GetTargetAssetRoiDataResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryAllSourceAssetAndTargetAssetResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryIndexDetailsResponse; -import com.binance.connector.client.auto_invest.rest.model.QuerySourceAssetListResponse; -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.Pair; -import com.binance.connector.client.common.SystemUtil; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.exception.ConstraintViolationException; -import com.google.gson.reflect.TypeToken; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Validation; -import jakarta.validation.Validator; -import jakarta.validation.constraints.*; -import jakarta.validation.executable.ExecutableValidator; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; - -public class MarketDataApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - private static final String USER_AGENT = - String.format( - "binance-auto-invest/1.1.0 (Java/%s; %s; %s)", - SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); - private static final boolean HAS_TIME_UNIT = false; - - public MarketDataApi(ClientConfiguration clientConfiguration) { - this(new ApiClient(clientConfiguration)); - } - - public MarketDataApi(ApiClient apiClient) { - apiClient.setUserAgent(USER_AGENT); - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getListOfPlans - * - * @param planType Plan identifier (required) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get list of plans -
- * - * @see Get - * list of plans (USER_DATA) Documentation - */ - private okhttp3.Call getListOfPlansCall(String planType, Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/plan/list"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (planType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("planType", planType)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getListOfPlansValidateBeforeCall(String planType, Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {planType, recvWindow}; - Method method = this.getClass().getMethod("getListOfPlans", String.class, Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getListOfPlansCall(planType, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get list of plans (USER_DATA) Query plan lists * max one request every 3s per account Weight: - * 1 - * - * @param planType Plan identifier (required) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<GetListOfPlansResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get list of plans -
- * - * @see Get - * list of plans (USER_DATA) Documentation - */ - public ApiResponse getListOfPlans( - @NotNull String planType, Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = getListOfPlansValidateBeforeCall(planType, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getTargetAssetList - * - * @param targetAsset Plan identifier (optional) - * @param size Default: 8, Max:100 (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get target asset list -
- * - * @see Get - * target asset list(USER_DATA) Documentation - */ - private okhttp3.Call getTargetAssetListCall( - Long targetAsset, Long size, Long current, Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/target-asset/list"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (targetAsset != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("targetAsset", targetAsset)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getTargetAssetListValidateBeforeCall( - Long targetAsset, Long size, Long current, Long recvWindow) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {targetAsset, size, current, recvWindow}; - Method method = - this.getClass() - .getMethod( - "getTargetAssetList", - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getTargetAssetListCall(targetAsset, size, current, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get target asset list(USER_DATA) Get target asset list Weight: 1 - * - * @param targetAsset Plan identifier (optional) - * @param size Default: 8, Max:100 (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<GetTargetAssetListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get target asset list -
- * - * @see Get - * target asset list(USER_DATA) Documentation - */ - public ApiResponse getTargetAssetList( - Long targetAsset, Long size, Long current, Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = - getTargetAssetListValidateBeforeCall(targetAsset, size, current, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getTargetAssetRoiData - * - * @param targetAsset e.g \"BTC\" (required) - * @param hisRoiType FIVE_YEAR,THREE_YEAR,ONE_YEAR,SIX_MONTH,THREE_MONTH,SEVEN_DAY (required) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get target asset ROI data -
- * - * @see Get - * target asset ROI data Documentation - */ - private okhttp3.Call getTargetAssetRoiDataCall( - String targetAsset, String hisRoiType, Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/target-asset/roi/list"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (targetAsset != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("targetAsset", targetAsset)); - } - - if (hisRoiType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("hisRoiType", hisRoiType)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll(Arrays.asList(new String[] {})); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getTargetAssetRoiDataValidateBeforeCall( - String targetAsset, String hisRoiType, Long recvWindow) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {targetAsset, hisRoiType, recvWindow}; - Method method = - this.getClass() - .getMethod( - "getTargetAssetRoiData", - String.class, - String.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getTargetAssetRoiDataCall(targetAsset, hisRoiType, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get target asset ROI data ROI return list for target asset Weight: 1 - * - * @param targetAsset e.g \"BTC\" (required) - * @param hisRoiType FIVE_YEAR,THREE_YEAR,ONE_YEAR,SIX_MONTH,THREE_MONTH,SEVEN_DAY (required) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<GetTargetAssetRoiDataResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get target asset ROI data -
- * - * @see Get - * target asset ROI data Documentation - */ - public ApiResponse getTargetAssetRoiData( - @NotNull String targetAsset, @NotNull String hisRoiType, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getTargetAssetRoiDataValidateBeforeCall(targetAsset, hisRoiType, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for queryAllSourceAssetAndTargetAsset - * - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 all source asset and target asset -
- * - * @see Query - * all source asset and target asset(USER_DATA) Documentation - */ - private okhttp3.Call queryAllSourceAssetAndTargetAssetCall(Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/all/asset"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call queryAllSourceAssetAndTargetAssetValidateBeforeCall(Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {recvWindow}; - Method method = - this.getClass().getMethod("queryAllSourceAssetAndTargetAsset", Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return queryAllSourceAssetAndTargetAssetCall(recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Query all source asset and target asset(USER_DATA) Query all source assets and target assets - * Weight: 1 - * - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryAllSourceAssetAndTargetAssetResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 all source asset and target asset -
- * - * @see Query - * all source asset and target asset(USER_DATA) Documentation - */ - public ApiResponse queryAllSourceAssetAndTargetAsset( - Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = queryAllSourceAssetAndTargetAssetValidateBeforeCall(recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for queryIndexDetails - * - * @param indexId (required) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Details -
- * - * @see Query - * Index Details(USER_DATA) Documentation - */ - private okhttp3.Call queryIndexDetailsCall(Long indexId, Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/index/info"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (indexId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("indexId", indexId)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call queryIndexDetailsValidateBeforeCall(Long indexId, Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {indexId, recvWindow}; - Method method = this.getClass().getMethod("queryIndexDetails", Long.class, Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return queryIndexDetailsCall(indexId, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Query Index Details(USER_DATA) Query index details Weight: 1 - * - * @param indexId (required) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryIndexDetailsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Details -
- * - * @see Query - * Index Details(USER_DATA) Documentation - */ - public ApiResponse queryIndexDetails( - @NotNull Long indexId, Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = queryIndexDetailsValidateBeforeCall(indexId, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for querySourceAssetList - * - * @param usageType \"RECURRING\", \"ONE_TIME\" (required) - * @param targetAsset Plan identifier (optional) - * @param indexId 指数identifier, value = 1 (optional) - * @param flexibleAllowedToUse (optional) - * @param sourceType `MAIN_SITE` for Binance user,`TR` for Binance Turkey - * user (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 source asset list -
- * - * @see Query - * source asset list(USER_DATA) Documentation - */ - private okhttp3.Call querySourceAssetListCall( - String usageType, - Long targetAsset, - Long indexId, - Boolean flexibleAllowedToUse, - String sourceType, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/source-asset/list"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (targetAsset != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("targetAsset", targetAsset)); - } - - if (indexId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("indexId", indexId)); - } - - if (usageType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("usageType", usageType)); - } - - if (flexibleAllowedToUse != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair( - "flexibleAllowedToUse", flexibleAllowedToUse)); - } - - if (sourceType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sourceType", sourceType)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call querySourceAssetListValidateBeforeCall( - String usageType, - Long targetAsset, - Long indexId, - Boolean flexibleAllowedToUse, - String sourceType, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - usageType, targetAsset, indexId, flexibleAllowedToUse, sourceType, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "querySourceAssetList", - String.class, - Long.class, - Long.class, - Boolean.class, - String.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return querySourceAssetListCall( - usageType, - targetAsset, - indexId, - flexibleAllowedToUse, - sourceType, - recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Query source asset list(USER_DATA) Query Source Asset to be used for investment Weight: 1 - * - * @param usageType \"RECURRING\", \"ONE_TIME\" (required) - * @param targetAsset Plan identifier (optional) - * @param indexId 指数identifier, value = 1 (optional) - * @param flexibleAllowedToUse (optional) - * @param sourceType `MAIN_SITE` for Binance user,`TR` for Binance Turkey - * user (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QuerySourceAssetListResponse> - * @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 source asset list -
- * - * @see Query - * source asset list(USER_DATA) Documentation - */ - public ApiResponse querySourceAssetList( - @NotNull String usageType, - Long targetAsset, - Long indexId, - Boolean flexibleAllowedToUse, - String sourceType, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - querySourceAssetListValidateBeforeCall( - usageType, - targetAsset, - indexId, - flexibleAllowedToUse, - sourceType, - recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/api/TradeApi.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/api/TradeApi.java deleted file mode 100644 index 189789f1c..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/api/TradeApi.java +++ /dev/null @@ -1,2053 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.api; - -import com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusRequest; -import com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusResponse; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRebalanceDetailsResponse; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionRequest; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionResponse; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionTradeResponse; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanAdjustmentRequest; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanAdjustmentResponse; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanCreationRequest; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanCreationResponse; -import com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionRequest; -import com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryHoldingDetailsOfThePlanResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryIndexLinkedPlanPositionDetailsResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryOneTimeTransactionStatusResponse; -import com.binance.connector.client.auto_invest.rest.model.QuerySubscriptionTransactionHistoryResponse; -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.DecimalFormatter; -import com.binance.connector.client.common.JSON; -import com.binance.connector.client.common.Pair; -import com.binance.connector.client.common.SystemUtil; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.exception.ConstraintViolationException; -import com.google.gson.reflect.TypeToken; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Valid; -import jakarta.validation.Validation; -import jakarta.validation.Validator; -import jakarta.validation.constraints.*; -import jakarta.validation.executable.ExecutableValidator; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; - -public class TradeApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - private static final String USER_AGENT = - String.format( - "binance-auto-invest/1.1.0 (Java/%s; %s; %s)", - SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); - private static final boolean HAS_TIME_UNIT = false; - - public TradeApi(ClientConfiguration clientConfiguration) { - this(new ApiClient(clientConfiguration)); - } - - public TradeApi(ApiClient apiClient) { - apiClient.setUserAgent(USER_AGENT); - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for changePlanStatus - * - * @param changePlanStatusRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Change Plan Status -
- * - * @see Change - * Plan Status(TRADE) Documentation - */ - private okhttp3.Call changePlanStatusCall(ChangePlanStatusRequest changePlanStatusRequest) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/plan/edit-status"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (changePlanStatusRequest.getPlanId() != null) { - localVarFormParams.put("planId", changePlanStatusRequest.getPlanId()); - } - - if (changePlanStatusRequest.getStatus() != null) { - localVarFormParams.put("status", changePlanStatusRequest.getStatus()); - } - - if (changePlanStatusRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", changePlanStatusRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call changePlanStatusValidateBeforeCall( - ChangePlanStatusRequest changePlanStatusRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {changePlanStatusRequest}; - Method method = - this.getClass().getMethod("changePlanStatus", ChangePlanStatusRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return changePlanStatusCall(changePlanStatusRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Change Plan Status(TRADE) Change Plan Status * max one request every 3s per account Weight: 1 - * - * @param changePlanStatusRequest (required) - * @return ApiResponse<ChangePlanStatusResponse> - * @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 Change Plan Status -
- * - * @see Change - * Plan Status(TRADE) Documentation - */ - public ApiResponse changePlanStatus( - @Valid @NotNull ChangePlanStatusRequest changePlanStatusRequest) throws ApiException { - okhttp3.Call localVarCall = changePlanStatusValidateBeforeCall(changePlanStatusRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for indexLinkedPlanRebalanceDetails - * - * @param startTime (optional) - * @param endTime (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param size Default: 8, Max:100 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Rebalance Details -
- * - * @see Index - * Linked Plan Rebalance Details(USER_DATA) Documentation - */ - private okhttp3.Call indexLinkedPlanRebalanceDetailsCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/rebalance/history"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call indexLinkedPlanRebalanceDetailsValidateBeforeCall( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; - Method method = - this.getClass() - .getMethod( - "indexLinkedPlanRebalanceDetails", - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return indexLinkedPlanRebalanceDetailsCall( - startTime, endTime, current, size, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Index Linked Plan Rebalance Details(USER_DATA) Get the history of Index Linked Plan - * Redemption transactions * Max 30 day difference between `startTime` and - * `endTime` * If no `startTime` and `endTime`, default to show - * past 30 day records Weight: 1 - * - * @param startTime (optional) - * @param endTime (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param size Default: 8, Max:100 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<IndexLinkedPlanRebalanceDetailsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Rebalance Details -
- * - * @see Index - * Linked Plan Rebalance Details(USER_DATA) Documentation - */ - public ApiResponse indexLinkedPlanRebalanceDetails( - Long startTime, Long endTime, Long current, Long size, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - indexLinkedPlanRebalanceDetailsValidateBeforeCall( - startTime, endTime, current, size, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for indexLinkedPlanRedemption - * - * @param indexLinkedPlanRedemptionRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Redemption -
- * - * @see Index - * Linked Plan Redemption(TRADE) Documentation - */ - private okhttp3.Call indexLinkedPlanRedemptionCall( - IndexLinkedPlanRedemptionRequest indexLinkedPlanRedemptionRequest) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/redeem"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (indexLinkedPlanRedemptionRequest.getIndexId() != null) { - localVarFormParams.put("indexId", indexLinkedPlanRedemptionRequest.getIndexId()); - } - - if (indexLinkedPlanRedemptionRequest.getRequestId() != null) { - localVarFormParams.put("requestId", indexLinkedPlanRedemptionRequest.getRequestId()); - } - - if (indexLinkedPlanRedemptionRequest.getRedemptionPercentage() != null) { - localVarFormParams.put( - "redemptionPercentage", - indexLinkedPlanRedemptionRequest.getRedemptionPercentage()); - } - - if (indexLinkedPlanRedemptionRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", indexLinkedPlanRedemptionRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call indexLinkedPlanRedemptionValidateBeforeCall( - IndexLinkedPlanRedemptionRequest indexLinkedPlanRedemptionRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {indexLinkedPlanRedemptionRequest}; - Method method = - this.getClass() - .getMethod( - "indexLinkedPlanRedemption", - IndexLinkedPlanRedemptionRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return indexLinkedPlanRedemptionCall(indexLinkedPlanRedemptionRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Index Linked Plan Redemption(TRADE) To redeem index-Linked plan holdings Weight: 1 - * - * @param indexLinkedPlanRedemptionRequest (required) - * @return ApiResponse<IndexLinkedPlanRedemptionResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Redemption -
- * - * @see Index - * Linked Plan Redemption(TRADE) Documentation - */ - public ApiResponse indexLinkedPlanRedemption( - @Valid @NotNull IndexLinkedPlanRedemptionRequest indexLinkedPlanRedemptionRequest) - throws ApiException { - okhttp3.Call localVarCall = - indexLinkedPlanRedemptionValidateBeforeCall(indexLinkedPlanRedemptionRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for indexLinkedPlanRedemptionTrade - * - * @param requestId request id (required) - * @param startTime (optional) - * @param endTime (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param asset (optional) - * @param size Default: 8, Max:100 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Redemption -
- * - * @see Index - * Linked Plan Redemption(USER_DATA) Documentation - */ - private okhttp3.Call indexLinkedPlanRedemptionTradeCall( - Long requestId, - Long startTime, - Long endTime, - Long current, - String asset, - Long size, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/redeem/history"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (requestId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("requestId", requestId)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call indexLinkedPlanRedemptionTradeValidateBeforeCall( - Long requestId, - Long startTime, - Long endTime, - Long current, - String asset, - Long size, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - requestId, startTime, endTime, current, asset, size, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "indexLinkedPlanRedemptionTrade", - Long.class, - Long.class, - Long.class, - Long.class, - String.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return indexLinkedPlanRedemptionTradeCall( - requestId, startTime, endTime, current, asset, size, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Index Linked Plan Redemption(USER_DATA) Get the history of Index Linked Plan Redemption - * transactions * Max 30 day difference between `startTime` and `endTime` * - * If no `startTime` and `endTime`, default to show past 30 day records - * Weight: 1 - * - * @param requestId request id (required) - * @param startTime (optional) - * @param endTime (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param asset (optional) - * @param size Default: 8, Max:100 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<IndexLinkedPlanRedemptionTradeResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Redemption -
- * - * @see Index - * Linked Plan Redemption(USER_DATA) Documentation - */ - public ApiResponse indexLinkedPlanRedemptionTrade( - @NotNull Long requestId, - Long startTime, - Long endTime, - Long current, - String asset, - Long size, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - indexLinkedPlanRedemptionTradeValidateBeforeCall( - requestId, startTime, endTime, current, asset, size, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for investmentPlanAdjustment - * - * @param investmentPlanAdjustmentRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Investment plan adjustment -
- * - * @see Investment - * plan adjustment(TRADE) Documentation - */ - private okhttp3.Call investmentPlanAdjustmentCall( - InvestmentPlanAdjustmentRequest investmentPlanAdjustmentRequest) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/plan/edit"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (investmentPlanAdjustmentRequest.getPlanId() != null) { - localVarFormParams.put("planId", investmentPlanAdjustmentRequest.getPlanId()); - } - - if (investmentPlanAdjustmentRequest.getSubscriptionAmount() != null) { - localVarFormParams.put( - "subscriptionAmount", - DecimalFormatter.getFormatter() - .format(investmentPlanAdjustmentRequest.getSubscriptionAmount())); - } - - if (investmentPlanAdjustmentRequest.getSubscriptionCycle() != null) { - localVarFormParams.put( - "subscriptionCycle", investmentPlanAdjustmentRequest.getSubscriptionCycle()); - } - - if (investmentPlanAdjustmentRequest.getSubscriptionStartTime() != null) { - localVarFormParams.put( - "subscriptionStartTime", - investmentPlanAdjustmentRequest.getSubscriptionStartTime()); - } - - if (investmentPlanAdjustmentRequest.getSourceAsset() != null) { - localVarFormParams.put("sourceAsset", investmentPlanAdjustmentRequest.getSourceAsset()); - } - - if (investmentPlanAdjustmentRequest.getFlexibleAllowedToUse() != null) { - localVarFormParams.put( - "flexibleAllowedToUse", - investmentPlanAdjustmentRequest.getFlexibleAllowedToUse()); - } - - if (investmentPlanAdjustmentRequest.getDetails() != null) { - String json = JSON.getGson().toJson(investmentPlanAdjustmentRequest.getDetails()); - localVarFormParams.put("details", json); - } - - if (investmentPlanAdjustmentRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", investmentPlanAdjustmentRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call investmentPlanAdjustmentValidateBeforeCall( - InvestmentPlanAdjustmentRequest investmentPlanAdjustmentRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {investmentPlanAdjustmentRequest}; - Method method = - this.getClass() - .getMethod( - "investmentPlanAdjustment", - InvestmentPlanAdjustmentRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return investmentPlanAdjustmentCall(investmentPlanAdjustmentRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Investment plan adjustment(TRADE) Query Source Asset to be used for investment * max one - * request every 3s per account Weight: 1 - * - * @param investmentPlanAdjustmentRequest (required) - * @return ApiResponse<InvestmentPlanAdjustmentResponse> - * @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 Investment plan adjustment -
- * - * @see Investment - * plan adjustment(TRADE) Documentation - */ - public ApiResponse investmentPlanAdjustment( - @Valid @NotNull InvestmentPlanAdjustmentRequest investmentPlanAdjustmentRequest) - throws ApiException { - okhttp3.Call localVarCall = - investmentPlanAdjustmentValidateBeforeCall(investmentPlanAdjustmentRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for investmentPlanCreation - * - * @param investmentPlanCreationRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Investment plan creation -
- * - * @see Investment - * plan creation(USER_DATA) Documentation - */ - private okhttp3.Call investmentPlanCreationCall( - InvestmentPlanCreationRequest investmentPlanCreationRequest) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/plan/add"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (investmentPlanCreationRequest.getSourceType() != null) { - localVarFormParams.put("sourceType", investmentPlanCreationRequest.getSourceType()); - } - - if (investmentPlanCreationRequest.getRequestId() != null) { - localVarFormParams.put("requestId", investmentPlanCreationRequest.getRequestId()); - } - - if (investmentPlanCreationRequest.getPlanType() != null) { - localVarFormParams.put("planType", investmentPlanCreationRequest.getPlanType()); - } - - if (investmentPlanCreationRequest.getIndexId() != null) { - localVarFormParams.put("indexId", investmentPlanCreationRequest.getIndexId()); - } - - if (investmentPlanCreationRequest.getSubscriptionAmount() != null) { - localVarFormParams.put( - "subscriptionAmount", - DecimalFormatter.getFormatter() - .format(investmentPlanCreationRequest.getSubscriptionAmount())); - } - - if (investmentPlanCreationRequest.getSubscriptionCycle() != null) { - localVarFormParams.put( - "subscriptionCycle", investmentPlanCreationRequest.getSubscriptionCycle()); - } - - if (investmentPlanCreationRequest.getSubscriptionStartTime() != null) { - localVarFormParams.put( - "subscriptionStartTime", - investmentPlanCreationRequest.getSubscriptionStartTime()); - } - - if (investmentPlanCreationRequest.getSourceAsset() != null) { - localVarFormParams.put("sourceAsset", investmentPlanCreationRequest.getSourceAsset()); - } - - if (investmentPlanCreationRequest.getFlexibleAllowedToUse() != null) { - localVarFormParams.put( - "flexibleAllowedToUse", - investmentPlanCreationRequest.getFlexibleAllowedToUse()); - } - - if (investmentPlanCreationRequest.getDetails() != null) { - String json = JSON.getGson().toJson(investmentPlanCreationRequest.getDetails()); - localVarFormParams.put("details", json); - } - - if (investmentPlanCreationRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", investmentPlanCreationRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call investmentPlanCreationValidateBeforeCall( - InvestmentPlanCreationRequest investmentPlanCreationRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {investmentPlanCreationRequest}; - Method method = - this.getClass() - .getMethod( - "investmentPlanCreation", InvestmentPlanCreationRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return investmentPlanCreationCall(investmentPlanCreationRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Investment plan creation(USER_DATA) Post an investment plan creation * max one request every - * 3s per account Weight: 1 - * - * @param investmentPlanCreationRequest (required) - * @return ApiResponse<InvestmentPlanCreationResponse> - * @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 Investment plan creation -
- * - * @see Investment - * plan creation(USER_DATA) Documentation - */ - public ApiResponse investmentPlanCreation( - @Valid @NotNull InvestmentPlanCreationRequest investmentPlanCreationRequest) - throws ApiException { - okhttp3.Call localVarCall = - investmentPlanCreationValidateBeforeCall(investmentPlanCreationRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for oneTimeTransaction - * - * @param oneTimeTransactionRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 One Time Transaction -
- * - * @see One - * Time Transaction(TRADE) Documentation - */ - private okhttp3.Call oneTimeTransactionCall(OneTimeTransactionRequest oneTimeTransactionRequest) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/one-off"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (oneTimeTransactionRequest.getSourceType() != null) { - localVarFormParams.put("sourceType", oneTimeTransactionRequest.getSourceType()); - } - - if (oneTimeTransactionRequest.getRequestId() != null) { - localVarFormParams.put("requestId", oneTimeTransactionRequest.getRequestId()); - } - - if (oneTimeTransactionRequest.getSubscriptionAmount() != null) { - localVarFormParams.put( - "subscriptionAmount", - DecimalFormatter.getFormatter() - .format(oneTimeTransactionRequest.getSubscriptionAmount())); - } - - if (oneTimeTransactionRequest.getSourceAsset() != null) { - localVarFormParams.put("sourceAsset", oneTimeTransactionRequest.getSourceAsset()); - } - - if (oneTimeTransactionRequest.getFlexibleAllowedToUse() != null) { - localVarFormParams.put( - "flexibleAllowedToUse", oneTimeTransactionRequest.getFlexibleAllowedToUse()); - } - - if (oneTimeTransactionRequest.getPlanId() != null) { - localVarFormParams.put("planId", oneTimeTransactionRequest.getPlanId()); - } - - if (oneTimeTransactionRequest.getIndexId() != null) { - localVarFormParams.put("indexId", oneTimeTransactionRequest.getIndexId()); - } - - if (oneTimeTransactionRequest.getDetails() != null) { - String json = JSON.getGson().toJson(oneTimeTransactionRequest.getDetails()); - localVarFormParams.put("details", json); - } - - if (oneTimeTransactionRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", oneTimeTransactionRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call oneTimeTransactionValidateBeforeCall( - OneTimeTransactionRequest oneTimeTransactionRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {oneTimeTransactionRequest}; - Method method = - this.getClass() - .getMethod("oneTimeTransaction", OneTimeTransactionRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return oneTimeTransactionCall(oneTimeTransactionRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * One Time Transaction(TRADE) One time transaction * - * `planId`/`planId`/`details` must not all be null Weight: 1 - * - * @param oneTimeTransactionRequest (required) - * @return ApiResponse<OneTimeTransactionResponse> - * @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 One Time Transaction -
- * - * @see One - * Time Transaction(TRADE) Documentation - */ - public ApiResponse oneTimeTransaction( - @Valid @NotNull OneTimeTransactionRequest oneTimeTransactionRequest) - throws ApiException { - okhttp3.Call localVarCall = oneTimeTransactionValidateBeforeCall(oneTimeTransactionRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for queryHoldingDetailsOfThePlan - * - * @param planId Plan identifier (optional) - * @param requestId requestId when create (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 holding details of the plan -
- * - * @see Query - * holding details of the plan(USER_DATA) Documentation - */ - private okhttp3.Call queryHoldingDetailsOfThePlanCall( - Long planId, String requestId, Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/plan/id"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (planId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("planId", planId)); - } - - if (requestId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("requestId", requestId)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call queryHoldingDetailsOfThePlanValidateBeforeCall( - Long planId, String requestId, Long recvWindow) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {planId, requestId, recvWindow}; - Method method = - this.getClass() - .getMethod( - "queryHoldingDetailsOfThePlan", - Long.class, - String.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return queryHoldingDetailsOfThePlanCall(planId, requestId, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Query holding details of the plan(USER_DATA) Query holding details of the plan Weight: 1 - * - * @param planId Plan identifier (optional) - * @param requestId requestId when create (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryHoldingDetailsOfThePlanResponse> - * @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 holding details of the plan -
- * - * @see Query - * holding details of the plan(USER_DATA) Documentation - */ - public ApiResponse queryHoldingDetailsOfThePlan( - Long planId, String requestId, Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = - queryHoldingDetailsOfThePlanValidateBeforeCall(planId, requestId, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for queryIndexLinkedPlanPositionDetails - * - * @param indexId (required) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Position Details -
- * - * @see Query - * Index Linked Plan Position Details(USER_DATA) Documentation - */ - private okhttp3.Call queryIndexLinkedPlanPositionDetailsCall(Long indexId, Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/index/user-summary"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (indexId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("indexId", indexId)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call queryIndexLinkedPlanPositionDetailsValidateBeforeCall( - Long indexId, Long recvWindow) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {indexId, recvWindow}; - Method method = - this.getClass() - .getMethod( - "queryIndexLinkedPlanPositionDetails", Long.class, Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return queryIndexLinkedPlanPositionDetailsCall(indexId, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Query Index Linked Plan Position Details(USER_DATA) Details on users Index-Linked plan - * position details Weight: 1 - * - * @param indexId (required) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryIndexLinkedPlanPositionDetailsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Linked Plan Position Details -
- * - * @see Query - * Index Linked Plan Position Details(USER_DATA) Documentation - */ - public ApiResponse - queryIndexLinkedPlanPositionDetails(@NotNull Long indexId, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - queryIndexLinkedPlanPositionDetailsValidateBeforeCall(indexId, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for queryOneTimeTransactionStatus - * - * @param transactionId PORTFOLIO plan's Id (required) - * @param requestId requestId when create (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 One-Time Transaction Status -
- * - * @see Query - * One-Time Transaction Status(USER_DATA) Documentation - */ - private okhttp3.Call queryOneTimeTransactionStatusCall( - Long transactionId, String requestId, Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/one-off/status"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (transactionId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("transactionId", transactionId)); - } - - if (requestId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("requestId", requestId)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call queryOneTimeTransactionStatusValidateBeforeCall( - Long transactionId, String requestId, Long recvWindow) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {transactionId, requestId, recvWindow}; - Method method = - this.getClass() - .getMethod( - "queryOneTimeTransactionStatus", - Long.class, - String.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return queryOneTimeTransactionStatusCall(transactionId, requestId, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Query One-Time Transaction Status(USER_DATA) Transaction status for one-time transaction - * Weight: 1 - * - * @param transactionId PORTFOLIO plan's Id (required) - * @param requestId requestId when create (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QueryOneTimeTransactionStatusResponse> - * @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 One-Time Transaction Status -
- * - * @see Query - * One-Time Transaction Status(USER_DATA) Documentation - */ - public ApiResponse queryOneTimeTransactionStatus( - @NotNull Long transactionId, String requestId, Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = - queryOneTimeTransactionStatusValidateBeforeCall( - transactionId, requestId, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for querySubscriptionTransactionHistory - * - * @param planId Plan identifier (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param targetAsset Plan identifier (optional) - * @param planType SINGLE, PORTFOLIO, INDEX, ALL (optional) - * @param size Default: 8, Max:100 (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 subscription transaction history -
- * - * @see Query - * subscription transaction history(USER_DATA) Documentation - */ - private okhttp3.Call querySubscriptionTransactionHistoryCall( - Long planId, - Long startTime, - Long endTime, - Long targetAsset, - Long planType, - Long size, - Long current, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/lending/auto-invest/history/list"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (planId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("planId", planId)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (targetAsset != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("targetAsset", targetAsset)); - } - - if (planType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("planType", planType)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call querySubscriptionTransactionHistoryValidateBeforeCall( - Long planId, - Long startTime, - Long endTime, - Long targetAsset, - Long planType, - Long size, - Long current, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - planId, startTime, endTime, targetAsset, planType, size, current, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "querySubscriptionTransactionHistory", - Long.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return querySubscriptionTransactionHistoryCall( - planId, - startTime, - endTime, - targetAsset, - planType, - size, - current, - recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Query subscription transaction history(USER_DATA) Query subscription transaction history of a - * plan * Max span between startTime and endTime is 30days * If both startTime and endTime are - * null,then default is 30days Weight: 1 - * - * @param planId Plan identifier (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param targetAsset Plan identifier (optional) - * @param planType SINGLE, PORTFOLIO, INDEX, ALL (optional) - * @param size Default: 8, Max:100 (optional) - * @param current Current query page. Default: 1, start from 1 (optional) - * @param recvWindow no more than ```60000``` (optional) - * @return ApiResponse<QuerySubscriptionTransactionHistoryResponse> - * @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 subscription transaction history -
- * - * @see Query - * subscription transaction history(USER_DATA) Documentation - */ - public ApiResponse - querySubscriptionTransactionHistory( - Long planId, - Long startTime, - Long endTime, - Long targetAsset, - Long planType, - Long size, - Long current, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - querySubscriptionTransactionHistoryValidateBeforeCall( - planId, - startTime, - endTime, - targetAsset, - planType, - size, - current, - recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/ChangePlanStatusResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/ChangePlanStatusResponse.java deleted file mode 100644 index 8b8266ba9..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/ChangePlanStatusResponse.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** ChangePlanStatusResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class ChangePlanStatusResponse { - public static final String SERIALIZED_NAME_PLAN_ID = "planId"; - - @SerializedName(SERIALIZED_NAME_PLAN_ID) - @jakarta.annotation.Nullable - private Long planId; - - public static final String SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME = "nextExecutionDateTime"; - - @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME) - @jakarta.annotation.Nullable - private Long nextExecutionDateTime; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public ChangePlanStatusResponse() {} - - public ChangePlanStatusResponse planId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - return this; - } - - /** - * Get planId - * - * @return planId - */ - @jakarta.annotation.Nullable - public Long getPlanId() { - return planId; - } - - public void setPlanId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - } - - public ChangePlanStatusResponse nextExecutionDateTime( - @jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; - return this; - } - - /** - * Get nextExecutionDateTime - * - * @return nextExecutionDateTime - */ - @jakarta.annotation.Nullable - public Long getNextExecutionDateTime() { - return nextExecutionDateTime; - } - - public void setNextExecutionDateTime(@jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; - } - - public ChangePlanStatusResponse status(@jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ChangePlanStatusResponse changePlanStatusResponse = (ChangePlanStatusResponse) o; - return Objects.equals(this.planId, changePlanStatusResponse.planId) - && Objects.equals( - this.nextExecutionDateTime, changePlanStatusResponse.nextExecutionDateTime) - && Objects.equals(this.status, changePlanStatusResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(planId, nextExecutionDateTime, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChangePlanStatusResponse {\n"); - sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); - sb.append(" nextExecutionDateTime: ") - .append(toIndentedString(nextExecutionDateTime)) - .append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object planIdValue = getPlanId(); - String planIdValueAsString = ""; - planIdValueAsString = planIdValue.toString(); - sb.append("planId=").append(urlEncode(planIdValueAsString)).append(""); - Object nextExecutionDateTimeValue = getNextExecutionDateTime(); - String nextExecutionDateTimeValueAsString = ""; - nextExecutionDateTimeValueAsString = nextExecutionDateTimeValue.toString(); - sb.append("nextExecutionDateTime=") - .append(urlEncode(nextExecutionDateTimeValueAsString)) - .append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).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("planId"); - openapiFields.add("nextExecutionDateTime"); - openapiFields.add("status"); - - // 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 ChangePlanStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ChangePlanStatusResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ChangePlanStatusResponse is not found" - + " in the empty JSON string", - ChangePlanStatusResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangePlanStatusResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangePlanStatusResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ChangePlanStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ChangePlanStatusResponse' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ChangePlanStatusResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ChangePlanStatusResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ChangePlanStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ChangePlanStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ChangePlanStatusResponse - * @throws IOException if the JSON string is invalid with respect to ChangePlanStatusResponse - */ - public static ChangePlanStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ChangePlanStatusResponse.class); - } - - /** - * Convert an instance of ChangePlanStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/Details.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/Details.java deleted file mode 100644 index 30f97f091..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/Details.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** Details */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class Details extends ArrayList { - public Details() {} - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Details {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Details - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Details.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Details is not found in the empty JSON" - + " string", - Details.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Details.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Details`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Details.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Details' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter
thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Details.class)); - - return (TypeAdapter) - new TypeAdapter
() { - @Override - public void write(JsonWriter out, Details value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Details read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Details given an JSON string - * - * @param jsonString JSON string - * @return An instance of Details - * @throws IOException if the JSON string is invalid with respect to Details - */ - public static Details fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Details.class); - } - - /** - * Convert an instance of Details to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/DetailsInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/DetailsInner.java deleted file mode 100644 index 84896089f..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/DetailsInner.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** DetailsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class DetailsInner { - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nonnull - private String targetAsset; - - public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; - - @SerializedName(SERIALIZED_NAME_PERCENTAGE) - @jakarta.annotation.Nonnull - private String percentage; - - public DetailsInner() {} - - public DetailsInner targetAsset(@jakarta.annotation.Nonnull String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nonnull String targetAsset) { - this.targetAsset = targetAsset; - } - - public DetailsInner percentage(@jakarta.annotation.Nonnull String percentage) { - this.percentage = percentage; - return this; - } - - /** - * Get percentage - * - * @return percentage - */ - @jakarta.annotation.Nonnull - @NotNull - public String getPercentage() { - return percentage; - } - - public void setPercentage(@jakarta.annotation.Nonnull String percentage) { - this.percentage = percentage; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DetailsInner detailsInner = (DetailsInner) o; - return Objects.equals(this.targetAsset, detailsInner.targetAsset) - && Objects.equals(this.percentage, detailsInner.percentage); - } - - @Override - public int hashCode() { - return Objects.hash(targetAsset, percentage); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DetailsInner {\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object percentageValue = getPercentage(); - String percentageValueAsString = ""; - percentageValueAsString = percentageValue.toString(); - sb.append("percentage=").append(urlEncode(percentageValueAsString)).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("targetAsset"); - openapiFields.add("percentage"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("targetAsset"); - openapiRequiredFields.add("percentage"); - } - - /** - * 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 DetailsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DetailsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DetailsInner is not found in the empty" - + " JSON string", - DetailsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DetailsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DetailsInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DetailsInner.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - if (!jsonObj.get("percentage").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `percentage` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("percentage").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DetailsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DetailsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(DetailsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DetailsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DetailsInner read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DetailsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of DetailsInner - * @throws IOException if the JSON string is invalid with respect to DetailsInner - */ - public static DetailsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DetailsInner.class); - } - - /** - * Convert an instance of DetailsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetListOfPlansResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetListOfPlansResponse.java deleted file mode 100644 index ed053e710..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetListOfPlansResponse.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** GetListOfPlansResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetListOfPlansResponse { - public static final String SERIALIZED_NAME_PLAN_VALUE_IN_U_S_D = "planValueInUSD"; - - @SerializedName(SERIALIZED_NAME_PLAN_VALUE_IN_U_S_D) - @jakarta.annotation.Nullable - private String planValueInUSD; - - public static final String SERIALIZED_NAME_PLAN_VALUE_IN_B_T_C = "planValueInBTC"; - - @SerializedName(SERIALIZED_NAME_PLAN_VALUE_IN_B_T_C) - @jakarta.annotation.Nullable - private String planValueInBTC; - - public static final String SERIALIZED_NAME_PNL_IN_U_S_D = "pnlInUSD"; - - @SerializedName(SERIALIZED_NAME_PNL_IN_U_S_D) - @jakarta.annotation.Nullable - private String pnlInUSD; - - public static final String SERIALIZED_NAME_ROI = "roi"; - - @SerializedName(SERIALIZED_NAME_ROI) - @jakarta.annotation.Nullable - private String roi; - - public static final String SERIALIZED_NAME_PLANS = "plans"; - - @SerializedName(SERIALIZED_NAME_PLANS) - @jakarta.annotation.Nullable - private List<@Valid GetListOfPlansResponsePlansInner> plans; - - public GetListOfPlansResponse() {} - - public GetListOfPlansResponse planValueInUSD( - @jakarta.annotation.Nullable String planValueInUSD) { - this.planValueInUSD = planValueInUSD; - return this; - } - - /** - * Get planValueInUSD - * - * @return planValueInUSD - */ - @jakarta.annotation.Nullable - public String getPlanValueInUSD() { - return planValueInUSD; - } - - public void setPlanValueInUSD(@jakarta.annotation.Nullable String planValueInUSD) { - this.planValueInUSD = planValueInUSD; - } - - public GetListOfPlansResponse planValueInBTC( - @jakarta.annotation.Nullable String planValueInBTC) { - this.planValueInBTC = planValueInBTC; - return this; - } - - /** - * Get planValueInBTC - * - * @return planValueInBTC - */ - @jakarta.annotation.Nullable - public String getPlanValueInBTC() { - return planValueInBTC; - } - - public void setPlanValueInBTC(@jakarta.annotation.Nullable String planValueInBTC) { - this.planValueInBTC = planValueInBTC; - } - - public GetListOfPlansResponse pnlInUSD(@jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - return this; - } - - /** - * Get pnlInUSD - * - * @return pnlInUSD - */ - @jakarta.annotation.Nullable - public String getPnlInUSD() { - return pnlInUSD; - } - - public void setPnlInUSD(@jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - } - - public GetListOfPlansResponse roi(@jakarta.annotation.Nullable String roi) { - this.roi = roi; - return this; - } - - /** - * Get roi - * - * @return roi - */ - @jakarta.annotation.Nullable - public String getRoi() { - return roi; - } - - public void setRoi(@jakarta.annotation.Nullable String roi) { - this.roi = roi; - } - - public GetListOfPlansResponse plans( - @jakarta.annotation.Nullable List<@Valid GetListOfPlansResponsePlansInner> plans) { - this.plans = plans; - return this; - } - - public GetListOfPlansResponse addPlansItem(GetListOfPlansResponsePlansInner plansItem) { - if (this.plans == null) { - this.plans = new ArrayList<>(); - } - this.plans.add(plansItem); - return this; - } - - /** - * Get plans - * - * @return plans - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid GetListOfPlansResponsePlansInner> getPlans() { - return plans; - } - - public void setPlans( - @jakarta.annotation.Nullable List<@Valid GetListOfPlansResponsePlansInner> plans) { - this.plans = plans; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetListOfPlansResponse getListOfPlansResponse = (GetListOfPlansResponse) o; - return Objects.equals(this.planValueInUSD, getListOfPlansResponse.planValueInUSD) - && Objects.equals(this.planValueInBTC, getListOfPlansResponse.planValueInBTC) - && Objects.equals(this.pnlInUSD, getListOfPlansResponse.pnlInUSD) - && Objects.equals(this.roi, getListOfPlansResponse.roi) - && Objects.equals(this.plans, getListOfPlansResponse.plans); - } - - @Override - public int hashCode() { - return Objects.hash(planValueInUSD, planValueInBTC, pnlInUSD, roi, plans); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetListOfPlansResponse {\n"); - sb.append(" planValueInUSD: ").append(toIndentedString(planValueInUSD)).append("\n"); - sb.append(" planValueInBTC: ").append(toIndentedString(planValueInBTC)).append("\n"); - sb.append(" pnlInUSD: ").append(toIndentedString(pnlInUSD)).append("\n"); - sb.append(" roi: ").append(toIndentedString(roi)).append("\n"); - sb.append(" plans: ").append(toIndentedString(plans)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object planValueInUSDValue = getPlanValueInUSD(); - String planValueInUSDValueAsString = ""; - planValueInUSDValueAsString = planValueInUSDValue.toString(); - sb.append("planValueInUSD=").append(urlEncode(planValueInUSDValueAsString)).append(""); - Object planValueInBTCValue = getPlanValueInBTC(); - String planValueInBTCValueAsString = ""; - planValueInBTCValueAsString = planValueInBTCValue.toString(); - sb.append("planValueInBTC=").append(urlEncode(planValueInBTCValueAsString)).append(""); - Object pnlInUSDValue = getPnlInUSD(); - String pnlInUSDValueAsString = ""; - pnlInUSDValueAsString = pnlInUSDValue.toString(); - sb.append("pnlInUSD=").append(urlEncode(pnlInUSDValueAsString)).append(""); - Object roiValue = getRoi(); - String roiValueAsString = ""; - roiValueAsString = roiValue.toString(); - sb.append("roi=").append(urlEncode(roiValueAsString)).append(""); - Object plansValue = getPlans(); - String plansValueAsString = ""; - plansValueAsString = - (String) - ((Collection) plansValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("plans=").append(urlEncode(plansValueAsString)).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("planValueInUSD"); - openapiFields.add("planValueInBTC"); - openapiFields.add("pnlInUSD"); - openapiFields.add("roi"); - openapiFields.add("plans"); - - // 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 GetListOfPlansResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetListOfPlansResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetListOfPlansResponse is not found in" - + " the empty JSON string", - GetListOfPlansResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetListOfPlansResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetListOfPlansResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("planValueInUSD") != null && !jsonObj.get("planValueInUSD").isJsonNull()) - && !jsonObj.get("planValueInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `planValueInUSD` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("planValueInUSD").toString())); - } - if ((jsonObj.get("planValueInBTC") != null && !jsonObj.get("planValueInBTC").isJsonNull()) - && !jsonObj.get("planValueInBTC").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `planValueInBTC` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("planValueInBTC").toString())); - } - if ((jsonObj.get("pnlInUSD") != null && !jsonObj.get("pnlInUSD").isJsonNull()) - && !jsonObj.get("pnlInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `pnlInUSD` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("pnlInUSD").toString())); - } - if ((jsonObj.get("roi") != null && !jsonObj.get("roi").isJsonNull()) - && !jsonObj.get("roi").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `roi` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("roi").toString())); - } - if (jsonObj.get("plans") != null && !jsonObj.get("plans").isJsonNull()) { - JsonArray jsonArrayplans = jsonObj.getAsJsonArray("plans"); - if (jsonArrayplans != null) { - // ensure the json data is an array - if (!jsonObj.get("plans").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `plans` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("plans").toString())); - } - - // validate the optional field `plans` (array) - for (int i = 0; i < jsonArrayplans.size(); i++) { - GetListOfPlansResponsePlansInner.validateJsonElement(jsonArrayplans.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetListOfPlansResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetListOfPlansResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetListOfPlansResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetListOfPlansResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetListOfPlansResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetListOfPlansResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetListOfPlansResponse - * @throws IOException if the JSON string is invalid with respect to GetListOfPlansResponse - */ - public static GetListOfPlansResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetListOfPlansResponse.class); - } - - /** - * Convert an instance of GetListOfPlansResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetListOfPlansResponsePlansInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetListOfPlansResponsePlansInner.java deleted file mode 100644 index 2be03769e..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetListOfPlansResponsePlansInner.java +++ /dev/null @@ -1,1143 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** GetListOfPlansResponsePlansInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetListOfPlansResponsePlansInner { - public static final String SERIALIZED_NAME_PLAN_ID = "planId"; - - @SerializedName(SERIALIZED_NAME_PLAN_ID) - @jakarta.annotation.Nullable - private Long planId; - - public static final String SERIALIZED_NAME_PLAN_TYPE = "planType"; - - @SerializedName(SERIALIZED_NAME_PLAN_TYPE) - @jakarta.annotation.Nullable - private String planType; - - public static final String SERIALIZED_NAME_EDIT_ALLOWED = "editAllowed"; - - @SerializedName(SERIALIZED_NAME_EDIT_ALLOWED) - @jakarta.annotation.Nullable - private String editAllowed; - - public static final String SERIALIZED_NAME_CREATION_DATE_TIME = "creationDateTime"; - - @SerializedName(SERIALIZED_NAME_CREATION_DATE_TIME) - @jakarta.annotation.Nullable - private Long creationDateTime; - - public static final String SERIALIZED_NAME_FIRST_EXECUTION_DATE_TIME = "firstExecutionDateTime"; - - @SerializedName(SERIALIZED_NAME_FIRST_EXECUTION_DATE_TIME) - @jakarta.annotation.Nullable - private Long firstExecutionDateTime; - - public static final String SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME = "nextExecutionDateTime"; - - @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME) - @jakarta.annotation.Nullable - private Long nextExecutionDateTime; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_LAST_UPDATED_DATE_TIME = "lastUpdatedDateTime"; - - @SerializedName(SERIALIZED_NAME_LAST_UPDATED_DATE_TIME) - @jakarta.annotation.Nullable - private Long lastUpdatedDateTime; - - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nullable - private String targetAsset; - - public static final String SERIALIZED_NAME_TOTAL_TARGET_AMOUNT = "totalTargetAmount"; - - @SerializedName(SERIALIZED_NAME_TOTAL_TARGET_AMOUNT) - @jakarta.annotation.Nullable - private String totalTargetAmount; - - public static final String SERIALIZED_NAME_SOURCE_ASSET = "sourceAsset"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSET) - @jakarta.annotation.Nullable - private String sourceAsset; - - public static final String SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D = "totalInvestedInUSD"; - - @SerializedName(SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D) - @jakarta.annotation.Nullable - private String totalInvestedInUSD; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_AMOUNT = "subscriptionAmount"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_AMOUNT) - @jakarta.annotation.Nullable - private String subscriptionAmount; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_CYCLE = "subscriptionCycle"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_CYCLE) - @jakarta.annotation.Nullable - private String subscriptionCycle; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_START_DAY = "subscriptionStartDay"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_START_DAY) - @jakarta.annotation.Nullable - private String subscriptionStartDay; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_START_WEEKDAY = - "subscriptionStartWeekday"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_START_WEEKDAY) - @jakarta.annotation.Nullable - private String subscriptionStartWeekday; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_START_TIME = "subscriptionStartTime"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_START_TIME) - @jakarta.annotation.Nullable - private String subscriptionStartTime; - - public static final String SERIALIZED_NAME_SOURCE_WALLET = "sourceWallet"; - - @SerializedName(SERIALIZED_NAME_SOURCE_WALLET) - @jakarta.annotation.Nullable - private String sourceWallet; - - public static final String SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE = "flexibleAllowedToUse"; - - @SerializedName(SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE) - @jakarta.annotation.Nullable - private String flexibleAllowedToUse; - - public static final String SERIALIZED_NAME_PLAN_VALUE_IN_U_S_D = "planValueInUSD"; - - @SerializedName(SERIALIZED_NAME_PLAN_VALUE_IN_U_S_D) - @jakarta.annotation.Nullable - private String planValueInUSD; - - public static final String SERIALIZED_NAME_PNL_IN_U_S_D = "pnlInUSD"; - - @SerializedName(SERIALIZED_NAME_PNL_IN_U_S_D) - @jakarta.annotation.Nullable - private String pnlInUSD; - - public static final String SERIALIZED_NAME_ROI = "roi"; - - @SerializedName(SERIALIZED_NAME_ROI) - @jakarta.annotation.Nullable - private String roi; - - public GetListOfPlansResponsePlansInner() {} - - public GetListOfPlansResponsePlansInner planId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - return this; - } - - /** - * Get planId - * - * @return planId - */ - @jakarta.annotation.Nullable - public Long getPlanId() { - return planId; - } - - public void setPlanId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - } - - public GetListOfPlansResponsePlansInner planType(@jakarta.annotation.Nullable String planType) { - this.planType = planType; - return this; - } - - /** - * Get planType - * - * @return planType - */ - @jakarta.annotation.Nullable - public String getPlanType() { - return planType; - } - - public void setPlanType(@jakarta.annotation.Nullable String planType) { - this.planType = planType; - } - - public GetListOfPlansResponsePlansInner editAllowed( - @jakarta.annotation.Nullable String editAllowed) { - this.editAllowed = editAllowed; - return this; - } - - /** - * Get editAllowed - * - * @return editAllowed - */ - @jakarta.annotation.Nullable - public String getEditAllowed() { - return editAllowed; - } - - public void setEditAllowed(@jakarta.annotation.Nullable String editAllowed) { - this.editAllowed = editAllowed; - } - - public GetListOfPlansResponsePlansInner creationDateTime( - @jakarta.annotation.Nullable Long creationDateTime) { - this.creationDateTime = creationDateTime; - return this; - } - - /** - * Get creationDateTime - * - * @return creationDateTime - */ - @jakarta.annotation.Nullable - public Long getCreationDateTime() { - return creationDateTime; - } - - public void setCreationDateTime(@jakarta.annotation.Nullable Long creationDateTime) { - this.creationDateTime = creationDateTime; - } - - public GetListOfPlansResponsePlansInner firstExecutionDateTime( - @jakarta.annotation.Nullable Long firstExecutionDateTime) { - this.firstExecutionDateTime = firstExecutionDateTime; - return this; - } - - /** - * Get firstExecutionDateTime - * - * @return firstExecutionDateTime - */ - @jakarta.annotation.Nullable - public Long getFirstExecutionDateTime() { - return firstExecutionDateTime; - } - - public void setFirstExecutionDateTime( - @jakarta.annotation.Nullable Long firstExecutionDateTime) { - this.firstExecutionDateTime = firstExecutionDateTime; - } - - public GetListOfPlansResponsePlansInner nextExecutionDateTime( - @jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; - return this; - } - - /** - * Get nextExecutionDateTime - * - * @return nextExecutionDateTime - */ - @jakarta.annotation.Nullable - public Long getNextExecutionDateTime() { - return nextExecutionDateTime; - } - - public void setNextExecutionDateTime(@jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; - } - - public GetListOfPlansResponsePlansInner status(@jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - public GetListOfPlansResponsePlansInner lastUpdatedDateTime( - @jakarta.annotation.Nullable Long lastUpdatedDateTime) { - this.lastUpdatedDateTime = lastUpdatedDateTime; - return this; - } - - /** - * Get lastUpdatedDateTime - * - * @return lastUpdatedDateTime - */ - @jakarta.annotation.Nullable - public Long getLastUpdatedDateTime() { - return lastUpdatedDateTime; - } - - public void setLastUpdatedDateTime(@jakarta.annotation.Nullable Long lastUpdatedDateTime) { - this.lastUpdatedDateTime = lastUpdatedDateTime; - } - - public GetListOfPlansResponsePlansInner targetAsset( - @jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nullable - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - } - - public GetListOfPlansResponsePlansInner totalTargetAmount( - @jakarta.annotation.Nullable String totalTargetAmount) { - this.totalTargetAmount = totalTargetAmount; - return this; - } - - /** - * Get totalTargetAmount - * - * @return totalTargetAmount - */ - @jakarta.annotation.Nullable - public String getTotalTargetAmount() { - return totalTargetAmount; - } - - public void setTotalTargetAmount(@jakarta.annotation.Nullable String totalTargetAmount) { - this.totalTargetAmount = totalTargetAmount; - } - - public GetListOfPlansResponsePlansInner sourceAsset( - @jakarta.annotation.Nullable String sourceAsset) { - this.sourceAsset = sourceAsset; - return this; - } - - /** - * Get sourceAsset - * - * @return sourceAsset - */ - @jakarta.annotation.Nullable - public String getSourceAsset() { - return sourceAsset; - } - - public void setSourceAsset(@jakarta.annotation.Nullable String sourceAsset) { - this.sourceAsset = sourceAsset; - } - - public GetListOfPlansResponsePlansInner totalInvestedInUSD( - @jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - return this; - } - - /** - * Get totalInvestedInUSD - * - * @return totalInvestedInUSD - */ - @jakarta.annotation.Nullable - public String getTotalInvestedInUSD() { - return totalInvestedInUSD; - } - - public void setTotalInvestedInUSD(@jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - } - - public GetListOfPlansResponsePlansInner subscriptionAmount( - @jakarta.annotation.Nullable String subscriptionAmount) { - this.subscriptionAmount = subscriptionAmount; - return this; - } - - /** - * Get subscriptionAmount - * - * @return subscriptionAmount - */ - @jakarta.annotation.Nullable - public String getSubscriptionAmount() { - return subscriptionAmount; - } - - public void setSubscriptionAmount(@jakarta.annotation.Nullable String subscriptionAmount) { - this.subscriptionAmount = subscriptionAmount; - } - - public GetListOfPlansResponsePlansInner subscriptionCycle( - @jakarta.annotation.Nullable String subscriptionCycle) { - this.subscriptionCycle = subscriptionCycle; - return this; - } - - /** - * Get subscriptionCycle - * - * @return subscriptionCycle - */ - @jakarta.annotation.Nullable - public String getSubscriptionCycle() { - return subscriptionCycle; - } - - public void setSubscriptionCycle(@jakarta.annotation.Nullable String subscriptionCycle) { - this.subscriptionCycle = subscriptionCycle; - } - - public GetListOfPlansResponsePlansInner subscriptionStartDay( - @jakarta.annotation.Nullable String subscriptionStartDay) { - this.subscriptionStartDay = subscriptionStartDay; - return this; - } - - /** - * Get subscriptionStartDay - * - * @return subscriptionStartDay - */ - @jakarta.annotation.Nullable - public String getSubscriptionStartDay() { - return subscriptionStartDay; - } - - public void setSubscriptionStartDay(@jakarta.annotation.Nullable String subscriptionStartDay) { - this.subscriptionStartDay = subscriptionStartDay; - } - - public GetListOfPlansResponsePlansInner subscriptionStartWeekday( - @jakarta.annotation.Nullable String subscriptionStartWeekday) { - this.subscriptionStartWeekday = subscriptionStartWeekday; - return this; - } - - /** - * Get subscriptionStartWeekday - * - * @return subscriptionStartWeekday - */ - @jakarta.annotation.Nullable - public String getSubscriptionStartWeekday() { - return subscriptionStartWeekday; - } - - public void setSubscriptionStartWeekday( - @jakarta.annotation.Nullable String subscriptionStartWeekday) { - this.subscriptionStartWeekday = subscriptionStartWeekday; - } - - public GetListOfPlansResponsePlansInner subscriptionStartTime( - @jakarta.annotation.Nullable String subscriptionStartTime) { - this.subscriptionStartTime = subscriptionStartTime; - return this; - } - - /** - * Get subscriptionStartTime - * - * @return subscriptionStartTime - */ - @jakarta.annotation.Nullable - public String getSubscriptionStartTime() { - return subscriptionStartTime; - } - - public void setSubscriptionStartTime( - @jakarta.annotation.Nullable String subscriptionStartTime) { - this.subscriptionStartTime = subscriptionStartTime; - } - - public GetListOfPlansResponsePlansInner sourceWallet( - @jakarta.annotation.Nullable String sourceWallet) { - this.sourceWallet = sourceWallet; - return this; - } - - /** - * Get sourceWallet - * - * @return sourceWallet - */ - @jakarta.annotation.Nullable - public String getSourceWallet() { - return sourceWallet; - } - - public void setSourceWallet(@jakarta.annotation.Nullable String sourceWallet) { - this.sourceWallet = sourceWallet; - } - - public GetListOfPlansResponsePlansInner flexibleAllowedToUse( - @jakarta.annotation.Nullable String flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - return this; - } - - /** - * Get flexibleAllowedToUse - * - * @return flexibleAllowedToUse - */ - @jakarta.annotation.Nullable - public String getFlexibleAllowedToUse() { - return flexibleAllowedToUse; - } - - public void setFlexibleAllowedToUse(@jakarta.annotation.Nullable String flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - } - - public GetListOfPlansResponsePlansInner planValueInUSD( - @jakarta.annotation.Nullable String planValueInUSD) { - this.planValueInUSD = planValueInUSD; - return this; - } - - /** - * Get planValueInUSD - * - * @return planValueInUSD - */ - @jakarta.annotation.Nullable - public String getPlanValueInUSD() { - return planValueInUSD; - } - - public void setPlanValueInUSD(@jakarta.annotation.Nullable String planValueInUSD) { - this.planValueInUSD = planValueInUSD; - } - - public GetListOfPlansResponsePlansInner pnlInUSD(@jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - return this; - } - - /** - * Get pnlInUSD - * - * @return pnlInUSD - */ - @jakarta.annotation.Nullable - public String getPnlInUSD() { - return pnlInUSD; - } - - public void setPnlInUSD(@jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - } - - public GetListOfPlansResponsePlansInner roi(@jakarta.annotation.Nullable String roi) { - this.roi = roi; - return this; - } - - /** - * Get roi - * - * @return roi - */ - @jakarta.annotation.Nullable - public String getRoi() { - return roi; - } - - public void setRoi(@jakarta.annotation.Nullable String roi) { - this.roi = roi; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetListOfPlansResponsePlansInner getListOfPlansResponsePlansInner = - (GetListOfPlansResponsePlansInner) o; - return Objects.equals(this.planId, getListOfPlansResponsePlansInner.planId) - && Objects.equals(this.planType, getListOfPlansResponsePlansInner.planType) - && Objects.equals(this.editAllowed, getListOfPlansResponsePlansInner.editAllowed) - && Objects.equals( - this.creationDateTime, getListOfPlansResponsePlansInner.creationDateTime) - && Objects.equals( - this.firstExecutionDateTime, - getListOfPlansResponsePlansInner.firstExecutionDateTime) - && Objects.equals( - this.nextExecutionDateTime, - getListOfPlansResponsePlansInner.nextExecutionDateTime) - && Objects.equals(this.status, getListOfPlansResponsePlansInner.status) - && Objects.equals( - this.lastUpdatedDateTime, - getListOfPlansResponsePlansInner.lastUpdatedDateTime) - && Objects.equals(this.targetAsset, getListOfPlansResponsePlansInner.targetAsset) - && Objects.equals( - this.totalTargetAmount, getListOfPlansResponsePlansInner.totalTargetAmount) - && Objects.equals(this.sourceAsset, getListOfPlansResponsePlansInner.sourceAsset) - && Objects.equals( - this.totalInvestedInUSD, - getListOfPlansResponsePlansInner.totalInvestedInUSD) - && Objects.equals( - this.subscriptionAmount, - getListOfPlansResponsePlansInner.subscriptionAmount) - && Objects.equals( - this.subscriptionCycle, getListOfPlansResponsePlansInner.subscriptionCycle) - && Objects.equals( - this.subscriptionStartDay, - getListOfPlansResponsePlansInner.subscriptionStartDay) - && Objects.equals( - this.subscriptionStartWeekday, - getListOfPlansResponsePlansInner.subscriptionStartWeekday) - && Objects.equals( - this.subscriptionStartTime, - getListOfPlansResponsePlansInner.subscriptionStartTime) - && Objects.equals(this.sourceWallet, getListOfPlansResponsePlansInner.sourceWallet) - && Objects.equals( - this.flexibleAllowedToUse, - getListOfPlansResponsePlansInner.flexibleAllowedToUse) - && Objects.equals( - this.planValueInUSD, getListOfPlansResponsePlansInner.planValueInUSD) - && Objects.equals(this.pnlInUSD, getListOfPlansResponsePlansInner.pnlInUSD) - && Objects.equals(this.roi, getListOfPlansResponsePlansInner.roi); - } - - @Override - public int hashCode() { - return Objects.hash( - planId, - planType, - editAllowed, - creationDateTime, - firstExecutionDateTime, - nextExecutionDateTime, - status, - lastUpdatedDateTime, - targetAsset, - totalTargetAmount, - sourceAsset, - totalInvestedInUSD, - subscriptionAmount, - subscriptionCycle, - subscriptionStartDay, - subscriptionStartWeekday, - subscriptionStartTime, - sourceWallet, - flexibleAllowedToUse, - planValueInUSD, - pnlInUSD, - roi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetListOfPlansResponsePlansInner {\n"); - sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); - sb.append(" planType: ").append(toIndentedString(planType)).append("\n"); - sb.append(" editAllowed: ").append(toIndentedString(editAllowed)).append("\n"); - sb.append(" creationDateTime: ").append(toIndentedString(creationDateTime)).append("\n"); - sb.append(" firstExecutionDateTime: ") - .append(toIndentedString(firstExecutionDateTime)) - .append("\n"); - sb.append(" nextExecutionDateTime: ") - .append(toIndentedString(nextExecutionDateTime)) - .append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" lastUpdatedDateTime: ") - .append(toIndentedString(lastUpdatedDateTime)) - .append("\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" totalTargetAmount: ").append(toIndentedString(totalTargetAmount)).append("\n"); - sb.append(" sourceAsset: ").append(toIndentedString(sourceAsset)).append("\n"); - sb.append(" totalInvestedInUSD: ") - .append(toIndentedString(totalInvestedInUSD)) - .append("\n"); - sb.append(" subscriptionAmount: ") - .append(toIndentedString(subscriptionAmount)) - .append("\n"); - sb.append(" subscriptionCycle: ").append(toIndentedString(subscriptionCycle)).append("\n"); - sb.append(" subscriptionStartDay: ") - .append(toIndentedString(subscriptionStartDay)) - .append("\n"); - sb.append(" subscriptionStartWeekday: ") - .append(toIndentedString(subscriptionStartWeekday)) - .append("\n"); - sb.append(" subscriptionStartTime: ") - .append(toIndentedString(subscriptionStartTime)) - .append("\n"); - sb.append(" sourceWallet: ").append(toIndentedString(sourceWallet)).append("\n"); - sb.append(" flexibleAllowedToUse: ") - .append(toIndentedString(flexibleAllowedToUse)) - .append("\n"); - sb.append(" planValueInUSD: ").append(toIndentedString(planValueInUSD)).append("\n"); - sb.append(" pnlInUSD: ").append(toIndentedString(pnlInUSD)).append("\n"); - sb.append(" roi: ").append(toIndentedString(roi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object planIdValue = getPlanId(); - String planIdValueAsString = ""; - planIdValueAsString = planIdValue.toString(); - sb.append("planId=").append(urlEncode(planIdValueAsString)).append(""); - Object planTypeValue = getPlanType(); - String planTypeValueAsString = ""; - planTypeValueAsString = planTypeValue.toString(); - sb.append("planType=").append(urlEncode(planTypeValueAsString)).append(""); - Object editAllowedValue = getEditAllowed(); - String editAllowedValueAsString = ""; - editAllowedValueAsString = editAllowedValue.toString(); - sb.append("editAllowed=").append(urlEncode(editAllowedValueAsString)).append(""); - Object creationDateTimeValue = getCreationDateTime(); - String creationDateTimeValueAsString = ""; - creationDateTimeValueAsString = creationDateTimeValue.toString(); - sb.append("creationDateTime=").append(urlEncode(creationDateTimeValueAsString)).append(""); - Object firstExecutionDateTimeValue = getFirstExecutionDateTime(); - String firstExecutionDateTimeValueAsString = ""; - firstExecutionDateTimeValueAsString = firstExecutionDateTimeValue.toString(); - sb.append("firstExecutionDateTime=") - .append(urlEncode(firstExecutionDateTimeValueAsString)) - .append(""); - Object nextExecutionDateTimeValue = getNextExecutionDateTime(); - String nextExecutionDateTimeValueAsString = ""; - nextExecutionDateTimeValueAsString = nextExecutionDateTimeValue.toString(); - sb.append("nextExecutionDateTime=") - .append(urlEncode(nextExecutionDateTimeValueAsString)) - .append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object lastUpdatedDateTimeValue = getLastUpdatedDateTime(); - String lastUpdatedDateTimeValueAsString = ""; - lastUpdatedDateTimeValueAsString = lastUpdatedDateTimeValue.toString(); - sb.append("lastUpdatedDateTime=") - .append(urlEncode(lastUpdatedDateTimeValueAsString)) - .append(""); - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object totalTargetAmountValue = getTotalTargetAmount(); - String totalTargetAmountValueAsString = ""; - totalTargetAmountValueAsString = totalTargetAmountValue.toString(); - sb.append("totalTargetAmount=") - .append(urlEncode(totalTargetAmountValueAsString)) - .append(""); - Object sourceAssetValue = getSourceAsset(); - String sourceAssetValueAsString = ""; - sourceAssetValueAsString = sourceAssetValue.toString(); - sb.append("sourceAsset=").append(urlEncode(sourceAssetValueAsString)).append(""); - Object totalInvestedInUSDValue = getTotalInvestedInUSD(); - String totalInvestedInUSDValueAsString = ""; - totalInvestedInUSDValueAsString = totalInvestedInUSDValue.toString(); - sb.append("totalInvestedInUSD=") - .append(urlEncode(totalInvestedInUSDValueAsString)) - .append(""); - Object subscriptionAmountValue = getSubscriptionAmount(); - String subscriptionAmountValueAsString = ""; - subscriptionAmountValueAsString = subscriptionAmountValue.toString(); - sb.append("subscriptionAmount=") - .append(urlEncode(subscriptionAmountValueAsString)) - .append(""); - Object subscriptionCycleValue = getSubscriptionCycle(); - String subscriptionCycleValueAsString = ""; - subscriptionCycleValueAsString = subscriptionCycleValue.toString(); - sb.append("subscriptionCycle=") - .append(urlEncode(subscriptionCycleValueAsString)) - .append(""); - Object subscriptionStartDayValue = getSubscriptionStartDay(); - String subscriptionStartDayValueAsString = ""; - subscriptionStartDayValueAsString = subscriptionStartDayValue.toString(); - sb.append("subscriptionStartDay=") - .append(urlEncode(subscriptionStartDayValueAsString)) - .append(""); - Object subscriptionStartWeekdayValue = getSubscriptionStartWeekday(); - String subscriptionStartWeekdayValueAsString = ""; - subscriptionStartWeekdayValueAsString = subscriptionStartWeekdayValue.toString(); - sb.append("subscriptionStartWeekday=") - .append(urlEncode(subscriptionStartWeekdayValueAsString)) - .append(""); - Object subscriptionStartTimeValue = getSubscriptionStartTime(); - String subscriptionStartTimeValueAsString = ""; - subscriptionStartTimeValueAsString = subscriptionStartTimeValue.toString(); - sb.append("subscriptionStartTime=") - .append(urlEncode(subscriptionStartTimeValueAsString)) - .append(""); - Object sourceWalletValue = getSourceWallet(); - String sourceWalletValueAsString = ""; - sourceWalletValueAsString = sourceWalletValue.toString(); - sb.append("sourceWallet=").append(urlEncode(sourceWalletValueAsString)).append(""); - Object flexibleAllowedToUseValue = getFlexibleAllowedToUse(); - String flexibleAllowedToUseValueAsString = ""; - flexibleAllowedToUseValueAsString = flexibleAllowedToUseValue.toString(); - sb.append("flexibleAllowedToUse=") - .append(urlEncode(flexibleAllowedToUseValueAsString)) - .append(""); - Object planValueInUSDValue = getPlanValueInUSD(); - String planValueInUSDValueAsString = ""; - planValueInUSDValueAsString = planValueInUSDValue.toString(); - sb.append("planValueInUSD=").append(urlEncode(planValueInUSDValueAsString)).append(""); - Object pnlInUSDValue = getPnlInUSD(); - String pnlInUSDValueAsString = ""; - pnlInUSDValueAsString = pnlInUSDValue.toString(); - sb.append("pnlInUSD=").append(urlEncode(pnlInUSDValueAsString)).append(""); - Object roiValue = getRoi(); - String roiValueAsString = ""; - roiValueAsString = roiValue.toString(); - sb.append("roi=").append(urlEncode(roiValueAsString)).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("planId"); - openapiFields.add("planType"); - openapiFields.add("editAllowed"); - openapiFields.add("creationDateTime"); - openapiFields.add("firstExecutionDateTime"); - openapiFields.add("nextExecutionDateTime"); - openapiFields.add("status"); - openapiFields.add("lastUpdatedDateTime"); - openapiFields.add("targetAsset"); - openapiFields.add("totalTargetAmount"); - openapiFields.add("sourceAsset"); - openapiFields.add("totalInvestedInUSD"); - openapiFields.add("subscriptionAmount"); - openapiFields.add("subscriptionCycle"); - openapiFields.add("subscriptionStartDay"); - openapiFields.add("subscriptionStartWeekday"); - openapiFields.add("subscriptionStartTime"); - openapiFields.add("sourceWallet"); - openapiFields.add("flexibleAllowedToUse"); - openapiFields.add("planValueInUSD"); - openapiFields.add("pnlInUSD"); - openapiFields.add("roi"); - - // 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 - * GetListOfPlansResponsePlansInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetListOfPlansResponsePlansInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetListOfPlansResponsePlansInner is" - + " not found in the empty JSON string", - GetListOfPlansResponsePlansInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetListOfPlansResponsePlansInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetListOfPlansResponsePlansInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("planType") != null && !jsonObj.get("planType").isJsonNull()) - && !jsonObj.get("planType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `planType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("planType").toString())); - } - if ((jsonObj.get("editAllowed") != null && !jsonObj.get("editAllowed").isJsonNull()) - && !jsonObj.get("editAllowed").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `editAllowed` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("editAllowed").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) - && !jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - if ((jsonObj.get("totalTargetAmount") != null - && !jsonObj.get("totalTargetAmount").isJsonNull()) - && !jsonObj.get("totalTargetAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `totalTargetAmount` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("totalTargetAmount").toString())); - } - if ((jsonObj.get("sourceAsset") != null && !jsonObj.get("sourceAsset").isJsonNull()) - && !jsonObj.get("sourceAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceAsset").toString())); - } - if ((jsonObj.get("totalInvestedInUSD") != null - && !jsonObj.get("totalInvestedInUSD").isJsonNull()) - && !jsonObj.get("totalInvestedInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `totalInvestedInUSD` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("totalInvestedInUSD").toString())); - } - if ((jsonObj.get("subscriptionAmount") != null - && !jsonObj.get("subscriptionAmount").isJsonNull()) - && !jsonObj.get("subscriptionAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionAmount` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("subscriptionAmount").toString())); - } - if ((jsonObj.get("subscriptionCycle") != null - && !jsonObj.get("subscriptionCycle").isJsonNull()) - && !jsonObj.get("subscriptionCycle").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionCycle` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("subscriptionCycle").toString())); - } - if ((jsonObj.get("subscriptionStartDay") != null - && !jsonObj.get("subscriptionStartDay").isJsonNull()) - && !jsonObj.get("subscriptionStartDay").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionStartDay` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("subscriptionStartDay").toString())); - } - if ((jsonObj.get("subscriptionStartWeekday") != null - && !jsonObj.get("subscriptionStartWeekday").isJsonNull()) - && !jsonObj.get("subscriptionStartWeekday").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionStartWeekday` to be a primitive type" - + " in the JSON string but got `%s`", - jsonObj.get("subscriptionStartWeekday").toString())); - } - if ((jsonObj.get("subscriptionStartTime") != null - && !jsonObj.get("subscriptionStartTime").isJsonNull()) - && !jsonObj.get("subscriptionStartTime").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionStartTime` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("subscriptionStartTime").toString())); - } - if ((jsonObj.get("sourceWallet") != null && !jsonObj.get("sourceWallet").isJsonNull()) - && !jsonObj.get("sourceWallet").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceWallet` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceWallet").toString())); - } - if ((jsonObj.get("flexibleAllowedToUse") != null - && !jsonObj.get("flexibleAllowedToUse").isJsonNull()) - && !jsonObj.get("flexibleAllowedToUse").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `flexibleAllowedToUse` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("flexibleAllowedToUse").toString())); - } - if ((jsonObj.get("planValueInUSD") != null && !jsonObj.get("planValueInUSD").isJsonNull()) - && !jsonObj.get("planValueInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `planValueInUSD` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("planValueInUSD").toString())); - } - if ((jsonObj.get("pnlInUSD") != null && !jsonObj.get("pnlInUSD").isJsonNull()) - && !jsonObj.get("pnlInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `pnlInUSD` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("pnlInUSD").toString())); - } - if ((jsonObj.get("roi") != null && !jsonObj.get("roi").isJsonNull()) - && !jsonObj.get("roi").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `roi` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("roi").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetListOfPlansResponsePlansInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetListOfPlansResponsePlansInner' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetListOfPlansResponsePlansInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetListOfPlansResponsePlansInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetListOfPlansResponsePlansInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetListOfPlansResponsePlansInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetListOfPlansResponsePlansInner - * @throws IOException if the JSON string is invalid with respect to - * GetListOfPlansResponsePlansInner - */ - public static GetListOfPlansResponsePlansInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetListOfPlansResponsePlansInner.class); - } - - /** - * Convert an instance of GetListOfPlansResponsePlansInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetListResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetListResponse.java deleted file mode 100644 index c3cc9b6fc..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetListResponse.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** GetTargetAssetListResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetTargetAssetListResponse { - public static final String SERIALIZED_NAME_TARGET_ASSETS = "targetAssets"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSETS) - @jakarta.annotation.Nullable - private List targetAssets; - - public static final String SERIALIZED_NAME_AUTO_INVEST_ASSET_LIST = "autoInvestAssetList"; - - @SerializedName(SERIALIZED_NAME_AUTO_INVEST_ASSET_LIST) - @jakarta.annotation.Nullable - private List<@Valid GetTargetAssetListResponseAutoInvestAssetListInner> autoInvestAssetList; - - public GetTargetAssetListResponse() {} - - public GetTargetAssetListResponse targetAssets( - @jakarta.annotation.Nullable List targetAssets) { - this.targetAssets = targetAssets; - return this; - } - - public GetTargetAssetListResponse addTargetAssetsItem(String targetAssetsItem) { - if (this.targetAssets == null) { - this.targetAssets = new ArrayList<>(); - } - this.targetAssets.add(targetAssetsItem); - return this; - } - - /** - * Get targetAssets - * - * @return targetAssets - */ - @jakarta.annotation.Nullable - public List getTargetAssets() { - return targetAssets; - } - - public void setTargetAssets(@jakarta.annotation.Nullable List targetAssets) { - this.targetAssets = targetAssets; - } - - public GetTargetAssetListResponse autoInvestAssetList( - @jakarta.annotation.Nullable - List<@Valid GetTargetAssetListResponseAutoInvestAssetListInner> - autoInvestAssetList) { - this.autoInvestAssetList = autoInvestAssetList; - return this; - } - - public GetTargetAssetListResponse addAutoInvestAssetListItem( - GetTargetAssetListResponseAutoInvestAssetListInner autoInvestAssetListItem) { - if (this.autoInvestAssetList == null) { - this.autoInvestAssetList = new ArrayList<>(); - } - this.autoInvestAssetList.add(autoInvestAssetListItem); - return this; - } - - /** - * Get autoInvestAssetList - * - * @return autoInvestAssetList - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid GetTargetAssetListResponseAutoInvestAssetListInner> - getAutoInvestAssetList() { - return autoInvestAssetList; - } - - public void setAutoInvestAssetList( - @jakarta.annotation.Nullable - List<@Valid GetTargetAssetListResponseAutoInvestAssetListInner> - autoInvestAssetList) { - this.autoInvestAssetList = autoInvestAssetList; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTargetAssetListResponse getTargetAssetListResponse = (GetTargetAssetListResponse) o; - return Objects.equals(this.targetAssets, getTargetAssetListResponse.targetAssets) - && Objects.equals( - this.autoInvestAssetList, getTargetAssetListResponse.autoInvestAssetList); - } - - @Override - public int hashCode() { - return Objects.hash(targetAssets, autoInvestAssetList); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTargetAssetListResponse {\n"); - sb.append(" targetAssets: ").append(toIndentedString(targetAssets)).append("\n"); - sb.append(" autoInvestAssetList: ") - .append(toIndentedString(autoInvestAssetList)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object targetAssetsValue = getTargetAssets(); - String targetAssetsValueAsString = ""; - targetAssetsValueAsString = - (String) - ((Collection) targetAssetsValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("targetAssets=").append(urlEncode(targetAssetsValueAsString)).append(""); - Object autoInvestAssetListValue = getAutoInvestAssetList(); - String autoInvestAssetListValueAsString = ""; - autoInvestAssetListValueAsString = - (String) - ((Collection) autoInvestAssetListValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("autoInvestAssetList=") - .append(urlEncode(autoInvestAssetListValueAsString)) - .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("targetAssets"); - openapiFields.add("autoInvestAssetList"); - - // 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 GetTargetAssetListResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetTargetAssetListResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetTargetAssetListResponse is not" - + " found in the empty JSON string", - GetTargetAssetListResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetTargetAssetListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTargetAssetListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("targetAssets") != null - && !jsonObj.get("targetAssets").isJsonNull() - && !jsonObj.get("targetAssets").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAssets` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("targetAssets").toString())); - } - if (jsonObj.get("autoInvestAssetList") != null - && !jsonObj.get("autoInvestAssetList").isJsonNull()) { - JsonArray jsonArrayautoInvestAssetList = jsonObj.getAsJsonArray("autoInvestAssetList"); - if (jsonArrayautoInvestAssetList != null) { - // ensure the json data is an array - if (!jsonObj.get("autoInvestAssetList").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `autoInvestAssetList` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("autoInvestAssetList").toString())); - } - - // validate the optional field `autoInvestAssetList` (array) - for (int i = 0; i < jsonArrayautoInvestAssetList.size(); i++) { - GetTargetAssetListResponseAutoInvestAssetListInner.validateJsonElement( - jsonArrayautoInvestAssetList.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTargetAssetListResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTargetAssetListResponse' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetTargetAssetListResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTargetAssetListResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTargetAssetListResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetTargetAssetListResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTargetAssetListResponse - * @throws IOException if the JSON string is invalid with respect to GetTargetAssetListResponse - */ - public static GetTargetAssetListResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTargetAssetListResponse.class); - } - - /** - * Convert an instance of GetTargetAssetListResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetListResponseAutoInvestAssetListInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetListResponseAutoInvestAssetListInner.java deleted file mode 100644 index 120220b0e..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetListResponseAutoInvestAssetListInner.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** GetTargetAssetListResponseAutoInvestAssetListInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetTargetAssetListResponseAutoInvestAssetListInner { - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nullable - private String targetAsset; - - public static final String SERIALIZED_NAME_ROI_AND_DIMENSION_TYPE_LIST = - "roiAndDimensionTypeList"; - - @SerializedName(SERIALIZED_NAME_ROI_AND_DIMENSION_TYPE_LIST) - @jakarta.annotation.Nullable - private List< - @Valid - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner> - roiAndDimensionTypeList; - - public GetTargetAssetListResponseAutoInvestAssetListInner() {} - - public GetTargetAssetListResponseAutoInvestAssetListInner targetAsset( - @jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nullable - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - } - - public GetTargetAssetListResponseAutoInvestAssetListInner roiAndDimensionTypeList( - @jakarta.annotation.Nullable - List< - @Valid - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner> - roiAndDimensionTypeList) { - this.roiAndDimensionTypeList = roiAndDimensionTypeList; - return this; - } - - public GetTargetAssetListResponseAutoInvestAssetListInner addRoiAndDimensionTypeListItem( - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - roiAndDimensionTypeListItem) { - if (this.roiAndDimensionTypeList == null) { - this.roiAndDimensionTypeList = new ArrayList<>(); - } - this.roiAndDimensionTypeList.add(roiAndDimensionTypeListItem); - return this; - } - - /** - * Get roiAndDimensionTypeList - * - * @return roiAndDimensionTypeList - */ - @jakarta.annotation.Nullable - @Valid - public List< - @Valid - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner> - getRoiAndDimensionTypeList() { - return roiAndDimensionTypeList; - } - - public void setRoiAndDimensionTypeList( - @jakarta.annotation.Nullable - List< - @Valid - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner> - roiAndDimensionTypeList) { - this.roiAndDimensionTypeList = roiAndDimensionTypeList; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTargetAssetListResponseAutoInvestAssetListInner - getTargetAssetListResponseAutoInvestAssetListInner = - (GetTargetAssetListResponseAutoInvestAssetListInner) o; - return Objects.equals( - this.targetAsset, - getTargetAssetListResponseAutoInvestAssetListInner.targetAsset) - && Objects.equals( - this.roiAndDimensionTypeList, - getTargetAssetListResponseAutoInvestAssetListInner.roiAndDimensionTypeList); - } - - @Override - public int hashCode() { - return Objects.hash(targetAsset, roiAndDimensionTypeList); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTargetAssetListResponseAutoInvestAssetListInner {\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" roiAndDimensionTypeList: ") - .append(toIndentedString(roiAndDimensionTypeList)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object roiAndDimensionTypeListValue = getRoiAndDimensionTypeList(); - String roiAndDimensionTypeListValueAsString = ""; - roiAndDimensionTypeListValueAsString = - (String) - ((Collection) roiAndDimensionTypeListValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("roiAndDimensionTypeList=") - .append(urlEncode(roiAndDimensionTypeListValueAsString)) - .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("targetAsset"); - openapiFields.add("roiAndDimensionTypeList"); - - // 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 - * GetTargetAssetListResponseAutoInvestAssetListInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetTargetAssetListResponseAutoInvestAssetListInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " GetTargetAssetListResponseAutoInvestAssetListInner is not" - + " found in the empty JSON string", - GetTargetAssetListResponseAutoInvestAssetListInner - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetTargetAssetListResponseAutoInvestAssetListInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTargetAssetListResponseAutoInvestAssetListInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) - && !jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - if (jsonObj.get("roiAndDimensionTypeList") != null - && !jsonObj.get("roiAndDimensionTypeList").isJsonNull()) { - JsonArray jsonArrayroiAndDimensionTypeList = - jsonObj.getAsJsonArray("roiAndDimensionTypeList"); - if (jsonArrayroiAndDimensionTypeList != null) { - // ensure the json data is an array - if (!jsonObj.get("roiAndDimensionTypeList").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `roiAndDimensionTypeList` to be an array in" - + " the JSON string but got `%s`", - jsonObj.get("roiAndDimensionTypeList").toString())); - } - - // validate the optional field `roiAndDimensionTypeList` (array) - for (int i = 0; i < jsonArrayroiAndDimensionTypeList.size(); i++) { - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .validateJsonElement(jsonArrayroiAndDimensionTypeList.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTargetAssetListResponseAutoInvestAssetListInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'GetTargetAssetListResponseAutoInvestAssetListInner' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - GetTargetAssetListResponseAutoInvestAssetListInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - GetTargetAssetListResponseAutoInvestAssetListInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTargetAssetListResponseAutoInvestAssetListInner read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetTargetAssetListResponseAutoInvestAssetListInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTargetAssetListResponseAutoInvestAssetListInner - * @throws IOException if the JSON string is invalid with respect to - * GetTargetAssetListResponseAutoInvestAssetListInner - */ - public static GetTargetAssetListResponseAutoInvestAssetListInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, GetTargetAssetListResponseAutoInvestAssetListInner.class); - } - - /** - * Convert an instance of GetTargetAssetListResponseAutoInvestAssetListInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner.java deleted file mode 100644 index 011022891..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner { - public static final String SERIALIZED_NAME_SIMULATE_ROI = "simulateRoi"; - - @SerializedName(SERIALIZED_NAME_SIMULATE_ROI) - @jakarta.annotation.Nullable - private String simulateRoi; - - public static final String SERIALIZED_NAME_DIMENSION_VALUE = "dimensionValue"; - - @SerializedName(SERIALIZED_NAME_DIMENSION_VALUE) - @jakarta.annotation.Nullable - private String dimensionValue; - - public static final String SERIALIZED_NAME_DIMENSION_UNIT = "dimensionUnit"; - - @SerializedName(SERIALIZED_NAME_DIMENSION_UNIT) - @jakarta.annotation.Nullable - private String dimensionUnit; - - public GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner() {} - - public GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - simulateRoi(@jakarta.annotation.Nullable String simulateRoi) { - this.simulateRoi = simulateRoi; - return this; - } - - /** - * Get simulateRoi - * - * @return simulateRoi - */ - @jakarta.annotation.Nullable - public String getSimulateRoi() { - return simulateRoi; - } - - public void setSimulateRoi(@jakarta.annotation.Nullable String simulateRoi) { - this.simulateRoi = simulateRoi; - } - - public GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - dimensionValue(@jakarta.annotation.Nullable String dimensionValue) { - this.dimensionValue = dimensionValue; - return this; - } - - /** - * Get dimensionValue - * - * @return dimensionValue - */ - @jakarta.annotation.Nullable - public String getDimensionValue() { - return dimensionValue; - } - - public void setDimensionValue(@jakarta.annotation.Nullable String dimensionValue) { - this.dimensionValue = dimensionValue; - } - - public GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - dimensionUnit(@jakarta.annotation.Nullable String dimensionUnit) { - this.dimensionUnit = dimensionUnit; - return this; - } - - /** - * Get dimensionUnit - * - * @return dimensionUnit - */ - @jakarta.annotation.Nullable - public String getDimensionUnit() { - return dimensionUnit; - } - - public void setDimensionUnit(@jakarta.annotation.Nullable String dimensionUnit) { - this.dimensionUnit = dimensionUnit; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - getTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner = - (GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner) - o; - return Objects.equals( - this.simulateRoi, - getTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .simulateRoi) - && Objects.equals( - this.dimensionValue, - getTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .dimensionValue) - && Objects.equals( - this.dimensionUnit, - getTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .dimensionUnit); - } - - @Override - public int hashCode() { - return Objects.hash(simulateRoi, dimensionValue, dimensionUnit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class" - + " GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner" - + " {\n"); - sb.append(" simulateRoi: ").append(toIndentedString(simulateRoi)).append("\n"); - sb.append(" dimensionValue: ").append(toIndentedString(dimensionValue)).append("\n"); - sb.append(" dimensionUnit: ").append(toIndentedString(dimensionUnit)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object simulateRoiValue = getSimulateRoi(); - String simulateRoiValueAsString = ""; - simulateRoiValueAsString = simulateRoiValue.toString(); - sb.append("simulateRoi=").append(urlEncode(simulateRoiValueAsString)).append(""); - Object dimensionValueValue = getDimensionValue(); - String dimensionValueValueAsString = ""; - dimensionValueValueAsString = dimensionValueValue.toString(); - sb.append("dimensionValue=").append(urlEncode(dimensionValueValueAsString)).append(""); - Object dimensionUnitValue = getDimensionUnit(); - String dimensionUnitValueAsString = ""; - dimensionUnitValueAsString = dimensionUnitValue.toString(); - sb.append("dimensionUnit=").append(urlEncode(dimensionUnitValueAsString)).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("simulateRoi"); - openapiFields.add("dimensionValue"); - openapiFields.add("dimensionUnit"); - - // 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 - * GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner" - + " is not found in the empty JSON string", - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("simulateRoi") != null && !jsonObj.get("simulateRoi").isJsonNull()) - && !jsonObj.get("simulateRoi").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `simulateRoi` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("simulateRoi").toString())); - } - if ((jsonObj.get("dimensionValue") != null && !jsonObj.get("dimensionValue").isJsonNull()) - && !jsonObj.get("dimensionValue").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `dimensionValue` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("dimensionValue").toString())); - } - if ((jsonObj.get("dimensionUnit") != null && !jsonObj.get("dimensionUnit").isJsonNull()) - && !jsonObj.get("dimensionUnit").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `dimensionUnit` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("dimensionUnit").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .class - .isAssignableFrom(type.getRawType())) { - return null; // this class only serializes - // 'GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter< - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner> - thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .class)); - - return (TypeAdapter) - new TypeAdapter< - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner>() { - @Override - public void write( - JsonWriter out, - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of - * GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner given an JSON - * string - * - * @param jsonString JSON string - * @return An instance of - * GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - * @throws IOException if the JSON string is invalid with respect to - * GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - */ - public static GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - fromJson(String jsonString) throws IOException { - return JSON.getGson() - .fromJson( - jsonString, - GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner - .class); - } - - /** - * Convert an instance of - * GetTargetAssetListResponseAutoInvestAssetListInnerRoiAndDimensionTypeListInner to an JSON - * string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetRoiDataResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetRoiDataResponse.java deleted file mode 100644 index 323976323..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetRoiDataResponse.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** GetTargetAssetRoiDataResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetTargetAssetRoiDataResponse extends ArrayList { - public GetTargetAssetRoiDataResponse() {} - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTargetAssetRoiDataResponse {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetTargetAssetRoiDataResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetTargetAssetRoiDataResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetTargetAssetRoiDataResponse is not" - + " found in the empty JSON string", - GetTargetAssetRoiDataResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetTargetAssetRoiDataResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTargetAssetRoiDataResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTargetAssetRoiDataResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTargetAssetRoiDataResponse' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetTargetAssetRoiDataResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTargetAssetRoiDataResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTargetAssetRoiDataResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetTargetAssetRoiDataResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTargetAssetRoiDataResponse - * @throws IOException if the JSON string is invalid with respect to - * GetTargetAssetRoiDataResponse - */ - public static GetTargetAssetRoiDataResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTargetAssetRoiDataResponse.class); - } - - /** - * Convert an instance of GetTargetAssetRoiDataResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetRoiDataResponseInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetRoiDataResponseInner.java deleted file mode 100644 index 97968198a..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/GetTargetAssetRoiDataResponseInner.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** GetTargetAssetRoiDataResponseInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetTargetAssetRoiDataResponseInner { - public static final String SERIALIZED_NAME_DATE = "date"; - - @SerializedName(SERIALIZED_NAME_DATE) - @jakarta.annotation.Nullable - private String date; - - public static final String SERIALIZED_NAME_SIMULATE_ROI = "simulateRoi"; - - @SerializedName(SERIALIZED_NAME_SIMULATE_ROI) - @jakarta.annotation.Nullable - private String simulateRoi; - - public GetTargetAssetRoiDataResponseInner() {} - - public GetTargetAssetRoiDataResponseInner date(@jakarta.annotation.Nullable String date) { - this.date = date; - return this; - } - - /** - * Get date - * - * @return date - */ - @jakarta.annotation.Nullable - public String getDate() { - return date; - } - - public void setDate(@jakarta.annotation.Nullable String date) { - this.date = date; - } - - public GetTargetAssetRoiDataResponseInner simulateRoi( - @jakarta.annotation.Nullable String simulateRoi) { - this.simulateRoi = simulateRoi; - return this; - } - - /** - * Get simulateRoi - * - * @return simulateRoi - */ - @jakarta.annotation.Nullable - public String getSimulateRoi() { - return simulateRoi; - } - - public void setSimulateRoi(@jakarta.annotation.Nullable String simulateRoi) { - this.simulateRoi = simulateRoi; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTargetAssetRoiDataResponseInner getTargetAssetRoiDataResponseInner = - (GetTargetAssetRoiDataResponseInner) o; - return Objects.equals(this.date, getTargetAssetRoiDataResponseInner.date) - && Objects.equals(this.simulateRoi, getTargetAssetRoiDataResponseInner.simulateRoi); - } - - @Override - public int hashCode() { - return Objects.hash(date, simulateRoi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTargetAssetRoiDataResponseInner {\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" simulateRoi: ").append(toIndentedString(simulateRoi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object dateValue = getDate(); - String dateValueAsString = ""; - dateValueAsString = dateValue.toString(); - sb.append("date=").append(urlEncode(dateValueAsString)).append(""); - Object simulateRoiValue = getSimulateRoi(); - String simulateRoiValueAsString = ""; - simulateRoiValueAsString = simulateRoiValue.toString(); - sb.append("simulateRoi=").append(urlEncode(simulateRoiValueAsString)).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("date"); - openapiFields.add("simulateRoi"); - - // 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 - * GetTargetAssetRoiDataResponseInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetTargetAssetRoiDataResponseInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetTargetAssetRoiDataResponseInner is" - + " not found in the empty JSON string", - GetTargetAssetRoiDataResponseInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetTargetAssetRoiDataResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTargetAssetRoiDataResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("date") != null && !jsonObj.get("date").isJsonNull()) - && !jsonObj.get("date").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `date` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("date").toString())); - } - if ((jsonObj.get("simulateRoi") != null && !jsonObj.get("simulateRoi").isJsonNull()) - && !jsonObj.get("simulateRoi").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `simulateRoi` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("simulateRoi").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTargetAssetRoiDataResponseInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTargetAssetRoiDataResponseInner' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetTargetAssetRoiDataResponseInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTargetAssetRoiDataResponseInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTargetAssetRoiDataResponseInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetTargetAssetRoiDataResponseInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTargetAssetRoiDataResponseInner - * @throws IOException if the JSON string is invalid with respect to - * GetTargetAssetRoiDataResponseInner - */ - public static GetTargetAssetRoiDataResponseInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, GetTargetAssetRoiDataResponseInner.class); - } - - /** - * Convert an instance of GetTargetAssetRoiDataResponseInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRebalanceDetailsResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRebalanceDetailsResponse.java deleted file mode 100644 index fd94b7dec..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRebalanceDetailsResponse.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** IndexLinkedPlanRebalanceDetailsResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class IndexLinkedPlanRebalanceDetailsResponse - extends ArrayList { - public IndexLinkedPlanRebalanceDetailsResponse() {} - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IndexLinkedPlanRebalanceDetailsResponse {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * IndexLinkedPlanRebalanceDetailsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IndexLinkedPlanRebalanceDetailsResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " IndexLinkedPlanRebalanceDetailsResponse is not found in the" - + " empty JSON string", - IndexLinkedPlanRebalanceDetailsResponse.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexLinkedPlanRebalanceDetailsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexLinkedPlanRebalanceDetailsResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IndexLinkedPlanRebalanceDetailsResponse.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'IndexLinkedPlanRebalanceDetailsResponse' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(IndexLinkedPlanRebalanceDetailsResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, IndexLinkedPlanRebalanceDetailsResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IndexLinkedPlanRebalanceDetailsResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of IndexLinkedPlanRebalanceDetailsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of IndexLinkedPlanRebalanceDetailsResponse - * @throws IOException if the JSON string is invalid with respect to - * IndexLinkedPlanRebalanceDetailsResponse - */ - public static IndexLinkedPlanRebalanceDetailsResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, IndexLinkedPlanRebalanceDetailsResponse.class); - } - - /** - * Convert an instance of IndexLinkedPlanRebalanceDetailsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRebalanceDetailsResponseInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRebalanceDetailsResponseInner.java deleted file mode 100644 index 1f2625404..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRebalanceDetailsResponseInner.java +++ /dev/null @@ -1,530 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** IndexLinkedPlanRebalanceDetailsResponseInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class IndexLinkedPlanRebalanceDetailsResponseInner { - public static final String SERIALIZED_NAME_INDEX_ID = "indexId"; - - @SerializedName(SERIALIZED_NAME_INDEX_ID) - @jakarta.annotation.Nullable - private Long indexId; - - public static final String SERIALIZED_NAME_INDEX_NAME = "indexName"; - - @SerializedName(SERIALIZED_NAME_INDEX_NAME) - @jakarta.annotation.Nullable - private String indexName; - - public static final String SERIALIZED_NAME_REBALANCE_ID = "rebalanceId"; - - @SerializedName(SERIALIZED_NAME_REBALANCE_ID) - @jakarta.annotation.Nullable - private Long rebalanceId; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_REBALANCE_FEE = "rebalanceFee"; - - @SerializedName(SERIALIZED_NAME_REBALANCE_FEE) - @jakarta.annotation.Nullable - private String rebalanceFee; - - public static final String SERIALIZED_NAME_REBALANCE_FEE_UNIT = "rebalanceFeeUnit"; - - @SerializedName(SERIALIZED_NAME_REBALANCE_FEE_UNIT) - @jakarta.annotation.Nullable - private String rebalanceFeeUnit; - - public static final String SERIALIZED_NAME_TRANSACTION_DETAILS = "transactionDetails"; - - @SerializedName(SERIALIZED_NAME_TRANSACTION_DETAILS) - @jakarta.annotation.Nullable - private List<@Valid IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner> - transactionDetails; - - public IndexLinkedPlanRebalanceDetailsResponseInner() {} - - public IndexLinkedPlanRebalanceDetailsResponseInner indexId( - @jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - return this; - } - - /** - * Get indexId - * - * @return indexId - */ - @jakarta.annotation.Nullable - public Long getIndexId() { - return indexId; - } - - public void setIndexId(@jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - } - - public IndexLinkedPlanRebalanceDetailsResponseInner indexName( - @jakarta.annotation.Nullable String indexName) { - this.indexName = indexName; - return this; - } - - /** - * Get indexName - * - * @return indexName - */ - @jakarta.annotation.Nullable - public String getIndexName() { - return indexName; - } - - public void setIndexName(@jakarta.annotation.Nullable String indexName) { - this.indexName = indexName; - } - - public IndexLinkedPlanRebalanceDetailsResponseInner rebalanceId( - @jakarta.annotation.Nullable Long rebalanceId) { - this.rebalanceId = rebalanceId; - return this; - } - - /** - * Get rebalanceId - * - * @return rebalanceId - */ - @jakarta.annotation.Nullable - public Long getRebalanceId() { - return rebalanceId; - } - - public void setRebalanceId(@jakarta.annotation.Nullable Long rebalanceId) { - this.rebalanceId = rebalanceId; - } - - public IndexLinkedPlanRebalanceDetailsResponseInner status( - @jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - public IndexLinkedPlanRebalanceDetailsResponseInner rebalanceFee( - @jakarta.annotation.Nullable String rebalanceFee) { - this.rebalanceFee = rebalanceFee; - return this; - } - - /** - * Get rebalanceFee - * - * @return rebalanceFee - */ - @jakarta.annotation.Nullable - public String getRebalanceFee() { - return rebalanceFee; - } - - public void setRebalanceFee(@jakarta.annotation.Nullable String rebalanceFee) { - this.rebalanceFee = rebalanceFee; - } - - public IndexLinkedPlanRebalanceDetailsResponseInner rebalanceFeeUnit( - @jakarta.annotation.Nullable String rebalanceFeeUnit) { - this.rebalanceFeeUnit = rebalanceFeeUnit; - return this; - } - - /** - * Get rebalanceFeeUnit - * - * @return rebalanceFeeUnit - */ - @jakarta.annotation.Nullable - public String getRebalanceFeeUnit() { - return rebalanceFeeUnit; - } - - public void setRebalanceFeeUnit(@jakarta.annotation.Nullable String rebalanceFeeUnit) { - this.rebalanceFeeUnit = rebalanceFeeUnit; - } - - public IndexLinkedPlanRebalanceDetailsResponseInner transactionDetails( - @jakarta.annotation.Nullable - List<@Valid IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner> - transactionDetails) { - this.transactionDetails = transactionDetails; - return this; - } - - public IndexLinkedPlanRebalanceDetailsResponseInner addTransactionDetailsItem( - IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - transactionDetailsItem) { - if (this.transactionDetails == null) { - this.transactionDetails = new ArrayList<>(); - } - this.transactionDetails.add(transactionDetailsItem); - return this; - } - - /** - * Get transactionDetails - * - * @return transactionDetails - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner> - getTransactionDetails() { - return transactionDetails; - } - - public void setTransactionDetails( - @jakarta.annotation.Nullable - List<@Valid IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner> - transactionDetails) { - this.transactionDetails = transactionDetails; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IndexLinkedPlanRebalanceDetailsResponseInner indexLinkedPlanRebalanceDetailsResponseInner = - (IndexLinkedPlanRebalanceDetailsResponseInner) o; - return Objects.equals(this.indexId, indexLinkedPlanRebalanceDetailsResponseInner.indexId) - && Objects.equals( - this.indexName, indexLinkedPlanRebalanceDetailsResponseInner.indexName) - && Objects.equals( - this.rebalanceId, indexLinkedPlanRebalanceDetailsResponseInner.rebalanceId) - && Objects.equals(this.status, indexLinkedPlanRebalanceDetailsResponseInner.status) - && Objects.equals( - this.rebalanceFee, - indexLinkedPlanRebalanceDetailsResponseInner.rebalanceFee) - && Objects.equals( - this.rebalanceFeeUnit, - indexLinkedPlanRebalanceDetailsResponseInner.rebalanceFeeUnit) - && Objects.equals( - this.transactionDetails, - indexLinkedPlanRebalanceDetailsResponseInner.transactionDetails); - } - - @Override - public int hashCode() { - return Objects.hash( - indexId, - indexName, - rebalanceId, - status, - rebalanceFee, - rebalanceFeeUnit, - transactionDetails); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IndexLinkedPlanRebalanceDetailsResponseInner {\n"); - sb.append(" indexId: ").append(toIndentedString(indexId)).append("\n"); - sb.append(" indexName: ").append(toIndentedString(indexName)).append("\n"); - sb.append(" rebalanceId: ").append(toIndentedString(rebalanceId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" rebalanceFee: ").append(toIndentedString(rebalanceFee)).append("\n"); - sb.append(" rebalanceFeeUnit: ").append(toIndentedString(rebalanceFeeUnit)).append("\n"); - sb.append(" transactionDetails: ") - .append(toIndentedString(transactionDetails)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object indexIdValue = getIndexId(); - String indexIdValueAsString = ""; - indexIdValueAsString = indexIdValue.toString(); - sb.append("indexId=").append(urlEncode(indexIdValueAsString)).append(""); - Object indexNameValue = getIndexName(); - String indexNameValueAsString = ""; - indexNameValueAsString = indexNameValue.toString(); - sb.append("indexName=").append(urlEncode(indexNameValueAsString)).append(""); - Object rebalanceIdValue = getRebalanceId(); - String rebalanceIdValueAsString = ""; - rebalanceIdValueAsString = rebalanceIdValue.toString(); - sb.append("rebalanceId=").append(urlEncode(rebalanceIdValueAsString)).append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object rebalanceFeeValue = getRebalanceFee(); - String rebalanceFeeValueAsString = ""; - rebalanceFeeValueAsString = rebalanceFeeValue.toString(); - sb.append("rebalanceFee=").append(urlEncode(rebalanceFeeValueAsString)).append(""); - Object rebalanceFeeUnitValue = getRebalanceFeeUnit(); - String rebalanceFeeUnitValueAsString = ""; - rebalanceFeeUnitValueAsString = rebalanceFeeUnitValue.toString(); - sb.append("rebalanceFeeUnit=").append(urlEncode(rebalanceFeeUnitValueAsString)).append(""); - Object transactionDetailsValue = getTransactionDetails(); - String transactionDetailsValueAsString = ""; - transactionDetailsValueAsString = - (String) - ((Collection) transactionDetailsValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("transactionDetails=") - .append(urlEncode(transactionDetailsValueAsString)) - .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("indexId"); - openapiFields.add("indexName"); - openapiFields.add("rebalanceId"); - openapiFields.add("status"); - openapiFields.add("rebalanceFee"); - openapiFields.add("rebalanceFeeUnit"); - openapiFields.add("transactionDetails"); - - // 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 - * IndexLinkedPlanRebalanceDetailsResponseInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IndexLinkedPlanRebalanceDetailsResponseInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " IndexLinkedPlanRebalanceDetailsResponseInner is not found" - + " in the empty JSON string", - IndexLinkedPlanRebalanceDetailsResponseInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexLinkedPlanRebalanceDetailsResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexLinkedPlanRebalanceDetailsResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("indexName") != null && !jsonObj.get("indexName").isJsonNull()) - && !jsonObj.get("indexName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `indexName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("indexName").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if ((jsonObj.get("rebalanceFee") != null && !jsonObj.get("rebalanceFee").isJsonNull()) - && !jsonObj.get("rebalanceFee").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rebalanceFee` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rebalanceFee").toString())); - } - if ((jsonObj.get("rebalanceFeeUnit") != null - && !jsonObj.get("rebalanceFeeUnit").isJsonNull()) - && !jsonObj.get("rebalanceFeeUnit").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rebalanceFeeUnit` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("rebalanceFeeUnit").toString())); - } - if (jsonObj.get("transactionDetails") != null - && !jsonObj.get("transactionDetails").isJsonNull()) { - JsonArray jsonArraytransactionDetails = jsonObj.getAsJsonArray("transactionDetails"); - if (jsonArraytransactionDetails != null) { - // ensure the json data is an array - if (!jsonObj.get("transactionDetails").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transactionDetails` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("transactionDetails").toString())); - } - - // validate the optional field `transactionDetails` (array) - for (int i = 0; i < jsonArraytransactionDetails.size(); i++) { - IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - .validateJsonElement(jsonArraytransactionDetails.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IndexLinkedPlanRebalanceDetailsResponseInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'IndexLinkedPlanRebalanceDetailsResponseInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get(IndexLinkedPlanRebalanceDetailsResponseInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, IndexLinkedPlanRebalanceDetailsResponseInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IndexLinkedPlanRebalanceDetailsResponseInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of IndexLinkedPlanRebalanceDetailsResponseInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of IndexLinkedPlanRebalanceDetailsResponseInner - * @throws IOException if the JSON string is invalid with respect to - * IndexLinkedPlanRebalanceDetailsResponseInner - */ - public static IndexLinkedPlanRebalanceDetailsResponseInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, IndexLinkedPlanRebalanceDetailsResponseInner.class); - } - - /** - * Convert an instance of IndexLinkedPlanRebalanceDetailsResponseInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.java deleted file mode 100644 index dd478f1a4..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.java +++ /dev/null @@ -1,389 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner { - public static final String SERIALIZED_NAME_ASSET = "asset"; - - @SerializedName(SERIALIZED_NAME_ASSET) - @jakarta.annotation.Nullable - private String asset; - - public static final String SERIALIZED_NAME_TRANSACTION_DATE_TIME = "transactionDateTime"; - - @SerializedName(SERIALIZED_NAME_TRANSACTION_DATE_TIME) - @jakarta.annotation.Nullable - private Long transactionDateTime; - - public static final String SERIALIZED_NAME_REBALANCE_DIRECTION = "rebalanceDirection"; - - @SerializedName(SERIALIZED_NAME_REBALANCE_DIRECTION) - @jakarta.annotation.Nullable - private String rebalanceDirection; - - public static final String SERIALIZED_NAME_REBALANCE_AMOUNT = "rebalanceAmount"; - - @SerializedName(SERIALIZED_NAME_REBALANCE_AMOUNT) - @jakarta.annotation.Nullable - private String rebalanceAmount; - - public IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner() {} - - public IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner asset( - @jakarta.annotation.Nullable String asset) { - this.asset = asset; - return this; - } - - /** - * Get asset - * - * @return asset - */ - @jakarta.annotation.Nullable - public String getAsset() { - return asset; - } - - public void setAsset(@jakarta.annotation.Nullable String asset) { - this.asset = asset; - } - - public IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner transactionDateTime( - @jakarta.annotation.Nullable Long transactionDateTime) { - this.transactionDateTime = transactionDateTime; - return this; - } - - /** - * Get transactionDateTime - * - * @return transactionDateTime - */ - @jakarta.annotation.Nullable - public Long getTransactionDateTime() { - return transactionDateTime; - } - - public void setTransactionDateTime(@jakarta.annotation.Nullable Long transactionDateTime) { - this.transactionDateTime = transactionDateTime; - } - - public IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner rebalanceDirection( - @jakarta.annotation.Nullable String rebalanceDirection) { - this.rebalanceDirection = rebalanceDirection; - return this; - } - - /** - * Get rebalanceDirection - * - * @return rebalanceDirection - */ - @jakarta.annotation.Nullable - public String getRebalanceDirection() { - return rebalanceDirection; - } - - public void setRebalanceDirection(@jakarta.annotation.Nullable String rebalanceDirection) { - this.rebalanceDirection = rebalanceDirection; - } - - public IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner rebalanceAmount( - @jakarta.annotation.Nullable String rebalanceAmount) { - this.rebalanceAmount = rebalanceAmount; - return this; - } - - /** - * Get rebalanceAmount - * - * @return rebalanceAmount - */ - @jakarta.annotation.Nullable - public String getRebalanceAmount() { - return rebalanceAmount; - } - - public void setRebalanceAmount(@jakarta.annotation.Nullable String rebalanceAmount) { - this.rebalanceAmount = rebalanceAmount; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - indexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner = - (IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner) o; - return Objects.equals( - this.asset, - indexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.asset) - && Objects.equals( - this.transactionDateTime, - indexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - .transactionDateTime) - && Objects.equals( - this.rebalanceDirection, - indexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - .rebalanceDirection) - && Objects.equals( - this.rebalanceAmount, - indexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - .rebalanceAmount); - } - - @Override - public int hashCode() { - return Objects.hash(asset, transactionDateTime, rebalanceDirection, rebalanceAmount); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner {\n"); - sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); - sb.append(" transactionDateTime: ") - .append(toIndentedString(transactionDateTime)) - .append("\n"); - sb.append(" rebalanceDirection: ") - .append(toIndentedString(rebalanceDirection)) - .append("\n"); - sb.append(" rebalanceAmount: ").append(toIndentedString(rebalanceAmount)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object assetValue = getAsset(); - String assetValueAsString = ""; - assetValueAsString = assetValue.toString(); - sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); - Object transactionDateTimeValue = getTransactionDateTime(); - String transactionDateTimeValueAsString = ""; - transactionDateTimeValueAsString = transactionDateTimeValue.toString(); - sb.append("transactionDateTime=") - .append(urlEncode(transactionDateTimeValueAsString)) - .append(""); - Object rebalanceDirectionValue = getRebalanceDirection(); - String rebalanceDirectionValueAsString = ""; - rebalanceDirectionValueAsString = rebalanceDirectionValue.toString(); - sb.append("rebalanceDirection=") - .append(urlEncode(rebalanceDirectionValueAsString)) - .append(""); - Object rebalanceAmountValue = getRebalanceAmount(); - String rebalanceAmountValueAsString = ""; - rebalanceAmountValueAsString = rebalanceAmountValue.toString(); - sb.append("rebalanceAmount=").append(urlEncode(rebalanceAmountValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("asset"); - openapiFields.add("transactionDateTime"); - openapiFields.add("rebalanceDirection"); - openapiFields.add("rebalanceAmount"); - - // 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 - * IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - .openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner" - + " is not found in the empty JSON string", - IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) - && !jsonObj.get("asset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `asset` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("asset").toString())); - } - if ((jsonObj.get("rebalanceDirection") != null - && !jsonObj.get("rebalanceDirection").isJsonNull()) - && !jsonObj.get("rebalanceDirection").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rebalanceDirection` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("rebalanceDirection").toString())); - } - if ((jsonObj.get("rebalanceAmount") != null && !jsonObj.get("rebalanceAmount").isJsonNull()) - && !jsonObj.get("rebalanceAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rebalanceAmount` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("rebalanceAmount").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.class - .isAssignableFrom(type.getRawType())) { - return null; // this class only serializes - // 'IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - .class)); - - return (TypeAdapter) - new TypeAdapter< - IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner>() { - @Override - public void write( - JsonWriter out, - IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - * given an JSON string - * - * @param jsonString JSON string - * @return An instance of IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - * @throws IOException if the JSON string is invalid with respect to - * IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner - */ - public static IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner fromJson( - String jsonString) throws IOException { - return JSON.getGson() - .fromJson( - jsonString, - IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner.class); - } - - /** - * Convert an instance of IndexLinkedPlanRebalanceDetailsResponseInnerTransactionDetailsInner to - * an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionRequest.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionRequest.java deleted file mode 100644 index 5353efd85..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionRequest.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** IndexLinkedPlanRedemptionRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class IndexLinkedPlanRedemptionRequest { - public static final String SERIALIZED_NAME_INDEX_ID = "indexId"; - - @SerializedName(SERIALIZED_NAME_INDEX_ID) - @jakarta.annotation.Nonnull - private Long indexId; - - public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; - - @SerializedName(SERIALIZED_NAME_REQUEST_ID) - @jakarta.annotation.Nullable - private Long requestId; - - public static final String SERIALIZED_NAME_REDEMPTION_PERCENTAGE = "redemptionPercentage"; - - @SerializedName(SERIALIZED_NAME_REDEMPTION_PERCENTAGE) - @jakarta.annotation.Nonnull - private Long redemptionPercentage; - - public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; - - @SerializedName(SERIALIZED_NAME_RECV_WINDOW) - @jakarta.annotation.Nullable - private Long recvWindow; - - public IndexLinkedPlanRedemptionRequest() {} - - public IndexLinkedPlanRedemptionRequest indexId(@jakarta.annotation.Nonnull Long indexId) { - this.indexId = indexId; - return this; - } - - /** - * Get indexId - * - * @return indexId - */ - @jakarta.annotation.Nonnull - @NotNull - public Long getIndexId() { - return indexId; - } - - public void setIndexId(@jakarta.annotation.Nonnull Long indexId) { - this.indexId = indexId; - } - - public IndexLinkedPlanRedemptionRequest requestId(@jakarta.annotation.Nullable Long requestId) { - this.requestId = requestId; - return this; - } - - /** - * Get requestId - * - * @return requestId - */ - @jakarta.annotation.Nullable - public Long getRequestId() { - return requestId; - } - - public void setRequestId(@jakarta.annotation.Nullable Long requestId) { - this.requestId = requestId; - } - - public IndexLinkedPlanRedemptionRequest redemptionPercentage( - @jakarta.annotation.Nonnull Long redemptionPercentage) { - this.redemptionPercentage = redemptionPercentage; - return this; - } - - /** - * Get redemptionPercentage - * - * @return redemptionPercentage - */ - @jakarta.annotation.Nonnull - @NotNull - public Long getRedemptionPercentage() { - return redemptionPercentage; - } - - public void setRedemptionPercentage(@jakarta.annotation.Nonnull Long redemptionPercentage) { - this.redemptionPercentage = redemptionPercentage; - } - - public IndexLinkedPlanRedemptionRequest recvWindow( - @jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - return this; - } - - /** - * Get recvWindow - * - * @return recvWindow - */ - @jakarta.annotation.Nullable - public Long getRecvWindow() { - return recvWindow; - } - - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IndexLinkedPlanRedemptionRequest indexLinkedPlanRedemptionRequest = - (IndexLinkedPlanRedemptionRequest) o; - return Objects.equals(this.indexId, indexLinkedPlanRedemptionRequest.indexId) - && Objects.equals(this.requestId, indexLinkedPlanRedemptionRequest.requestId) - && Objects.equals( - this.redemptionPercentage, - indexLinkedPlanRedemptionRequest.redemptionPercentage) - && Objects.equals(this.recvWindow, indexLinkedPlanRedemptionRequest.recvWindow); - } - - @Override - public int hashCode() { - return Objects.hash(indexId, requestId, redemptionPercentage, recvWindow); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IndexLinkedPlanRedemptionRequest {\n"); - sb.append(" indexId: ").append(toIndentedString(indexId)).append("\n"); - sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); - sb.append(" redemptionPercentage: ") - .append(toIndentedString(redemptionPercentage)) - .append("\n"); - sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object indexIdValue = getIndexId(); - String indexIdValueAsString = ""; - indexIdValueAsString = indexIdValue.toString(); - sb.append("indexId=").append(urlEncode(indexIdValueAsString)).append(""); - Object requestIdValue = getRequestId(); - String requestIdValueAsString = ""; - requestIdValueAsString = requestIdValue.toString(); - sb.append("requestId=").append(urlEncode(requestIdValueAsString)).append(""); - Object redemptionPercentageValue = getRedemptionPercentage(); - String redemptionPercentageValueAsString = ""; - redemptionPercentageValueAsString = redemptionPercentageValue.toString(); - sb.append("redemptionPercentage=") - .append(urlEncode(redemptionPercentageValueAsString)) - .append(""); - Object recvWindowValue = getRecvWindow(); - String recvWindowValueAsString = ""; - recvWindowValueAsString = recvWindowValue.toString(); - sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("indexId"); - openapiFields.add("requestId"); - openapiFields.add("redemptionPercentage"); - openapiFields.add("recvWindow"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("indexId"); - openapiRequiredFields.add("redemptionPercentage"); - } - - /** - * 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 - * IndexLinkedPlanRedemptionRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IndexLinkedPlanRedemptionRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in IndexLinkedPlanRedemptionRequest is" - + " not found in the empty JSON string", - IndexLinkedPlanRedemptionRequest.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexLinkedPlanRedemptionRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexLinkedPlanRedemptionRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IndexLinkedPlanRedemptionRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IndexLinkedPlanRedemptionRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IndexLinkedPlanRedemptionRequest' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(IndexLinkedPlanRedemptionRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, IndexLinkedPlanRedemptionRequest value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IndexLinkedPlanRedemptionRequest read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of IndexLinkedPlanRedemptionRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of IndexLinkedPlanRedemptionRequest - * @throws IOException if the JSON string is invalid with respect to - * IndexLinkedPlanRedemptionRequest - */ - public static IndexLinkedPlanRedemptionRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IndexLinkedPlanRedemptionRequest.class); - } - - /** - * Convert an instance of IndexLinkedPlanRedemptionRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionResponse.java deleted file mode 100644 index bf5bd9abf..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionResponse.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** IndexLinkedPlanRedemptionResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class IndexLinkedPlanRedemptionResponse { - public static final String SERIALIZED_NAME_REDEMPTION_ID = "redemptionId"; - - @SerializedName(SERIALIZED_NAME_REDEMPTION_ID) - @jakarta.annotation.Nullable - private Long redemptionId; - - public IndexLinkedPlanRedemptionResponse() {} - - public IndexLinkedPlanRedemptionResponse redemptionId( - @jakarta.annotation.Nullable Long redemptionId) { - this.redemptionId = redemptionId; - return this; - } - - /** - * Get redemptionId - * - * @return redemptionId - */ - @jakarta.annotation.Nullable - public Long getRedemptionId() { - return redemptionId; - } - - public void setRedemptionId(@jakarta.annotation.Nullable Long redemptionId) { - this.redemptionId = redemptionId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IndexLinkedPlanRedemptionResponse indexLinkedPlanRedemptionResponse = - (IndexLinkedPlanRedemptionResponse) o; - return Objects.equals(this.redemptionId, indexLinkedPlanRedemptionResponse.redemptionId); - } - - @Override - public int hashCode() { - return Objects.hash(redemptionId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IndexLinkedPlanRedemptionResponse {\n"); - sb.append(" redemptionId: ").append(toIndentedString(redemptionId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object redemptionIdValue = getRedemptionId(); - String redemptionIdValueAsString = ""; - redemptionIdValueAsString = redemptionIdValue.toString(); - sb.append("redemptionId=").append(urlEncode(redemptionIdValueAsString)).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("redemptionId"); - - // 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 - * IndexLinkedPlanRedemptionResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IndexLinkedPlanRedemptionResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in IndexLinkedPlanRedemptionResponse is" - + " not found in the empty JSON string", - IndexLinkedPlanRedemptionResponse.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexLinkedPlanRedemptionResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexLinkedPlanRedemptionResponse` 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 (!IndexLinkedPlanRedemptionResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IndexLinkedPlanRedemptionResponse' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(IndexLinkedPlanRedemptionResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, IndexLinkedPlanRedemptionResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IndexLinkedPlanRedemptionResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of IndexLinkedPlanRedemptionResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of IndexLinkedPlanRedemptionResponse - * @throws IOException if the JSON string is invalid with respect to - * IndexLinkedPlanRedemptionResponse - */ - public static IndexLinkedPlanRedemptionResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IndexLinkedPlanRedemptionResponse.class); - } - - /** - * Convert an instance of IndexLinkedPlanRedemptionResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionTradeResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionTradeResponse.java deleted file mode 100644 index 28abfad62..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionTradeResponse.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** IndexLinkedPlanRedemptionTradeResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class IndexLinkedPlanRedemptionTradeResponse - extends ArrayList { - public IndexLinkedPlanRedemptionTradeResponse() {} - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IndexLinkedPlanRedemptionTradeResponse {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * IndexLinkedPlanRedemptionTradeResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IndexLinkedPlanRedemptionTradeResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in IndexLinkedPlanRedemptionTradeResponse" - + " is not found in the empty JSON string", - IndexLinkedPlanRedemptionTradeResponse.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexLinkedPlanRedemptionTradeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexLinkedPlanRedemptionTradeResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IndexLinkedPlanRedemptionTradeResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IndexLinkedPlanRedemptionTradeResponse' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(IndexLinkedPlanRedemptionTradeResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, IndexLinkedPlanRedemptionTradeResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IndexLinkedPlanRedemptionTradeResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of IndexLinkedPlanRedemptionTradeResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of IndexLinkedPlanRedemptionTradeResponse - * @throws IOException if the JSON string is invalid with respect to - * IndexLinkedPlanRedemptionTradeResponse - */ - public static IndexLinkedPlanRedemptionTradeResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, IndexLinkedPlanRedemptionTradeResponse.class); - } - - /** - * Convert an instance of IndexLinkedPlanRedemptionTradeResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionTradeResponseInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionTradeResponseInner.java deleted file mode 100644 index c98826bb8..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/IndexLinkedPlanRedemptionTradeResponseInner.java +++ /dev/null @@ -1,569 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** IndexLinkedPlanRedemptionTradeResponseInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class IndexLinkedPlanRedemptionTradeResponseInner { - public static final String SERIALIZED_NAME_INDEX_ID = "indexId"; - - @SerializedName(SERIALIZED_NAME_INDEX_ID) - @jakarta.annotation.Nullable - private Long indexId; - - public static final String SERIALIZED_NAME_INDEX_NAME = "indexName"; - - @SerializedName(SERIALIZED_NAME_INDEX_NAME) - @jakarta.annotation.Nullable - private String indexName; - - public static final String SERIALIZED_NAME_REDEMPTION_ID = "redemptionId"; - - @SerializedName(SERIALIZED_NAME_REDEMPTION_ID) - @jakarta.annotation.Nullable - private Long redemptionId; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_ASSET = "asset"; - - @SerializedName(SERIALIZED_NAME_ASSET) - @jakarta.annotation.Nullable - private String asset; - - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - - @SerializedName(SERIALIZED_NAME_AMOUNT) - @jakarta.annotation.Nullable - private String amount; - - public static final String SERIALIZED_NAME_REDEMPTION_DATE_TIME = "redemptionDateTime"; - - @SerializedName(SERIALIZED_NAME_REDEMPTION_DATE_TIME) - @jakarta.annotation.Nullable - private Long redemptionDateTime; - - public static final String SERIALIZED_NAME_TRANSACTION_FEE = "transactionFee"; - - @SerializedName(SERIALIZED_NAME_TRANSACTION_FEE) - @jakarta.annotation.Nullable - private String transactionFee; - - public static final String SERIALIZED_NAME_TRANSACTION_FEE_UNIT = "transactionFeeUnit"; - - @SerializedName(SERIALIZED_NAME_TRANSACTION_FEE_UNIT) - @jakarta.annotation.Nullable - private String transactionFeeUnit; - - public IndexLinkedPlanRedemptionTradeResponseInner() {} - - public IndexLinkedPlanRedemptionTradeResponseInner indexId( - @jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - return this; - } - - /** - * Get indexId - * - * @return indexId - */ - @jakarta.annotation.Nullable - public Long getIndexId() { - return indexId; - } - - public void setIndexId(@jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - } - - public IndexLinkedPlanRedemptionTradeResponseInner indexName( - @jakarta.annotation.Nullable String indexName) { - this.indexName = indexName; - return this; - } - - /** - * Get indexName - * - * @return indexName - */ - @jakarta.annotation.Nullable - public String getIndexName() { - return indexName; - } - - public void setIndexName(@jakarta.annotation.Nullable String indexName) { - this.indexName = indexName; - } - - public IndexLinkedPlanRedemptionTradeResponseInner redemptionId( - @jakarta.annotation.Nullable Long redemptionId) { - this.redemptionId = redemptionId; - return this; - } - - /** - * Get redemptionId - * - * @return redemptionId - */ - @jakarta.annotation.Nullable - public Long getRedemptionId() { - return redemptionId; - } - - public void setRedemptionId(@jakarta.annotation.Nullable Long redemptionId) { - this.redemptionId = redemptionId; - } - - public IndexLinkedPlanRedemptionTradeResponseInner status( - @jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - public IndexLinkedPlanRedemptionTradeResponseInner asset( - @jakarta.annotation.Nullable String asset) { - this.asset = asset; - return this; - } - - /** - * Get asset - * - * @return asset - */ - @jakarta.annotation.Nullable - public String getAsset() { - return asset; - } - - public void setAsset(@jakarta.annotation.Nullable String asset) { - this.asset = asset; - } - - public IndexLinkedPlanRedemptionTradeResponseInner amount( - @jakarta.annotation.Nullable String amount) { - this.amount = amount; - return this; - } - - /** - * Get amount - * - * @return amount - */ - @jakarta.annotation.Nullable - public String getAmount() { - return amount; - } - - public void setAmount(@jakarta.annotation.Nullable String amount) { - this.amount = amount; - } - - public IndexLinkedPlanRedemptionTradeResponseInner redemptionDateTime( - @jakarta.annotation.Nullable Long redemptionDateTime) { - this.redemptionDateTime = redemptionDateTime; - return this; - } - - /** - * Get redemptionDateTime - * - * @return redemptionDateTime - */ - @jakarta.annotation.Nullable - public Long getRedemptionDateTime() { - return redemptionDateTime; - } - - public void setRedemptionDateTime(@jakarta.annotation.Nullable Long redemptionDateTime) { - this.redemptionDateTime = redemptionDateTime; - } - - public IndexLinkedPlanRedemptionTradeResponseInner transactionFee( - @jakarta.annotation.Nullable String transactionFee) { - this.transactionFee = transactionFee; - return this; - } - - /** - * Get transactionFee - * - * @return transactionFee - */ - @jakarta.annotation.Nullable - public String getTransactionFee() { - return transactionFee; - } - - public void setTransactionFee(@jakarta.annotation.Nullable String transactionFee) { - this.transactionFee = transactionFee; - } - - public IndexLinkedPlanRedemptionTradeResponseInner transactionFeeUnit( - @jakarta.annotation.Nullable String transactionFeeUnit) { - this.transactionFeeUnit = transactionFeeUnit; - return this; - } - - /** - * Get transactionFeeUnit - * - * @return transactionFeeUnit - */ - @jakarta.annotation.Nullable - public String getTransactionFeeUnit() { - return transactionFeeUnit; - } - - public void setTransactionFeeUnit(@jakarta.annotation.Nullable String transactionFeeUnit) { - this.transactionFeeUnit = transactionFeeUnit; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IndexLinkedPlanRedemptionTradeResponseInner indexLinkedPlanRedemptionTradeResponseInner = - (IndexLinkedPlanRedemptionTradeResponseInner) o; - return Objects.equals(this.indexId, indexLinkedPlanRedemptionTradeResponseInner.indexId) - && Objects.equals( - this.indexName, indexLinkedPlanRedemptionTradeResponseInner.indexName) - && Objects.equals( - this.redemptionId, indexLinkedPlanRedemptionTradeResponseInner.redemptionId) - && Objects.equals(this.status, indexLinkedPlanRedemptionTradeResponseInner.status) - && Objects.equals(this.asset, indexLinkedPlanRedemptionTradeResponseInner.asset) - && Objects.equals(this.amount, indexLinkedPlanRedemptionTradeResponseInner.amount) - && Objects.equals( - this.redemptionDateTime, - indexLinkedPlanRedemptionTradeResponseInner.redemptionDateTime) - && Objects.equals( - this.transactionFee, - indexLinkedPlanRedemptionTradeResponseInner.transactionFee) - && Objects.equals( - this.transactionFeeUnit, - indexLinkedPlanRedemptionTradeResponseInner.transactionFeeUnit); - } - - @Override - public int hashCode() { - return Objects.hash( - indexId, - indexName, - redemptionId, - status, - asset, - amount, - redemptionDateTime, - transactionFee, - transactionFeeUnit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IndexLinkedPlanRedemptionTradeResponseInner {\n"); - sb.append(" indexId: ").append(toIndentedString(indexId)).append("\n"); - sb.append(" indexName: ").append(toIndentedString(indexName)).append("\n"); - sb.append(" redemptionId: ").append(toIndentedString(redemptionId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" redemptionDateTime: ") - .append(toIndentedString(redemptionDateTime)) - .append("\n"); - sb.append(" transactionFee: ").append(toIndentedString(transactionFee)).append("\n"); - sb.append(" transactionFeeUnit: ") - .append(toIndentedString(transactionFeeUnit)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object indexIdValue = getIndexId(); - String indexIdValueAsString = ""; - indexIdValueAsString = indexIdValue.toString(); - sb.append("indexId=").append(urlEncode(indexIdValueAsString)).append(""); - Object indexNameValue = getIndexName(); - String indexNameValueAsString = ""; - indexNameValueAsString = indexNameValue.toString(); - sb.append("indexName=").append(urlEncode(indexNameValueAsString)).append(""); - Object redemptionIdValue = getRedemptionId(); - String redemptionIdValueAsString = ""; - redemptionIdValueAsString = redemptionIdValue.toString(); - sb.append("redemptionId=").append(urlEncode(redemptionIdValueAsString)).append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object assetValue = getAsset(); - String assetValueAsString = ""; - assetValueAsString = assetValue.toString(); - sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); - Object amountValue = getAmount(); - String amountValueAsString = ""; - amountValueAsString = amountValue.toString(); - sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); - Object redemptionDateTimeValue = getRedemptionDateTime(); - String redemptionDateTimeValueAsString = ""; - redemptionDateTimeValueAsString = redemptionDateTimeValue.toString(); - sb.append("redemptionDateTime=") - .append(urlEncode(redemptionDateTimeValueAsString)) - .append(""); - Object transactionFeeValue = getTransactionFee(); - String transactionFeeValueAsString = ""; - transactionFeeValueAsString = transactionFeeValue.toString(); - sb.append("transactionFee=").append(urlEncode(transactionFeeValueAsString)).append(""); - Object transactionFeeUnitValue = getTransactionFeeUnit(); - String transactionFeeUnitValueAsString = ""; - transactionFeeUnitValueAsString = transactionFeeUnitValue.toString(); - sb.append("transactionFeeUnit=") - .append(urlEncode(transactionFeeUnitValueAsString)) - .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("indexId"); - openapiFields.add("indexName"); - openapiFields.add("redemptionId"); - openapiFields.add("status"); - openapiFields.add("asset"); - openapiFields.add("amount"); - openapiFields.add("redemptionDateTime"); - openapiFields.add("transactionFee"); - openapiFields.add("transactionFeeUnit"); - - // 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 - * IndexLinkedPlanRedemptionTradeResponseInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IndexLinkedPlanRedemptionTradeResponseInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " IndexLinkedPlanRedemptionTradeResponseInner is not found in" - + " the empty JSON string", - IndexLinkedPlanRedemptionTradeResponseInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexLinkedPlanRedemptionTradeResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexLinkedPlanRedemptionTradeResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("indexName") != null && !jsonObj.get("indexName").isJsonNull()) - && !jsonObj.get("indexName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `indexName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("indexName").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) - && !jsonObj.get("asset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `asset` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("asset").toString())); - } - if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) - && !jsonObj.get("amount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `amount` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("amount").toString())); - } - if ((jsonObj.get("transactionFee") != null && !jsonObj.get("transactionFee").isJsonNull()) - && !jsonObj.get("transactionFee").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transactionFee` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("transactionFee").toString())); - } - if ((jsonObj.get("transactionFeeUnit") != null - && !jsonObj.get("transactionFeeUnit").isJsonNull()) - && !jsonObj.get("transactionFeeUnit").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transactionFeeUnit` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("transactionFeeUnit").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IndexLinkedPlanRedemptionTradeResponseInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'IndexLinkedPlanRedemptionTradeResponseInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(IndexLinkedPlanRedemptionTradeResponseInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, IndexLinkedPlanRedemptionTradeResponseInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IndexLinkedPlanRedemptionTradeResponseInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of IndexLinkedPlanRedemptionTradeResponseInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of IndexLinkedPlanRedemptionTradeResponseInner - * @throws IOException if the JSON string is invalid with respect to - * IndexLinkedPlanRedemptionTradeResponseInner - */ - public static IndexLinkedPlanRedemptionTradeResponseInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, IndexLinkedPlanRedemptionTradeResponseInner.class); - } - - /** - * Convert an instance of IndexLinkedPlanRedemptionTradeResponseInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanAdjustmentRequest.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanAdjustmentRequest.java deleted file mode 100644 index fa02e12a0..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanAdjustmentRequest.java +++ /dev/null @@ -1,519 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** InvestmentPlanAdjustmentRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class InvestmentPlanAdjustmentRequest { - public static final String SERIALIZED_NAME_PLAN_ID = "planId"; - - @SerializedName(SERIALIZED_NAME_PLAN_ID) - @jakarta.annotation.Nonnull - private Long planId; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_AMOUNT = "subscriptionAmount"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_AMOUNT) - @jakarta.annotation.Nonnull - private Double subscriptionAmount; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_CYCLE = "subscriptionCycle"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_CYCLE) - @jakarta.annotation.Nonnull - private String subscriptionCycle; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_START_TIME = "subscriptionStartTime"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_START_TIME) - @jakarta.annotation.Nonnull - private Long subscriptionStartTime; - - public static final String SERIALIZED_NAME_SOURCE_ASSET = "sourceAsset"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSET) - @jakarta.annotation.Nonnull - private String sourceAsset; - - public static final String SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE = "flexibleAllowedToUse"; - - @SerializedName(SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE) - @jakarta.annotation.Nullable - private Boolean flexibleAllowedToUse; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - - @SerializedName(SERIALIZED_NAME_DETAILS) - @jakarta.annotation.Nonnull - private Details details; - - public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; - - @SerializedName(SERIALIZED_NAME_RECV_WINDOW) - @jakarta.annotation.Nullable - private Long recvWindow; - - public InvestmentPlanAdjustmentRequest() {} - - public InvestmentPlanAdjustmentRequest planId(@jakarta.annotation.Nonnull Long planId) { - this.planId = planId; - return this; - } - - /** - * Get planId - * - * @return planId - */ - @jakarta.annotation.Nonnull - @NotNull - public Long getPlanId() { - return planId; - } - - public void setPlanId(@jakarta.annotation.Nonnull Long planId) { - this.planId = planId; - } - - public InvestmentPlanAdjustmentRequest subscriptionAmount( - @jakarta.annotation.Nonnull Double subscriptionAmount) { - this.subscriptionAmount = subscriptionAmount; - return this; - } - - /** - * Get subscriptionAmount - * - * @return subscriptionAmount - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Double getSubscriptionAmount() { - return subscriptionAmount; - } - - public void setSubscriptionAmount(@jakarta.annotation.Nonnull Double subscriptionAmount) { - this.subscriptionAmount = subscriptionAmount; - } - - public InvestmentPlanAdjustmentRequest subscriptionCycle( - @jakarta.annotation.Nonnull String subscriptionCycle) { - this.subscriptionCycle = subscriptionCycle; - return this; - } - - /** - * Get subscriptionCycle - * - * @return subscriptionCycle - */ - @jakarta.annotation.Nonnull - @NotNull - public String getSubscriptionCycle() { - return subscriptionCycle; - } - - public void setSubscriptionCycle(@jakarta.annotation.Nonnull String subscriptionCycle) { - this.subscriptionCycle = subscriptionCycle; - } - - public InvestmentPlanAdjustmentRequest subscriptionStartTime( - @jakarta.annotation.Nonnull Long subscriptionStartTime) { - this.subscriptionStartTime = subscriptionStartTime; - return this; - } - - /** - * Get subscriptionStartTime - * - * @return subscriptionStartTime - */ - @jakarta.annotation.Nonnull - @NotNull - public Long getSubscriptionStartTime() { - return subscriptionStartTime; - } - - public void setSubscriptionStartTime(@jakarta.annotation.Nonnull Long subscriptionStartTime) { - this.subscriptionStartTime = subscriptionStartTime; - } - - public InvestmentPlanAdjustmentRequest sourceAsset( - @jakarta.annotation.Nonnull String sourceAsset) { - this.sourceAsset = sourceAsset; - return this; - } - - /** - * Get sourceAsset - * - * @return sourceAsset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getSourceAsset() { - return sourceAsset; - } - - public void setSourceAsset(@jakarta.annotation.Nonnull String sourceAsset) { - this.sourceAsset = sourceAsset; - } - - public InvestmentPlanAdjustmentRequest flexibleAllowedToUse( - @jakarta.annotation.Nullable Boolean flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - return this; - } - - /** - * Get flexibleAllowedToUse - * - * @return flexibleAllowedToUse - */ - @jakarta.annotation.Nullable - public Boolean getFlexibleAllowedToUse() { - return flexibleAllowedToUse; - } - - public void setFlexibleAllowedToUse(@jakarta.annotation.Nullable Boolean flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - } - - public InvestmentPlanAdjustmentRequest details(@jakarta.annotation.Nonnull Details details) { - this.details = details; - return this; - } - - /** - * Get details - * - * @return details - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Details getDetails() { - return details; - } - - public void setDetails(@jakarta.annotation.Nonnull Details details) { - this.details = details; - } - - public InvestmentPlanAdjustmentRequest recvWindow( - @jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - return this; - } - - /** - * Get recvWindow - * - * @return recvWindow - */ - @jakarta.annotation.Nullable - public Long getRecvWindow() { - return recvWindow; - } - - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InvestmentPlanAdjustmentRequest investmentPlanAdjustmentRequest = - (InvestmentPlanAdjustmentRequest) o; - return Objects.equals(this.planId, investmentPlanAdjustmentRequest.planId) - && Objects.equals( - this.subscriptionAmount, investmentPlanAdjustmentRequest.subscriptionAmount) - && Objects.equals( - this.subscriptionCycle, investmentPlanAdjustmentRequest.subscriptionCycle) - && Objects.equals( - this.subscriptionStartTime, - investmentPlanAdjustmentRequest.subscriptionStartTime) - && Objects.equals(this.sourceAsset, investmentPlanAdjustmentRequest.sourceAsset) - && Objects.equals( - this.flexibleAllowedToUse, - investmentPlanAdjustmentRequest.flexibleAllowedToUse) - && Objects.equals(this.details, investmentPlanAdjustmentRequest.details) - && Objects.equals(this.recvWindow, investmentPlanAdjustmentRequest.recvWindow); - } - - @Override - public int hashCode() { - return Objects.hash( - planId, - subscriptionAmount, - subscriptionCycle, - subscriptionStartTime, - sourceAsset, - flexibleAllowedToUse, - details, - recvWindow); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InvestmentPlanAdjustmentRequest {\n"); - sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); - sb.append(" subscriptionAmount: ") - .append(toIndentedString(subscriptionAmount)) - .append("\n"); - sb.append(" subscriptionCycle: ").append(toIndentedString(subscriptionCycle)).append("\n"); - sb.append(" subscriptionStartTime: ") - .append(toIndentedString(subscriptionStartTime)) - .append("\n"); - sb.append(" sourceAsset: ").append(toIndentedString(sourceAsset)).append("\n"); - sb.append(" flexibleAllowedToUse: ") - .append(toIndentedString(flexibleAllowedToUse)) - .append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object planIdValue = getPlanId(); - String planIdValueAsString = ""; - planIdValueAsString = planIdValue.toString(); - sb.append("planId=").append(urlEncode(planIdValueAsString)).append(""); - Object subscriptionAmountValue = getSubscriptionAmount(); - String subscriptionAmountValueAsString = ""; - subscriptionAmountValueAsString = subscriptionAmountValue.toString(); - sb.append("subscriptionAmount=") - .append(urlEncode(subscriptionAmountValueAsString)) - .append(""); - Object subscriptionCycleValue = getSubscriptionCycle(); - String subscriptionCycleValueAsString = ""; - subscriptionCycleValueAsString = subscriptionCycleValue.toString(); - sb.append("subscriptionCycle=") - .append(urlEncode(subscriptionCycleValueAsString)) - .append(""); - Object subscriptionStartTimeValue = getSubscriptionStartTime(); - String subscriptionStartTimeValueAsString = ""; - subscriptionStartTimeValueAsString = subscriptionStartTimeValue.toString(); - sb.append("subscriptionStartTime=") - .append(urlEncode(subscriptionStartTimeValueAsString)) - .append(""); - Object sourceAssetValue = getSourceAsset(); - String sourceAssetValueAsString = ""; - sourceAssetValueAsString = sourceAssetValue.toString(); - sb.append("sourceAsset=").append(urlEncode(sourceAssetValueAsString)).append(""); - Object flexibleAllowedToUseValue = getFlexibleAllowedToUse(); - String flexibleAllowedToUseValueAsString = ""; - flexibleAllowedToUseValueAsString = flexibleAllowedToUseValue.toString(); - sb.append("flexibleAllowedToUse=") - .append(urlEncode(flexibleAllowedToUseValueAsString)) - .append(""); - Object detailsValue = getDetails(); - String detailsValueAsString = ""; - detailsValueAsString = detailsValue.toString(); - sb.append("details=").append(urlEncode(detailsValueAsString)).append(""); - Object recvWindowValue = getRecvWindow(); - String recvWindowValueAsString = ""; - recvWindowValueAsString = recvWindowValue.toString(); - sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("planId"); - openapiFields.add("subscriptionAmount"); - openapiFields.add("subscriptionCycle"); - openapiFields.add("subscriptionStartTime"); - openapiFields.add("sourceAsset"); - openapiFields.add("flexibleAllowedToUse"); - openapiFields.add("details"); - openapiFields.add("recvWindow"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("planId"); - openapiRequiredFields.add("subscriptionAmount"); - openapiRequiredFields.add("subscriptionCycle"); - openapiRequiredFields.add("subscriptionStartTime"); - openapiRequiredFields.add("sourceAsset"); - openapiRequiredFields.add("details"); - } - - /** - * 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 - * InvestmentPlanAdjustmentRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!InvestmentPlanAdjustmentRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in InvestmentPlanAdjustmentRequest is not" - + " found in the empty JSON string", - InvestmentPlanAdjustmentRequest.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!InvestmentPlanAdjustmentRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `InvestmentPlanAdjustmentRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InvestmentPlanAdjustmentRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("subscriptionCycle").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionCycle` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("subscriptionCycle").toString())); - } - if (!jsonObj.get("sourceAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceAsset").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InvestmentPlanAdjustmentRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InvestmentPlanAdjustmentRequest' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(InvestmentPlanAdjustmentRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, InvestmentPlanAdjustmentRequest value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InvestmentPlanAdjustmentRequest read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of InvestmentPlanAdjustmentRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvestmentPlanAdjustmentRequest - * @throws IOException if the JSON string is invalid with respect to - * InvestmentPlanAdjustmentRequest - */ - public static InvestmentPlanAdjustmentRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InvestmentPlanAdjustmentRequest.class); - } - - /** - * Convert an instance of InvestmentPlanAdjustmentRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanAdjustmentResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanAdjustmentResponse.java deleted file mode 100644 index fe5c359e0..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanAdjustmentResponse.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** InvestmentPlanAdjustmentResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class InvestmentPlanAdjustmentResponse { - public static final String SERIALIZED_NAME_PLAN_ID = "planId"; - - @SerializedName(SERIALIZED_NAME_PLAN_ID) - @jakarta.annotation.Nullable - private Long planId; - - public static final String SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME = "nextExecutionDateTime"; - - @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME) - @jakarta.annotation.Nullable - private Long nextExecutionDateTime; - - public InvestmentPlanAdjustmentResponse() {} - - public InvestmentPlanAdjustmentResponse planId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - return this; - } - - /** - * Get planId - * - * @return planId - */ - @jakarta.annotation.Nullable - public Long getPlanId() { - return planId; - } - - public void setPlanId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - } - - public InvestmentPlanAdjustmentResponse nextExecutionDateTime( - @jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; - return this; - } - - /** - * Get nextExecutionDateTime - * - * @return nextExecutionDateTime - */ - @jakarta.annotation.Nullable - public Long getNextExecutionDateTime() { - return nextExecutionDateTime; - } - - public void setNextExecutionDateTime(@jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InvestmentPlanAdjustmentResponse investmentPlanAdjustmentResponse = - (InvestmentPlanAdjustmentResponse) o; - return Objects.equals(this.planId, investmentPlanAdjustmentResponse.planId) - && Objects.equals( - this.nextExecutionDateTime, - investmentPlanAdjustmentResponse.nextExecutionDateTime); - } - - @Override - public int hashCode() { - return Objects.hash(planId, nextExecutionDateTime); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InvestmentPlanAdjustmentResponse {\n"); - sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); - sb.append(" nextExecutionDateTime: ") - .append(toIndentedString(nextExecutionDateTime)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object planIdValue = getPlanId(); - String planIdValueAsString = ""; - planIdValueAsString = planIdValue.toString(); - sb.append("planId=").append(urlEncode(planIdValueAsString)).append(""); - Object nextExecutionDateTimeValue = getNextExecutionDateTime(); - String nextExecutionDateTimeValueAsString = ""; - nextExecutionDateTimeValueAsString = nextExecutionDateTimeValue.toString(); - sb.append("nextExecutionDateTime=") - .append(urlEncode(nextExecutionDateTimeValueAsString)) - .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("planId"); - openapiFields.add("nextExecutionDateTime"); - - // 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 - * InvestmentPlanAdjustmentResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!InvestmentPlanAdjustmentResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in InvestmentPlanAdjustmentResponse is" - + " not found in the empty JSON string", - InvestmentPlanAdjustmentResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!InvestmentPlanAdjustmentResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `InvestmentPlanAdjustmentResponse` 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 (!InvestmentPlanAdjustmentResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InvestmentPlanAdjustmentResponse' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(InvestmentPlanAdjustmentResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, InvestmentPlanAdjustmentResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InvestmentPlanAdjustmentResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of InvestmentPlanAdjustmentResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvestmentPlanAdjustmentResponse - * @throws IOException if the JSON string is invalid with respect to - * InvestmentPlanAdjustmentResponse - */ - public static InvestmentPlanAdjustmentResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InvestmentPlanAdjustmentResponse.class); - } - - /** - * Convert an instance of InvestmentPlanAdjustmentResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanCreationRequest.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanCreationRequest.java deleted file mode 100644 index 05727ccb5..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanCreationRequest.java +++ /dev/null @@ -1,633 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** InvestmentPlanCreationRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class InvestmentPlanCreationRequest { - public static final String SERIALIZED_NAME_SOURCE_TYPE = "sourceType"; - - @SerializedName(SERIALIZED_NAME_SOURCE_TYPE) - @jakarta.annotation.Nonnull - private String sourceType; - - public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; - - @SerializedName(SERIALIZED_NAME_REQUEST_ID) - @jakarta.annotation.Nullable - private Long requestId; - - public static final String SERIALIZED_NAME_PLAN_TYPE = "planType"; - - @SerializedName(SERIALIZED_NAME_PLAN_TYPE) - @jakarta.annotation.Nonnull - private String planType; - - public static final String SERIALIZED_NAME_INDEX_ID = "indexId"; - - @SerializedName(SERIALIZED_NAME_INDEX_ID) - @jakarta.annotation.Nullable - private Long indexId; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_AMOUNT = "subscriptionAmount"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_AMOUNT) - @jakarta.annotation.Nonnull - private Double subscriptionAmount; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_CYCLE = "subscriptionCycle"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_CYCLE) - @jakarta.annotation.Nonnull - private String subscriptionCycle; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_START_TIME = "subscriptionStartTime"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_START_TIME) - @jakarta.annotation.Nonnull - private Long subscriptionStartTime; - - public static final String SERIALIZED_NAME_SOURCE_ASSET = "sourceAsset"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSET) - @jakarta.annotation.Nonnull - private String sourceAsset; - - public static final String SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE = "flexibleAllowedToUse"; - - @SerializedName(SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE) - @jakarta.annotation.Nullable - private Boolean flexibleAllowedToUse; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - - @SerializedName(SERIALIZED_NAME_DETAILS) - @jakarta.annotation.Nonnull - private Details details; - - public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; - - @SerializedName(SERIALIZED_NAME_RECV_WINDOW) - @jakarta.annotation.Nullable - private Long recvWindow; - - public InvestmentPlanCreationRequest() {} - - public InvestmentPlanCreationRequest sourceType(@jakarta.annotation.Nonnull String sourceType) { - this.sourceType = sourceType; - return this; - } - - /** - * Get sourceType - * - * @return sourceType - */ - @jakarta.annotation.Nonnull - @NotNull - public String getSourceType() { - return sourceType; - } - - public void setSourceType(@jakarta.annotation.Nonnull String sourceType) { - this.sourceType = sourceType; - } - - public InvestmentPlanCreationRequest requestId(@jakarta.annotation.Nullable Long requestId) { - this.requestId = requestId; - return this; - } - - /** - * Get requestId - * - * @return requestId - */ - @jakarta.annotation.Nullable - public Long getRequestId() { - return requestId; - } - - public void setRequestId(@jakarta.annotation.Nullable Long requestId) { - this.requestId = requestId; - } - - public InvestmentPlanCreationRequest planType(@jakarta.annotation.Nonnull String planType) { - this.planType = planType; - return this; - } - - /** - * Get planType - * - * @return planType - */ - @jakarta.annotation.Nonnull - @NotNull - public String getPlanType() { - return planType; - } - - public void setPlanType(@jakarta.annotation.Nonnull String planType) { - this.planType = planType; - } - - public InvestmentPlanCreationRequest indexId(@jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - return this; - } - - /** - * Get indexId - * - * @return indexId - */ - @jakarta.annotation.Nullable - public Long getIndexId() { - return indexId; - } - - public void setIndexId(@jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - } - - public InvestmentPlanCreationRequest subscriptionAmount( - @jakarta.annotation.Nonnull Double subscriptionAmount) { - this.subscriptionAmount = subscriptionAmount; - return this; - } - - /** - * Get subscriptionAmount - * - * @return subscriptionAmount - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Double getSubscriptionAmount() { - return subscriptionAmount; - } - - public void setSubscriptionAmount(@jakarta.annotation.Nonnull Double subscriptionAmount) { - this.subscriptionAmount = subscriptionAmount; - } - - public InvestmentPlanCreationRequest subscriptionCycle( - @jakarta.annotation.Nonnull String subscriptionCycle) { - this.subscriptionCycle = subscriptionCycle; - return this; - } - - /** - * Get subscriptionCycle - * - * @return subscriptionCycle - */ - @jakarta.annotation.Nonnull - @NotNull - public String getSubscriptionCycle() { - return subscriptionCycle; - } - - public void setSubscriptionCycle(@jakarta.annotation.Nonnull String subscriptionCycle) { - this.subscriptionCycle = subscriptionCycle; - } - - public InvestmentPlanCreationRequest subscriptionStartTime( - @jakarta.annotation.Nonnull Long subscriptionStartTime) { - this.subscriptionStartTime = subscriptionStartTime; - return this; - } - - /** - * Get subscriptionStartTime - * - * @return subscriptionStartTime - */ - @jakarta.annotation.Nonnull - @NotNull - public Long getSubscriptionStartTime() { - return subscriptionStartTime; - } - - public void setSubscriptionStartTime(@jakarta.annotation.Nonnull Long subscriptionStartTime) { - this.subscriptionStartTime = subscriptionStartTime; - } - - public InvestmentPlanCreationRequest sourceAsset( - @jakarta.annotation.Nonnull String sourceAsset) { - this.sourceAsset = sourceAsset; - return this; - } - - /** - * Get sourceAsset - * - * @return sourceAsset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getSourceAsset() { - return sourceAsset; - } - - public void setSourceAsset(@jakarta.annotation.Nonnull String sourceAsset) { - this.sourceAsset = sourceAsset; - } - - public InvestmentPlanCreationRequest flexibleAllowedToUse( - @jakarta.annotation.Nullable Boolean flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - return this; - } - - /** - * Get flexibleAllowedToUse - * - * @return flexibleAllowedToUse - */ - @jakarta.annotation.Nullable - public Boolean getFlexibleAllowedToUse() { - return flexibleAllowedToUse; - } - - public void setFlexibleAllowedToUse(@jakarta.annotation.Nullable Boolean flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - } - - public InvestmentPlanCreationRequest details(@jakarta.annotation.Nonnull Details details) { - this.details = details; - return this; - } - - /** - * Get details - * - * @return details - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Details getDetails() { - return details; - } - - public void setDetails(@jakarta.annotation.Nonnull Details details) { - this.details = details; - } - - public InvestmentPlanCreationRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - return this; - } - - /** - * Get recvWindow - * - * @return recvWindow - */ - @jakarta.annotation.Nullable - public Long getRecvWindow() { - return recvWindow; - } - - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InvestmentPlanCreationRequest investmentPlanCreationRequest = - (InvestmentPlanCreationRequest) o; - return Objects.equals(this.sourceType, investmentPlanCreationRequest.sourceType) - && Objects.equals(this.requestId, investmentPlanCreationRequest.requestId) - && Objects.equals(this.planType, investmentPlanCreationRequest.planType) - && Objects.equals(this.indexId, investmentPlanCreationRequest.indexId) - && Objects.equals( - this.subscriptionAmount, investmentPlanCreationRequest.subscriptionAmount) - && Objects.equals( - this.subscriptionCycle, investmentPlanCreationRequest.subscriptionCycle) - && Objects.equals( - this.subscriptionStartTime, - investmentPlanCreationRequest.subscriptionStartTime) - && Objects.equals(this.sourceAsset, investmentPlanCreationRequest.sourceAsset) - && Objects.equals( - this.flexibleAllowedToUse, - investmentPlanCreationRequest.flexibleAllowedToUse) - && Objects.equals(this.details, investmentPlanCreationRequest.details) - && Objects.equals(this.recvWindow, investmentPlanCreationRequest.recvWindow); - } - - @Override - public int hashCode() { - return Objects.hash( - sourceType, - requestId, - planType, - indexId, - subscriptionAmount, - subscriptionCycle, - subscriptionStartTime, - sourceAsset, - flexibleAllowedToUse, - details, - recvWindow); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InvestmentPlanCreationRequest {\n"); - sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); - sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); - sb.append(" planType: ").append(toIndentedString(planType)).append("\n"); - sb.append(" indexId: ").append(toIndentedString(indexId)).append("\n"); - sb.append(" subscriptionAmount: ") - .append(toIndentedString(subscriptionAmount)) - .append("\n"); - sb.append(" subscriptionCycle: ").append(toIndentedString(subscriptionCycle)).append("\n"); - sb.append(" subscriptionStartTime: ") - .append(toIndentedString(subscriptionStartTime)) - .append("\n"); - sb.append(" sourceAsset: ").append(toIndentedString(sourceAsset)).append("\n"); - sb.append(" flexibleAllowedToUse: ") - .append(toIndentedString(flexibleAllowedToUse)) - .append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object sourceTypeValue = getSourceType(); - String sourceTypeValueAsString = ""; - sourceTypeValueAsString = sourceTypeValue.toString(); - sb.append("sourceType=").append(urlEncode(sourceTypeValueAsString)).append(""); - Object requestIdValue = getRequestId(); - String requestIdValueAsString = ""; - requestIdValueAsString = requestIdValue.toString(); - sb.append("requestId=").append(urlEncode(requestIdValueAsString)).append(""); - Object planTypeValue = getPlanType(); - String planTypeValueAsString = ""; - planTypeValueAsString = planTypeValue.toString(); - sb.append("planType=").append(urlEncode(planTypeValueAsString)).append(""); - Object indexIdValue = getIndexId(); - String indexIdValueAsString = ""; - indexIdValueAsString = indexIdValue.toString(); - sb.append("indexId=").append(urlEncode(indexIdValueAsString)).append(""); - Object subscriptionAmountValue = getSubscriptionAmount(); - String subscriptionAmountValueAsString = ""; - subscriptionAmountValueAsString = subscriptionAmountValue.toString(); - sb.append("subscriptionAmount=") - .append(urlEncode(subscriptionAmountValueAsString)) - .append(""); - Object subscriptionCycleValue = getSubscriptionCycle(); - String subscriptionCycleValueAsString = ""; - subscriptionCycleValueAsString = subscriptionCycleValue.toString(); - sb.append("subscriptionCycle=") - .append(urlEncode(subscriptionCycleValueAsString)) - .append(""); - Object subscriptionStartTimeValue = getSubscriptionStartTime(); - String subscriptionStartTimeValueAsString = ""; - subscriptionStartTimeValueAsString = subscriptionStartTimeValue.toString(); - sb.append("subscriptionStartTime=") - .append(urlEncode(subscriptionStartTimeValueAsString)) - .append(""); - Object sourceAssetValue = getSourceAsset(); - String sourceAssetValueAsString = ""; - sourceAssetValueAsString = sourceAssetValue.toString(); - sb.append("sourceAsset=").append(urlEncode(sourceAssetValueAsString)).append(""); - Object flexibleAllowedToUseValue = getFlexibleAllowedToUse(); - String flexibleAllowedToUseValueAsString = ""; - flexibleAllowedToUseValueAsString = flexibleAllowedToUseValue.toString(); - sb.append("flexibleAllowedToUse=") - .append(urlEncode(flexibleAllowedToUseValueAsString)) - .append(""); - Object detailsValue = getDetails(); - String detailsValueAsString = ""; - detailsValueAsString = detailsValue.toString(); - sb.append("details=").append(urlEncode(detailsValueAsString)).append(""); - Object recvWindowValue = getRecvWindow(); - String recvWindowValueAsString = ""; - recvWindowValueAsString = recvWindowValue.toString(); - sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceType"); - openapiFields.add("requestId"); - openapiFields.add("planType"); - openapiFields.add("indexId"); - openapiFields.add("subscriptionAmount"); - openapiFields.add("subscriptionCycle"); - openapiFields.add("subscriptionStartTime"); - openapiFields.add("sourceAsset"); - openapiFields.add("flexibleAllowedToUse"); - openapiFields.add("details"); - openapiFields.add("recvWindow"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("sourceType"); - openapiRequiredFields.add("planType"); - openapiRequiredFields.add("subscriptionAmount"); - openapiRequiredFields.add("subscriptionCycle"); - openapiRequiredFields.add("subscriptionStartTime"); - openapiRequiredFields.add("sourceAsset"); - openapiRequiredFields.add("details"); - } - - /** - * 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 - * InvestmentPlanCreationRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!InvestmentPlanCreationRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in InvestmentPlanCreationRequest is not" - + " found in the empty JSON string", - InvestmentPlanCreationRequest.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!InvestmentPlanCreationRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `InvestmentPlanCreationRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InvestmentPlanCreationRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("sourceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceType").toString())); - } - if (!jsonObj.get("planType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `planType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("planType").toString())); - } - if (!jsonObj.get("subscriptionCycle").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionCycle` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("subscriptionCycle").toString())); - } - if (!jsonObj.get("sourceAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceAsset").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InvestmentPlanCreationRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InvestmentPlanCreationRequest' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(InvestmentPlanCreationRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, InvestmentPlanCreationRequest value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InvestmentPlanCreationRequest read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of InvestmentPlanCreationRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvestmentPlanCreationRequest - * @throws IOException if the JSON string is invalid with respect to - * InvestmentPlanCreationRequest - */ - public static InvestmentPlanCreationRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InvestmentPlanCreationRequest.class); - } - - /** - * Convert an instance of InvestmentPlanCreationRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/OneTimeTransactionRequest.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/OneTimeTransactionRequest.java deleted file mode 100644 index 4565771f9..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/OneTimeTransactionRequest.java +++ /dev/null @@ -1,529 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** OneTimeTransactionRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OneTimeTransactionRequest { - public static final String SERIALIZED_NAME_SOURCE_TYPE = "sourceType"; - - @SerializedName(SERIALIZED_NAME_SOURCE_TYPE) - @jakarta.annotation.Nonnull - private String sourceType; - - public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; - - @SerializedName(SERIALIZED_NAME_REQUEST_ID) - @jakarta.annotation.Nullable - private Long requestId; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_AMOUNT = "subscriptionAmount"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_AMOUNT) - @jakarta.annotation.Nonnull - private Double subscriptionAmount; - - public static final String SERIALIZED_NAME_SOURCE_ASSET = "sourceAsset"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSET) - @jakarta.annotation.Nonnull - private String sourceAsset; - - public static final String SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE = "flexibleAllowedToUse"; - - @SerializedName(SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE) - @jakarta.annotation.Nullable - private Boolean flexibleAllowedToUse; - - public static final String SERIALIZED_NAME_PLAN_ID = "planId"; - - @SerializedName(SERIALIZED_NAME_PLAN_ID) - @jakarta.annotation.Nullable - private Long planId; - - public static final String SERIALIZED_NAME_INDEX_ID = "indexId"; - - @SerializedName(SERIALIZED_NAME_INDEX_ID) - @jakarta.annotation.Nullable - private Long indexId; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - - @SerializedName(SERIALIZED_NAME_DETAILS) - @jakarta.annotation.Nonnull - private Details details; - - public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; - - @SerializedName(SERIALIZED_NAME_RECV_WINDOW) - @jakarta.annotation.Nullable - private Long recvWindow; - - public OneTimeTransactionRequest() {} - - public OneTimeTransactionRequest sourceType(@jakarta.annotation.Nonnull String sourceType) { - this.sourceType = sourceType; - return this; - } - - /** - * Get sourceType - * - * @return sourceType - */ - @jakarta.annotation.Nonnull - @NotNull - public String getSourceType() { - return sourceType; - } - - public void setSourceType(@jakarta.annotation.Nonnull String sourceType) { - this.sourceType = sourceType; - } - - public OneTimeTransactionRequest requestId(@jakarta.annotation.Nullable Long requestId) { - this.requestId = requestId; - return this; - } - - /** - * Get requestId - * - * @return requestId - */ - @jakarta.annotation.Nullable - public Long getRequestId() { - return requestId; - } - - public void setRequestId(@jakarta.annotation.Nullable Long requestId) { - this.requestId = requestId; - } - - public OneTimeTransactionRequest subscriptionAmount( - @jakarta.annotation.Nonnull Double subscriptionAmount) { - this.subscriptionAmount = subscriptionAmount; - return this; - } - - /** - * Get subscriptionAmount - * - * @return subscriptionAmount - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Double getSubscriptionAmount() { - return subscriptionAmount; - } - - public void setSubscriptionAmount(@jakarta.annotation.Nonnull Double subscriptionAmount) { - this.subscriptionAmount = subscriptionAmount; - } - - public OneTimeTransactionRequest sourceAsset(@jakarta.annotation.Nonnull String sourceAsset) { - this.sourceAsset = sourceAsset; - return this; - } - - /** - * Get sourceAsset - * - * @return sourceAsset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getSourceAsset() { - return sourceAsset; - } - - public void setSourceAsset(@jakarta.annotation.Nonnull String sourceAsset) { - this.sourceAsset = sourceAsset; - } - - public OneTimeTransactionRequest flexibleAllowedToUse( - @jakarta.annotation.Nullable Boolean flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - return this; - } - - /** - * Get flexibleAllowedToUse - * - * @return flexibleAllowedToUse - */ - @jakarta.annotation.Nullable - public Boolean getFlexibleAllowedToUse() { - return flexibleAllowedToUse; - } - - public void setFlexibleAllowedToUse(@jakarta.annotation.Nullable Boolean flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - } - - public OneTimeTransactionRequest planId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - return this; - } - - /** - * Get planId - * - * @return planId - */ - @jakarta.annotation.Nullable - public Long getPlanId() { - return planId; - } - - public void setPlanId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - } - - public OneTimeTransactionRequest indexId(@jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - return this; - } - - /** - * Get indexId - * - * @return indexId - */ - @jakarta.annotation.Nullable - public Long getIndexId() { - return indexId; - } - - public void setIndexId(@jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - } - - public OneTimeTransactionRequest details(@jakarta.annotation.Nonnull Details details) { - this.details = details; - return this; - } - - /** - * Get details - * - * @return details - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Details getDetails() { - return details; - } - - public void setDetails(@jakarta.annotation.Nonnull Details details) { - this.details = details; - } - - public OneTimeTransactionRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - return this; - } - - /** - * Get recvWindow - * - * @return recvWindow - */ - @jakarta.annotation.Nullable - public Long getRecvWindow() { - return recvWindow; - } - - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OneTimeTransactionRequest oneTimeTransactionRequest = (OneTimeTransactionRequest) o; - return Objects.equals(this.sourceType, oneTimeTransactionRequest.sourceType) - && Objects.equals(this.requestId, oneTimeTransactionRequest.requestId) - && Objects.equals( - this.subscriptionAmount, oneTimeTransactionRequest.subscriptionAmount) - && Objects.equals(this.sourceAsset, oneTimeTransactionRequest.sourceAsset) - && Objects.equals( - this.flexibleAllowedToUse, oneTimeTransactionRequest.flexibleAllowedToUse) - && Objects.equals(this.planId, oneTimeTransactionRequest.planId) - && Objects.equals(this.indexId, oneTimeTransactionRequest.indexId) - && Objects.equals(this.details, oneTimeTransactionRequest.details) - && Objects.equals(this.recvWindow, oneTimeTransactionRequest.recvWindow); - } - - @Override - public int hashCode() { - return Objects.hash( - sourceType, - requestId, - subscriptionAmount, - sourceAsset, - flexibleAllowedToUse, - planId, - indexId, - details, - recvWindow); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OneTimeTransactionRequest {\n"); - sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); - sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); - sb.append(" subscriptionAmount: ") - .append(toIndentedString(subscriptionAmount)) - .append("\n"); - sb.append(" sourceAsset: ").append(toIndentedString(sourceAsset)).append("\n"); - sb.append(" flexibleAllowedToUse: ") - .append(toIndentedString(flexibleAllowedToUse)) - .append("\n"); - sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); - sb.append(" indexId: ").append(toIndentedString(indexId)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object sourceTypeValue = getSourceType(); - String sourceTypeValueAsString = ""; - sourceTypeValueAsString = sourceTypeValue.toString(); - sb.append("sourceType=").append(urlEncode(sourceTypeValueAsString)).append(""); - Object requestIdValue = getRequestId(); - String requestIdValueAsString = ""; - requestIdValueAsString = requestIdValue.toString(); - sb.append("requestId=").append(urlEncode(requestIdValueAsString)).append(""); - Object subscriptionAmountValue = getSubscriptionAmount(); - String subscriptionAmountValueAsString = ""; - subscriptionAmountValueAsString = subscriptionAmountValue.toString(); - sb.append("subscriptionAmount=") - .append(urlEncode(subscriptionAmountValueAsString)) - .append(""); - Object sourceAssetValue = getSourceAsset(); - String sourceAssetValueAsString = ""; - sourceAssetValueAsString = sourceAssetValue.toString(); - sb.append("sourceAsset=").append(urlEncode(sourceAssetValueAsString)).append(""); - Object flexibleAllowedToUseValue = getFlexibleAllowedToUse(); - String flexibleAllowedToUseValueAsString = ""; - flexibleAllowedToUseValueAsString = flexibleAllowedToUseValue.toString(); - sb.append("flexibleAllowedToUse=") - .append(urlEncode(flexibleAllowedToUseValueAsString)) - .append(""); - Object planIdValue = getPlanId(); - String planIdValueAsString = ""; - planIdValueAsString = planIdValue.toString(); - sb.append("planId=").append(urlEncode(planIdValueAsString)).append(""); - Object indexIdValue = getIndexId(); - String indexIdValueAsString = ""; - indexIdValueAsString = indexIdValue.toString(); - sb.append("indexId=").append(urlEncode(indexIdValueAsString)).append(""); - Object detailsValue = getDetails(); - String detailsValueAsString = ""; - detailsValueAsString = detailsValue.toString(); - sb.append("details=").append(urlEncode(detailsValueAsString)).append(""); - Object recvWindowValue = getRecvWindow(); - String recvWindowValueAsString = ""; - recvWindowValueAsString = recvWindowValue.toString(); - sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceType"); - openapiFields.add("requestId"); - openapiFields.add("subscriptionAmount"); - openapiFields.add("sourceAsset"); - openapiFields.add("flexibleAllowedToUse"); - openapiFields.add("planId"); - openapiFields.add("indexId"); - openapiFields.add("details"); - openapiFields.add("recvWindow"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("sourceType"); - openapiRequiredFields.add("subscriptionAmount"); - openapiRequiredFields.add("sourceAsset"); - openapiRequiredFields.add("details"); - } - - /** - * 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 OneTimeTransactionRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OneTimeTransactionRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in OneTimeTransactionRequest is not found" - + " in the empty JSON string", - OneTimeTransactionRequest.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OneTimeTransactionRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OneTimeTransactionRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : OneTimeTransactionRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("sourceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceType").toString())); - } - if (!jsonObj.get("sourceAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceAsset").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OneTimeTransactionRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OneTimeTransactionRequest' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(OneTimeTransactionRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, OneTimeTransactionRequest value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OneTimeTransactionRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OneTimeTransactionRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of OneTimeTransactionRequest - * @throws IOException if the JSON string is invalid with respect to OneTimeTransactionRequest - */ - public static OneTimeTransactionRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OneTimeTransactionRequest.class); - } - - /** - * Convert an instance of OneTimeTransactionRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryAllSourceAssetAndTargetAssetResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryAllSourceAssetAndTargetAssetResponse.java deleted file mode 100644 index cbab73b57..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryAllSourceAssetAndTargetAssetResponse.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** QueryAllSourceAssetAndTargetAssetResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QueryAllSourceAssetAndTargetAssetResponse { - public static final String SERIALIZED_NAME_TARGET_ASSETS = "targetAssets"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSETS) - @jakarta.annotation.Nullable - private List targetAssets; - - public static final String SERIALIZED_NAME_SOURCE_ASSETS = "sourceAssets"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSETS) - @jakarta.annotation.Nullable - private List sourceAssets; - - public QueryAllSourceAssetAndTargetAssetResponse() {} - - public QueryAllSourceAssetAndTargetAssetResponse targetAssets( - @jakarta.annotation.Nullable List targetAssets) { - this.targetAssets = targetAssets; - return this; - } - - public QueryAllSourceAssetAndTargetAssetResponse addTargetAssetsItem(String targetAssetsItem) { - if (this.targetAssets == null) { - this.targetAssets = new ArrayList<>(); - } - this.targetAssets.add(targetAssetsItem); - return this; - } - - /** - * Get targetAssets - * - * @return targetAssets - */ - @jakarta.annotation.Nullable - public List getTargetAssets() { - return targetAssets; - } - - public void setTargetAssets(@jakarta.annotation.Nullable List targetAssets) { - this.targetAssets = targetAssets; - } - - public QueryAllSourceAssetAndTargetAssetResponse sourceAssets( - @jakarta.annotation.Nullable List sourceAssets) { - this.sourceAssets = sourceAssets; - return this; - } - - public QueryAllSourceAssetAndTargetAssetResponse addSourceAssetsItem(String sourceAssetsItem) { - if (this.sourceAssets == null) { - this.sourceAssets = new ArrayList<>(); - } - this.sourceAssets.add(sourceAssetsItem); - return this; - } - - /** - * Get sourceAssets - * - * @return sourceAssets - */ - @jakarta.annotation.Nullable - public List getSourceAssets() { - return sourceAssets; - } - - public void setSourceAssets(@jakarta.annotation.Nullable List sourceAssets) { - this.sourceAssets = sourceAssets; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryAllSourceAssetAndTargetAssetResponse queryAllSourceAssetAndTargetAssetResponse = - (QueryAllSourceAssetAndTargetAssetResponse) o; - return Objects.equals( - this.targetAssets, queryAllSourceAssetAndTargetAssetResponse.targetAssets) - && Objects.equals( - this.sourceAssets, queryAllSourceAssetAndTargetAssetResponse.sourceAssets); - } - - @Override - public int hashCode() { - return Objects.hash(targetAssets, sourceAssets); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryAllSourceAssetAndTargetAssetResponse {\n"); - sb.append(" targetAssets: ").append(toIndentedString(targetAssets)).append("\n"); - sb.append(" sourceAssets: ").append(toIndentedString(sourceAssets)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object targetAssetsValue = getTargetAssets(); - String targetAssetsValueAsString = ""; - targetAssetsValueAsString = - (String) - ((Collection) targetAssetsValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("targetAssets=").append(urlEncode(targetAssetsValueAsString)).append(""); - Object sourceAssetsValue = getSourceAssets(); - String sourceAssetsValueAsString = ""; - sourceAssetsValueAsString = - (String) - ((Collection) sourceAssetsValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("sourceAssets=").append(urlEncode(sourceAssetsValueAsString)).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("targetAssets"); - openapiFields.add("sourceAssets"); - - // 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 - * QueryAllSourceAssetAndTargetAssetResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueryAllSourceAssetAndTargetAssetResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " QueryAllSourceAssetAndTargetAssetResponse is not found in" - + " the empty JSON string", - QueryAllSourceAssetAndTargetAssetResponse.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllSourceAssetAndTargetAssetResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllSourceAssetAndTargetAssetResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("targetAssets") != null - && !jsonObj.get("targetAssets").isJsonNull() - && !jsonObj.get("targetAssets").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAssets` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("targetAssets").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("sourceAssets") != null - && !jsonObj.get("sourceAssets").isJsonNull() - && !jsonObj.get("sourceAssets").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAssets` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("sourceAssets").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryAllSourceAssetAndTargetAssetResponse.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'QueryAllSourceAssetAndTargetAssetResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(QueryAllSourceAssetAndTargetAssetResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, QueryAllSourceAssetAndTargetAssetResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QueryAllSourceAssetAndTargetAssetResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QueryAllSourceAssetAndTargetAssetResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryAllSourceAssetAndTargetAssetResponse - * @throws IOException if the JSON string is invalid with respect to - * QueryAllSourceAssetAndTargetAssetResponse - */ - public static QueryAllSourceAssetAndTargetAssetResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, QueryAllSourceAssetAndTargetAssetResponse.class); - } - - /** - * Convert an instance of QueryAllSourceAssetAndTargetAssetResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryHoldingDetailsOfThePlanResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryHoldingDetailsOfThePlanResponse.java deleted file mode 100644 index c7912e5a6..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryHoldingDetailsOfThePlanResponse.java +++ /dev/null @@ -1,856 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** QueryHoldingDetailsOfThePlanResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QueryHoldingDetailsOfThePlanResponse { - public static final String SERIALIZED_NAME_PLAN_ID = "planId"; - - @SerializedName(SERIALIZED_NAME_PLAN_ID) - @jakarta.annotation.Nullable - private Long planId; - - public static final String SERIALIZED_NAME_PLAN_TYPE = "planType"; - - @SerializedName(SERIALIZED_NAME_PLAN_TYPE) - @jakarta.annotation.Nullable - private String planType; - - public static final String SERIALIZED_NAME_EDIT_ALLOWED = "editAllowed"; - - @SerializedName(SERIALIZED_NAME_EDIT_ALLOWED) - @jakarta.annotation.Nullable - private String editAllowed; - - public static final String SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE = "flexibleAllowedToUse"; - - @SerializedName(SERIALIZED_NAME_FLEXIBLE_ALLOWED_TO_USE) - @jakarta.annotation.Nullable - private String flexibleAllowedToUse; - - public static final String SERIALIZED_NAME_CREATION_DATE_TIME = "creationDateTime"; - - @SerializedName(SERIALIZED_NAME_CREATION_DATE_TIME) - @jakarta.annotation.Nullable - private Long creationDateTime; - - public static final String SERIALIZED_NAME_FIRST_EXECUTION_DATE_TIME = "firstExecutionDateTime"; - - @SerializedName(SERIALIZED_NAME_FIRST_EXECUTION_DATE_TIME) - @jakarta.annotation.Nullable - private Long firstExecutionDateTime; - - public static final String SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME = "nextExecutionDateTime"; - - @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME) - @jakarta.annotation.Nullable - private Long nextExecutionDateTime; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nullable - private String targetAsset; - - public static final String SERIALIZED_NAME_SOURCE_ASSET = "sourceAsset"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSET) - @jakarta.annotation.Nullable - private String sourceAsset; - - public static final String SERIALIZED_NAME_PLAN_VALUE_IN_U_S_D = "planValueInUSD"; - - @SerializedName(SERIALIZED_NAME_PLAN_VALUE_IN_U_S_D) - @jakarta.annotation.Nullable - private String planValueInUSD; - - public static final String SERIALIZED_NAME_PNL_IN_U_S_D = "pnlInUSD"; - - @SerializedName(SERIALIZED_NAME_PNL_IN_U_S_D) - @jakarta.annotation.Nullable - private String pnlInUSD; - - public static final String SERIALIZED_NAME_ROI = "roi"; - - @SerializedName(SERIALIZED_NAME_ROI) - @jakarta.annotation.Nullable - private String roi; - - public static final String SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D = "totalInvestedInUSD"; - - @SerializedName(SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D) - @jakarta.annotation.Nullable - private String totalInvestedInUSD; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - - @SerializedName(SERIALIZED_NAME_DETAILS) - @jakarta.annotation.Nullable - private List<@Valid QueryHoldingDetailsOfThePlanResponseDetailsInner> details; - - public QueryHoldingDetailsOfThePlanResponse() {} - - public QueryHoldingDetailsOfThePlanResponse planId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - return this; - } - - /** - * Get planId - * - * @return planId - */ - @jakarta.annotation.Nullable - public Long getPlanId() { - return planId; - } - - public void setPlanId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - } - - public QueryHoldingDetailsOfThePlanResponse planType( - @jakarta.annotation.Nullable String planType) { - this.planType = planType; - return this; - } - - /** - * Get planType - * - * @return planType - */ - @jakarta.annotation.Nullable - public String getPlanType() { - return planType; - } - - public void setPlanType(@jakarta.annotation.Nullable String planType) { - this.planType = planType; - } - - public QueryHoldingDetailsOfThePlanResponse editAllowed( - @jakarta.annotation.Nullable String editAllowed) { - this.editAllowed = editAllowed; - return this; - } - - /** - * Get editAllowed - * - * @return editAllowed - */ - @jakarta.annotation.Nullable - public String getEditAllowed() { - return editAllowed; - } - - public void setEditAllowed(@jakarta.annotation.Nullable String editAllowed) { - this.editAllowed = editAllowed; - } - - public QueryHoldingDetailsOfThePlanResponse flexibleAllowedToUse( - @jakarta.annotation.Nullable String flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - return this; - } - - /** - * Get flexibleAllowedToUse - * - * @return flexibleAllowedToUse - */ - @jakarta.annotation.Nullable - public String getFlexibleAllowedToUse() { - return flexibleAllowedToUse; - } - - public void setFlexibleAllowedToUse(@jakarta.annotation.Nullable String flexibleAllowedToUse) { - this.flexibleAllowedToUse = flexibleAllowedToUse; - } - - public QueryHoldingDetailsOfThePlanResponse creationDateTime( - @jakarta.annotation.Nullable Long creationDateTime) { - this.creationDateTime = creationDateTime; - return this; - } - - /** - * Get creationDateTime - * - * @return creationDateTime - */ - @jakarta.annotation.Nullable - public Long getCreationDateTime() { - return creationDateTime; - } - - public void setCreationDateTime(@jakarta.annotation.Nullable Long creationDateTime) { - this.creationDateTime = creationDateTime; - } - - public QueryHoldingDetailsOfThePlanResponse firstExecutionDateTime( - @jakarta.annotation.Nullable Long firstExecutionDateTime) { - this.firstExecutionDateTime = firstExecutionDateTime; - return this; - } - - /** - * Get firstExecutionDateTime - * - * @return firstExecutionDateTime - */ - @jakarta.annotation.Nullable - public Long getFirstExecutionDateTime() { - return firstExecutionDateTime; - } - - public void setFirstExecutionDateTime( - @jakarta.annotation.Nullable Long firstExecutionDateTime) { - this.firstExecutionDateTime = firstExecutionDateTime; - } - - public QueryHoldingDetailsOfThePlanResponse nextExecutionDateTime( - @jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; - return this; - } - - /** - * Get nextExecutionDateTime - * - * @return nextExecutionDateTime - */ - @jakarta.annotation.Nullable - public Long getNextExecutionDateTime() { - return nextExecutionDateTime; - } - - public void setNextExecutionDateTime(@jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; - } - - public QueryHoldingDetailsOfThePlanResponse status(@jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - public QueryHoldingDetailsOfThePlanResponse targetAsset( - @jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nullable - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - } - - public QueryHoldingDetailsOfThePlanResponse sourceAsset( - @jakarta.annotation.Nullable String sourceAsset) { - this.sourceAsset = sourceAsset; - return this; - } - - /** - * Get sourceAsset - * - * @return sourceAsset - */ - @jakarta.annotation.Nullable - public String getSourceAsset() { - return sourceAsset; - } - - public void setSourceAsset(@jakarta.annotation.Nullable String sourceAsset) { - this.sourceAsset = sourceAsset; - } - - public QueryHoldingDetailsOfThePlanResponse planValueInUSD( - @jakarta.annotation.Nullable String planValueInUSD) { - this.planValueInUSD = planValueInUSD; - return this; - } - - /** - * Get planValueInUSD - * - * @return planValueInUSD - */ - @jakarta.annotation.Nullable - public String getPlanValueInUSD() { - return planValueInUSD; - } - - public void setPlanValueInUSD(@jakarta.annotation.Nullable String planValueInUSD) { - this.planValueInUSD = planValueInUSD; - } - - public QueryHoldingDetailsOfThePlanResponse pnlInUSD( - @jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - return this; - } - - /** - * Get pnlInUSD - * - * @return pnlInUSD - */ - @jakarta.annotation.Nullable - public String getPnlInUSD() { - return pnlInUSD; - } - - public void setPnlInUSD(@jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - } - - public QueryHoldingDetailsOfThePlanResponse roi(@jakarta.annotation.Nullable String roi) { - this.roi = roi; - return this; - } - - /** - * Get roi - * - * @return roi - */ - @jakarta.annotation.Nullable - public String getRoi() { - return roi; - } - - public void setRoi(@jakarta.annotation.Nullable String roi) { - this.roi = roi; - } - - public QueryHoldingDetailsOfThePlanResponse totalInvestedInUSD( - @jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - return this; - } - - /** - * Get totalInvestedInUSD - * - * @return totalInvestedInUSD - */ - @jakarta.annotation.Nullable - public String getTotalInvestedInUSD() { - return totalInvestedInUSD; - } - - public void setTotalInvestedInUSD(@jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - } - - public QueryHoldingDetailsOfThePlanResponse details( - @jakarta.annotation.Nullable - List<@Valid QueryHoldingDetailsOfThePlanResponseDetailsInner> details) { - this.details = details; - return this; - } - - public QueryHoldingDetailsOfThePlanResponse addDetailsItem( - QueryHoldingDetailsOfThePlanResponseDetailsInner detailsItem) { - if (this.details == null) { - this.details = new ArrayList<>(); - } - this.details.add(detailsItem); - return this; - } - - /** - * Get details - * - * @return details - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid QueryHoldingDetailsOfThePlanResponseDetailsInner> getDetails() { - return details; - } - - public void setDetails( - @jakarta.annotation.Nullable - List<@Valid QueryHoldingDetailsOfThePlanResponseDetailsInner> details) { - this.details = details; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryHoldingDetailsOfThePlanResponse queryHoldingDetailsOfThePlanResponse = - (QueryHoldingDetailsOfThePlanResponse) o; - return Objects.equals(this.planId, queryHoldingDetailsOfThePlanResponse.planId) - && Objects.equals(this.planType, queryHoldingDetailsOfThePlanResponse.planType) - && Objects.equals( - this.editAllowed, queryHoldingDetailsOfThePlanResponse.editAllowed) - && Objects.equals( - this.flexibleAllowedToUse, - queryHoldingDetailsOfThePlanResponse.flexibleAllowedToUse) - && Objects.equals( - this.creationDateTime, - queryHoldingDetailsOfThePlanResponse.creationDateTime) - && Objects.equals( - this.firstExecutionDateTime, - queryHoldingDetailsOfThePlanResponse.firstExecutionDateTime) - && Objects.equals( - this.nextExecutionDateTime, - queryHoldingDetailsOfThePlanResponse.nextExecutionDateTime) - && Objects.equals(this.status, queryHoldingDetailsOfThePlanResponse.status) - && Objects.equals( - this.targetAsset, queryHoldingDetailsOfThePlanResponse.targetAsset) - && Objects.equals( - this.sourceAsset, queryHoldingDetailsOfThePlanResponse.sourceAsset) - && Objects.equals( - this.planValueInUSD, queryHoldingDetailsOfThePlanResponse.planValueInUSD) - && Objects.equals(this.pnlInUSD, queryHoldingDetailsOfThePlanResponse.pnlInUSD) - && Objects.equals(this.roi, queryHoldingDetailsOfThePlanResponse.roi) - && Objects.equals( - this.totalInvestedInUSD, - queryHoldingDetailsOfThePlanResponse.totalInvestedInUSD) - && Objects.equals(this.details, queryHoldingDetailsOfThePlanResponse.details); - } - - @Override - public int hashCode() { - return Objects.hash( - planId, - planType, - editAllowed, - flexibleAllowedToUse, - creationDateTime, - firstExecutionDateTime, - nextExecutionDateTime, - status, - targetAsset, - sourceAsset, - planValueInUSD, - pnlInUSD, - roi, - totalInvestedInUSD, - details); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryHoldingDetailsOfThePlanResponse {\n"); - sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); - sb.append(" planType: ").append(toIndentedString(planType)).append("\n"); - sb.append(" editAllowed: ").append(toIndentedString(editAllowed)).append("\n"); - sb.append(" flexibleAllowedToUse: ") - .append(toIndentedString(flexibleAllowedToUse)) - .append("\n"); - sb.append(" creationDateTime: ").append(toIndentedString(creationDateTime)).append("\n"); - sb.append(" firstExecutionDateTime: ") - .append(toIndentedString(firstExecutionDateTime)) - .append("\n"); - sb.append(" nextExecutionDateTime: ") - .append(toIndentedString(nextExecutionDateTime)) - .append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" sourceAsset: ").append(toIndentedString(sourceAsset)).append("\n"); - sb.append(" planValueInUSD: ").append(toIndentedString(planValueInUSD)).append("\n"); - sb.append(" pnlInUSD: ").append(toIndentedString(pnlInUSD)).append("\n"); - sb.append(" roi: ").append(toIndentedString(roi)).append("\n"); - sb.append(" totalInvestedInUSD: ") - .append(toIndentedString(totalInvestedInUSD)) - .append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object planIdValue = getPlanId(); - String planIdValueAsString = ""; - planIdValueAsString = planIdValue.toString(); - sb.append("planId=").append(urlEncode(planIdValueAsString)).append(""); - Object planTypeValue = getPlanType(); - String planTypeValueAsString = ""; - planTypeValueAsString = planTypeValue.toString(); - sb.append("planType=").append(urlEncode(planTypeValueAsString)).append(""); - Object editAllowedValue = getEditAllowed(); - String editAllowedValueAsString = ""; - editAllowedValueAsString = editAllowedValue.toString(); - sb.append("editAllowed=").append(urlEncode(editAllowedValueAsString)).append(""); - Object flexibleAllowedToUseValue = getFlexibleAllowedToUse(); - String flexibleAllowedToUseValueAsString = ""; - flexibleAllowedToUseValueAsString = flexibleAllowedToUseValue.toString(); - sb.append("flexibleAllowedToUse=") - .append(urlEncode(flexibleAllowedToUseValueAsString)) - .append(""); - Object creationDateTimeValue = getCreationDateTime(); - String creationDateTimeValueAsString = ""; - creationDateTimeValueAsString = creationDateTimeValue.toString(); - sb.append("creationDateTime=").append(urlEncode(creationDateTimeValueAsString)).append(""); - Object firstExecutionDateTimeValue = getFirstExecutionDateTime(); - String firstExecutionDateTimeValueAsString = ""; - firstExecutionDateTimeValueAsString = firstExecutionDateTimeValue.toString(); - sb.append("firstExecutionDateTime=") - .append(urlEncode(firstExecutionDateTimeValueAsString)) - .append(""); - Object nextExecutionDateTimeValue = getNextExecutionDateTime(); - String nextExecutionDateTimeValueAsString = ""; - nextExecutionDateTimeValueAsString = nextExecutionDateTimeValue.toString(); - sb.append("nextExecutionDateTime=") - .append(urlEncode(nextExecutionDateTimeValueAsString)) - .append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object sourceAssetValue = getSourceAsset(); - String sourceAssetValueAsString = ""; - sourceAssetValueAsString = sourceAssetValue.toString(); - sb.append("sourceAsset=").append(urlEncode(sourceAssetValueAsString)).append(""); - Object planValueInUSDValue = getPlanValueInUSD(); - String planValueInUSDValueAsString = ""; - planValueInUSDValueAsString = planValueInUSDValue.toString(); - sb.append("planValueInUSD=").append(urlEncode(planValueInUSDValueAsString)).append(""); - Object pnlInUSDValue = getPnlInUSD(); - String pnlInUSDValueAsString = ""; - pnlInUSDValueAsString = pnlInUSDValue.toString(); - sb.append("pnlInUSD=").append(urlEncode(pnlInUSDValueAsString)).append(""); - Object roiValue = getRoi(); - String roiValueAsString = ""; - roiValueAsString = roiValue.toString(); - sb.append("roi=").append(urlEncode(roiValueAsString)).append(""); - Object totalInvestedInUSDValue = getTotalInvestedInUSD(); - String totalInvestedInUSDValueAsString = ""; - totalInvestedInUSDValueAsString = totalInvestedInUSDValue.toString(); - sb.append("totalInvestedInUSD=") - .append(urlEncode(totalInvestedInUSDValueAsString)) - .append(""); - Object detailsValue = getDetails(); - String detailsValueAsString = ""; - detailsValueAsString = - (String) - ((Collection) detailsValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("details=").append(urlEncode(detailsValueAsString)).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("planId"); - openapiFields.add("planType"); - openapiFields.add("editAllowed"); - openapiFields.add("flexibleAllowedToUse"); - openapiFields.add("creationDateTime"); - openapiFields.add("firstExecutionDateTime"); - openapiFields.add("nextExecutionDateTime"); - openapiFields.add("status"); - openapiFields.add("targetAsset"); - openapiFields.add("sourceAsset"); - openapiFields.add("planValueInUSD"); - openapiFields.add("pnlInUSD"); - openapiFields.add("roi"); - openapiFields.add("totalInvestedInUSD"); - openapiFields.add("details"); - - // 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 - * QueryHoldingDetailsOfThePlanResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueryHoldingDetailsOfThePlanResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in QueryHoldingDetailsOfThePlanResponse" - + " is not found in the empty JSON string", - QueryHoldingDetailsOfThePlanResponse.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryHoldingDetailsOfThePlanResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryHoldingDetailsOfThePlanResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("planType") != null && !jsonObj.get("planType").isJsonNull()) - && !jsonObj.get("planType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `planType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("planType").toString())); - } - if ((jsonObj.get("editAllowed") != null && !jsonObj.get("editAllowed").isJsonNull()) - && !jsonObj.get("editAllowed").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `editAllowed` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("editAllowed").toString())); - } - if ((jsonObj.get("flexibleAllowedToUse") != null - && !jsonObj.get("flexibleAllowedToUse").isJsonNull()) - && !jsonObj.get("flexibleAllowedToUse").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `flexibleAllowedToUse` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("flexibleAllowedToUse").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) - && !jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - if ((jsonObj.get("sourceAsset") != null && !jsonObj.get("sourceAsset").isJsonNull()) - && !jsonObj.get("sourceAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceAsset").toString())); - } - if ((jsonObj.get("planValueInUSD") != null && !jsonObj.get("planValueInUSD").isJsonNull()) - && !jsonObj.get("planValueInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `planValueInUSD` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("planValueInUSD").toString())); - } - if ((jsonObj.get("pnlInUSD") != null && !jsonObj.get("pnlInUSD").isJsonNull()) - && !jsonObj.get("pnlInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `pnlInUSD` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("pnlInUSD").toString())); - } - if ((jsonObj.get("roi") != null && !jsonObj.get("roi").isJsonNull()) - && !jsonObj.get("roi").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `roi` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("roi").toString())); - } - if ((jsonObj.get("totalInvestedInUSD") != null - && !jsonObj.get("totalInvestedInUSD").isJsonNull()) - && !jsonObj.get("totalInvestedInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `totalInvestedInUSD` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("totalInvestedInUSD").toString())); - } - if (jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) { - JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); - if (jsonArraydetails != null) { - // ensure the json data is an array - if (!jsonObj.get("details").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `details` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("details").toString())); - } - - // validate the optional field `details` (array) - for (int i = 0; i < jsonArraydetails.size(); i++) { - QueryHoldingDetailsOfThePlanResponseDetailsInner.validateJsonElement( - jsonArraydetails.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryHoldingDetailsOfThePlanResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'QueryHoldingDetailsOfThePlanResponse' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(QueryHoldingDetailsOfThePlanResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, QueryHoldingDetailsOfThePlanResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QueryHoldingDetailsOfThePlanResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QueryHoldingDetailsOfThePlanResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryHoldingDetailsOfThePlanResponse - * @throws IOException if the JSON string is invalid with respect to - * QueryHoldingDetailsOfThePlanResponse - */ - public static QueryHoldingDetailsOfThePlanResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, QueryHoldingDetailsOfThePlanResponse.class); - } - - /** - * Convert an instance of QueryHoldingDetailsOfThePlanResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryHoldingDetailsOfThePlanResponseDetailsInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryHoldingDetailsOfThePlanResponseDetailsInner.java deleted file mode 100644 index ebdf773eb..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryHoldingDetailsOfThePlanResponseDetailsInner.java +++ /dev/null @@ -1,836 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** QueryHoldingDetailsOfThePlanResponseDetailsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QueryHoldingDetailsOfThePlanResponseDetailsInner { - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nullable - private String targetAsset; - - public static final String SERIALIZED_NAME_AVERAGE_PRICE_IN_U_S_D = "averagePriceInUSD"; - - @SerializedName(SERIALIZED_NAME_AVERAGE_PRICE_IN_U_S_D) - @jakarta.annotation.Nullable - private String averagePriceInUSD; - - public static final String SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D = "totalInvestedInUSD"; - - @SerializedName(SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D) - @jakarta.annotation.Nullable - private String totalInvestedInUSD; - - public static final String SERIALIZED_NAME_PURCHASED_AMOUNT = "purchasedAmount"; - - @SerializedName(SERIALIZED_NAME_PURCHASED_AMOUNT) - @jakarta.annotation.Nullable - private String purchasedAmount; - - public static final String SERIALIZED_NAME_PURCHASED_AMOUNT_UNIT = "purchasedAmountUnit"; - - @SerializedName(SERIALIZED_NAME_PURCHASED_AMOUNT_UNIT) - @jakarta.annotation.Nullable - private String purchasedAmountUnit; - - public static final String SERIALIZED_NAME_PNL_IN_U_S_D = "pnlInUSD"; - - @SerializedName(SERIALIZED_NAME_PNL_IN_U_S_D) - @jakarta.annotation.Nullable - private String pnlInUSD; - - public static final String SERIALIZED_NAME_ROI = "roi"; - - @SerializedName(SERIALIZED_NAME_ROI) - @jakarta.annotation.Nullable - private String roi; - - public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; - - @SerializedName(SERIALIZED_NAME_PERCENTAGE) - @jakarta.annotation.Nullable - private String percentage; - - public static final String SERIALIZED_NAME_ASSET_STATUS = "assetStatus"; - - @SerializedName(SERIALIZED_NAME_ASSET_STATUS) - @jakarta.annotation.Nullable - private String assetStatus; - - public static final String SERIALIZED_NAME_AVAILABLE_AMOUNT = "availableAmount"; - - @SerializedName(SERIALIZED_NAME_AVAILABLE_AMOUNT) - @jakarta.annotation.Nullable - private String availableAmount; - - public static final String SERIALIZED_NAME_AVAILABLE_AMOUNT_UNIT = "availableAmountUnit"; - - @SerializedName(SERIALIZED_NAME_AVAILABLE_AMOUNT_UNIT) - @jakarta.annotation.Nullable - private String availableAmountUnit; - - public static final String SERIALIZED_NAME_REDEEMED_AMOUT = "redeemedAmout"; - - @SerializedName(SERIALIZED_NAME_REDEEMED_AMOUT) - @jakarta.annotation.Nullable - private String redeemedAmout; - - public static final String SERIALIZED_NAME_REDEEMED_AMOUT_UNIT = "redeemedAmoutUnit"; - - @SerializedName(SERIALIZED_NAME_REDEEMED_AMOUT_UNIT) - @jakarta.annotation.Nullable - private String redeemedAmoutUnit; - - public static final String SERIALIZED_NAME_ASSET_VALUE_IN_U_S_D = "assetValueInUSD"; - - @SerializedName(SERIALIZED_NAME_ASSET_VALUE_IN_U_S_D) - @jakarta.annotation.Nullable - private String assetValueInUSD; - - public QueryHoldingDetailsOfThePlanResponseDetailsInner() {} - - public QueryHoldingDetailsOfThePlanResponseDetailsInner targetAsset( - @jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nullable - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner averagePriceInUSD( - @jakarta.annotation.Nullable String averagePriceInUSD) { - this.averagePriceInUSD = averagePriceInUSD; - return this; - } - - /** - * Get averagePriceInUSD - * - * @return averagePriceInUSD - */ - @jakarta.annotation.Nullable - public String getAveragePriceInUSD() { - return averagePriceInUSD; - } - - public void setAveragePriceInUSD(@jakarta.annotation.Nullable String averagePriceInUSD) { - this.averagePriceInUSD = averagePriceInUSD; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner totalInvestedInUSD( - @jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - return this; - } - - /** - * Get totalInvestedInUSD - * - * @return totalInvestedInUSD - */ - @jakarta.annotation.Nullable - public String getTotalInvestedInUSD() { - return totalInvestedInUSD; - } - - public void setTotalInvestedInUSD(@jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner purchasedAmount( - @jakarta.annotation.Nullable String purchasedAmount) { - this.purchasedAmount = purchasedAmount; - return this; - } - - /** - * Get purchasedAmount - * - * @return purchasedAmount - */ - @jakarta.annotation.Nullable - public String getPurchasedAmount() { - return purchasedAmount; - } - - public void setPurchasedAmount(@jakarta.annotation.Nullable String purchasedAmount) { - this.purchasedAmount = purchasedAmount; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner purchasedAmountUnit( - @jakarta.annotation.Nullable String purchasedAmountUnit) { - this.purchasedAmountUnit = purchasedAmountUnit; - return this; - } - - /** - * Get purchasedAmountUnit - * - * @return purchasedAmountUnit - */ - @jakarta.annotation.Nullable - public String getPurchasedAmountUnit() { - return purchasedAmountUnit; - } - - public void setPurchasedAmountUnit(@jakarta.annotation.Nullable String purchasedAmountUnit) { - this.purchasedAmountUnit = purchasedAmountUnit; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner pnlInUSD( - @jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - return this; - } - - /** - * Get pnlInUSD - * - * @return pnlInUSD - */ - @jakarta.annotation.Nullable - public String getPnlInUSD() { - return pnlInUSD; - } - - public void setPnlInUSD(@jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner roi( - @jakarta.annotation.Nullable String roi) { - this.roi = roi; - return this; - } - - /** - * Get roi - * - * @return roi - */ - @jakarta.annotation.Nullable - public String getRoi() { - return roi; - } - - public void setRoi(@jakarta.annotation.Nullable String roi) { - this.roi = roi; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner percentage( - @jakarta.annotation.Nullable String percentage) { - this.percentage = percentage; - return this; - } - - /** - * Get percentage - * - * @return percentage - */ - @jakarta.annotation.Nullable - public String getPercentage() { - return percentage; - } - - public void setPercentage(@jakarta.annotation.Nullable String percentage) { - this.percentage = percentage; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner assetStatus( - @jakarta.annotation.Nullable String assetStatus) { - this.assetStatus = assetStatus; - return this; - } - - /** - * Get assetStatus - * - * @return assetStatus - */ - @jakarta.annotation.Nullable - public String getAssetStatus() { - return assetStatus; - } - - public void setAssetStatus(@jakarta.annotation.Nullable String assetStatus) { - this.assetStatus = assetStatus; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner availableAmount( - @jakarta.annotation.Nullable String availableAmount) { - this.availableAmount = availableAmount; - return this; - } - - /** - * Get availableAmount - * - * @return availableAmount - */ - @jakarta.annotation.Nullable - public String getAvailableAmount() { - return availableAmount; - } - - public void setAvailableAmount(@jakarta.annotation.Nullable String availableAmount) { - this.availableAmount = availableAmount; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner availableAmountUnit( - @jakarta.annotation.Nullable String availableAmountUnit) { - this.availableAmountUnit = availableAmountUnit; - return this; - } - - /** - * Get availableAmountUnit - * - * @return availableAmountUnit - */ - @jakarta.annotation.Nullable - public String getAvailableAmountUnit() { - return availableAmountUnit; - } - - public void setAvailableAmountUnit(@jakarta.annotation.Nullable String availableAmountUnit) { - this.availableAmountUnit = availableAmountUnit; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner redeemedAmout( - @jakarta.annotation.Nullable String redeemedAmout) { - this.redeemedAmout = redeemedAmout; - return this; - } - - /** - * Get redeemedAmout - * - * @return redeemedAmout - */ - @jakarta.annotation.Nullable - public String getRedeemedAmout() { - return redeemedAmout; - } - - public void setRedeemedAmout(@jakarta.annotation.Nullable String redeemedAmout) { - this.redeemedAmout = redeemedAmout; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner redeemedAmoutUnit( - @jakarta.annotation.Nullable String redeemedAmoutUnit) { - this.redeemedAmoutUnit = redeemedAmoutUnit; - return this; - } - - /** - * Get redeemedAmoutUnit - * - * @return redeemedAmoutUnit - */ - @jakarta.annotation.Nullable - public String getRedeemedAmoutUnit() { - return redeemedAmoutUnit; - } - - public void setRedeemedAmoutUnit(@jakarta.annotation.Nullable String redeemedAmoutUnit) { - this.redeemedAmoutUnit = redeemedAmoutUnit; - } - - public QueryHoldingDetailsOfThePlanResponseDetailsInner assetValueInUSD( - @jakarta.annotation.Nullable String assetValueInUSD) { - this.assetValueInUSD = assetValueInUSD; - return this; - } - - /** - * Get assetValueInUSD - * - * @return assetValueInUSD - */ - @jakarta.annotation.Nullable - public String getAssetValueInUSD() { - return assetValueInUSD; - } - - public void setAssetValueInUSD(@jakarta.annotation.Nullable String assetValueInUSD) { - this.assetValueInUSD = assetValueInUSD; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryHoldingDetailsOfThePlanResponseDetailsInner - queryHoldingDetailsOfThePlanResponseDetailsInner = - (QueryHoldingDetailsOfThePlanResponseDetailsInner) o; - return Objects.equals( - this.targetAsset, - queryHoldingDetailsOfThePlanResponseDetailsInner.targetAsset) - && Objects.equals( - this.averagePriceInUSD, - queryHoldingDetailsOfThePlanResponseDetailsInner.averagePriceInUSD) - && Objects.equals( - this.totalInvestedInUSD, - queryHoldingDetailsOfThePlanResponseDetailsInner.totalInvestedInUSD) - && Objects.equals( - this.purchasedAmount, - queryHoldingDetailsOfThePlanResponseDetailsInner.purchasedAmount) - && Objects.equals( - this.purchasedAmountUnit, - queryHoldingDetailsOfThePlanResponseDetailsInner.purchasedAmountUnit) - && Objects.equals( - this.pnlInUSD, queryHoldingDetailsOfThePlanResponseDetailsInner.pnlInUSD) - && Objects.equals(this.roi, queryHoldingDetailsOfThePlanResponseDetailsInner.roi) - && Objects.equals( - this.percentage, - queryHoldingDetailsOfThePlanResponseDetailsInner.percentage) - && Objects.equals( - this.assetStatus, - queryHoldingDetailsOfThePlanResponseDetailsInner.assetStatus) - && Objects.equals( - this.availableAmount, - queryHoldingDetailsOfThePlanResponseDetailsInner.availableAmount) - && Objects.equals( - this.availableAmountUnit, - queryHoldingDetailsOfThePlanResponseDetailsInner.availableAmountUnit) - && Objects.equals( - this.redeemedAmout, - queryHoldingDetailsOfThePlanResponseDetailsInner.redeemedAmout) - && Objects.equals( - this.redeemedAmoutUnit, - queryHoldingDetailsOfThePlanResponseDetailsInner.redeemedAmoutUnit) - && Objects.equals( - this.assetValueInUSD, - queryHoldingDetailsOfThePlanResponseDetailsInner.assetValueInUSD); - } - - @Override - public int hashCode() { - return Objects.hash( - targetAsset, - averagePriceInUSD, - totalInvestedInUSD, - purchasedAmount, - purchasedAmountUnit, - pnlInUSD, - roi, - percentage, - assetStatus, - availableAmount, - availableAmountUnit, - redeemedAmout, - redeemedAmoutUnit, - assetValueInUSD); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryHoldingDetailsOfThePlanResponseDetailsInner {\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" averagePriceInUSD: ").append(toIndentedString(averagePriceInUSD)).append("\n"); - sb.append(" totalInvestedInUSD: ") - .append(toIndentedString(totalInvestedInUSD)) - .append("\n"); - sb.append(" purchasedAmount: ").append(toIndentedString(purchasedAmount)).append("\n"); - sb.append(" purchasedAmountUnit: ") - .append(toIndentedString(purchasedAmountUnit)) - .append("\n"); - sb.append(" pnlInUSD: ").append(toIndentedString(pnlInUSD)).append("\n"); - sb.append(" roi: ").append(toIndentedString(roi)).append("\n"); - sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); - sb.append(" assetStatus: ").append(toIndentedString(assetStatus)).append("\n"); - sb.append(" availableAmount: ").append(toIndentedString(availableAmount)).append("\n"); - sb.append(" availableAmountUnit: ") - .append(toIndentedString(availableAmountUnit)) - .append("\n"); - sb.append(" redeemedAmout: ").append(toIndentedString(redeemedAmout)).append("\n"); - sb.append(" redeemedAmoutUnit: ").append(toIndentedString(redeemedAmoutUnit)).append("\n"); - sb.append(" assetValueInUSD: ").append(toIndentedString(assetValueInUSD)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object averagePriceInUSDValue = getAveragePriceInUSD(); - String averagePriceInUSDValueAsString = ""; - averagePriceInUSDValueAsString = averagePriceInUSDValue.toString(); - sb.append("averagePriceInUSD=") - .append(urlEncode(averagePriceInUSDValueAsString)) - .append(""); - Object totalInvestedInUSDValue = getTotalInvestedInUSD(); - String totalInvestedInUSDValueAsString = ""; - totalInvestedInUSDValueAsString = totalInvestedInUSDValue.toString(); - sb.append("totalInvestedInUSD=") - .append(urlEncode(totalInvestedInUSDValueAsString)) - .append(""); - Object purchasedAmountValue = getPurchasedAmount(); - String purchasedAmountValueAsString = ""; - purchasedAmountValueAsString = purchasedAmountValue.toString(); - sb.append("purchasedAmount=").append(urlEncode(purchasedAmountValueAsString)).append(""); - Object purchasedAmountUnitValue = getPurchasedAmountUnit(); - String purchasedAmountUnitValueAsString = ""; - purchasedAmountUnitValueAsString = purchasedAmountUnitValue.toString(); - sb.append("purchasedAmountUnit=") - .append(urlEncode(purchasedAmountUnitValueAsString)) - .append(""); - Object pnlInUSDValue = getPnlInUSD(); - String pnlInUSDValueAsString = ""; - pnlInUSDValueAsString = pnlInUSDValue.toString(); - sb.append("pnlInUSD=").append(urlEncode(pnlInUSDValueAsString)).append(""); - Object roiValue = getRoi(); - String roiValueAsString = ""; - roiValueAsString = roiValue.toString(); - sb.append("roi=").append(urlEncode(roiValueAsString)).append(""); - Object percentageValue = getPercentage(); - String percentageValueAsString = ""; - percentageValueAsString = percentageValue.toString(); - sb.append("percentage=").append(urlEncode(percentageValueAsString)).append(""); - Object assetStatusValue = getAssetStatus(); - String assetStatusValueAsString = ""; - assetStatusValueAsString = assetStatusValue.toString(); - sb.append("assetStatus=").append(urlEncode(assetStatusValueAsString)).append(""); - Object availableAmountValue = getAvailableAmount(); - String availableAmountValueAsString = ""; - availableAmountValueAsString = availableAmountValue.toString(); - sb.append("availableAmount=").append(urlEncode(availableAmountValueAsString)).append(""); - Object availableAmountUnitValue = getAvailableAmountUnit(); - String availableAmountUnitValueAsString = ""; - availableAmountUnitValueAsString = availableAmountUnitValue.toString(); - sb.append("availableAmountUnit=") - .append(urlEncode(availableAmountUnitValueAsString)) - .append(""); - Object redeemedAmoutValue = getRedeemedAmout(); - String redeemedAmoutValueAsString = ""; - redeemedAmoutValueAsString = redeemedAmoutValue.toString(); - sb.append("redeemedAmout=").append(urlEncode(redeemedAmoutValueAsString)).append(""); - Object redeemedAmoutUnitValue = getRedeemedAmoutUnit(); - String redeemedAmoutUnitValueAsString = ""; - redeemedAmoutUnitValueAsString = redeemedAmoutUnitValue.toString(); - sb.append("redeemedAmoutUnit=") - .append(urlEncode(redeemedAmoutUnitValueAsString)) - .append(""); - Object assetValueInUSDValue = getAssetValueInUSD(); - String assetValueInUSDValueAsString = ""; - assetValueInUSDValueAsString = assetValueInUSDValue.toString(); - sb.append("assetValueInUSD=").append(urlEncode(assetValueInUSDValueAsString)).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("targetAsset"); - openapiFields.add("averagePriceInUSD"); - openapiFields.add("totalInvestedInUSD"); - openapiFields.add("purchasedAmount"); - openapiFields.add("purchasedAmountUnit"); - openapiFields.add("pnlInUSD"); - openapiFields.add("roi"); - openapiFields.add("percentage"); - openapiFields.add("assetStatus"); - openapiFields.add("availableAmount"); - openapiFields.add("availableAmountUnit"); - openapiFields.add("redeemedAmout"); - openapiFields.add("redeemedAmoutUnit"); - openapiFields.add("assetValueInUSD"); - - // 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 - * QueryHoldingDetailsOfThePlanResponseDetailsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueryHoldingDetailsOfThePlanResponseDetailsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " QueryHoldingDetailsOfThePlanResponseDetailsInner is not" - + " found in the empty JSON string", - QueryHoldingDetailsOfThePlanResponseDetailsInner - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryHoldingDetailsOfThePlanResponseDetailsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryHoldingDetailsOfThePlanResponseDetailsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) - && !jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - if ((jsonObj.get("averagePriceInUSD") != null - && !jsonObj.get("averagePriceInUSD").isJsonNull()) - && !jsonObj.get("averagePriceInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `averagePriceInUSD` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("averagePriceInUSD").toString())); - } - if ((jsonObj.get("totalInvestedInUSD") != null - && !jsonObj.get("totalInvestedInUSD").isJsonNull()) - && !jsonObj.get("totalInvestedInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `totalInvestedInUSD` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("totalInvestedInUSD").toString())); - } - if ((jsonObj.get("purchasedAmount") != null && !jsonObj.get("purchasedAmount").isJsonNull()) - && !jsonObj.get("purchasedAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `purchasedAmount` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("purchasedAmount").toString())); - } - if ((jsonObj.get("purchasedAmountUnit") != null - && !jsonObj.get("purchasedAmountUnit").isJsonNull()) - && !jsonObj.get("purchasedAmountUnit").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `purchasedAmountUnit` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("purchasedAmountUnit").toString())); - } - if ((jsonObj.get("pnlInUSD") != null && !jsonObj.get("pnlInUSD").isJsonNull()) - && !jsonObj.get("pnlInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `pnlInUSD` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("pnlInUSD").toString())); - } - if ((jsonObj.get("roi") != null && !jsonObj.get("roi").isJsonNull()) - && !jsonObj.get("roi").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `roi` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("roi").toString())); - } - if ((jsonObj.get("percentage") != null && !jsonObj.get("percentage").isJsonNull()) - && !jsonObj.get("percentage").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `percentage` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("percentage").toString())); - } - if ((jsonObj.get("assetStatus") != null && !jsonObj.get("assetStatus").isJsonNull()) - && !jsonObj.get("assetStatus").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `assetStatus` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("assetStatus").toString())); - } - if ((jsonObj.get("availableAmount") != null && !jsonObj.get("availableAmount").isJsonNull()) - && !jsonObj.get("availableAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `availableAmount` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("availableAmount").toString())); - } - if ((jsonObj.get("availableAmountUnit") != null - && !jsonObj.get("availableAmountUnit").isJsonNull()) - && !jsonObj.get("availableAmountUnit").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `availableAmountUnit` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("availableAmountUnit").toString())); - } - if ((jsonObj.get("redeemedAmout") != null && !jsonObj.get("redeemedAmout").isJsonNull()) - && !jsonObj.get("redeemedAmout").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `redeemedAmout` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("redeemedAmout").toString())); - } - if ((jsonObj.get("redeemedAmoutUnit") != null - && !jsonObj.get("redeemedAmoutUnit").isJsonNull()) - && !jsonObj.get("redeemedAmoutUnit").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `redeemedAmoutUnit` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("redeemedAmoutUnit").toString())); - } - if ((jsonObj.get("assetValueInUSD") != null && !jsonObj.get("assetValueInUSD").isJsonNull()) - && !jsonObj.get("assetValueInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `assetValueInUSD` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("assetValueInUSD").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryHoldingDetailsOfThePlanResponseDetailsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'QueryHoldingDetailsOfThePlanResponseDetailsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get(QueryHoldingDetailsOfThePlanResponseDetailsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - QueryHoldingDetailsOfThePlanResponseDetailsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QueryHoldingDetailsOfThePlanResponseDetailsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QueryHoldingDetailsOfThePlanResponseDetailsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryHoldingDetailsOfThePlanResponseDetailsInner - * @throws IOException if the JSON string is invalid with respect to - * QueryHoldingDetailsOfThePlanResponseDetailsInner - */ - public static QueryHoldingDetailsOfThePlanResponseDetailsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, QueryHoldingDetailsOfThePlanResponseDetailsInner.class); - } - - /** - * Convert an instance of QueryHoldingDetailsOfThePlanResponseDetailsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexDetailsResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexDetailsResponse.java deleted file mode 100644 index d174bd781..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexDetailsResponse.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** QueryIndexDetailsResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QueryIndexDetailsResponse { - public static final String SERIALIZED_NAME_INDEX_ID = "indexId"; - - @SerializedName(SERIALIZED_NAME_INDEX_ID) - @jakarta.annotation.Nullable - private Long indexId; - - public static final String SERIALIZED_NAME_INDEX_NAME = "indexName"; - - @SerializedName(SERIALIZED_NAME_INDEX_NAME) - @jakarta.annotation.Nullable - private String indexName; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_ASSET_ALLOCATION = "assetAllocation"; - - @SerializedName(SERIALIZED_NAME_ASSET_ALLOCATION) - @jakarta.annotation.Nullable - private List<@Valid QueryIndexDetailsResponseAssetAllocationInner> assetAllocation; - - public QueryIndexDetailsResponse() {} - - public QueryIndexDetailsResponse indexId(@jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - return this; - } - - /** - * Get indexId - * - * @return indexId - */ - @jakarta.annotation.Nullable - public Long getIndexId() { - return indexId; - } - - public void setIndexId(@jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - } - - public QueryIndexDetailsResponse indexName(@jakarta.annotation.Nullable String indexName) { - this.indexName = indexName; - return this; - } - - /** - * Get indexName - * - * @return indexName - */ - @jakarta.annotation.Nullable - public String getIndexName() { - return indexName; - } - - public void setIndexName(@jakarta.annotation.Nullable String indexName) { - this.indexName = indexName; - } - - public QueryIndexDetailsResponse status(@jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - public QueryIndexDetailsResponse assetAllocation( - @jakarta.annotation.Nullable - List<@Valid QueryIndexDetailsResponseAssetAllocationInner> assetAllocation) { - this.assetAllocation = assetAllocation; - return this; - } - - public QueryIndexDetailsResponse addAssetAllocationItem( - QueryIndexDetailsResponseAssetAllocationInner assetAllocationItem) { - if (this.assetAllocation == null) { - this.assetAllocation = new ArrayList<>(); - } - this.assetAllocation.add(assetAllocationItem); - return this; - } - - /** - * Get assetAllocation - * - * @return assetAllocation - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid QueryIndexDetailsResponseAssetAllocationInner> getAssetAllocation() { - return assetAllocation; - } - - public void setAssetAllocation( - @jakarta.annotation.Nullable - List<@Valid QueryIndexDetailsResponseAssetAllocationInner> assetAllocation) { - this.assetAllocation = assetAllocation; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryIndexDetailsResponse queryIndexDetailsResponse = (QueryIndexDetailsResponse) o; - return Objects.equals(this.indexId, queryIndexDetailsResponse.indexId) - && Objects.equals(this.indexName, queryIndexDetailsResponse.indexName) - && Objects.equals(this.status, queryIndexDetailsResponse.status) - && Objects.equals(this.assetAllocation, queryIndexDetailsResponse.assetAllocation); - } - - @Override - public int hashCode() { - return Objects.hash(indexId, indexName, status, assetAllocation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryIndexDetailsResponse {\n"); - sb.append(" indexId: ").append(toIndentedString(indexId)).append("\n"); - sb.append(" indexName: ").append(toIndentedString(indexName)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" assetAllocation: ").append(toIndentedString(assetAllocation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object indexIdValue = getIndexId(); - String indexIdValueAsString = ""; - indexIdValueAsString = indexIdValue.toString(); - sb.append("indexId=").append(urlEncode(indexIdValueAsString)).append(""); - Object indexNameValue = getIndexName(); - String indexNameValueAsString = ""; - indexNameValueAsString = indexNameValue.toString(); - sb.append("indexName=").append(urlEncode(indexNameValueAsString)).append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object assetAllocationValue = getAssetAllocation(); - String assetAllocationValueAsString = ""; - assetAllocationValueAsString = - (String) - ((Collection) assetAllocationValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("assetAllocation=").append(urlEncode(assetAllocationValueAsString)).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("indexId"); - openapiFields.add("indexName"); - openapiFields.add("status"); - openapiFields.add("assetAllocation"); - - // 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 QueryIndexDetailsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueryIndexDetailsResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in QueryIndexDetailsResponse is not found" - + " in the empty JSON string", - QueryIndexDetailsResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryIndexDetailsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryIndexDetailsResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("indexName") != null && !jsonObj.get("indexName").isJsonNull()) - && !jsonObj.get("indexName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `indexName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("indexName").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if (jsonObj.get("assetAllocation") != null - && !jsonObj.get("assetAllocation").isJsonNull()) { - JsonArray jsonArrayassetAllocation = jsonObj.getAsJsonArray("assetAllocation"); - if (jsonArrayassetAllocation != null) { - // ensure the json data is an array - if (!jsonObj.get("assetAllocation").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `assetAllocation` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("assetAllocation").toString())); - } - - // validate the optional field `assetAllocation` (array) - for (int i = 0; i < jsonArrayassetAllocation.size(); i++) { - QueryIndexDetailsResponseAssetAllocationInner.validateJsonElement( - jsonArrayassetAllocation.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryIndexDetailsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'QueryIndexDetailsResponse' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(QueryIndexDetailsResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, QueryIndexDetailsResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QueryIndexDetailsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QueryIndexDetailsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryIndexDetailsResponse - * @throws IOException if the JSON string is invalid with respect to QueryIndexDetailsResponse - */ - public static QueryIndexDetailsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, QueryIndexDetailsResponse.class); - } - - /** - * Convert an instance of QueryIndexDetailsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexDetailsResponseAssetAllocationInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexDetailsResponseAssetAllocationInner.java deleted file mode 100644 index 7cb3863be..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexDetailsResponseAssetAllocationInner.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** QueryIndexDetailsResponseAssetAllocationInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QueryIndexDetailsResponseAssetAllocationInner { - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nullable - private String targetAsset; - - public static final String SERIALIZED_NAME_ALLOCATION = "allocation"; - - @SerializedName(SERIALIZED_NAME_ALLOCATION) - @jakarta.annotation.Nullable - private String allocation; - - public QueryIndexDetailsResponseAssetAllocationInner() {} - - public QueryIndexDetailsResponseAssetAllocationInner targetAsset( - @jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nullable - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - } - - public QueryIndexDetailsResponseAssetAllocationInner allocation( - @jakarta.annotation.Nullable String allocation) { - this.allocation = allocation; - return this; - } - - /** - * Get allocation - * - * @return allocation - */ - @jakarta.annotation.Nullable - public String getAllocation() { - return allocation; - } - - public void setAllocation(@jakarta.annotation.Nullable String allocation) { - this.allocation = allocation; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryIndexDetailsResponseAssetAllocationInner - queryIndexDetailsResponseAssetAllocationInner = - (QueryIndexDetailsResponseAssetAllocationInner) o; - return Objects.equals( - this.targetAsset, queryIndexDetailsResponseAssetAllocationInner.targetAsset) - && Objects.equals( - this.allocation, queryIndexDetailsResponseAssetAllocationInner.allocation); - } - - @Override - public int hashCode() { - return Objects.hash(targetAsset, allocation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryIndexDetailsResponseAssetAllocationInner {\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" allocation: ").append(toIndentedString(allocation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object allocationValue = getAllocation(); - String allocationValueAsString = ""; - allocationValueAsString = allocationValue.toString(); - sb.append("allocation=").append(urlEncode(allocationValueAsString)).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("targetAsset"); - openapiFields.add("allocation"); - - // 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 - * QueryIndexDetailsResponseAssetAllocationInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueryIndexDetailsResponseAssetAllocationInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " QueryIndexDetailsResponseAssetAllocationInner is not found" - + " in the empty JSON string", - QueryIndexDetailsResponseAssetAllocationInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryIndexDetailsResponseAssetAllocationInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryIndexDetailsResponseAssetAllocationInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) - && !jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - if ((jsonObj.get("allocation") != null && !jsonObj.get("allocation").isJsonNull()) - && !jsonObj.get("allocation").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `allocation` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("allocation").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryIndexDetailsResponseAssetAllocationInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'QueryIndexDetailsResponseAssetAllocationInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get(QueryIndexDetailsResponseAssetAllocationInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, QueryIndexDetailsResponseAssetAllocationInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QueryIndexDetailsResponseAssetAllocationInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QueryIndexDetailsResponseAssetAllocationInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryIndexDetailsResponseAssetAllocationInner - * @throws IOException if the JSON string is invalid with respect to - * QueryIndexDetailsResponseAssetAllocationInner - */ - public static QueryIndexDetailsResponseAssetAllocationInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, QueryIndexDetailsResponseAssetAllocationInner.class); - } - - /** - * Convert an instance of QueryIndexDetailsResponseAssetAllocationInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexLinkedPlanPositionDetailsResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexLinkedPlanPositionDetailsResponse.java deleted file mode 100644 index e409a5b8c..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexLinkedPlanPositionDetailsResponse.java +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** QueryIndexLinkedPlanPositionDetailsResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QueryIndexLinkedPlanPositionDetailsResponse { - public static final String SERIALIZED_NAME_INDEX_ID = "indexId"; - - @SerializedName(SERIALIZED_NAME_INDEX_ID) - @jakarta.annotation.Nullable - private Long indexId; - - public static final String SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D = "totalInvestedInUSD"; - - @SerializedName(SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D) - @jakarta.annotation.Nullable - private String totalInvestedInUSD; - - public static final String SERIALIZED_NAME_CURRENT_INVESTED_IN_U_S_D = "currentInvestedInUSD"; - - @SerializedName(SERIALIZED_NAME_CURRENT_INVESTED_IN_U_S_D) - @jakarta.annotation.Nullable - private String currentInvestedInUSD; - - public static final String SERIALIZED_NAME_PNL_IN_U_S_D = "pnlInUSD"; - - @SerializedName(SERIALIZED_NAME_PNL_IN_U_S_D) - @jakarta.annotation.Nullable - private String pnlInUSD; - - public static final String SERIALIZED_NAME_ROI = "roi"; - - @SerializedName(SERIALIZED_NAME_ROI) - @jakarta.annotation.Nullable - private String roi; - - public static final String SERIALIZED_NAME_ASSET_ALLOCATION = "assetAllocation"; - - @SerializedName(SERIALIZED_NAME_ASSET_ALLOCATION) - @jakarta.annotation.Nullable - private List<@Valid QueryIndexDetailsResponseAssetAllocationInner> assetAllocation; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - - @SerializedName(SERIALIZED_NAME_DETAILS) - @jakarta.annotation.Nullable - private List<@Valid QueryIndexLinkedPlanPositionDetailsResponseDetailsInner> details; - - public QueryIndexLinkedPlanPositionDetailsResponse() {} - - public QueryIndexLinkedPlanPositionDetailsResponse indexId( - @jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - return this; - } - - /** - * Get indexId - * - * @return indexId - */ - @jakarta.annotation.Nullable - public Long getIndexId() { - return indexId; - } - - public void setIndexId(@jakarta.annotation.Nullable Long indexId) { - this.indexId = indexId; - } - - public QueryIndexLinkedPlanPositionDetailsResponse totalInvestedInUSD( - @jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - return this; - } - - /** - * Get totalInvestedInUSD - * - * @return totalInvestedInUSD - */ - @jakarta.annotation.Nullable - public String getTotalInvestedInUSD() { - return totalInvestedInUSD; - } - - public void setTotalInvestedInUSD(@jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - } - - public QueryIndexLinkedPlanPositionDetailsResponse currentInvestedInUSD( - @jakarta.annotation.Nullable String currentInvestedInUSD) { - this.currentInvestedInUSD = currentInvestedInUSD; - return this; - } - - /** - * Get currentInvestedInUSD - * - * @return currentInvestedInUSD - */ - @jakarta.annotation.Nullable - public String getCurrentInvestedInUSD() { - return currentInvestedInUSD; - } - - public void setCurrentInvestedInUSD(@jakarta.annotation.Nullable String currentInvestedInUSD) { - this.currentInvestedInUSD = currentInvestedInUSD; - } - - public QueryIndexLinkedPlanPositionDetailsResponse pnlInUSD( - @jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - return this; - } - - /** - * Get pnlInUSD - * - * @return pnlInUSD - */ - @jakarta.annotation.Nullable - public String getPnlInUSD() { - return pnlInUSD; - } - - public void setPnlInUSD(@jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - } - - public QueryIndexLinkedPlanPositionDetailsResponse roi( - @jakarta.annotation.Nullable String roi) { - this.roi = roi; - return this; - } - - /** - * Get roi - * - * @return roi - */ - @jakarta.annotation.Nullable - public String getRoi() { - return roi; - } - - public void setRoi(@jakarta.annotation.Nullable String roi) { - this.roi = roi; - } - - public QueryIndexLinkedPlanPositionDetailsResponse assetAllocation( - @jakarta.annotation.Nullable - List<@Valid QueryIndexDetailsResponseAssetAllocationInner> assetAllocation) { - this.assetAllocation = assetAllocation; - return this; - } - - public QueryIndexLinkedPlanPositionDetailsResponse addAssetAllocationItem( - QueryIndexDetailsResponseAssetAllocationInner assetAllocationItem) { - if (this.assetAllocation == null) { - this.assetAllocation = new ArrayList<>(); - } - this.assetAllocation.add(assetAllocationItem); - return this; - } - - /** - * Get assetAllocation - * - * @return assetAllocation - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid QueryIndexDetailsResponseAssetAllocationInner> getAssetAllocation() { - return assetAllocation; - } - - public void setAssetAllocation( - @jakarta.annotation.Nullable - List<@Valid QueryIndexDetailsResponseAssetAllocationInner> assetAllocation) { - this.assetAllocation = assetAllocation; - } - - public QueryIndexLinkedPlanPositionDetailsResponse details( - @jakarta.annotation.Nullable - List<@Valid QueryIndexLinkedPlanPositionDetailsResponseDetailsInner> details) { - this.details = details; - return this; - } - - public QueryIndexLinkedPlanPositionDetailsResponse addDetailsItem( - QueryIndexLinkedPlanPositionDetailsResponseDetailsInner detailsItem) { - if (this.details == null) { - this.details = new ArrayList<>(); - } - this.details.add(detailsItem); - return this; - } - - /** - * Get details - * - * @return details - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid QueryIndexLinkedPlanPositionDetailsResponseDetailsInner> getDetails() { - return details; - } - - public void setDetails( - @jakarta.annotation.Nullable - List<@Valid QueryIndexLinkedPlanPositionDetailsResponseDetailsInner> details) { - this.details = details; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryIndexLinkedPlanPositionDetailsResponse queryIndexLinkedPlanPositionDetailsResponse = - (QueryIndexLinkedPlanPositionDetailsResponse) o; - return Objects.equals(this.indexId, queryIndexLinkedPlanPositionDetailsResponse.indexId) - && Objects.equals( - this.totalInvestedInUSD, - queryIndexLinkedPlanPositionDetailsResponse.totalInvestedInUSD) - && Objects.equals( - this.currentInvestedInUSD, - queryIndexLinkedPlanPositionDetailsResponse.currentInvestedInUSD) - && Objects.equals( - this.pnlInUSD, queryIndexLinkedPlanPositionDetailsResponse.pnlInUSD) - && Objects.equals(this.roi, queryIndexLinkedPlanPositionDetailsResponse.roi) - && Objects.equals( - this.assetAllocation, - queryIndexLinkedPlanPositionDetailsResponse.assetAllocation) - && Objects.equals( - this.details, queryIndexLinkedPlanPositionDetailsResponse.details); - } - - @Override - public int hashCode() { - return Objects.hash( - indexId, - totalInvestedInUSD, - currentInvestedInUSD, - pnlInUSD, - roi, - assetAllocation, - details); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryIndexLinkedPlanPositionDetailsResponse {\n"); - sb.append(" indexId: ").append(toIndentedString(indexId)).append("\n"); - sb.append(" totalInvestedInUSD: ") - .append(toIndentedString(totalInvestedInUSD)) - .append("\n"); - sb.append(" currentInvestedInUSD: ") - .append(toIndentedString(currentInvestedInUSD)) - .append("\n"); - sb.append(" pnlInUSD: ").append(toIndentedString(pnlInUSD)).append("\n"); - sb.append(" roi: ").append(toIndentedString(roi)).append("\n"); - sb.append(" assetAllocation: ").append(toIndentedString(assetAllocation)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object indexIdValue = getIndexId(); - String indexIdValueAsString = ""; - indexIdValueAsString = indexIdValue.toString(); - sb.append("indexId=").append(urlEncode(indexIdValueAsString)).append(""); - Object totalInvestedInUSDValue = getTotalInvestedInUSD(); - String totalInvestedInUSDValueAsString = ""; - totalInvestedInUSDValueAsString = totalInvestedInUSDValue.toString(); - sb.append("totalInvestedInUSD=") - .append(urlEncode(totalInvestedInUSDValueAsString)) - .append(""); - Object currentInvestedInUSDValue = getCurrentInvestedInUSD(); - String currentInvestedInUSDValueAsString = ""; - currentInvestedInUSDValueAsString = currentInvestedInUSDValue.toString(); - sb.append("currentInvestedInUSD=") - .append(urlEncode(currentInvestedInUSDValueAsString)) - .append(""); - Object pnlInUSDValue = getPnlInUSD(); - String pnlInUSDValueAsString = ""; - pnlInUSDValueAsString = pnlInUSDValue.toString(); - sb.append("pnlInUSD=").append(urlEncode(pnlInUSDValueAsString)).append(""); - Object roiValue = getRoi(); - String roiValueAsString = ""; - roiValueAsString = roiValue.toString(); - sb.append("roi=").append(urlEncode(roiValueAsString)).append(""); - Object assetAllocationValue = getAssetAllocation(); - String assetAllocationValueAsString = ""; - assetAllocationValueAsString = - (String) - ((Collection) assetAllocationValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("assetAllocation=").append(urlEncode(assetAllocationValueAsString)).append(""); - Object detailsValue = getDetails(); - String detailsValueAsString = ""; - detailsValueAsString = - (String) - ((Collection) detailsValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("details=").append(urlEncode(detailsValueAsString)).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("indexId"); - openapiFields.add("totalInvestedInUSD"); - openapiFields.add("currentInvestedInUSD"); - openapiFields.add("pnlInUSD"); - openapiFields.add("roi"); - openapiFields.add("assetAllocation"); - openapiFields.add("details"); - - // 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 - * QueryIndexLinkedPlanPositionDetailsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueryIndexLinkedPlanPositionDetailsResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " QueryIndexLinkedPlanPositionDetailsResponse is not found in" - + " the empty JSON string", - QueryIndexLinkedPlanPositionDetailsResponse.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryIndexLinkedPlanPositionDetailsResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryIndexLinkedPlanPositionDetailsResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("totalInvestedInUSD") != null - && !jsonObj.get("totalInvestedInUSD").isJsonNull()) - && !jsonObj.get("totalInvestedInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `totalInvestedInUSD` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("totalInvestedInUSD").toString())); - } - if ((jsonObj.get("currentInvestedInUSD") != null - && !jsonObj.get("currentInvestedInUSD").isJsonNull()) - && !jsonObj.get("currentInvestedInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `currentInvestedInUSD` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("currentInvestedInUSD").toString())); - } - if ((jsonObj.get("pnlInUSD") != null && !jsonObj.get("pnlInUSD").isJsonNull()) - && !jsonObj.get("pnlInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `pnlInUSD` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("pnlInUSD").toString())); - } - if ((jsonObj.get("roi") != null && !jsonObj.get("roi").isJsonNull()) - && !jsonObj.get("roi").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `roi` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("roi").toString())); - } - if (jsonObj.get("assetAllocation") != null - && !jsonObj.get("assetAllocation").isJsonNull()) { - JsonArray jsonArrayassetAllocation = jsonObj.getAsJsonArray("assetAllocation"); - if (jsonArrayassetAllocation != null) { - // ensure the json data is an array - if (!jsonObj.get("assetAllocation").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `assetAllocation` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("assetAllocation").toString())); - } - - // validate the optional field `assetAllocation` (array) - for (int i = 0; i < jsonArrayassetAllocation.size(); i++) { - QueryIndexDetailsResponseAssetAllocationInner.validateJsonElement( - jsonArrayassetAllocation.get(i)); - } - ; - } - } - if (jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) { - JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); - if (jsonArraydetails != null) { - // ensure the json data is an array - if (!jsonObj.get("details").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `details` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("details").toString())); - } - - // validate the optional field `details` (array) - for (int i = 0; i < jsonArraydetails.size(); i++) { - QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.validateJsonElement( - jsonArraydetails.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryIndexLinkedPlanPositionDetailsResponse.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'QueryIndexLinkedPlanPositionDetailsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(QueryIndexLinkedPlanPositionDetailsResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, QueryIndexLinkedPlanPositionDetailsResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QueryIndexLinkedPlanPositionDetailsResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QueryIndexLinkedPlanPositionDetailsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryIndexLinkedPlanPositionDetailsResponse - * @throws IOException if the JSON string is invalid with respect to - * QueryIndexLinkedPlanPositionDetailsResponse - */ - public static QueryIndexLinkedPlanPositionDetailsResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, QueryIndexLinkedPlanPositionDetailsResponse.class); - } - - /** - * Convert an instance of QueryIndexLinkedPlanPositionDetailsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.java deleted file mode 100644 index f02ce7373..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.java +++ /dev/null @@ -1,704 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** QueryIndexLinkedPlanPositionDetailsResponseDetailsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QueryIndexLinkedPlanPositionDetailsResponseDetailsInner { - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nullable - private String targetAsset; - - public static final String SERIALIZED_NAME_AVERAGE_PRICE_IN_U_S_D = "averagePriceInUSD"; - - @SerializedName(SERIALIZED_NAME_AVERAGE_PRICE_IN_U_S_D) - @jakarta.annotation.Nullable - private String averagePriceInUSD; - - public static final String SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D = "totalInvestedInUSD"; - - @SerializedName(SERIALIZED_NAME_TOTAL_INVESTED_IN_U_S_D) - @jakarta.annotation.Nullable - private String totalInvestedInUSD; - - public static final String SERIALIZED_NAME_CURRENT_INVESTED_IN_U_S_D = "currentInvestedInUSD"; - - @SerializedName(SERIALIZED_NAME_CURRENT_INVESTED_IN_U_S_D) - @jakarta.annotation.Nullable - private String currentInvestedInUSD; - - public static final String SERIALIZED_NAME_PURCHASED_AMOUNT = "purchasedAmount"; - - @SerializedName(SERIALIZED_NAME_PURCHASED_AMOUNT) - @jakarta.annotation.Nullable - private String purchasedAmount; - - public static final String SERIALIZED_NAME_PNL_IN_U_S_D = "pnlInUSD"; - - @SerializedName(SERIALIZED_NAME_PNL_IN_U_S_D) - @jakarta.annotation.Nullable - private String pnlInUSD; - - public static final String SERIALIZED_NAME_ROI = "roi"; - - @SerializedName(SERIALIZED_NAME_ROI) - @jakarta.annotation.Nullable - private String roi; - - public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; - - @SerializedName(SERIALIZED_NAME_PERCENTAGE) - @jakarta.annotation.Nullable - private String percentage; - - public static final String SERIALIZED_NAME_AVAILABLE_AMOUNT = "availableAmount"; - - @SerializedName(SERIALIZED_NAME_AVAILABLE_AMOUNT) - @jakarta.annotation.Nullable - private String availableAmount; - - public static final String SERIALIZED_NAME_REDEEMED_AMOUNT = "redeemedAmount"; - - @SerializedName(SERIALIZED_NAME_REDEEMED_AMOUNT) - @jakarta.annotation.Nullable - private String redeemedAmount; - - public static final String SERIALIZED_NAME_ASSET_VALUE_IN_U_S_D = "assetValueInUSD"; - - @SerializedName(SERIALIZED_NAME_ASSET_VALUE_IN_U_S_D) - @jakarta.annotation.Nullable - private String assetValueInUSD; - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner() {} - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner targetAsset( - @jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nullable - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner averagePriceInUSD( - @jakarta.annotation.Nullable String averagePriceInUSD) { - this.averagePriceInUSD = averagePriceInUSD; - return this; - } - - /** - * Get averagePriceInUSD - * - * @return averagePriceInUSD - */ - @jakarta.annotation.Nullable - public String getAveragePriceInUSD() { - return averagePriceInUSD; - } - - public void setAveragePriceInUSD(@jakarta.annotation.Nullable String averagePriceInUSD) { - this.averagePriceInUSD = averagePriceInUSD; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner totalInvestedInUSD( - @jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - return this; - } - - /** - * Get totalInvestedInUSD - * - * @return totalInvestedInUSD - */ - @jakarta.annotation.Nullable - public String getTotalInvestedInUSD() { - return totalInvestedInUSD; - } - - public void setTotalInvestedInUSD(@jakarta.annotation.Nullable String totalInvestedInUSD) { - this.totalInvestedInUSD = totalInvestedInUSD; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner currentInvestedInUSD( - @jakarta.annotation.Nullable String currentInvestedInUSD) { - this.currentInvestedInUSD = currentInvestedInUSD; - return this; - } - - /** - * Get currentInvestedInUSD - * - * @return currentInvestedInUSD - */ - @jakarta.annotation.Nullable - public String getCurrentInvestedInUSD() { - return currentInvestedInUSD; - } - - public void setCurrentInvestedInUSD(@jakarta.annotation.Nullable String currentInvestedInUSD) { - this.currentInvestedInUSD = currentInvestedInUSD; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner purchasedAmount( - @jakarta.annotation.Nullable String purchasedAmount) { - this.purchasedAmount = purchasedAmount; - return this; - } - - /** - * Get purchasedAmount - * - * @return purchasedAmount - */ - @jakarta.annotation.Nullable - public String getPurchasedAmount() { - return purchasedAmount; - } - - public void setPurchasedAmount(@jakarta.annotation.Nullable String purchasedAmount) { - this.purchasedAmount = purchasedAmount; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner pnlInUSD( - @jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - return this; - } - - /** - * Get pnlInUSD - * - * @return pnlInUSD - */ - @jakarta.annotation.Nullable - public String getPnlInUSD() { - return pnlInUSD; - } - - public void setPnlInUSD(@jakarta.annotation.Nullable String pnlInUSD) { - this.pnlInUSD = pnlInUSD; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner roi( - @jakarta.annotation.Nullable String roi) { - this.roi = roi; - return this; - } - - /** - * Get roi - * - * @return roi - */ - @jakarta.annotation.Nullable - public String getRoi() { - return roi; - } - - public void setRoi(@jakarta.annotation.Nullable String roi) { - this.roi = roi; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner percentage( - @jakarta.annotation.Nullable String percentage) { - this.percentage = percentage; - return this; - } - - /** - * Get percentage - * - * @return percentage - */ - @jakarta.annotation.Nullable - public String getPercentage() { - return percentage; - } - - public void setPercentage(@jakarta.annotation.Nullable String percentage) { - this.percentage = percentage; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner availableAmount( - @jakarta.annotation.Nullable String availableAmount) { - this.availableAmount = availableAmount; - return this; - } - - /** - * Get availableAmount - * - * @return availableAmount - */ - @jakarta.annotation.Nullable - public String getAvailableAmount() { - return availableAmount; - } - - public void setAvailableAmount(@jakarta.annotation.Nullable String availableAmount) { - this.availableAmount = availableAmount; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner redeemedAmount( - @jakarta.annotation.Nullable String redeemedAmount) { - this.redeemedAmount = redeemedAmount; - return this; - } - - /** - * Get redeemedAmount - * - * @return redeemedAmount - */ - @jakarta.annotation.Nullable - public String getRedeemedAmount() { - return redeemedAmount; - } - - public void setRedeemedAmount(@jakarta.annotation.Nullable String redeemedAmount) { - this.redeemedAmount = redeemedAmount; - } - - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner assetValueInUSD( - @jakarta.annotation.Nullable String assetValueInUSD) { - this.assetValueInUSD = assetValueInUSD; - return this; - } - - /** - * Get assetValueInUSD - * - * @return assetValueInUSD - */ - @jakarta.annotation.Nullable - public String getAssetValueInUSD() { - return assetValueInUSD; - } - - public void setAssetValueInUSD(@jakarta.annotation.Nullable String assetValueInUSD) { - this.assetValueInUSD = assetValueInUSD; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryIndexLinkedPlanPositionDetailsResponseDetailsInner - queryIndexLinkedPlanPositionDetailsResponseDetailsInner = - (QueryIndexLinkedPlanPositionDetailsResponseDetailsInner) o; - return Objects.equals( - this.targetAsset, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner.targetAsset) - && Objects.equals( - this.averagePriceInUSD, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner.averagePriceInUSD) - && Objects.equals( - this.totalInvestedInUSD, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner.totalInvestedInUSD) - && Objects.equals( - this.currentInvestedInUSD, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner - .currentInvestedInUSD) - && Objects.equals( - this.purchasedAmount, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner.purchasedAmount) - && Objects.equals( - this.pnlInUSD, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner.pnlInUSD) - && Objects.equals( - this.roi, queryIndexLinkedPlanPositionDetailsResponseDetailsInner.roi) - && Objects.equals( - this.percentage, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner.percentage) - && Objects.equals( - this.availableAmount, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner.availableAmount) - && Objects.equals( - this.redeemedAmount, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner.redeemedAmount) - && Objects.equals( - this.assetValueInUSD, - queryIndexLinkedPlanPositionDetailsResponseDetailsInner.assetValueInUSD); - } - - @Override - public int hashCode() { - return Objects.hash( - targetAsset, - averagePriceInUSD, - totalInvestedInUSD, - currentInvestedInUSD, - purchasedAmount, - pnlInUSD, - roi, - percentage, - availableAmount, - redeemedAmount, - assetValueInUSD); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryIndexLinkedPlanPositionDetailsResponseDetailsInner {\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" averagePriceInUSD: ").append(toIndentedString(averagePriceInUSD)).append("\n"); - sb.append(" totalInvestedInUSD: ") - .append(toIndentedString(totalInvestedInUSD)) - .append("\n"); - sb.append(" currentInvestedInUSD: ") - .append(toIndentedString(currentInvestedInUSD)) - .append("\n"); - sb.append(" purchasedAmount: ").append(toIndentedString(purchasedAmount)).append("\n"); - sb.append(" pnlInUSD: ").append(toIndentedString(pnlInUSD)).append("\n"); - sb.append(" roi: ").append(toIndentedString(roi)).append("\n"); - sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); - sb.append(" availableAmount: ").append(toIndentedString(availableAmount)).append("\n"); - sb.append(" redeemedAmount: ").append(toIndentedString(redeemedAmount)).append("\n"); - sb.append(" assetValueInUSD: ").append(toIndentedString(assetValueInUSD)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object averagePriceInUSDValue = getAveragePriceInUSD(); - String averagePriceInUSDValueAsString = ""; - averagePriceInUSDValueAsString = averagePriceInUSDValue.toString(); - sb.append("averagePriceInUSD=") - .append(urlEncode(averagePriceInUSDValueAsString)) - .append(""); - Object totalInvestedInUSDValue = getTotalInvestedInUSD(); - String totalInvestedInUSDValueAsString = ""; - totalInvestedInUSDValueAsString = totalInvestedInUSDValue.toString(); - sb.append("totalInvestedInUSD=") - .append(urlEncode(totalInvestedInUSDValueAsString)) - .append(""); - Object currentInvestedInUSDValue = getCurrentInvestedInUSD(); - String currentInvestedInUSDValueAsString = ""; - currentInvestedInUSDValueAsString = currentInvestedInUSDValue.toString(); - sb.append("currentInvestedInUSD=") - .append(urlEncode(currentInvestedInUSDValueAsString)) - .append(""); - Object purchasedAmountValue = getPurchasedAmount(); - String purchasedAmountValueAsString = ""; - purchasedAmountValueAsString = purchasedAmountValue.toString(); - sb.append("purchasedAmount=").append(urlEncode(purchasedAmountValueAsString)).append(""); - Object pnlInUSDValue = getPnlInUSD(); - String pnlInUSDValueAsString = ""; - pnlInUSDValueAsString = pnlInUSDValue.toString(); - sb.append("pnlInUSD=").append(urlEncode(pnlInUSDValueAsString)).append(""); - Object roiValue = getRoi(); - String roiValueAsString = ""; - roiValueAsString = roiValue.toString(); - sb.append("roi=").append(urlEncode(roiValueAsString)).append(""); - Object percentageValue = getPercentage(); - String percentageValueAsString = ""; - percentageValueAsString = percentageValue.toString(); - sb.append("percentage=").append(urlEncode(percentageValueAsString)).append(""); - Object availableAmountValue = getAvailableAmount(); - String availableAmountValueAsString = ""; - availableAmountValueAsString = availableAmountValue.toString(); - sb.append("availableAmount=").append(urlEncode(availableAmountValueAsString)).append(""); - Object redeemedAmountValue = getRedeemedAmount(); - String redeemedAmountValueAsString = ""; - redeemedAmountValueAsString = redeemedAmountValue.toString(); - sb.append("redeemedAmount=").append(urlEncode(redeemedAmountValueAsString)).append(""); - Object assetValueInUSDValue = getAssetValueInUSD(); - String assetValueInUSDValueAsString = ""; - assetValueInUSDValueAsString = assetValueInUSDValue.toString(); - sb.append("assetValueInUSD=").append(urlEncode(assetValueInUSDValueAsString)).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("targetAsset"); - openapiFields.add("averagePriceInUSD"); - openapiFields.add("totalInvestedInUSD"); - openapiFields.add("currentInvestedInUSD"); - openapiFields.add("purchasedAmount"); - openapiFields.add("pnlInUSD"); - openapiFields.add("roi"); - openapiFields.add("percentage"); - openapiFields.add("availableAmount"); - openapiFields.add("redeemedAmount"); - openapiFields.add("assetValueInUSD"); - - // 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 - * QueryIndexLinkedPlanPositionDetailsResponseDetailsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " QueryIndexLinkedPlanPositionDetailsResponseDetailsInner is" - + " not found in the empty JSON string", - QueryIndexLinkedPlanPositionDetailsResponseDetailsInner - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryIndexLinkedPlanPositionDetailsResponseDetailsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) - && !jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - if ((jsonObj.get("averagePriceInUSD") != null - && !jsonObj.get("averagePriceInUSD").isJsonNull()) - && !jsonObj.get("averagePriceInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `averagePriceInUSD` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("averagePriceInUSD").toString())); - } - if ((jsonObj.get("totalInvestedInUSD") != null - && !jsonObj.get("totalInvestedInUSD").isJsonNull()) - && !jsonObj.get("totalInvestedInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `totalInvestedInUSD` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("totalInvestedInUSD").toString())); - } - if ((jsonObj.get("currentInvestedInUSD") != null - && !jsonObj.get("currentInvestedInUSD").isJsonNull()) - && !jsonObj.get("currentInvestedInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `currentInvestedInUSD` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("currentInvestedInUSD").toString())); - } - if ((jsonObj.get("purchasedAmount") != null && !jsonObj.get("purchasedAmount").isJsonNull()) - && !jsonObj.get("purchasedAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `purchasedAmount` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("purchasedAmount").toString())); - } - if ((jsonObj.get("pnlInUSD") != null && !jsonObj.get("pnlInUSD").isJsonNull()) - && !jsonObj.get("pnlInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `pnlInUSD` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("pnlInUSD").toString())); - } - if ((jsonObj.get("roi") != null && !jsonObj.get("roi").isJsonNull()) - && !jsonObj.get("roi").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `roi` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("roi").toString())); - } - if ((jsonObj.get("percentage") != null && !jsonObj.get("percentage").isJsonNull()) - && !jsonObj.get("percentage").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `percentage` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("percentage").toString())); - } - if ((jsonObj.get("availableAmount") != null && !jsonObj.get("availableAmount").isJsonNull()) - && !jsonObj.get("availableAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `availableAmount` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("availableAmount").toString())); - } - if ((jsonObj.get("redeemedAmount") != null && !jsonObj.get("redeemedAmount").isJsonNull()) - && !jsonObj.get("redeemedAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `redeemedAmount` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("redeemedAmount").toString())); - } - if ((jsonObj.get("assetValueInUSD") != null && !jsonObj.get("assetValueInUSD").isJsonNull()) - && !jsonObj.get("assetValueInUSD").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `assetValueInUSD` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("assetValueInUSD").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'QueryIndexLinkedPlanPositionDetailsResponseDetailsInner' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - QueryIndexLinkedPlanPositionDetailsResponseDetailsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QueryIndexLinkedPlanPositionDetailsResponseDetailsInner read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QueryIndexLinkedPlanPositionDetailsResponseDetailsInner given an JSON - * string - * - * @param jsonString JSON string - * @return An instance of QueryIndexLinkedPlanPositionDetailsResponseDetailsInner - * @throws IOException if the JSON string is invalid with respect to - * QueryIndexLinkedPlanPositionDetailsResponseDetailsInner - */ - public static QueryIndexLinkedPlanPositionDetailsResponseDetailsInner fromJson( - String jsonString) throws IOException { - return JSON.getGson() - .fromJson( - jsonString, QueryIndexLinkedPlanPositionDetailsResponseDetailsInner.class); - } - - /** - * Convert an instance of QueryIndexLinkedPlanPositionDetailsResponseDetailsInner to an JSON - * string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryOneTimeTransactionStatusResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryOneTimeTransactionStatusResponse.java deleted file mode 100644 index ac3b037e2..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QueryOneTimeTransactionStatusResponse.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** QueryOneTimeTransactionStatusResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QueryOneTimeTransactionStatusResponse { - public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; - - @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) - @jakarta.annotation.Nullable - private Long transactionId; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public QueryOneTimeTransactionStatusResponse() {} - - public QueryOneTimeTransactionStatusResponse transactionId( - @jakarta.annotation.Nullable Long transactionId) { - this.transactionId = transactionId; - return this; - } - - /** - * Get transactionId - * - * @return transactionId - */ - @jakarta.annotation.Nullable - public Long getTransactionId() { - return transactionId; - } - - public void setTransactionId(@jakarta.annotation.Nullable Long transactionId) { - this.transactionId = transactionId; - } - - public QueryOneTimeTransactionStatusResponse status( - @jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryOneTimeTransactionStatusResponse queryOneTimeTransactionStatusResponse = - (QueryOneTimeTransactionStatusResponse) o; - return Objects.equals( - this.transactionId, queryOneTimeTransactionStatusResponse.transactionId) - && Objects.equals(this.status, queryOneTimeTransactionStatusResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(transactionId, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryOneTimeTransactionStatusResponse {\n"); - sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object transactionIdValue = getTransactionId(); - String transactionIdValueAsString = ""; - transactionIdValueAsString = transactionIdValue.toString(); - sb.append("transactionId=").append(urlEncode(transactionIdValueAsString)).append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).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("transactionId"); - openapiFields.add("status"); - - // 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 - * QueryOneTimeTransactionStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueryOneTimeTransactionStatusResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in QueryOneTimeTransactionStatusResponse" - + " is not found in the empty JSON string", - QueryOneTimeTransactionStatusResponse.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryOneTimeTransactionStatusResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryOneTimeTransactionStatusResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryOneTimeTransactionStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'QueryOneTimeTransactionStatusResponse' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(QueryOneTimeTransactionStatusResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, QueryOneTimeTransactionStatusResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QueryOneTimeTransactionStatusResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QueryOneTimeTransactionStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryOneTimeTransactionStatusResponse - * @throws IOException if the JSON string is invalid with respect to - * QueryOneTimeTransactionStatusResponse - */ - public static QueryOneTimeTransactionStatusResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, QueryOneTimeTransactionStatusResponse.class); - } - - /** - * Convert an instance of QueryOneTimeTransactionStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySourceAssetListResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySourceAssetListResponse.java deleted file mode 100644 index 9b42f6dc5..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySourceAssetListResponse.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** QuerySourceAssetListResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QuerySourceAssetListResponse { - public static final String SERIALIZED_NAME_FEE_RATE = "feeRate"; - - @SerializedName(SERIALIZED_NAME_FEE_RATE) - @jakarta.annotation.Nullable - private String feeRate; - - public static final String SERIALIZED_NAME_TAX_RATE = "taxRate"; - - @SerializedName(SERIALIZED_NAME_TAX_RATE) - @jakarta.annotation.Nullable - private String taxRate; - - public static final String SERIALIZED_NAME_SOURCE_ASSETS = "sourceAssets"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSETS) - @jakarta.annotation.Nullable - private List<@Valid QuerySourceAssetListResponseSourceAssetsInner> sourceAssets; - - public QuerySourceAssetListResponse() {} - - public QuerySourceAssetListResponse feeRate(@jakarta.annotation.Nullable String feeRate) { - this.feeRate = feeRate; - return this; - } - - /** - * Get feeRate - * - * @return feeRate - */ - @jakarta.annotation.Nullable - public String getFeeRate() { - return feeRate; - } - - public void setFeeRate(@jakarta.annotation.Nullable String feeRate) { - this.feeRate = feeRate; - } - - public QuerySourceAssetListResponse taxRate(@jakarta.annotation.Nullable String taxRate) { - this.taxRate = taxRate; - return this; - } - - /** - * Get taxRate - * - * @return taxRate - */ - @jakarta.annotation.Nullable - public String getTaxRate() { - return taxRate; - } - - public void setTaxRate(@jakarta.annotation.Nullable String taxRate) { - this.taxRate = taxRate; - } - - public QuerySourceAssetListResponse sourceAssets( - @jakarta.annotation.Nullable - List<@Valid QuerySourceAssetListResponseSourceAssetsInner> sourceAssets) { - this.sourceAssets = sourceAssets; - return this; - } - - public QuerySourceAssetListResponse addSourceAssetsItem( - QuerySourceAssetListResponseSourceAssetsInner sourceAssetsItem) { - if (this.sourceAssets == null) { - this.sourceAssets = new ArrayList<>(); - } - this.sourceAssets.add(sourceAssetsItem); - return this; - } - - /** - * Get sourceAssets - * - * @return sourceAssets - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid QuerySourceAssetListResponseSourceAssetsInner> getSourceAssets() { - return sourceAssets; - } - - public void setSourceAssets( - @jakarta.annotation.Nullable - List<@Valid QuerySourceAssetListResponseSourceAssetsInner> sourceAssets) { - this.sourceAssets = sourceAssets; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QuerySourceAssetListResponse querySourceAssetListResponse = - (QuerySourceAssetListResponse) o; - return Objects.equals(this.feeRate, querySourceAssetListResponse.feeRate) - && Objects.equals(this.taxRate, querySourceAssetListResponse.taxRate) - && Objects.equals(this.sourceAssets, querySourceAssetListResponse.sourceAssets); - } - - @Override - public int hashCode() { - return Objects.hash(feeRate, taxRate, sourceAssets); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QuerySourceAssetListResponse {\n"); - sb.append(" feeRate: ").append(toIndentedString(feeRate)).append("\n"); - sb.append(" taxRate: ").append(toIndentedString(taxRate)).append("\n"); - sb.append(" sourceAssets: ").append(toIndentedString(sourceAssets)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object feeRateValue = getFeeRate(); - String feeRateValueAsString = ""; - feeRateValueAsString = feeRateValue.toString(); - sb.append("feeRate=").append(urlEncode(feeRateValueAsString)).append(""); - Object taxRateValue = getTaxRate(); - String taxRateValueAsString = ""; - taxRateValueAsString = taxRateValue.toString(); - sb.append("taxRate=").append(urlEncode(taxRateValueAsString)).append(""); - Object sourceAssetsValue = getSourceAssets(); - String sourceAssetsValueAsString = ""; - sourceAssetsValueAsString = - (String) - ((Collection) sourceAssetsValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("sourceAssets=").append(urlEncode(sourceAssetsValueAsString)).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("feeRate"); - openapiFields.add("taxRate"); - openapiFields.add("sourceAssets"); - - // 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 - * QuerySourceAssetListResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QuerySourceAssetListResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in QuerySourceAssetListResponse is not" - + " found in the empty JSON string", - QuerySourceAssetListResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QuerySourceAssetListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QuerySourceAssetListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("feeRate") != null && !jsonObj.get("feeRate").isJsonNull()) - && !jsonObj.get("feeRate").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `feeRate` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("feeRate").toString())); - } - if ((jsonObj.get("taxRate") != null && !jsonObj.get("taxRate").isJsonNull()) - && !jsonObj.get("taxRate").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `taxRate` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("taxRate").toString())); - } - if (jsonObj.get("sourceAssets") != null && !jsonObj.get("sourceAssets").isJsonNull()) { - JsonArray jsonArraysourceAssets = jsonObj.getAsJsonArray("sourceAssets"); - if (jsonArraysourceAssets != null) { - // ensure the json data is an array - if (!jsonObj.get("sourceAssets").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAssets` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("sourceAssets").toString())); - } - - // validate the optional field `sourceAssets` (array) - for (int i = 0; i < jsonArraysourceAssets.size(); i++) { - QuerySourceAssetListResponseSourceAssetsInner.validateJsonElement( - jsonArraysourceAssets.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QuerySourceAssetListResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'QuerySourceAssetListResponse' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(QuerySourceAssetListResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, QuerySourceAssetListResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QuerySourceAssetListResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QuerySourceAssetListResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of QuerySourceAssetListResponse - * @throws IOException if the JSON string is invalid with respect to - * QuerySourceAssetListResponse - */ - public static QuerySourceAssetListResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, QuerySourceAssetListResponse.class); - } - - /** - * Convert an instance of QuerySourceAssetListResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySourceAssetListResponseSourceAssetsInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySourceAssetListResponseSourceAssetsInner.java deleted file mode 100644 index 80f33a7d2..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySourceAssetListResponseSourceAssetsInner.java +++ /dev/null @@ -1,412 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** QuerySourceAssetListResponseSourceAssetsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QuerySourceAssetListResponseSourceAssetsInner { - public static final String SERIALIZED_NAME_SOURCE_ASSET = "sourceAsset"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSET) - @jakarta.annotation.Nullable - private String sourceAsset; - - public static final String SERIALIZED_NAME_ASSET_MIN_AMOUNT = "assetMinAmount"; - - @SerializedName(SERIALIZED_NAME_ASSET_MIN_AMOUNT) - @jakarta.annotation.Nullable - private String assetMinAmount; - - public static final String SERIALIZED_NAME_ASSET_MAX_AMOUNT = "assetMaxAmount"; - - @SerializedName(SERIALIZED_NAME_ASSET_MAX_AMOUNT) - @jakarta.annotation.Nullable - private String assetMaxAmount; - - public static final String SERIALIZED_NAME_SCALE = "scale"; - - @SerializedName(SERIALIZED_NAME_SCALE) - @jakarta.annotation.Nullable - private String scale; - - public static final String SERIALIZED_NAME_FLEXIBLE_AMOUNT = "flexibleAmount"; - - @SerializedName(SERIALIZED_NAME_FLEXIBLE_AMOUNT) - @jakarta.annotation.Nullable - private String flexibleAmount; - - public QuerySourceAssetListResponseSourceAssetsInner() {} - - public QuerySourceAssetListResponseSourceAssetsInner sourceAsset( - @jakarta.annotation.Nullable String sourceAsset) { - this.sourceAsset = sourceAsset; - return this; - } - - /** - * Get sourceAsset - * - * @return sourceAsset - */ - @jakarta.annotation.Nullable - public String getSourceAsset() { - return sourceAsset; - } - - public void setSourceAsset(@jakarta.annotation.Nullable String sourceAsset) { - this.sourceAsset = sourceAsset; - } - - public QuerySourceAssetListResponseSourceAssetsInner assetMinAmount( - @jakarta.annotation.Nullable String assetMinAmount) { - this.assetMinAmount = assetMinAmount; - return this; - } - - /** - * Get assetMinAmount - * - * @return assetMinAmount - */ - @jakarta.annotation.Nullable - public String getAssetMinAmount() { - return assetMinAmount; - } - - public void setAssetMinAmount(@jakarta.annotation.Nullable String assetMinAmount) { - this.assetMinAmount = assetMinAmount; - } - - public QuerySourceAssetListResponseSourceAssetsInner assetMaxAmount( - @jakarta.annotation.Nullable String assetMaxAmount) { - this.assetMaxAmount = assetMaxAmount; - return this; - } - - /** - * Get assetMaxAmount - * - * @return assetMaxAmount - */ - @jakarta.annotation.Nullable - public String getAssetMaxAmount() { - return assetMaxAmount; - } - - public void setAssetMaxAmount(@jakarta.annotation.Nullable String assetMaxAmount) { - this.assetMaxAmount = assetMaxAmount; - } - - public QuerySourceAssetListResponseSourceAssetsInner scale( - @jakarta.annotation.Nullable String scale) { - this.scale = scale; - return this; - } - - /** - * Get scale - * - * @return scale - */ - @jakarta.annotation.Nullable - public String getScale() { - return scale; - } - - public void setScale(@jakarta.annotation.Nullable String scale) { - this.scale = scale; - } - - public QuerySourceAssetListResponseSourceAssetsInner flexibleAmount( - @jakarta.annotation.Nullable String flexibleAmount) { - this.flexibleAmount = flexibleAmount; - return this; - } - - /** - * Get flexibleAmount - * - * @return flexibleAmount - */ - @jakarta.annotation.Nullable - public String getFlexibleAmount() { - return flexibleAmount; - } - - public void setFlexibleAmount(@jakarta.annotation.Nullable String flexibleAmount) { - this.flexibleAmount = flexibleAmount; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QuerySourceAssetListResponseSourceAssetsInner - querySourceAssetListResponseSourceAssetsInner = - (QuerySourceAssetListResponseSourceAssetsInner) o; - return Objects.equals( - this.sourceAsset, querySourceAssetListResponseSourceAssetsInner.sourceAsset) - && Objects.equals( - this.assetMinAmount, - querySourceAssetListResponseSourceAssetsInner.assetMinAmount) - && Objects.equals( - this.assetMaxAmount, - querySourceAssetListResponseSourceAssetsInner.assetMaxAmount) - && Objects.equals(this.scale, querySourceAssetListResponseSourceAssetsInner.scale) - && Objects.equals( - this.flexibleAmount, - querySourceAssetListResponseSourceAssetsInner.flexibleAmount); - } - - @Override - public int hashCode() { - return Objects.hash(sourceAsset, assetMinAmount, assetMaxAmount, scale, flexibleAmount); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QuerySourceAssetListResponseSourceAssetsInner {\n"); - sb.append(" sourceAsset: ").append(toIndentedString(sourceAsset)).append("\n"); - sb.append(" assetMinAmount: ").append(toIndentedString(assetMinAmount)).append("\n"); - sb.append(" assetMaxAmount: ").append(toIndentedString(assetMaxAmount)).append("\n"); - sb.append(" scale: ").append(toIndentedString(scale)).append("\n"); - sb.append(" flexibleAmount: ").append(toIndentedString(flexibleAmount)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object sourceAssetValue = getSourceAsset(); - String sourceAssetValueAsString = ""; - sourceAssetValueAsString = sourceAssetValue.toString(); - sb.append("sourceAsset=").append(urlEncode(sourceAssetValueAsString)).append(""); - Object assetMinAmountValue = getAssetMinAmount(); - String assetMinAmountValueAsString = ""; - assetMinAmountValueAsString = assetMinAmountValue.toString(); - sb.append("assetMinAmount=").append(urlEncode(assetMinAmountValueAsString)).append(""); - Object assetMaxAmountValue = getAssetMaxAmount(); - String assetMaxAmountValueAsString = ""; - assetMaxAmountValueAsString = assetMaxAmountValue.toString(); - sb.append("assetMaxAmount=").append(urlEncode(assetMaxAmountValueAsString)).append(""); - Object scaleValue = getScale(); - String scaleValueAsString = ""; - scaleValueAsString = scaleValue.toString(); - sb.append("scale=").append(urlEncode(scaleValueAsString)).append(""); - Object flexibleAmountValue = getFlexibleAmount(); - String flexibleAmountValueAsString = ""; - flexibleAmountValueAsString = flexibleAmountValue.toString(); - sb.append("flexibleAmount=").append(urlEncode(flexibleAmountValueAsString)).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("sourceAsset"); - openapiFields.add("assetMinAmount"); - openapiFields.add("assetMaxAmount"); - openapiFields.add("scale"); - openapiFields.add("flexibleAmount"); - - // 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 - * QuerySourceAssetListResponseSourceAssetsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QuerySourceAssetListResponseSourceAssetsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " QuerySourceAssetListResponseSourceAssetsInner is not found" - + " in the empty JSON string", - QuerySourceAssetListResponseSourceAssetsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QuerySourceAssetListResponseSourceAssetsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QuerySourceAssetListResponseSourceAssetsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("sourceAsset") != null && !jsonObj.get("sourceAsset").isJsonNull()) - && !jsonObj.get("sourceAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceAsset").toString())); - } - if ((jsonObj.get("assetMinAmount") != null && !jsonObj.get("assetMinAmount").isJsonNull()) - && !jsonObj.get("assetMinAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `assetMinAmount` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("assetMinAmount").toString())); - } - if ((jsonObj.get("assetMaxAmount") != null && !jsonObj.get("assetMaxAmount").isJsonNull()) - && !jsonObj.get("assetMaxAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `assetMaxAmount` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("assetMaxAmount").toString())); - } - if ((jsonObj.get("scale") != null && !jsonObj.get("scale").isJsonNull()) - && !jsonObj.get("scale").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `scale` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("scale").toString())); - } - if ((jsonObj.get("flexibleAmount") != null && !jsonObj.get("flexibleAmount").isJsonNull()) - && !jsonObj.get("flexibleAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `flexibleAmount` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("flexibleAmount").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QuerySourceAssetListResponseSourceAssetsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'QuerySourceAssetListResponseSourceAssetsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get(QuerySourceAssetListResponseSourceAssetsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, QuerySourceAssetListResponseSourceAssetsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QuerySourceAssetListResponseSourceAssetsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QuerySourceAssetListResponseSourceAssetsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of QuerySourceAssetListResponseSourceAssetsInner - * @throws IOException if the JSON string is invalid with respect to - * QuerySourceAssetListResponseSourceAssetsInner - */ - public static QuerySourceAssetListResponseSourceAssetsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, QuerySourceAssetListResponseSourceAssetsInner.class); - } - - /** - * Convert an instance of QuerySourceAssetListResponseSourceAssetsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySubscriptionTransactionHistoryResponse.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySubscriptionTransactionHistoryResponse.java deleted file mode 100644 index 249884f81..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySubscriptionTransactionHistoryResponse.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** QuerySubscriptionTransactionHistoryResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QuerySubscriptionTransactionHistoryResponse - extends ArrayList { - public QuerySubscriptionTransactionHistoryResponse() {} - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QuerySubscriptionTransactionHistoryResponse {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * QuerySubscriptionTransactionHistoryResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QuerySubscriptionTransactionHistoryResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " QuerySubscriptionTransactionHistoryResponse is not found in" - + " the empty JSON string", - QuerySubscriptionTransactionHistoryResponse.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QuerySubscriptionTransactionHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QuerySubscriptionTransactionHistoryResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QuerySubscriptionTransactionHistoryResponse.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'QuerySubscriptionTransactionHistoryResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(QuerySubscriptionTransactionHistoryResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, QuerySubscriptionTransactionHistoryResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QuerySubscriptionTransactionHistoryResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QuerySubscriptionTransactionHistoryResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of QuerySubscriptionTransactionHistoryResponse - * @throws IOException if the JSON string is invalid with respect to - * QuerySubscriptionTransactionHistoryResponse - */ - public static QuerySubscriptionTransactionHistoryResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, QuerySubscriptionTransactionHistoryResponse.class); - } - - /** - * Convert an instance of QuerySubscriptionTransactionHistoryResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySubscriptionTransactionHistoryResponseInner.java b/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySubscriptionTransactionHistoryResponseInner.java deleted file mode 100644 index d32da6afc..000000000 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/QuerySubscriptionTransactionHistoryResponseInner.java +++ /dev/null @@ -1,986 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.model; - -import com.binance.connector.client.auto_invest.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.Map; -import java.util.Objects; -import java.util.Set; -import org.hibernate.validator.constraints.*; - -/** QuerySubscriptionTransactionHistoryResponseInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QuerySubscriptionTransactionHistoryResponseInner { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @jakarta.annotation.Nullable - private Long id; - - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nullable - private String targetAsset; - - public static final String SERIALIZED_NAME_PLAN_TYPE = "planType"; - - @SerializedName(SERIALIZED_NAME_PLAN_TYPE) - @jakarta.annotation.Nullable - private String planType; - - public static final String SERIALIZED_NAME_PLAN_NAME = "planName"; - - @SerializedName(SERIALIZED_NAME_PLAN_NAME) - @jakarta.annotation.Nullable - private String planName; - - public static final String SERIALIZED_NAME_PLAN_ID = "planId"; - - @SerializedName(SERIALIZED_NAME_PLAN_ID) - @jakarta.annotation.Nullable - private Long planId; - - public static final String SERIALIZED_NAME_TRANSACTION_DATE_TIME = "transactionDateTime"; - - @SerializedName(SERIALIZED_NAME_TRANSACTION_DATE_TIME) - @jakarta.annotation.Nullable - private Long transactionDateTime; - - public static final String SERIALIZED_NAME_TRANSACTION_STATUS = "transactionStatus"; - - @SerializedName(SERIALIZED_NAME_TRANSACTION_STATUS) - @jakarta.annotation.Nullable - private String transactionStatus; - - public static final String SERIALIZED_NAME_FAILED_TYPE = "failedType"; - - @SerializedName(SERIALIZED_NAME_FAILED_TYPE) - @jakarta.annotation.Nullable - private String failedType; - - public static final String SERIALIZED_NAME_SOURCE_ASSET = "sourceAsset"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSET) - @jakarta.annotation.Nullable - private String sourceAsset; - - public static final String SERIALIZED_NAME_SOURCE_ASSET_AMOUNT = "sourceAssetAmount"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ASSET_AMOUNT) - @jakarta.annotation.Nullable - private String sourceAssetAmount; - - public static final String SERIALIZED_NAME_TARGET_ASSET_AMOUNT = "targetAssetAmount"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET_AMOUNT) - @jakarta.annotation.Nullable - private String targetAssetAmount; - - public static final String SERIALIZED_NAME_SOURCE_WALLET = "sourceWallet"; - - @SerializedName(SERIALIZED_NAME_SOURCE_WALLET) - @jakarta.annotation.Nullable - private String sourceWallet; - - public static final String SERIALIZED_NAME_FLEXIBLE_USED = "flexibleUsed"; - - @SerializedName(SERIALIZED_NAME_FLEXIBLE_USED) - @jakarta.annotation.Nullable - private String flexibleUsed; - - public static final String SERIALIZED_NAME_TRANSACTION_FEE = "transactionFee"; - - @SerializedName(SERIALIZED_NAME_TRANSACTION_FEE) - @jakarta.annotation.Nullable - private String transactionFee; - - public static final String SERIALIZED_NAME_TRANSACTION_FEE_UNIT = "transactionFeeUnit"; - - @SerializedName(SERIALIZED_NAME_TRANSACTION_FEE_UNIT) - @jakarta.annotation.Nullable - private String transactionFeeUnit; - - public static final String SERIALIZED_NAME_EXECUTION_PRICE = "executionPrice"; - - @SerializedName(SERIALIZED_NAME_EXECUTION_PRICE) - @jakarta.annotation.Nullable - private String executionPrice; - - public static final String SERIALIZED_NAME_EXECUTION_TYPE = "executionType"; - - @SerializedName(SERIALIZED_NAME_EXECUTION_TYPE) - @jakarta.annotation.Nullable - private String executionType; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_CYCLE = "subscriptionCycle"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_CYCLE) - @jakarta.annotation.Nullable - private String subscriptionCycle; - - public QuerySubscriptionTransactionHistoryResponseInner() {} - - public QuerySubscriptionTransactionHistoryResponseInner id( - @jakarta.annotation.Nullable Long id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @jakarta.annotation.Nullable - public Long getId() { - return id; - } - - public void setId(@jakarta.annotation.Nullable Long id) { - this.id = id; - } - - public QuerySubscriptionTransactionHistoryResponseInner targetAsset( - @jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nullable - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - } - - public QuerySubscriptionTransactionHistoryResponseInner planType( - @jakarta.annotation.Nullable String planType) { - this.planType = planType; - return this; - } - - /** - * Get planType - * - * @return planType - */ - @jakarta.annotation.Nullable - public String getPlanType() { - return planType; - } - - public void setPlanType(@jakarta.annotation.Nullable String planType) { - this.planType = planType; - } - - public QuerySubscriptionTransactionHistoryResponseInner planName( - @jakarta.annotation.Nullable String planName) { - this.planName = planName; - return this; - } - - /** - * Get planName - * - * @return planName - */ - @jakarta.annotation.Nullable - public String getPlanName() { - return planName; - } - - public void setPlanName(@jakarta.annotation.Nullable String planName) { - this.planName = planName; - } - - public QuerySubscriptionTransactionHistoryResponseInner planId( - @jakarta.annotation.Nullable Long planId) { - this.planId = planId; - return this; - } - - /** - * Get planId - * - * @return planId - */ - @jakarta.annotation.Nullable - public Long getPlanId() { - return planId; - } - - public void setPlanId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; - } - - public QuerySubscriptionTransactionHistoryResponseInner transactionDateTime( - @jakarta.annotation.Nullable Long transactionDateTime) { - this.transactionDateTime = transactionDateTime; - return this; - } - - /** - * Get transactionDateTime - * - * @return transactionDateTime - */ - @jakarta.annotation.Nullable - public Long getTransactionDateTime() { - return transactionDateTime; - } - - public void setTransactionDateTime(@jakarta.annotation.Nullable Long transactionDateTime) { - this.transactionDateTime = transactionDateTime; - } - - public QuerySubscriptionTransactionHistoryResponseInner transactionStatus( - @jakarta.annotation.Nullable String transactionStatus) { - this.transactionStatus = transactionStatus; - return this; - } - - /** - * Get transactionStatus - * - * @return transactionStatus - */ - @jakarta.annotation.Nullable - public String getTransactionStatus() { - return transactionStatus; - } - - public void setTransactionStatus(@jakarta.annotation.Nullable String transactionStatus) { - this.transactionStatus = transactionStatus; - } - - public QuerySubscriptionTransactionHistoryResponseInner failedType( - @jakarta.annotation.Nullable String failedType) { - this.failedType = failedType; - return this; - } - - /** - * Get failedType - * - * @return failedType - */ - @jakarta.annotation.Nullable - public String getFailedType() { - return failedType; - } - - public void setFailedType(@jakarta.annotation.Nullable String failedType) { - this.failedType = failedType; - } - - public QuerySubscriptionTransactionHistoryResponseInner sourceAsset( - @jakarta.annotation.Nullable String sourceAsset) { - this.sourceAsset = sourceAsset; - return this; - } - - /** - * Get sourceAsset - * - * @return sourceAsset - */ - @jakarta.annotation.Nullable - public String getSourceAsset() { - return sourceAsset; - } - - public void setSourceAsset(@jakarta.annotation.Nullable String sourceAsset) { - this.sourceAsset = sourceAsset; - } - - public QuerySubscriptionTransactionHistoryResponseInner sourceAssetAmount( - @jakarta.annotation.Nullable String sourceAssetAmount) { - this.sourceAssetAmount = sourceAssetAmount; - return this; - } - - /** - * Get sourceAssetAmount - * - * @return sourceAssetAmount - */ - @jakarta.annotation.Nullable - public String getSourceAssetAmount() { - return sourceAssetAmount; - } - - public void setSourceAssetAmount(@jakarta.annotation.Nullable String sourceAssetAmount) { - this.sourceAssetAmount = sourceAssetAmount; - } - - public QuerySubscriptionTransactionHistoryResponseInner targetAssetAmount( - @jakarta.annotation.Nullable String targetAssetAmount) { - this.targetAssetAmount = targetAssetAmount; - return this; - } - - /** - * Get targetAssetAmount - * - * @return targetAssetAmount - */ - @jakarta.annotation.Nullable - public String getTargetAssetAmount() { - return targetAssetAmount; - } - - public void setTargetAssetAmount(@jakarta.annotation.Nullable String targetAssetAmount) { - this.targetAssetAmount = targetAssetAmount; - } - - public QuerySubscriptionTransactionHistoryResponseInner sourceWallet( - @jakarta.annotation.Nullable String sourceWallet) { - this.sourceWallet = sourceWallet; - return this; - } - - /** - * Get sourceWallet - * - * @return sourceWallet - */ - @jakarta.annotation.Nullable - public String getSourceWallet() { - return sourceWallet; - } - - public void setSourceWallet(@jakarta.annotation.Nullable String sourceWallet) { - this.sourceWallet = sourceWallet; - } - - public QuerySubscriptionTransactionHistoryResponseInner flexibleUsed( - @jakarta.annotation.Nullable String flexibleUsed) { - this.flexibleUsed = flexibleUsed; - return this; - } - - /** - * Get flexibleUsed - * - * @return flexibleUsed - */ - @jakarta.annotation.Nullable - public String getFlexibleUsed() { - return flexibleUsed; - } - - public void setFlexibleUsed(@jakarta.annotation.Nullable String flexibleUsed) { - this.flexibleUsed = flexibleUsed; - } - - public QuerySubscriptionTransactionHistoryResponseInner transactionFee( - @jakarta.annotation.Nullable String transactionFee) { - this.transactionFee = transactionFee; - return this; - } - - /** - * Get transactionFee - * - * @return transactionFee - */ - @jakarta.annotation.Nullable - public String getTransactionFee() { - return transactionFee; - } - - public void setTransactionFee(@jakarta.annotation.Nullable String transactionFee) { - this.transactionFee = transactionFee; - } - - public QuerySubscriptionTransactionHistoryResponseInner transactionFeeUnit( - @jakarta.annotation.Nullable String transactionFeeUnit) { - this.transactionFeeUnit = transactionFeeUnit; - return this; - } - - /** - * Get transactionFeeUnit - * - * @return transactionFeeUnit - */ - @jakarta.annotation.Nullable - public String getTransactionFeeUnit() { - return transactionFeeUnit; - } - - public void setTransactionFeeUnit(@jakarta.annotation.Nullable String transactionFeeUnit) { - this.transactionFeeUnit = transactionFeeUnit; - } - - public QuerySubscriptionTransactionHistoryResponseInner executionPrice( - @jakarta.annotation.Nullable String executionPrice) { - this.executionPrice = executionPrice; - return this; - } - - /** - * Get executionPrice - * - * @return executionPrice - */ - @jakarta.annotation.Nullable - public String getExecutionPrice() { - return executionPrice; - } - - public void setExecutionPrice(@jakarta.annotation.Nullable String executionPrice) { - this.executionPrice = executionPrice; - } - - public QuerySubscriptionTransactionHistoryResponseInner executionType( - @jakarta.annotation.Nullable String executionType) { - this.executionType = executionType; - return this; - } - - /** - * Get executionType - * - * @return executionType - */ - @jakarta.annotation.Nullable - public String getExecutionType() { - return executionType; - } - - public void setExecutionType(@jakarta.annotation.Nullable String executionType) { - this.executionType = executionType; - } - - public QuerySubscriptionTransactionHistoryResponseInner subscriptionCycle( - @jakarta.annotation.Nullable String subscriptionCycle) { - this.subscriptionCycle = subscriptionCycle; - return this; - } - - /** - * Get subscriptionCycle - * - * @return subscriptionCycle - */ - @jakarta.annotation.Nullable - public String getSubscriptionCycle() { - return subscriptionCycle; - } - - public void setSubscriptionCycle(@jakarta.annotation.Nullable String subscriptionCycle) { - this.subscriptionCycle = subscriptionCycle; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QuerySubscriptionTransactionHistoryResponseInner - querySubscriptionTransactionHistoryResponseInner = - (QuerySubscriptionTransactionHistoryResponseInner) o; - return Objects.equals(this.id, querySubscriptionTransactionHistoryResponseInner.id) - && Objects.equals( - this.targetAsset, - querySubscriptionTransactionHistoryResponseInner.targetAsset) - && Objects.equals( - this.planType, querySubscriptionTransactionHistoryResponseInner.planType) - && Objects.equals( - this.planName, querySubscriptionTransactionHistoryResponseInner.planName) - && Objects.equals( - this.planId, querySubscriptionTransactionHistoryResponseInner.planId) - && Objects.equals( - this.transactionDateTime, - querySubscriptionTransactionHistoryResponseInner.transactionDateTime) - && Objects.equals( - this.transactionStatus, - querySubscriptionTransactionHistoryResponseInner.transactionStatus) - && Objects.equals( - this.failedType, - querySubscriptionTransactionHistoryResponseInner.failedType) - && Objects.equals( - this.sourceAsset, - querySubscriptionTransactionHistoryResponseInner.sourceAsset) - && Objects.equals( - this.sourceAssetAmount, - querySubscriptionTransactionHistoryResponseInner.sourceAssetAmount) - && Objects.equals( - this.targetAssetAmount, - querySubscriptionTransactionHistoryResponseInner.targetAssetAmount) - && Objects.equals( - this.sourceWallet, - querySubscriptionTransactionHistoryResponseInner.sourceWallet) - && Objects.equals( - this.flexibleUsed, - querySubscriptionTransactionHistoryResponseInner.flexibleUsed) - && Objects.equals( - this.transactionFee, - querySubscriptionTransactionHistoryResponseInner.transactionFee) - && Objects.equals( - this.transactionFeeUnit, - querySubscriptionTransactionHistoryResponseInner.transactionFeeUnit) - && Objects.equals( - this.executionPrice, - querySubscriptionTransactionHistoryResponseInner.executionPrice) - && Objects.equals( - this.executionType, - querySubscriptionTransactionHistoryResponseInner.executionType) - && Objects.equals( - this.subscriptionCycle, - querySubscriptionTransactionHistoryResponseInner.subscriptionCycle); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - targetAsset, - planType, - planName, - planId, - transactionDateTime, - transactionStatus, - failedType, - sourceAsset, - sourceAssetAmount, - targetAssetAmount, - sourceWallet, - flexibleUsed, - transactionFee, - transactionFeeUnit, - executionPrice, - executionType, - subscriptionCycle); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QuerySubscriptionTransactionHistoryResponseInner {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" planType: ").append(toIndentedString(planType)).append("\n"); - sb.append(" planName: ").append(toIndentedString(planName)).append("\n"); - sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); - sb.append(" transactionDateTime: ") - .append(toIndentedString(transactionDateTime)) - .append("\n"); - sb.append(" transactionStatus: ").append(toIndentedString(transactionStatus)).append("\n"); - sb.append(" failedType: ").append(toIndentedString(failedType)).append("\n"); - sb.append(" sourceAsset: ").append(toIndentedString(sourceAsset)).append("\n"); - sb.append(" sourceAssetAmount: ").append(toIndentedString(sourceAssetAmount)).append("\n"); - sb.append(" targetAssetAmount: ").append(toIndentedString(targetAssetAmount)).append("\n"); - sb.append(" sourceWallet: ").append(toIndentedString(sourceWallet)).append("\n"); - sb.append(" flexibleUsed: ").append(toIndentedString(flexibleUsed)).append("\n"); - sb.append(" transactionFee: ").append(toIndentedString(transactionFee)).append("\n"); - sb.append(" transactionFeeUnit: ") - .append(toIndentedString(transactionFeeUnit)) - .append("\n"); - sb.append(" executionPrice: ").append(toIndentedString(executionPrice)).append("\n"); - sb.append(" executionType: ").append(toIndentedString(executionType)).append("\n"); - sb.append(" subscriptionCycle: ").append(toIndentedString(subscriptionCycle)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object idValue = getId(); - String idValueAsString = ""; - idValueAsString = idValue.toString(); - sb.append("id=").append(urlEncode(idValueAsString)).append(""); - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object planTypeValue = getPlanType(); - String planTypeValueAsString = ""; - planTypeValueAsString = planTypeValue.toString(); - sb.append("planType=").append(urlEncode(planTypeValueAsString)).append(""); - Object planNameValue = getPlanName(); - String planNameValueAsString = ""; - planNameValueAsString = planNameValue.toString(); - sb.append("planName=").append(urlEncode(planNameValueAsString)).append(""); - Object planIdValue = getPlanId(); - String planIdValueAsString = ""; - planIdValueAsString = planIdValue.toString(); - sb.append("planId=").append(urlEncode(planIdValueAsString)).append(""); - Object transactionDateTimeValue = getTransactionDateTime(); - String transactionDateTimeValueAsString = ""; - transactionDateTimeValueAsString = transactionDateTimeValue.toString(); - sb.append("transactionDateTime=") - .append(urlEncode(transactionDateTimeValueAsString)) - .append(""); - Object transactionStatusValue = getTransactionStatus(); - String transactionStatusValueAsString = ""; - transactionStatusValueAsString = transactionStatusValue.toString(); - sb.append("transactionStatus=") - .append(urlEncode(transactionStatusValueAsString)) - .append(""); - Object failedTypeValue = getFailedType(); - String failedTypeValueAsString = ""; - failedTypeValueAsString = failedTypeValue.toString(); - sb.append("failedType=").append(urlEncode(failedTypeValueAsString)).append(""); - Object sourceAssetValue = getSourceAsset(); - String sourceAssetValueAsString = ""; - sourceAssetValueAsString = sourceAssetValue.toString(); - sb.append("sourceAsset=").append(urlEncode(sourceAssetValueAsString)).append(""); - Object sourceAssetAmountValue = getSourceAssetAmount(); - String sourceAssetAmountValueAsString = ""; - sourceAssetAmountValueAsString = sourceAssetAmountValue.toString(); - sb.append("sourceAssetAmount=") - .append(urlEncode(sourceAssetAmountValueAsString)) - .append(""); - Object targetAssetAmountValue = getTargetAssetAmount(); - String targetAssetAmountValueAsString = ""; - targetAssetAmountValueAsString = targetAssetAmountValue.toString(); - sb.append("targetAssetAmount=") - .append(urlEncode(targetAssetAmountValueAsString)) - .append(""); - Object sourceWalletValue = getSourceWallet(); - String sourceWalletValueAsString = ""; - sourceWalletValueAsString = sourceWalletValue.toString(); - sb.append("sourceWallet=").append(urlEncode(sourceWalletValueAsString)).append(""); - Object flexibleUsedValue = getFlexibleUsed(); - String flexibleUsedValueAsString = ""; - flexibleUsedValueAsString = flexibleUsedValue.toString(); - sb.append("flexibleUsed=").append(urlEncode(flexibleUsedValueAsString)).append(""); - Object transactionFeeValue = getTransactionFee(); - String transactionFeeValueAsString = ""; - transactionFeeValueAsString = transactionFeeValue.toString(); - sb.append("transactionFee=").append(urlEncode(transactionFeeValueAsString)).append(""); - Object transactionFeeUnitValue = getTransactionFeeUnit(); - String transactionFeeUnitValueAsString = ""; - transactionFeeUnitValueAsString = transactionFeeUnitValue.toString(); - sb.append("transactionFeeUnit=") - .append(urlEncode(transactionFeeUnitValueAsString)) - .append(""); - Object executionPriceValue = getExecutionPrice(); - String executionPriceValueAsString = ""; - executionPriceValueAsString = executionPriceValue.toString(); - sb.append("executionPrice=").append(urlEncode(executionPriceValueAsString)).append(""); - Object executionTypeValue = getExecutionType(); - String executionTypeValueAsString = ""; - executionTypeValueAsString = executionTypeValue.toString(); - sb.append("executionType=").append(urlEncode(executionTypeValueAsString)).append(""); - Object subscriptionCycleValue = getSubscriptionCycle(); - String subscriptionCycleValueAsString = ""; - subscriptionCycleValueAsString = subscriptionCycleValue.toString(); - sb.append("subscriptionCycle=") - .append(urlEncode(subscriptionCycleValueAsString)) - .append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("targetAsset"); - openapiFields.add("planType"); - openapiFields.add("planName"); - openapiFields.add("planId"); - openapiFields.add("transactionDateTime"); - openapiFields.add("transactionStatus"); - openapiFields.add("failedType"); - openapiFields.add("sourceAsset"); - openapiFields.add("sourceAssetAmount"); - openapiFields.add("targetAssetAmount"); - openapiFields.add("sourceWallet"); - openapiFields.add("flexibleUsed"); - openapiFields.add("transactionFee"); - openapiFields.add("transactionFeeUnit"); - openapiFields.add("executionPrice"); - openapiFields.add("executionType"); - openapiFields.add("subscriptionCycle"); - - // 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 - * QuerySubscriptionTransactionHistoryResponseInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QuerySubscriptionTransactionHistoryResponseInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " QuerySubscriptionTransactionHistoryResponseInner is not" - + " found in the empty JSON string", - QuerySubscriptionTransactionHistoryResponseInner - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QuerySubscriptionTransactionHistoryResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QuerySubscriptionTransactionHistoryResponseInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) - && !jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - if ((jsonObj.get("planType") != null && !jsonObj.get("planType").isJsonNull()) - && !jsonObj.get("planType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `planType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("planType").toString())); - } - if ((jsonObj.get("planName") != null && !jsonObj.get("planName").isJsonNull()) - && !jsonObj.get("planName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `planName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("planName").toString())); - } - if ((jsonObj.get("transactionStatus") != null - && !jsonObj.get("transactionStatus").isJsonNull()) - && !jsonObj.get("transactionStatus").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transactionStatus` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("transactionStatus").toString())); - } - if ((jsonObj.get("failedType") != null && !jsonObj.get("failedType").isJsonNull()) - && !jsonObj.get("failedType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `failedType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("failedType").toString())); - } - if ((jsonObj.get("sourceAsset") != null && !jsonObj.get("sourceAsset").isJsonNull()) - && !jsonObj.get("sourceAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceAsset").toString())); - } - if ((jsonObj.get("sourceAssetAmount") != null - && !jsonObj.get("sourceAssetAmount").isJsonNull()) - && !jsonObj.get("sourceAssetAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceAssetAmount` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("sourceAssetAmount").toString())); - } - if ((jsonObj.get("targetAssetAmount") != null - && !jsonObj.get("targetAssetAmount").isJsonNull()) - && !jsonObj.get("targetAssetAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAssetAmount` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("targetAssetAmount").toString())); - } - if ((jsonObj.get("sourceWallet") != null && !jsonObj.get("sourceWallet").isJsonNull()) - && !jsonObj.get("sourceWallet").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceWallet` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceWallet").toString())); - } - if ((jsonObj.get("flexibleUsed") != null && !jsonObj.get("flexibleUsed").isJsonNull()) - && !jsonObj.get("flexibleUsed").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `flexibleUsed` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("flexibleUsed").toString())); - } - if ((jsonObj.get("transactionFee") != null && !jsonObj.get("transactionFee").isJsonNull()) - && !jsonObj.get("transactionFee").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transactionFee` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("transactionFee").toString())); - } - if ((jsonObj.get("transactionFeeUnit") != null - && !jsonObj.get("transactionFeeUnit").isJsonNull()) - && !jsonObj.get("transactionFeeUnit").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transactionFeeUnit` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("transactionFeeUnit").toString())); - } - if ((jsonObj.get("executionPrice") != null && !jsonObj.get("executionPrice").isJsonNull()) - && !jsonObj.get("executionPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `executionPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("executionPrice").toString())); - } - if ((jsonObj.get("executionType") != null && !jsonObj.get("executionType").isJsonNull()) - && !jsonObj.get("executionType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `executionType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("executionType").toString())); - } - if ((jsonObj.get("subscriptionCycle") != null - && !jsonObj.get("subscriptionCycle").isJsonNull()) - && !jsonObj.get("subscriptionCycle").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionCycle` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("subscriptionCycle").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QuerySubscriptionTransactionHistoryResponseInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'QuerySubscriptionTransactionHistoryResponseInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get(QuerySubscriptionTransactionHistoryResponseInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - QuerySubscriptionTransactionHistoryResponseInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QuerySubscriptionTransactionHistoryResponseInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QuerySubscriptionTransactionHistoryResponseInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of QuerySubscriptionTransactionHistoryResponseInner - * @throws IOException if the JSON string is invalid with respect to - * QuerySubscriptionTransactionHistoryResponseInner - */ - public static QuerySubscriptionTransactionHistoryResponseInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, QuerySubscriptionTransactionHistoryResponseInner.class); - } - - /** - * Convert an instance of QuerySubscriptionTransactionHistoryResponseInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/auto-invest/src/test/java/com/binance/connector/client/auto_invest/rest/api/MarketDataApiTest.java b/clients/auto-invest/src/test/java/com/binance/connector/client/auto_invest/rest/api/MarketDataApiTest.java deleted file mode 100644 index 7662e123a..000000000 --- a/clients/auto-invest/src/test/java/com/binance/connector/client/auto_invest/rest/api/MarketDataApiTest.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.api; - -import static org.junit.Assert.assertEquals; - -import com.binance.connector.client.auto_invest.rest.model.GetListOfPlansResponse; -import com.binance.connector.client.auto_invest.rest.model.GetTargetAssetListResponse; -import com.binance.connector.client.auto_invest.rest.model.GetTargetAssetRoiDataResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryAllSourceAssetAndTargetAssetResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryIndexDetailsResponse; -import com.binance.connector.client.auto_invest.rest.model.QuerySourceAssetListResponse; -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.auth.BinanceAuthenticationFactory; -import com.binance.connector.client.common.auth.SignatureAuthentication; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.sign.HmacSignatureGenerator; -import com.binance.connector.client.common.sign.SignatureGenerator; -import jakarta.validation.constraints.*; -import okhttp3.Call; -import okhttp3.Request; -import org.bouncycastle.crypto.CryptoException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; - -/** API tests for MarketDataApi */ -public class MarketDataApiTest { - - private MarketDataApi api; - private ApiClient apiClientSpy; - private SignatureGenerator signatureGeneratorSpy; - - @BeforeEach - public void initApiClient() throws ApiException { - ClientConfiguration clientConfiguration = new ClientConfiguration(); - clientConfiguration.setUrl("http://localhost:8080"); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setSecretKey("secretKey"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - HmacSignatureGenerator signatureGenerator = - new HmacSignatureGenerator(signatureConfiguration.getSecretKey()); - signatureGeneratorSpy = Mockito.spy(signatureGenerator); - SignatureAuthentication signatureAuthentication = - new SignatureAuthentication( - signatureConfiguration.getApiKey(), signatureGeneratorSpy); - SignatureAuthentication authenticationSpy = Mockito.spy(signatureAuthentication); - Mockito.doReturn("1736393892000").when(authenticationSpy).buildTimestamp(); - - BinanceAuthenticationFactory factoryMock = Mockito.mock(BinanceAuthenticationFactory.class); - Mockito.doReturn(authenticationSpy) - .when(factoryMock) - .getAuthentication(signatureConfiguration); - - ApiClient apiClient = new ApiClient(clientConfiguration, factoryMock); - - apiClientSpy = Mockito.spy(apiClient); - Mockito.doReturn(new ApiResponse<>(200, null)) - .when(apiClientSpy) - .execute(Mockito.any(), Mockito.any(java.lang.reflect.Type.class)); - Mockito.doReturn(new ApiResponse<>(200, null)).when(apiClientSpy).execute(Mockito.any()); - Mockito.doReturn("1736393892000").when(apiClientSpy).buildTimestamp(); - - api = new MarketDataApi(apiClientSpy); - } - - /** - * Get list of plans (USER_DATA) - * - *

Query plan lists * max one request every 3s per account Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getListOfPlansTest() throws ApiException, CryptoException { - String planType = ""; - Long recvWindow = 5000L; - ApiResponse response = api.getListOfPlans(planType, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "planType=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "5de5a9073df925946fb4442f5f96ee73bc22fc522430a1502ffd79aac5c8efd3", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/lending/auto-invest/plan/list", actualRequest.url().encodedPath()); - } - - /** - * Get target asset list(USER_DATA) - * - *

Get target asset list Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getTargetAssetListTest() throws ApiException, CryptoException { - Long targetAsset = 0L; - Long size = 8L; - Long current = 1L; - Long recvWindow = 5000L; - ApiResponse response = - api.getTargetAssetList(targetAsset, size, current, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "targetAsset=0&size=8¤t=1&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "a36d89d1eb2d5f8228428d9260f70141120c00bff6458617847c3e3852fc0321", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/lending/auto-invest/target-asset/list", - actualRequest.url().encodedPath()); - } - - /** - * Get target asset ROI data - * - *

ROI return list for target asset Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getTargetAssetRoiDataTest() throws ApiException, CryptoException { - String targetAsset = ""; - String hisRoiType = ""; - Long recvWindow = 5000L; - ApiResponse response = - api.getTargetAssetRoiData(targetAsset, hisRoiType, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/lending/auto-invest/target-asset/roi/list", - actualRequest.url().encodedPath()); - } - - /** - * Query all source asset and target asset(USER_DATA) - * - *

Query all source assets and target assets Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void queryAllSourceAssetAndTargetAssetTest() throws ApiException, CryptoException { - Long recvWindow = 5000L; - ApiResponse response = - api.queryAllSourceAssetAndTargetAsset(recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/lending/auto-invest/all/asset", actualRequest.url().encodedPath()); - } - - /** - * Query Index Details(USER_DATA) - * - *

Query index details Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void queryIndexDetailsTest() throws ApiException, CryptoException { - Long indexId = 1L; - Long recvWindow = 5000L; - ApiResponse response = - api.queryIndexDetails(indexId, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "indexId=1&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "ca36fec333b635ceda65152b3c44a7e30c31c4e90a2ce138cef6ecb4c247e6b5", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/lending/auto-invest/index/info", actualRequest.url().encodedPath()); - } - - /** - * Query source asset list(USER_DATA) - * - *

Query Source Asset to be used for investment Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void querySourceAssetListTest() throws ApiException, CryptoException { - String usageType = ""; - Long targetAsset = 0L; - Long indexId = 1L; - Boolean flexibleAllowedToUse = true; - String sourceType = ""; - Long recvWindow = 5000L; - ApiResponse response = - api.querySourceAssetList( - usageType, - targetAsset, - indexId, - flexibleAllowedToUse, - sourceType, - recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "targetAsset=0&indexId=1&usageType=&flexibleAllowedToUse=true&sourceType=&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "d6763190327d3ed9345f19c47c3bc145b3135abd5ee6555b4be0325fffe2bb8a", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/lending/auto-invest/source-asset/list", - actualRequest.url().encodedPath()); - } -} diff --git a/clients/auto-invest/src/test/java/com/binance/connector/client/auto_invest/rest/api/TradeApiTest.java b/clients/auto-invest/src/test/java/com/binance/connector/client/auto_invest/rest/api/TradeApiTest.java deleted file mode 100644 index 3a8280e12..000000000 --- a/clients/auto-invest/src/test/java/com/binance/connector/client/auto_invest/rest/api/TradeApiTest.java +++ /dev/null @@ -1,522 +0,0 @@ -/* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.api; - -import static org.junit.Assert.assertEquals; - -import com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusRequest; -import com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusResponse; -import com.binance.connector.client.auto_invest.rest.model.Details; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRebalanceDetailsResponse; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionRequest; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionResponse; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionTradeResponse; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanAdjustmentRequest; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanAdjustmentResponse; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanCreationRequest; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanCreationResponse; -import com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionRequest; -import com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryHoldingDetailsOfThePlanResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryIndexLinkedPlanPositionDetailsResponse; -import com.binance.connector.client.auto_invest.rest.model.QueryOneTimeTransactionStatusResponse; -import com.binance.connector.client.auto_invest.rest.model.QuerySubscriptionTransactionHistoryResponse; -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.auth.BinanceAuthenticationFactory; -import com.binance.connector.client.common.auth.SignatureAuthentication; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.sign.HmacSignatureGenerator; -import com.binance.connector.client.common.sign.SignatureGenerator; -import jakarta.validation.constraints.*; -import okhttp3.Call; -import okhttp3.Request; -import org.bouncycastle.crypto.CryptoException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; - -/** API tests for TradeApi */ -public class TradeApiTest { - - private TradeApi api; - private ApiClient apiClientSpy; - private SignatureGenerator signatureGeneratorSpy; - - @BeforeEach - public void initApiClient() throws ApiException { - ClientConfiguration clientConfiguration = new ClientConfiguration(); - clientConfiguration.setUrl("http://localhost:8080"); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setSecretKey("secretKey"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - HmacSignatureGenerator signatureGenerator = - new HmacSignatureGenerator(signatureConfiguration.getSecretKey()); - signatureGeneratorSpy = Mockito.spy(signatureGenerator); - SignatureAuthentication signatureAuthentication = - new SignatureAuthentication( - signatureConfiguration.getApiKey(), signatureGeneratorSpy); - SignatureAuthentication authenticationSpy = Mockito.spy(signatureAuthentication); - Mockito.doReturn("1736393892000").when(authenticationSpy).buildTimestamp(); - - BinanceAuthenticationFactory factoryMock = Mockito.mock(BinanceAuthenticationFactory.class); - Mockito.doReturn(authenticationSpy) - .when(factoryMock) - .getAuthentication(signatureConfiguration); - - ApiClient apiClient = new ApiClient(clientConfiguration, factoryMock); - - apiClientSpy = Mockito.spy(apiClient); - Mockito.doReturn(new ApiResponse<>(200, null)) - .when(apiClientSpy) - .execute(Mockito.any(), Mockito.any(java.lang.reflect.Type.class)); - Mockito.doReturn(new ApiResponse<>(200, null)).when(apiClientSpy).execute(Mockito.any()); - Mockito.doReturn("1736393892000").when(apiClientSpy).buildTimestamp(); - - api = new TradeApi(apiClientSpy); - } - - /** - * Change Plan Status(TRADE) - * - *

Change Plan Status * max one request every 3s per account Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void changePlanStatusTest() throws ApiException, CryptoException { - ChangePlanStatusRequest changePlanStatusRequest = new ChangePlanStatusRequest(); - - changePlanStatusRequest.planId(1L); - changePlanStatusRequest.status(""); - - ApiResponse response = - api.changePlanStatus(changePlanStatusRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("timestamp=1736393892000planId=1&status=", signInputCaptor.getValue()); - assertEquals( - "e91555a515d8a44caa038d28c90fbcd0462955c687fd5a0a67f5af6156c0061f", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/lending/auto-invest/plan/edit-status", actualRequest.url().encodedPath()); - } - - /** - * Index Linked Plan Rebalance Details(USER_DATA) - * - *

Get the history of Index Linked Plan Redemption transactions * Max 30 day difference - * between `startTime` and `endTime` * If no `startTime` and - * `endTime`, default to show past 30 day records Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void indexLinkedPlanRebalanceDetailsTest() throws ApiException, CryptoException { - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - Long size = 8L; - Long recvWindow = 5000L; - ApiResponse response = - api.indexLinkedPlanRebalanceDetails(startTime, endTime, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "startTime=1623319461670&endTime=1641782889000¤t=1&size=8&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "7542cbab547a04dd9561523640a8a0248ec925f2970f0be027d5039f8ecfac02", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/lending/auto-invest/rebalance/history", - actualRequest.url().encodedPath()); - } - - /** - * Index Linked Plan Redemption(TRADE) - * - *

To redeem index-Linked plan holdings Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void indexLinkedPlanRedemptionTest() throws ApiException, CryptoException { - IndexLinkedPlanRedemptionRequest indexLinkedPlanRedemptionRequest = - new IndexLinkedPlanRedemptionRequest(); - - indexLinkedPlanRedemptionRequest.indexId(1L); - indexLinkedPlanRedemptionRequest.redemptionPercentage(0L); - - ApiResponse response = - api.indexLinkedPlanRedemption(indexLinkedPlanRedemptionRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "timestamp=1736393892000redemptionPercentage=0&indexId=1", - signInputCaptor.getValue()); - assertEquals( - "4e3047c7fa3932aa3cd44bc5629dc236813ed073dc83cbb48df8558fdbeb0d55", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/lending/auto-invest/redeem", actualRequest.url().encodedPath()); - } - - /** - * Index Linked Plan Redemption(USER_DATA) - * - *

Get the history of Index Linked Plan Redemption transactions * Max 30 day difference - * between `startTime` and `endTime` * If no `startTime` and - * `endTime`, default to show past 30 day records Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void indexLinkedPlanRedemptionTradeTest() throws ApiException, CryptoException { - Long requestId = 1L; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - String asset = ""; - Long size = 8L; - Long recvWindow = 5000L; - ApiResponse response = - api.indexLinkedPlanRedemptionTrade( - requestId, startTime, endTime, current, asset, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "requestId=1&startTime=1623319461670&endTime=1641782889000¤t=1&asset=&size=8&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "203d5d13d945d28cdb1b090eb3564d1675e85c6b3e7ae176e890e1567a22efef", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/lending/auto-invest/redeem/history", actualRequest.url().encodedPath()); - } - - /** - * Investment plan adjustment(TRADE) - * - *

Query Source Asset to be used for investment * max one request every 3s per account - * Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void investmentPlanAdjustmentTest() throws ApiException, CryptoException { - InvestmentPlanAdjustmentRequest investmentPlanAdjustmentRequest = - new InvestmentPlanAdjustmentRequest(); - - investmentPlanAdjustmentRequest.planId(1L); - investmentPlanAdjustmentRequest.subscriptionAmount(1d); - investmentPlanAdjustmentRequest.subscriptionCycle(""); - investmentPlanAdjustmentRequest.subscriptionStartTime(0L); - investmentPlanAdjustmentRequest.sourceAsset(""); - investmentPlanAdjustmentRequest.details(new Details()); - - ApiResponse response = - api.investmentPlanAdjustment(investmentPlanAdjustmentRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "timestamp=1736393892000subscriptionStartTime=0&subscriptionAmount=1&subscriptionCycle=&sourceAsset=&planId=1&details=%5B%5D", - signInputCaptor.getValue()); - assertEquals( - "c5fa30877e75e7ff68715db9bd1fc38cae75ca56a0f48479fb3686da53e00c6a", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/lending/auto-invest/plan/edit", actualRequest.url().encodedPath()); - } - - /** - * Investment plan creation(USER_DATA) - * - *

Post an investment plan creation * max one request every 3s per account Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void investmentPlanCreationTest() throws ApiException, CryptoException { - InvestmentPlanCreationRequest investmentPlanCreationRequest = - new InvestmentPlanCreationRequest(); - - investmentPlanCreationRequest.sourceType(""); - investmentPlanCreationRequest.planType(""); - investmentPlanCreationRequest.subscriptionAmount(1d); - investmentPlanCreationRequest.subscriptionCycle(""); - investmentPlanCreationRequest.subscriptionStartTime(0L); - investmentPlanCreationRequest.sourceAsset(""); - investmentPlanCreationRequest.details(new Details()); - - ApiResponse response = - api.investmentPlanCreation(investmentPlanCreationRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "timestamp=1736393892000planType=&sourceType=&subscriptionStartTime=0&subscriptionAmount=1&subscriptionCycle=&sourceAsset=&details=%5B%5D", - signInputCaptor.getValue()); - assertEquals( - "fb57533993497914e03a43f1c294687d015c3ff36b04bd774bc4a0db350f32c4", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/lending/auto-invest/plan/add", actualRequest.url().encodedPath()); - } - - /** - * One Time Transaction(TRADE) - * - *

One time transaction * `planId`/`planId`/`details` must not - * all be null Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void oneTimeTransactionTest() throws ApiException, CryptoException { - OneTimeTransactionRequest oneTimeTransactionRequest = new OneTimeTransactionRequest(); - - oneTimeTransactionRequest.sourceType(""); - oneTimeTransactionRequest.subscriptionAmount(1d); - oneTimeTransactionRequest.sourceAsset(""); - oneTimeTransactionRequest.details(new Details()); - - ApiResponse response = - api.oneTimeTransaction(oneTimeTransactionRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "timestamp=1736393892000sourceType=&subscriptionAmount=1&sourceAsset=&details=%5B%5D", - signInputCaptor.getValue()); - assertEquals( - "d61f1d83cd98fea4384668bdf94fb7f750a1ec0c8a6d3cf1f49e7874d33a1614", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/lending/auto-invest/one-off", actualRequest.url().encodedPath()); - } - - /** - * Query holding details of the plan(USER_DATA) - * - *

Query holding details of the plan Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void queryHoldingDetailsOfThePlanTest() throws ApiException, CryptoException { - Long planId = 1L; - String requestId = "1"; - Long recvWindow = 5000L; - ApiResponse response = - api.queryHoldingDetailsOfThePlan(planId, requestId, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "planId=1&requestId=1&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "4eb4cba1124a9c45b8076bfe11d7f7c8c9adef5aced09ed4ecf3e6e88169c456", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/lending/auto-invest/plan/id", actualRequest.url().encodedPath()); - } - - /** - * Query Index Linked Plan Position Details(USER_DATA) - * - *

Details on users Index-Linked plan position details Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void queryIndexLinkedPlanPositionDetailsTest() throws ApiException, CryptoException { - Long indexId = 1L; - Long recvWindow = 5000L; - ApiResponse response = - api.queryIndexLinkedPlanPositionDetails(indexId, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "indexId=1&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "ca36fec333b635ceda65152b3c44a7e30c31c4e90a2ce138cef6ecb4c247e6b5", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/lending/auto-invest/index/user-summary", - actualRequest.url().encodedPath()); - } - - /** - * Query One-Time Transaction Status(USER_DATA) - * - *

Transaction status for one-time transaction Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void queryOneTimeTransactionStatusTest() throws ApiException, CryptoException { - Long transactionId = 1L; - String requestId = "1"; - Long recvWindow = 5000L; - ApiResponse response = - api.queryOneTimeTransactionStatus(transactionId, requestId, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "transactionId=1&requestId=1&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "085e15a3179eb89af08e4e5511dd957ac3cc0c46e241d80e95f12a5f4ca397e5", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/lending/auto-invest/one-off/status", actualRequest.url().encodedPath()); - } - - /** - * Query subscription transaction history(USER_DATA) - * - *

Query subscription transaction history of a plan * Max span between startTime and endTime - * is 30days * If both startTime and endTime are null,then default is 30days Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void querySubscriptionTransactionHistoryTest() throws ApiException, CryptoException { - Long planId = 1L; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long targetAsset = 0L; - Long planType = 0L; - Long size = 8L; - Long current = 1L; - Long recvWindow = 5000L; - ApiResponse response = - api.querySubscriptionTransactionHistory( - planId, - startTime, - endTime, - targetAsset, - planType, - size, - current, - recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "planId=1&startTime=1623319461670&endTime=1641782889000&targetAsset=0&planType=0&size=8¤t=1&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "130a5c6d790c6eee3523eb68e787731f123273ff73c4c0c609cac7ea1de289f8", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/lending/auto-invest/history/list", actualRequest.url().encodedPath()); - } -} diff --git a/clients/common/pom.xml b/clients/common/pom.xml index 44994faed..09bbcf280 100644 --- a/clients/common/pom.xml +++ b/clients/common/pom.xml @@ -10,6 +10,6 @@ binance-common common - 2.0.1 + 2.1.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 e7e759f03..c78da39a2 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 @@ -9,6 +9,8 @@ public interface ConnectionInterface { void connect(); + void disconnect(); + void send(ApiRequestWrapperDTO request) throws InterruptedException; BlockingQueue sendForStream(ApiRequestWrapperDTO request) throws InterruptedException; @@ -22,5 +24,4 @@ public interface ConnectionInterface { 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 6c466c44e..60091145a 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 @@ -544,4 +544,11 @@ public URI getUri(String uri) throws URISyntaxException { newQuery, oldUri.getFragment()); } + + public void disconnect() { + if (this.session != null) { + this.session.disconnect(); + setReady(false); + } + } } 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 1651930ca..3ce9aa861 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 @@ -86,6 +86,14 @@ public void connect() { isConnected = true; } + @Override + public void disconnect() { + for (ConnectionWrapper connectionWrapper : connectionList) { + connectionWrapper.disconnect(); + } + isConnected = false; + } + @Override public void send(ApiRequestWrapperDTO request) throws InterruptedException { getConnection().send(request); diff --git a/clients/derivatives-trading-coin-futures/CHANGELOG.md b/clients/derivatives-trading-coin-futures/CHANGELOG.md index 4d9e01c7a..585d3ec2e 100644 --- a/clients/derivatives-trading-coin-futures/CHANGELOG.md +++ b/clients/derivatives-trading-coin-futures/CHANGELOG.md @@ -1,5 +1,60 @@ # Changelog +## 4.0.0 - 2025-10-21 + +### Changed (23) + +#### REST API + +- Modified response for `compressedAggregateTradesList()` (`GET /dapi/v1/aggTrades`): + +- Modified response for `orderBook()` (`GET /dapi/v1/depth`): + +- Modified response for `getFundingRateInfo()` (`GET /dapi/v1/fundingInfo`): + +- Modified response for `queryOrder()` (`GET /dapi/v1/order`): + - property `positionSide` added + +#### WebSocket Streams + +- Modified response for `allBookTickersStream()` (`!bookTicker` stream): + +- Modified response for `contractInfoStream()` (`!contractInfo` stream): + +- Modified response for `allMarketLiquidationOrderStreams()` (`!forceOrder@arr` stream): + +- Modified response for `allMarketMiniTickersStream()` (`!miniTicker@arr` stream): + +- Modified response for `allMarketTickersStreams()` (`!ticker@arr` stream): + +- Modified response for `indexPriceStream()` (`@indexPrice@` stream): + +- Modified response for `indexKlineCandlestickStreams()` (`@indexPriceKline_` stream): + +- Modified response for `markPriceOfAllSymbolsOfAPair()` (`@markPrice@` stream): + +- Modified response for `continuousContractKlineCandlestickStreams()` (`_@continuousKline_` stream): + +- Modified response for `aggregateTradeStreams()` (`@aggTrade` stream): + +- Modified response for `individualSymbolBookTickerStreams()` (`@bookTicker` stream): + +- Modified response for `partialBookDepthStreams()` (`@depth@` stream): + +- Modified response for `diffBookDepthStreams()` (`@depth@` stream): + +- Modified response for `liquidationOrderStreams()` (`@forceOrder` stream): + +- Modified response for `klineCandlestickStreams()` (`@kline_` stream): + +- Modified response for `markPriceStream()` (`@markPrice@` stream): + +- Modified response for `markPriceKlineCandlestickStreams()` (`@markPriceKline_` stream): + +- Modified response for `individualSymbolMiniTickerStream()` (`@miniTicker` stream): + +- Modified response for `individualSymbolTickerStreams()` (`@ticker` stream): + ## 3.0.0 - 2025-09-22 ### Changed (1) @@ -10,6 +65,7 @@ - `symbols`.`filters`.`multiplierDecimal`: type `integer` → `string` ## 2.0.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. @@ -47,4 +103,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md index 013186efa..b22dc44e9 100644 --- a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-coin-futures - 3.0.0 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-coin-futures - 3.0.0 + 4.0.0 ``` diff --git a/clients/derivatives-trading-coin-futures/pom.xml b/clients/derivatives-trading-coin-futures/pom.xml index f19cefeaf..792fde6dd 100644 --- a/clients/derivatives-trading-coin-futures/pom.xml +++ b/clients/derivatives-trading-coin-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-coin-futures derivatives-trading-coin-futures - 3.0.0 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.1.1 \ No newline at end of file diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java index 4a7a62aaf..895553f5d 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java @@ -54,7 +54,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java index 14aa1ef09..c96505510 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java @@ -69,7 +69,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java index 67ed4e88c..7e90b1c87 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java index f630dce0d..6769e8a51 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java @@ -76,7 +76,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java index 7237594da..acd3b5599 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryOrderResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryOrderResponse.java index b2079881a..00fe85969 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryOrderResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryOrderResponse.java @@ -96,6 +96,12 @@ public class QueryOrderResponse { @jakarta.annotation.Nullable private String side; + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @@ -379,6 +385,25 @@ public void setSide(@jakarta.annotation.Nullable String side) { this.side = side; } + public QueryOrderResponse positionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + public QueryOrderResponse status(@jakarta.annotation.Nullable String status) { this.status = status; return this; @@ -685,6 +710,7 @@ public boolean equals(Object o) { && Objects.equals(this.price, queryOrderResponse.price) && Objects.equals(this.reduceOnly, queryOrderResponse.reduceOnly) && Objects.equals(this.side, queryOrderResponse.side) + && Objects.equals(this.positionSide, queryOrderResponse.positionSide) && Objects.equals(this.status, queryOrderResponse.status) && Objects.equals(this.stopPrice, queryOrderResponse.stopPrice) && Objects.equals(this.closePosition, queryOrderResponse.closePosition) @@ -716,6 +742,7 @@ public int hashCode() { price, reduceOnly, side, + positionSide, status, stopPrice, closePosition, @@ -747,6 +774,7 @@ public String toString() { sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); @@ -811,6 +839,10 @@ public String toUrlQueryString() { String sideValueAsString = ""; sideValueAsString = sideValue.toString(); sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); Object statusValue = getStatus(); String statusValueAsString = ""; statusValueAsString = statusValue.toString(); @@ -911,6 +943,7 @@ private String toIndentedString(Object o) { openapiFields.add("price"); openapiFields.add("reduceOnly"); openapiFields.add("side"); + openapiFields.add("positionSide"); openapiFields.add("status"); openapiFields.add("stopPrice"); openapiFields.add("closePosition"); @@ -1013,6 +1046,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("side").toString())); } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java index 5408a23c4..5316f26ea 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java @@ -34,7 +34,7 @@ public class DerivativesTradingCoinFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java index 07f915e09..a6332a885 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java @@ -58,7 +58,7 @@ public class DerivativesTradingCoinFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-options/CHANGELOG.md b/clients/derivatives-trading-options/CHANGELOG.md index 7290df346..6d671151a 100644 --- a/clients/derivatives-trading-options/CHANGELOG.md +++ b/clients/derivatives-trading-options/CHANGELOG.md @@ -1,5 +1,55 @@ # Changelog +## 4.0.0 - 2025-10-21 + +### Changed (17) + +#### REST API + +- Deleted parameter `limit` + - affected methods: + - `queryCurrentOpenOptionOrders()` (`GET /eapi/v1/openOrders`) +- Deleted parameter `price` + - affected methods: + - `newBlockTradeOrder()` (`POST /eapi/v1/block/order/create`) +- Deleted parameter `quantity` + - affected methods: + - `newBlockTradeOrder()` (`POST /eapi/v1/block/order/create`) +- Deleted parameter `side` + - affected methods: + - `newBlockTradeOrder()` (`POST /eapi/v1/block/order/create`) +- Deleted parameter `symbol` + - affected methods: + - `newBlockTradeOrder()` (`POST /eapi/v1/block/order/create`) +- Modified parameter `orders`: + - affected methods: + - `placeMultipleOrders()` (`POST /eapi/v1/batchOrders`) +- Modified parameter `side`: + - affected methods: + - `newOrder()` (`POST /eapi/v1/order`) + +- Modified response for `orderBook()` (`GET /eapi/v1/depth`): + +#### WebSocket Streams + +- Modified response for `partialBookDepthStreams()` (`@depth@` stream): + +- Modified response for `indexPriceStreams()` (`@index` stream): + +- Modified response for `klineCandlestickStreams()` (`@kline_` stream): + +- Modified response for `ticker24Hour()` (`@ticker` stream): + +- Modified response for `tradeStreams()` (`@trade` stream): + +- Modified response for `markPrice()` (`@markPrice` stream): + +- Modified response for `openInterest()` (`@openInterest@` stream): + +- Modified response for `ticker24HourByUnderlyingAssetAndExpirationData()` (`@ticker@` stream): + +- Modified response for `newSymbolInfo()` (`option_pair` stream): + ## 3.0.0 - 2025-09-22 ### Changed (4) @@ -14,6 +64,7 @@ - `asset`: item property `lpProfit` deleted ## 2.0.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. @@ -45,4 +96,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/derivatives-trading-options/docs/NewBlockTradeOrderRequest.md b/clients/derivatives-trading-options/docs/NewBlockTradeOrderRequest.md index afad2d948..3823a29d8 100644 --- a/clients/derivatives-trading-options/docs/NewBlockTradeOrderRequest.md +++ b/clients/derivatives-trading-options/docs/NewBlockTradeOrderRequest.md @@ -9,10 +9,6 @@ |------------ | ------------- | ------------- | -------------| |**liquidity** | **String** | | | |**legs** | **Legs** | | | -|**symbol** | **String** | | | -|**side** | **Side** | | | -|**price** | **Double** | | | -|**quantity** | **Double** | | | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/TradeApi.md b/clients/derivatives-trading-options/docs/TradeApi.md index c4924f621..be0ac2091 100644 --- a/clients/derivatives-trading-options/docs/TradeApi.md +++ b/clients/derivatives-trading-options/docs/TradeApi.md @@ -160,7 +160,7 @@ No authorization required Cancel all Option orders on specific symbol (TRADE) -Cancel all active order on a symbol. Weight: 1 +Cancel all active order on a symbol. Weight: 5 ### Example ```java @@ -544,7 +544,7 @@ No authorization required # **queryCurrentOpenOptionOrders** -> QueryCurrentOpenOptionOrdersResponse queryCurrentOpenOptionOrders(symbol, orderId, startTime, endTime, limit, recvWindow) +> QueryCurrentOpenOptionOrdersResponse queryCurrentOpenOptionOrders(symbol, orderId, startTime, endTime, recvWindow) Query Current Open Option Orders (USER_DATA) @@ -569,10 +569,9 @@ public class Example { Long orderId = 56L; // Long | Order ID, e.g 4611875134427365377 Long startTime = 56L; // Long | Start Time, e.g 1593511200000 Long endTime = 56L; // Long | End Time, e.g 1593512200000 - Long limit = 56L; // Long | Number of result sets returned Default:100 Max:1000 Long recvWindow = 56L; // Long | try { - QueryCurrentOpenOptionOrdersResponse result = apiInstance.queryCurrentOpenOptionOrders(symbol, orderId, startTime, endTime, limit, recvWindow); + QueryCurrentOpenOptionOrdersResponse result = apiInstance.queryCurrentOpenOptionOrders(symbol, orderId, startTime, endTime, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling TradeApi#queryCurrentOpenOptionOrders"); @@ -593,7 +592,6 @@ public class Example { | **orderId** | **Long**| Order ID, e.g 4611875134427365377 | [optional] | | **startTime** | **Long**| Start Time, e.g 1593511200000 | [optional] | | **endTime** | **Long**| End Time, e.g 1593512200000 | [optional] | -| **limit** | **Long**| Number of result sets returned Default:100 Max:1000 | [optional] | | **recvWindow** | **Long**| | [optional] | ### Return type diff --git a/clients/derivatives-trading-options/docs/rest-api/migration-guide.md b/clients/derivatives-trading-options/docs/rest-api/migration-guide.md index d01f1248e..f836fda16 100644 --- a/clients/derivatives-trading-options/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-options/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-options - 3.0.0 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-options - 3.0.0 + 4.0.0 ``` diff --git a/clients/derivatives-trading-options/example_rest.md b/clients/derivatives-trading-options/example_rest.md index 6085bb66b..e780623d9 100644 --- a/clients/derivatives-trading-options/example_rest.md +++ b/clients/derivatives-trading-options/example_rest.md @@ -8,6 +8,8 @@ [GET /eapi/v1/account](https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information) - optionAccountInformation - [OptionAccountInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionAccountInformationExample.java#L47) +[GET /eapi/v1/marginAccount](https://developers.binance.com/docs/derivatives/option/account/Option-Margin-Account-Information) - optionMarginAccountInformation - [OptionMarginAccountInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionMarginAccountInformationExample.java#L47) + ## MarketData [GET /eapi/v1/time](https://developers.binance.com/docs/derivatives/option/market-data/Check-Server-Time) - checkServerTime - [CheckServerTimeExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/CheckServerTimeExample.java#L47) @@ -46,7 +48,7 @@ [PUT /eapi/v1/block/order/create](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Extend-Block-Trade-Order) - extendBlockTradeOrder - [ExtendBlockTradeOrderExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/ExtendBlockTradeOrderExample.java#L48) -[POST /eapi/v1/block/order/create](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/New-Block-Trade-Order) - newBlockTradeOrder - [NewBlockTradeOrderExample.java:50](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/NewBlockTradeOrderExample.java#L50) +[POST /eapi/v1/block/order/create](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/New-Block-Trade-Order) - newBlockTradeOrder - [NewBlockTradeOrderExample.java:49](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/NewBlockTradeOrderExample.java#L49) [GET /eapi/v1/block/order/execute](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Query-Block-Trade-Detail) - queryBlockTradeDetails - [QueryBlockTradeDetailsExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/QueryBlockTradeDetailsExample.java#L48) @@ -60,8 +62,6 @@ [GET /eapi/v1/mmp](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Get-Market-Maker-Protection-Config) - getMarketMakerProtectionConfig - [GetMarketMakerProtectionConfigExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/GetMarketMakerProtectionConfigExample.java#L47) -[GET /eapi/v1/marginAccount](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Option-Margin-Account-Information) - optionMarginAccountInformation - [OptionMarginAccountInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/OptionMarginAccountInformationExample.java#L47) - [POST /eapi/v1/mmpReset](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Reset-Market-Maker-Protection-Config) - resetMarketMakerProtectionConfig - [ResetMarketMakerProtectionConfigExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/ResetMarketMakerProtectionConfigExample.java#L48) [POST /eapi/v1/countdownCancelAll](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) - setAutoCancelAllOpenOrders - [SetAutoCancelAllOpenOrdersExample.java:62](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/SetAutoCancelAllOpenOrdersExample.java#L62) diff --git a/clients/derivatives-trading-options/pom.xml b/clients/derivatives-trading-options/pom.xml index 66bc71ad0..7cb57dc7b 100644 --- a/clients/derivatives-trading-options/pom.xml +++ b/clients/derivatives-trading-options/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-options derivatives-trading-options - 3.0.0 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.1.1 \ No newline at end of file diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java index 8774f4fcd..86d7e6a69 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java @@ -46,7 +46,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java index 7bc18632e..ecb5e7f8d 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java @@ -941,7 +941,7 @@ public ApiResponse cancelAllOptionOrd /** * Cancel all Option orders on specific symbol (TRADE) Cancel all active order on a symbol. - * Weight: 1 + * Weight: 5 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) * @param recvWindow (optional) @@ -1101,7 +1101,6 @@ public ApiResponse placeMultipleOrders( * @param orderId Order ID, e.g 4611875134427365377 (optional) * @param startTime Start Time, e.g 1593511200000 (optional) * @param endTime End Time, e.g 1593512200000 (optional) - * @param limit Number of result sets returned Default:100 Max:1000 (optional) * @param recvWindow (optional) * @return ApiResponse<QueryCurrentOpenOptionOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1118,10 +1117,10 @@ public ApiResponse placeMultipleOrders( * Current Open Option Orders (USER_DATA) Documentation */ public ApiResponse queryCurrentOpenOptionOrders( - String symbol, Long orderId, Long startTime, Long endTime, Long limit, Long recvWindow) + String symbol, Long orderId, Long startTime, Long endTime, Long recvWindow) throws ApiException { return tradeApi.queryCurrentOpenOptionOrders( - symbol, orderId, startTime, endTime, limit, recvWindow); + symbol, orderId, startTime, endTime, recvWindow); } /** diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java index d8084b67d..cedd6f5fa 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java @@ -53,7 +53,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java index 03ae60e5c..5ce88240b 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.ApiClient; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.JSON; import com.binance.connector.client.common.Pair; import com.binance.connector.client.common.SystemUtil; @@ -53,7 +52,7 @@ public class MarketMakerBlockTradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -733,27 +732,6 @@ private okhttp3.Call newBlockTradeOrderCall(NewBlockTradeOrderRequest newBlockTr localVarFormParams.put("legs", json); } - if (newBlockTradeOrderRequest.getSymbol() != null) { - localVarFormParams.put("symbol", newBlockTradeOrderRequest.getSymbol()); - } - - if (newBlockTradeOrderRequest.getSide() != null) { - localVarFormParams.put("side", newBlockTradeOrderRequest.getSide()); - } - - if (newBlockTradeOrderRequest.getPrice() != null) { - localVarFormParams.put( - "price", - DecimalFormatter.getFormatter().format(newBlockTradeOrderRequest.getPrice())); - } - - if (newBlockTradeOrderRequest.getQuantity() != null) { - localVarFormParams.put( - "quantity", - DecimalFormatter.getFormatter() - .format(newBlockTradeOrderRequest.getQuantity())); - } - if (newBlockTradeOrderRequest.getRecvWindow() != null) { localVarFormParams.put("recvWindow", newBlockTradeOrderRequest.getRecvWindow()); } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java index 373a7dfbf..f3c0ae43b 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java @@ -53,7 +53,7 @@ public class MarketMakerEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java index 6ea4d5712..59fbad0ea 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java @@ -60,7 +60,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -542,7 +542,7 @@ private okhttp3.Call cancelAllOptionOrdersOnSpecificSymbolValidateBeforeCall( /** * Cancel all Option orders on specific symbol (TRADE) Cancel all active order on a symbol. - * Weight: 1 + * Weight: 5 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) * @param recvWindow (optional) @@ -1378,7 +1378,6 @@ public ApiResponse placeMultipleOrders( * @param orderId Order ID, e.g 4611875134427365377 (optional) * @param startTime Start Time, e.g 1593511200000 (optional) * @param endTime End Time, e.g 1593512200000 (optional) - * @param limit Number of result sets returned Default:100 Max:1000 (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1394,7 +1393,7 @@ public ApiResponse placeMultipleOrders( * Current Open Option Orders (USER_DATA) Documentation */ private okhttp3.Call queryCurrentOpenOptionOrdersCall( - String symbol, Long orderId, Long startTime, Long endTime, Long limit, Long recvWindow) + String symbol, Long orderId, Long startTime, Long endTime, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -1436,10 +1435,6 @@ private okhttp3.Call queryCurrentOpenOptionOrdersCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); } - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - if (recvWindow != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } @@ -1476,7 +1471,7 @@ private okhttp3.Call queryCurrentOpenOptionOrdersCall( @SuppressWarnings("rawtypes") private okhttp3.Call queryCurrentOpenOptionOrdersValidateBeforeCall( - String symbol, Long orderId, Long startTime, Long endTime, Long limit, Long recvWindow) + String symbol, Long orderId, Long startTime, Long endTime, Long recvWindow) throws ApiException { try { Validator validator = @@ -1487,7 +1482,7 @@ private okhttp3.Call queryCurrentOpenOptionOrdersValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, orderId, startTime, endTime, limit, recvWindow}; + Object[] parameterValues = {symbol, orderId, startTime, endTime, recvWindow}; Method method = this.getClass() .getMethod( @@ -1496,14 +1491,13 @@ private okhttp3.Call queryCurrentOpenOptionOrdersValidateBeforeCall( Long.class, Long.class, Long.class, - Long.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { return queryCurrentOpenOptionOrdersCall( - symbol, orderId, startTime, endTime, limit, recvWindow); + symbol, orderId, startTime, endTime, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -1524,7 +1518,6 @@ private okhttp3.Call queryCurrentOpenOptionOrdersValidateBeforeCall( * @param orderId Order ID, e.g 4611875134427365377 (optional) * @param startTime Start Time, e.g 1593511200000 (optional) * @param endTime End Time, e.g 1593512200000 (optional) - * @param limit Number of result sets returned Default:100 Max:1000 (optional) * @param recvWindow (optional) * @return ApiResponse<QueryCurrentOpenOptionOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1541,11 +1534,11 @@ private okhttp3.Call queryCurrentOpenOptionOrdersValidateBeforeCall( * Current Open Option Orders (USER_DATA) Documentation */ public ApiResponse queryCurrentOpenOptionOrders( - String symbol, Long orderId, Long startTime, Long endTime, Long limit, Long recvWindow) + String symbol, Long orderId, Long startTime, Long endTime, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = queryCurrentOpenOptionOrdersValidateBeforeCall( - symbol, orderId, startTime, endTime, limit, recvWindow); + symbol, orderId, startTime, endTime, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java index b61e3cf3f..decef1318 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewBlockTradeOrderRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewBlockTradeOrderRequest.java index 1adf8cfcc..416099c50 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewBlockTradeOrderRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewBlockTradeOrderRequest.java @@ -49,30 +49,6 @@ public class NewBlockTradeOrderRequest { @jakarta.annotation.Nonnull private Legs legs; - public static final String SERIALIZED_NAME_SYMBOL = "symbol"; - - @SerializedName(SERIALIZED_NAME_SYMBOL) - @jakarta.annotation.Nonnull - private String symbol; - - public static final String SERIALIZED_NAME_SIDE = "side"; - - @SerializedName(SERIALIZED_NAME_SIDE) - @jakarta.annotation.Nonnull - private Side side; - - public static final String SERIALIZED_NAME_PRICE = "price"; - - @SerializedName(SERIALIZED_NAME_PRICE) - @jakarta.annotation.Nonnull - private Double price; - - public static final String SERIALIZED_NAME_QUANTITY = "quantity"; - - @SerializedName(SERIALIZED_NAME_QUANTITY) - @jakarta.annotation.Nonnull - private Double quantity; - public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -122,89 +98,6 @@ public void setLegs(@jakarta.annotation.Nonnull Legs legs) { this.legs = legs; } - public NewBlockTradeOrderRequest symbol(@jakarta.annotation.Nonnull String symbol) { - this.symbol = symbol; - return this; - } - - /** - * Get symbol - * - * @return symbol - */ - @jakarta.annotation.Nonnull - @NotNull - public String getSymbol() { - return symbol; - } - - public void setSymbol(@jakarta.annotation.Nonnull String symbol) { - this.symbol = symbol; - } - - public NewBlockTradeOrderRequest side(@jakarta.annotation.Nonnull Side side) { - this.side = side; - return this; - } - - /** - * Get side - * - * @return side - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Side getSide() { - return side; - } - - public void setSide(@jakarta.annotation.Nonnull Side side) { - this.side = side; - } - - public NewBlockTradeOrderRequest price(@jakarta.annotation.Nonnull Double price) { - this.price = price; - return this; - } - - /** - * Get price - * - * @return price - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Double getPrice() { - return price; - } - - public void setPrice(@jakarta.annotation.Nonnull Double price) { - this.price = price; - } - - public NewBlockTradeOrderRequest quantity(@jakarta.annotation.Nonnull Double quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Double getQuantity() { - return quantity; - } - - public void setQuantity(@jakarta.annotation.Nonnull Double quantity) { - this.quantity = quantity; - } - public NewBlockTradeOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -235,16 +128,12 @@ public boolean equals(Object o) { NewBlockTradeOrderRequest newBlockTradeOrderRequest = (NewBlockTradeOrderRequest) o; return Objects.equals(this.liquidity, newBlockTradeOrderRequest.liquidity) && Objects.equals(this.legs, newBlockTradeOrderRequest.legs) - && Objects.equals(this.symbol, newBlockTradeOrderRequest.symbol) - && Objects.equals(this.side, newBlockTradeOrderRequest.side) - && Objects.equals(this.price, newBlockTradeOrderRequest.price) - && Objects.equals(this.quantity, newBlockTradeOrderRequest.quantity) && Objects.equals(this.recvWindow, newBlockTradeOrderRequest.recvWindow); } @Override public int hashCode() { - return Objects.hash(liquidity, legs, symbol, side, price, quantity, recvWindow); + return Objects.hash(liquidity, legs, recvWindow); } @Override @@ -253,10 +142,6 @@ public String toString() { sb.append("class NewBlockTradeOrderRequest {\n"); sb.append(" liquidity: ").append(toIndentedString(liquidity)).append("\n"); sb.append(" legs: ").append(toIndentedString(legs)).append("\n"); - sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); - sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -273,22 +158,6 @@ public String toUrlQueryString() { String legsValueAsString = ""; legsValueAsString = legsValue.toString(); sb.append("legs=").append(urlEncode(legsValueAsString)).append(""); - Object symbolValue = getSymbol(); - String symbolValueAsString = ""; - symbolValueAsString = symbolValue.toString(); - sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); - Object sideValue = getSide(); - String sideValueAsString = ""; - sideValueAsString = sideValue.toString(); - sb.append("side=").append(urlEncode(sideValueAsString)).append(""); - Object priceValue = getPrice(); - String priceValueAsString = ""; - priceValueAsString = priceValue.toString(); - sb.append("price=").append(urlEncode(priceValueAsString)).append(""); - Object quantityValue = getQuantity(); - String quantityValueAsString = ""; - quantityValueAsString = quantityValue.toString(); - sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); Object recvWindowValue = getRecvWindow(); String recvWindowValueAsString = ""; recvWindowValueAsString = recvWindowValue.toString(); @@ -323,20 +192,12 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("liquidity"); openapiFields.add("legs"); - openapiFields.add("symbol"); - openapiFields.add("side"); - openapiFields.add("price"); - openapiFields.add("quantity"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("liquidity"); openapiRequiredFields.add("legs"); - openapiRequiredFields.add("symbol"); - openapiRequiredFields.add("side"); - openapiRequiredFields.add("price"); - openapiRequiredFields.add("quantity"); } /** @@ -374,15 +235,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("liquidity").toString())); } - if (!jsonObj.get("symbol").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `symbol` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("symbol").toString())); - } - // validate the required field `side` - Side.validateJsonElement(jsonObj.get("side")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java index 1401cc401..fa40575d0 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java @@ -38,7 +38,7 @@ public class DerivativesTradingOptionsWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApiTest.java index 0430f1643..c2addc373 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApiTest.java @@ -232,10 +232,6 @@ public void newBlockTradeOrderTest() throws ApiException, CryptoException { newBlockTradeOrderRequest.liquidity(""); newBlockTradeOrderRequest.legs(new Legs()); - newBlockTradeOrderRequest.symbol(""); - newBlockTradeOrderRequest.side(Side.BUY); - newBlockTradeOrderRequest.price(1d); - newBlockTradeOrderRequest.quantity(1d); ApiResponse response = api.newBlockTradeOrder(newBlockTradeOrderRequest); @@ -251,10 +247,10 @@ public void newBlockTradeOrderTest() throws ApiException, CryptoException { Request actualRequest = captorValue.request(); assertEquals( - "timestamp=1736393892000symbol=&side=BUY&quantity=1&price=1&legs=%5B%5D&liquidity=", + "timestamp=1736393892000legs=%5B%5D&liquidity=", signInputCaptor.getValue()); assertEquals( - "67602c4e0a54cf28613b373cc457dccf540698cb3148e276c96f32ac09adf599", + "bfcdb97917945619131835baab3105074db01c428177e5af5122331605bf3cb8", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/block/order/create", actualRequest.url().encodedPath()); } diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApiTest.java index 6867905b2..66fe355d6 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApiTest.java @@ -379,11 +379,10 @@ public void queryCurrentOpenOptionOrdersTest() throws ApiException, CryptoExcept Long orderId = 1L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; - Long limit = 100L; Long recvWindow = 5000L; ApiResponse response = api.queryCurrentOpenOptionOrders( - symbol, orderId, startTime, endTime, limit, recvWindow); + symbol, orderId, startTime, endTime, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -396,10 +395,10 @@ public void queryCurrentOpenOptionOrdersTest() throws ApiException, CryptoExcept Request actualRequest = captorValue.request(); assertEquals( - "symbol=&orderId=1&startTime=1623319461670&endTime=1641782889000&limit=100&recvWindow=5000×tamp=1736393892000", + "symbol=&orderId=1&startTime=1623319461670&endTime=1641782889000&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "dc0808314025fc813dcde0328cd6754c982d28888760fc74b17e072087eb4895", + "51e9f45d125dacba55909402a133899dd5f0956cd707d8d24ff372c34f5a8155", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/openOrders", actualRequest.url().encodedPath()); } diff --git a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md index 9b5c44beb..1ddfa729d 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md @@ -1,6 +1,21 @@ # Changelog +## 4.0.0 - 2025-10-21 + +### Changed (2) + +#### REST API + +- Modified response for `mintBfusdForPortfolioMargin()` (`POST /sapi/v1/portfolio/mint`): + - property `mintRate` added + - property `rate` deleted + +- Modified response for `redeemBfusdForPortfolioMargin()` (`POST /sapi/v1/portfolio/redeem`): + - property `redeemRate` added + - property `rate` deleted + ## 3.0.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginResponse.md index 615588aab..5f7fa89e6 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginResponse.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginResponse.md @@ -11,7 +11,7 @@ |**targetAsset** | **String** | | [optional] | |**fromAssetQty** | **Long** | | [optional] | |**targetAssetQty** | **Double** | | [optional] | -|**rate** | **Double** | | [optional] | +|**mintRate** | **Double** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginResponse.md index 22961e040..637aa495f 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginResponse.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginResponse.md @@ -11,7 +11,7 @@ |**targetAsset** | **String** | | [optional] | |**fromAssetQty** | **Double** | | [optional] | |**targetAssetQty** | **Double** | | [optional] | -|**rate** | **Double** | | [optional] | +|**redeemRate** | **Double** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md b/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md index 11b8536ae..73b5827fd 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-portfolio-margin-pro - 3.0.1 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin-pro - 3.0.1 + 4.0.0 ``` diff --git a/clients/derivatives-trading-portfolio-margin-pro/pom.xml b/clients/derivatives-trading-portfolio-margin-pro/pom.xml index a00bfa687..2c5e74248 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/pom.xml +++ b/clients/derivatives-trading-portfolio-margin-pro/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-portfolio-margin-pro derivatives-trading-portfolio-margin-pro - 3.0.1 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.1.1 \ No newline at end of file diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java index a6b3758ca..b5b32445d 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java @@ -69,7 +69,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/3.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java index 618526ace..be5c5b804 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java @@ -45,7 +45,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/3.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginResponse.java index 4eb2d93c6..4f09947c4 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginResponse.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginResponse.java @@ -61,11 +61,11 @@ public class MintBfusdForPortfolioMarginResponse { @jakarta.annotation.Nullable private Double targetAssetQty; - public static final String SERIALIZED_NAME_RATE = "rate"; + public static final String SERIALIZED_NAME_MINT_RATE = "mintRate"; - @SerializedName(SERIALIZED_NAME_RATE) + @SerializedName(SERIALIZED_NAME_MINT_RATE) @jakarta.annotation.Nullable - private Double rate; + private Double mintRate; public MintBfusdForPortfolioMarginResponse() {} @@ -150,24 +150,25 @@ public void setTargetAssetQty(@jakarta.annotation.Nullable Double targetAssetQty this.targetAssetQty = targetAssetQty; } - public MintBfusdForPortfolioMarginResponse rate(@jakarta.annotation.Nullable Double rate) { - this.rate = rate; + public MintBfusdForPortfolioMarginResponse mintRate( + @jakarta.annotation.Nullable Double mintRate) { + this.mintRate = mintRate; return this; } /** - * Get rate + * Get mintRate * - * @return rate + * @return mintRate */ @jakarta.annotation.Nullable @Valid - public Double getRate() { - return rate; + public Double getMintRate() { + return mintRate; } - public void setRate(@jakarta.annotation.Nullable Double rate) { - this.rate = rate; + public void setMintRate(@jakarta.annotation.Nullable Double mintRate) { + this.mintRate = mintRate; } @Override @@ -186,12 +187,12 @@ public boolean equals(Object o) { this.fromAssetQty, mintBfusdForPortfolioMarginResponse.fromAssetQty) && Objects.equals( this.targetAssetQty, mintBfusdForPortfolioMarginResponse.targetAssetQty) - && Objects.equals(this.rate, mintBfusdForPortfolioMarginResponse.rate); + && Objects.equals(this.mintRate, mintBfusdForPortfolioMarginResponse.mintRate); } @Override public int hashCode() { - return Objects.hash(fromAsset, targetAsset, fromAssetQty, targetAssetQty, rate); + return Objects.hash(fromAsset, targetAsset, fromAssetQty, targetAssetQty, mintRate); } @Override @@ -202,7 +203,7 @@ public String toString() { sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); sb.append(" fromAssetQty: ").append(toIndentedString(fromAssetQty)).append("\n"); sb.append(" targetAssetQty: ").append(toIndentedString(targetAssetQty)).append("\n"); - sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); + sb.append(" mintRate: ").append(toIndentedString(mintRate)).append("\n"); sb.append("}"); return sb.toString(); } @@ -226,10 +227,10 @@ public String toUrlQueryString() { String targetAssetQtyValueAsString = ""; targetAssetQtyValueAsString = targetAssetQtyValue.toString(); sb.append("targetAssetQty=").append(urlEncode(targetAssetQtyValueAsString)).append(""); - Object rateValue = getRate(); - String rateValueAsString = ""; - rateValueAsString = rateValue.toString(); - sb.append("rate=").append(urlEncode(rateValueAsString)).append(""); + Object mintRateValue = getMintRate(); + String mintRateValueAsString = ""; + mintRateValueAsString = mintRateValue.toString(); + sb.append("mintRate=").append(urlEncode(mintRateValueAsString)).append(""); return sb.toString(); } @@ -262,7 +263,7 @@ private String toIndentedString(Object o) { openapiFields.add("targetAsset"); openapiFields.add("fromAssetQty"); openapiFields.add("targetAssetQty"); - openapiFields.add("rate"); + openapiFields.add("mintRate"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginResponse.java index 82bd8e8e8..63d2ec23f 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginResponse.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginResponse.java @@ -61,11 +61,11 @@ public class RedeemBfusdForPortfolioMarginResponse { @jakarta.annotation.Nullable private Double targetAssetQty; - public static final String SERIALIZED_NAME_RATE = "rate"; + public static final String SERIALIZED_NAME_REDEEM_RATE = "redeemRate"; - @SerializedName(SERIALIZED_NAME_RATE) + @SerializedName(SERIALIZED_NAME_REDEEM_RATE) @jakarta.annotation.Nullable - private Double rate; + private Double redeemRate; public RedeemBfusdForPortfolioMarginResponse() {} @@ -151,24 +151,25 @@ public void setTargetAssetQty(@jakarta.annotation.Nullable Double targetAssetQty this.targetAssetQty = targetAssetQty; } - public RedeemBfusdForPortfolioMarginResponse rate(@jakarta.annotation.Nullable Double rate) { - this.rate = rate; + public RedeemBfusdForPortfolioMarginResponse redeemRate( + @jakarta.annotation.Nullable Double redeemRate) { + this.redeemRate = redeemRate; return this; } /** - * Get rate + * Get redeemRate * - * @return rate + * @return redeemRate */ @jakarta.annotation.Nullable @Valid - public Double getRate() { - return rate; + public Double getRedeemRate() { + return redeemRate; } - public void setRate(@jakarta.annotation.Nullable Double rate) { - this.rate = rate; + public void setRedeemRate(@jakarta.annotation.Nullable Double redeemRate) { + this.redeemRate = redeemRate; } @Override @@ -188,12 +189,13 @@ public boolean equals(Object o) { this.fromAssetQty, redeemBfusdForPortfolioMarginResponse.fromAssetQty) && Objects.equals( this.targetAssetQty, redeemBfusdForPortfolioMarginResponse.targetAssetQty) - && Objects.equals(this.rate, redeemBfusdForPortfolioMarginResponse.rate); + && Objects.equals( + this.redeemRate, redeemBfusdForPortfolioMarginResponse.redeemRate); } @Override public int hashCode() { - return Objects.hash(fromAsset, targetAsset, fromAssetQty, targetAssetQty, rate); + return Objects.hash(fromAsset, targetAsset, fromAssetQty, targetAssetQty, redeemRate); } @Override @@ -204,7 +206,7 @@ public String toString() { sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); sb.append(" fromAssetQty: ").append(toIndentedString(fromAssetQty)).append("\n"); sb.append(" targetAssetQty: ").append(toIndentedString(targetAssetQty)).append("\n"); - sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); + sb.append(" redeemRate: ").append(toIndentedString(redeemRate)).append("\n"); sb.append("}"); return sb.toString(); } @@ -228,10 +230,10 @@ public String toUrlQueryString() { String targetAssetQtyValueAsString = ""; targetAssetQtyValueAsString = targetAssetQtyValue.toString(); sb.append("targetAssetQty=").append(urlEncode(targetAssetQtyValueAsString)).append(""); - Object rateValue = getRate(); - String rateValueAsString = ""; - rateValueAsString = rateValue.toString(); - sb.append("rate=").append(urlEncode(rateValueAsString)).append(""); + Object redeemRateValue = getRedeemRate(); + String redeemRateValueAsString = ""; + redeemRateValueAsString = redeemRateValue.toString(); + sb.append("redeemRate=").append(urlEncode(redeemRateValueAsString)).append(""); return sb.toString(); } @@ -264,7 +266,7 @@ private String toIndentedString(Object o) { openapiFields.add("targetAsset"); openapiFields.add("fromAssetQty"); openapiFields.add("targetAssetQty"); - openapiFields.add("rate"); + openapiFields.add("redeemRate"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java index cb08581ea..4766ca268 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java @@ -19,7 +19,7 @@ public class DerivativesTradingPortfolioMarginProWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/3.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-usds-futures/CHANGELOG.md b/clients/derivatives-trading-usds-futures/CHANGELOG.md index 4cd09bc86..011cfdd07 100644 --- a/clients/derivatives-trading-usds-futures/CHANGELOG.md +++ b/clients/derivatives-trading-usds-futures/CHANGELOG.md @@ -1,5 +1,57 @@ # Changelog +## 6.0.0 - 2025-10-21 + +### Changed (21) + +#### REST API + +- Modified response for `compressedAggregateTradesList()` (`GET /fapi/v1/aggTrades`): + +- Modified response for `orderBook()` (`GET /fapi/v1/depth`): + +#### WebSocket API + +- Modified response for `orderBook()` (`depth` method): + +#### WebSocket Streams + +- Modified response for `multiAssetsModeAssetIndex()` (`!assetIndex@arr` stream): + +- Modified response for `allBookTickersStream()` (`!bookTicker` stream): + +- Modified response for `contractInfoStream()` (`!contractInfo` stream): + +- Modified response for `allMarketLiquidationOrderStreams()` (`!forceOrder@arr` stream): + +- Modified response for `markPriceStreamForAllMarket()` (`!markPrice@arr@` stream): + +- Modified response for `allMarketMiniTickersStream()` (`!miniTicker@arr` stream): + +- Modified response for `allMarketTickersStreams()` (`!ticker@arr` stream): + +- Modified response for `continuousContractKlineCandlestickStreams()` (`_@continuousKline_` stream): + +- Modified response for `aggregateTradeStreams()` (`@aggTrade` stream): + +- Modified response for `individualSymbolBookTickerStreams()` (`@bookTicker` stream): + +- Modified response for `compositeIndexSymbolInformationStreams()` (`@compositeIndex` stream): + +- Modified response for `partialBookDepthStreams()` (`@depth@` stream): + +- Modified response for `diffBookDepthStreams()` (`@depth@` stream): + +- Modified response for `liquidationOrderStreams()` (`@forceOrder` stream): + +- Modified response for `klineCandlestickStreams()` (`@kline_` stream): + +- Modified response for `markPriceStream()` (`@markPrice@` stream): + +- Modified response for `individualSymbolMiniTickerStream()` (`@miniTicker` stream): + +- Modified response for `individualSymbolTickerStreams()` (`@ticker` stream): + ## 5.0.0 - 2025-09-22 ### Changed (1) @@ -10,6 +62,7 @@ - `assets`: item property `marginAvailable` deleted ## 4.0.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. @@ -41,6 +94,7 @@ - Fixed cases where the response can be an object or an array ## 2.0.0 - 2025-06-02 + ### Removed (1) #### REST API diff --git a/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdateO.md b/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdateO.md index d6f534323..08e7146d5 100644 --- a/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdateO.md +++ b/clients/derivatives-trading-usds-futures/docs/OrderTradeUpdateO.md @@ -43,6 +43,7 @@ |**V** | **String** | | [optional] | |**pm** | **String** | | [optional] | |**gtd** | **Long** | | [optional] | +|**er** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/TradeApi.md b/clients/derivatives-trading-usds-futures/docs/TradeApi.md index f7b5fef45..9c276be8e 100644 --- a/clients/derivatives-trading-usds-futures/docs/TradeApi.md +++ b/clients/derivatives-trading-usds-futures/docs/TradeApi.md @@ -80,7 +80,7 @@ No authorization required Modify Order (TRADE) -Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue * Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent. * Both `quantity` and `price` must be sent, which is different from dapi modify order endpoint. * When the new `quantity` or `price` doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is. * However the order will be cancelled by the amendment in the following situations: * when the order is in partially filled status and the new `quantity` <= `executedQty` * When the order is `GTX` and the new price will cause it to be executed immediately * One order can only be modfied for less than 10000 times Weight: 1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 1 on IP rate limit(x-mbx-used-weight-1m) +Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue * Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent. * Both `quantity` and `price` must be sent, which is different from dapi modify order endpoint. * When the new `quantity` or `price` doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is. * However the order will be cancelled by the amendment in the following situations: * when the order is in partially filled status and the new `quantity` <= `executedQty` * When the order is `GTX` and the new price will cause it to be executed immediately * One order can only be modfied for less than 10000 times Weight: 1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate limit(x-mbx-used-weight-1m) ### Example ```java diff --git a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md index a3ec9e9ee..89db0da51 100644 --- a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-usds-futures - 5.0.0 + 6.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-usds-futures - 5.0.0 + 6.0.0 ``` diff --git a/clients/derivatives-trading-usds-futures/pom.xml b/clients/derivatives-trading-usds-futures/pom.xml index 97ebdb9c1..104e679a0 100644 --- a/clients/derivatives-trading-usds-futures/pom.xml +++ b/clients/derivatives-trading-usds-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-usds-futures derivatives-trading-usds-futures - 5.0.0 + 6.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.1.1 \ No newline at end of file diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java index d513bba1b..c44896d7e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java @@ -64,7 +64,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java index 524002002..7f6142087 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java @@ -49,7 +49,7 @@ public class ConvertApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java index 7dfc15d4f..c86b61f47 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java @@ -2133,7 +2133,7 @@ public ApiResponse modifyMultipleOrders( * the new `quantity` <= `executedQty` * When the order is * `GTX` and the new price will cause it to be executed immediately * One order can * only be modfied for less than 10000 times Weight: 1 on 10s order rate - * limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 1 on IP rate + * limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate * limit(x-mbx-used-weight-1m) * * @param modifyOrderRequest (required) diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java index 50271bd9f..3b56a7fb7 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java @@ -74,7 +74,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java index 87ea852c8..cde8cdf58 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java index ed5e2b461..981f607fa 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java @@ -83,7 +83,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -2741,7 +2741,7 @@ private okhttp3.Call modifyOrderValidateBeforeCall(ModifyOrderRequest modifyOrde * the new `quantity` <= `executedQty` * When the order is * `GTX` and the new price will cause it to be executed immediately * One order can * only be modfied for less than 10000 times Weight: 1 on 10s order rate - * limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 1 on IP rate + * limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate * limit(x-mbx-used-weight-1m) * * @param modifyOrderRequest (required) diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java index 22abbc407..24ffcf30e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java @@ -43,7 +43,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java index f5b1a9431..2cd72c313 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java @@ -46,7 +46,7 @@ public class DerivativesTradingUsdsFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java index 9d6f86900..095d02dfe 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java @@ -120,7 +120,7 @@ private void cancelOrderValidateBeforeCall(CancelOrderRequest cancelOrderRequest * the new `quantity` <= `executedQty` * When the order is * `GTX` and the new price will cause it to be executed immediately * One order can * only be modfied for less than 10000 times Weight: 1 on 10s order rate - * limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 1 on IP rate + * limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate * limit(x-mbx-used-weight-1m) * * @param modifyOrderRequest (required) diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java index 119db05c8..7df4bfea6 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java @@ -56,7 +56,7 @@ public class DerivativesTradingUsdsFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdateO.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdateO.java index ab24d518a..ffec04f20 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdateO.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/OrderTradeUpdateO.java @@ -255,6 +255,12 @@ public class OrderTradeUpdateO extends BaseDTO { @jakarta.annotation.Nullable private Long gtd; + public static final String SERIALIZED_NAME_ER = "er"; + + @SerializedName(SERIALIZED_NAME_ER) + @jakarta.annotation.Nullable + private String er; + public OrderTradeUpdateO() {} public OrderTradeUpdateO sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { @@ -941,6 +947,25 @@ public void setGtd(@jakarta.annotation.Nullable Long gtd) { this.gtd = gtd; } + public OrderTradeUpdateO er(@jakarta.annotation.Nullable String er) { + this.er = er; + return this; + } + + /** + * Get er + * + * @return er + */ + @jakarta.annotation.Nullable + public String getEr() { + return er; + } + + public void setEr(@jakarta.annotation.Nullable String er) { + this.er = er; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -985,7 +1010,8 @@ public boolean equals(Object o) { && Objects.equals(this.rp, orderTradeUpdateO.rp) && Objects.equals(this.V, orderTradeUpdateO.V) && Objects.equals(this.pm, orderTradeUpdateO.pm) - && Objects.equals(this.gtd, orderTradeUpdateO.gtd); + && Objects.equals(this.gtd, orderTradeUpdateO.gtd) + && Objects.equals(this.er, orderTradeUpdateO.er); } @Override @@ -1026,7 +1052,8 @@ public int hashCode() { rp, V, pm, - gtd); + gtd, + er); } @Override @@ -1069,6 +1096,7 @@ public String toString() { sb.append(" V: ").append(toIndentedString(V)).append("\n"); sb.append(" pm: ").append(toIndentedString(pm)).append("\n"); sb.append(" gtd: ").append(toIndentedString(gtd)).append("\n"); + sb.append(" er: ").append(toIndentedString(er)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1257,6 +1285,11 @@ public String toUrlQueryString() { String gtdValueAsString = gtdValue.toString(); valMap.put("gtd", gtdValueAsString); } + String erValue = getEr(); + if (erValue != null) { + String erValueAsString = erValue.toString(); + valMap.put("er", erValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -1412,6 +1445,10 @@ public Map toMap() { if (gtdValue != null) { valMap.put("gtd", gtdValue); } + Object erValue = getEr(); + if (erValue != null) { + valMap.put("er", erValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -1474,6 +1511,7 @@ private String toIndentedString(Object o) { openapiFields.add("V"); openapiFields.add("pm"); openapiFields.add("gtd"); + openapiFields.add("er"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1717,6 +1755,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("pm").toString())); } + if ((jsonObj.get("er") != null && !jsonObj.get("er").isJsonNull()) + && !jsonObj.get("er").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `er` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("er").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/pom.xml b/clients/pom.xml index ac83e6c17..fbef24eb3 100644 --- a/clients/pom.xml +++ b/clients/pom.xml @@ -17,7 +17,6 @@ algo - auto-invest c2c convert common diff --git a/clients/spot/CHANGELOG.md b/clients/spot/CHANGELOG.md index cf63d7822..22c265a47 100644 --- a/clients/spot/CHANGELOG.md +++ b/clients/spot/CHANGELOG.md @@ -1,5 +1,266 @@ # Changelog +## 7.0.0 - 2025-10-21 + +### Added (2) + +#### REST API + +- `myFilters()` (`GET /api/v3/myFilters`) + +#### WebSocket API + +- `myFilters()` (`myFilters` method) + +### Changed (25) + +#### REST API + +- Modified parameter `aboveTimeInForce`: + - type `number` → `string` + - enum added: `GTC`, `IOC`, `FOK` + - affected methods: + - `orderListOco()` (`POST /api/v3/orderList/oco`) +- Modified parameter `belowTimeInForce`: + - enum removed: `belowType`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_LIMIT` + - enum added: `GTC`, `IOC`, `FOK` + - affected methods: + - `orderListOco()` (`POST /api/v3/orderList/oco`) +- Modified parameter `recvWindow`: + - type `integer` → `number` + - format `int64` → `float` + - affected methods: + - `getAccount()` (`GET /api/v3/account`) + - `allOrderList()` (`GET /api/v3/allOrderList`) + - `allOrders()` (`GET /api/v3/allOrders`) + - `myAllocations()` (`GET /api/v3/myAllocations`) + - `myPreventedMatches()` (`GET /api/v3/myPreventedMatches`) + - `myTrades()` (`GET /api/v3/myTrades`) + - `openOrderList()` (`GET /api/v3/openOrderList`) + - `deleteOpenOrders()` (`DELETE /api/v3/openOrders`) + - `getOpenOrders()` (`GET /api/v3/openOrders`) + - `deleteOrder()` (`DELETE /api/v3/order`) + - `getOrder()` (`GET /api/v3/order`) + - `newOrder()` (`POST /api/v3/order`) + - `orderAmendKeepPriority()` (`PUT /api/v3/order/amend/keepPriority`) + - `orderAmendments()` (`GET /api/v3/order/amendments`) + - `orderCancelReplace()` (`POST /api/v3/order/cancelReplace`) + - `orderOco()` (`POST /api/v3/order/oco`) + - `orderTest()` (`POST /api/v3/order/test`) + - `deleteOrderList()` (`DELETE /api/v3/orderList`) + - `getOrderList()` (`GET /api/v3/orderList`) + - `orderListOco()` (`POST /api/v3/orderList/oco`) + - `orderListOto()` (`POST /api/v3/orderList/oto`) + - `orderListOtoco()` (`POST /api/v3/orderList/otoco`) + - `rateLimitOrder()` (`GET /api/v3/rateLimit/order`) + - `sorOrder()` (`POST /api/v3/sor/order`) + - `sorOrderTest()` (`POST /api/v3/sor/order/test`) +- Modified parameter `stopLimitTimeInForce`: + - affected methods: + - `orderOco()` (`POST /api/v3/order/oco`) + +- Modified response for `aggTrades()` (`GET /api/v3/aggTrades`): + +- Modified response for `exchangeInfo()` (`GET /api/v3/exchangeInfo`): + - `exchangeFilters`: item property `maxQty` deleted + - `exchangeFilters`: item property `maxTrailingAboveDelta` deleted + - `exchangeFilters`: item property `maxTrailingBelowDelta` deleted + - `exchangeFilters`: item property `maxNumOrderLists` deleted + - `exchangeFilters`: item property `limit` deleted + - `exchangeFilters`: item property `bidMultiplierUp` deleted + - `exchangeFilters`: item property `applyMinToMarket` deleted + - `exchangeFilters`: item property `minNotional` deleted + - `exchangeFilters`: item property `minTrailingBelowDelta` deleted + - `exchangeFilters`: item property `stepSize` deleted + - `exchangeFilters`: item property `multiplierDown` deleted + - `exchangeFilters`: item property `tickSize` deleted + - `exchangeFilters`: item property `maxNumAlgoOrders` deleted + - `exchangeFilters`: item property `filterType` deleted + - `exchangeFilters`: item property `maxPrice` deleted + - `exchangeFilters`: item property `multiplierUp` deleted + - `exchangeFilters`: item property `minTrailingAboveDelta` deleted + - `exchangeFilters`: item property `askMultiplierDown` deleted + - `exchangeFilters`: item property `minQty` deleted + - `exchangeFilters`: item property `avgPriceMins` deleted + - `exchangeFilters`: item property `maxPosition` deleted + - `exchangeFilters`: item property `bidMultiplierDown` deleted + - `exchangeFilters`: item property `minPrice` deleted + - `exchangeFilters`: item property `maxNumOrderAmends` deleted + - `exchangeFilters`: item property `applyMaxToMarket` deleted + - `exchangeFilters`: item property `maxNumIcebergOrders` deleted + - `exchangeFilters`: item property `applyToMarket` deleted + - `exchangeFilters`: item property `maxNotional` deleted + - `exchangeFilters`: item property `askMultiplierUp` deleted + - `exchangeFilters`: item property `maxNumOrders` deleted + - `symbols`.`filters`: item property `minPrice` deleted + - `symbols`.`filters`: item property `limit` deleted + - `symbols`.`filters`: item property `maxTrailingBelowDelta` deleted + - `symbols`.`filters`: item property `maxNumAlgoOrders` deleted + - `symbols`.`filters`: item property `maxPrice` deleted + - `symbols`.`filters`: item property `avgPriceMins` deleted + - `symbols`.`filters`: item property `maxTrailingAboveDelta` deleted + - `symbols`.`filters`: item property `maxPosition` deleted + - `symbols`.`filters`: item property `stepSize` deleted + - `symbols`.`filters`: item property `applyMaxToMarket` deleted + - `symbols`.`filters`: item property `applyToMarket` deleted + - `symbols`.`filters`: item property `minNotional` deleted + - `symbols`.`filters`: item property `multiplierUp` deleted + - `symbols`.`filters`: item property `maxNotional` deleted + - `symbols`.`filters`: item property `maxNumOrderAmends` deleted + - `symbols`.`filters`: item property `multiplierDown` deleted + - `symbols`.`filters`: item property `maxNumOrders` deleted + - `symbols`.`filters`: item property `maxQty` deleted + - `symbols`.`filters`: item property `askMultiplierDown` deleted + - `symbols`.`filters`: item property `bidMultiplierDown` deleted + - `symbols`.`filters`: item property `minTrailingBelowDelta` deleted + - `symbols`.`filters`: item property `askMultiplierUp` deleted + - `symbols`.`filters`: item property `tickSize` deleted + - `symbols`.`filters`: item property `bidMultiplierUp` deleted + - `symbols`.`filters`: item property `maxNumIcebergOrders` deleted + - `symbols`.`filters`: item property `minTrailingAboveDelta` deleted + - `symbols`.`filters`: item property `applyMinToMarket` deleted + - `symbols`.`filters`: item property `filterType` deleted + - `symbols`.`filters`: item property `maxNumOrderLists` deleted + - `symbols`.`filters`: item property `minQty` deleted + +#### WebSocket API + +- Modified parameter `aboveTimeInForce`: + - type `number` → `string` + - enum added: `GTC`, `IOC`, `FOK` + - affected methods: + - `orderListPlaceOco()` (`orderList.place.oco` method) +- Modified parameter `belowTimeInForce`: + - enum removed: `belowType`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_LIMIT` + - enum added: `GTC`, `IOC`, `FOK` + - affected methods: + - `orderListPlaceOco()` (`orderList.place.oco` method) +- Modified parameter `recvWindow`: + - type `integer` → `number` + - format `int64` → `float` + - affected methods: + - `accountRateLimitsOrders()` (`account.rateLimits.orders` method) + - `accountStatus()` (`account.status` method) + - `allOrderLists()` (`allOrderLists` method) + - `allOrders()` (`allOrders` method) + - `myAllocations()` (`myAllocations` method) + - `myPreventedMatches()` (`myPreventedMatches` method) + - `myTrades()` (`myTrades` method) + - `openOrderListsStatus()` (`openOrderLists.status` method) + - `openOrdersCancelAll()` (`openOrders.cancelAll` method) + - `openOrdersStatus()` (`openOrders.status` method) + - `orderAmendKeepPriority()` (`order.amend.keepPriority` method) + - `orderAmendments()` (`order.amendments` method) + - `orderCancel()` (`order.cancel` method) + - `orderCancelReplace()` (`order.cancelReplace` method) + - `orderPlace()` (`order.place` method) + - `orderStatus()` (`order.status` method) + - `orderTest()` (`order.test` method) + - `orderListCancel()` (`orderList.cancel` method) + - `orderListPlace()` (`orderList.place` method) + - `orderListPlaceOco()` (`orderList.place.oco` method) + - `orderListPlaceOto()` (`orderList.place.oto` method) + - `orderListPlaceOtoco()` (`orderList.place.otoco` method) + - `orderListStatus()` (`orderList.status` method) + - `sessionLogon()` (`session.logon` method) + - `sorOrderPlace()` (`sor.order.place` method) + - `sorOrderTest()` (`sor.order.test` method) +- Modified parameter `stopLimitTimeInForce`: + - affected methods: + - `orderListPlace()` (`orderList.place` method) + +- Modified response for `exchangeInfo()` (`exchangeInfo` method): + - `result`.`exchangeFilters`: item property `stepSize` deleted + - `result`.`exchangeFilters`: item property `maxNumIcebergOrders` deleted + - `result`.`exchangeFilters`: item property `applyToMarket` deleted + - `result`.`exchangeFilters`: item property `minNotional` deleted + - `result`.`exchangeFilters`: item property `maxNumAlgoOrders` deleted + - `result`.`exchangeFilters`: item property `askMultiplierUp` deleted + - `result`.`exchangeFilters`: item property `avgPriceMins` deleted + - `result`.`exchangeFilters`: item property `askMultiplierDown` deleted + - `result`.`exchangeFilters`: item property `maxQty` deleted + - `result`.`exchangeFilters`: item property `maxPrice` deleted + - `result`.`exchangeFilters`: item property `minPrice` deleted + - `result`.`exchangeFilters`: item property `maxNumOrderAmends` deleted + - `result`.`exchangeFilters`: item property `maxPosition` deleted + - `result`.`exchangeFilters`: item property `multiplierUp` deleted + - `result`.`exchangeFilters`: item property `maxTrailingAboveDelta` deleted + - `result`.`exchangeFilters`: item property `tickSize` deleted + - `result`.`exchangeFilters`: item property `multiplierDown` deleted + - `result`.`exchangeFilters`: item property `applyMaxToMarket` deleted + - `result`.`exchangeFilters`: item property `bidMultiplierUp` deleted + - `result`.`exchangeFilters`: item property `maxNotional` deleted + - `result`.`exchangeFilters`: item property `maxNumOrders` deleted + - `result`.`exchangeFilters`: item property `minQty` deleted + - `result`.`exchangeFilters`: item property `minTrailingBelowDelta` deleted + - `result`.`exchangeFilters`: item property `filterType` deleted + - `result`.`exchangeFilters`: item property `bidMultiplierDown` deleted + - `result`.`exchangeFilters`: item property `maxNumOrderLists` deleted + - `result`.`exchangeFilters`: item property `limit` deleted + - `result`.`exchangeFilters`: item property `maxTrailingBelowDelta` deleted + - `result`.`exchangeFilters`: item property `minTrailingAboveDelta` deleted + - `result`.`exchangeFilters`: item property `applyMinToMarket` deleted + - `result`.`symbols`.`filters`: item property `applyMinToMarket` deleted + - `result`.`symbols`.`filters`: item property `maxNumOrderLists` deleted + - `result`.`symbols`.`filters`: item property `multiplierUp` deleted + - `result`.`symbols`.`filters`: item property `bidMultiplierUp` deleted + - `result`.`symbols`.`filters`: item property `maxNumAlgoOrders` deleted + - `result`.`symbols`.`filters`: item property `maxPrice` deleted + - `result`.`symbols`.`filters`: item property `minQty` deleted + - `result`.`symbols`.`filters`: item property `minTrailingBelowDelta` deleted + - `result`.`symbols`.`filters`: item property `applyMaxToMarket` deleted + - `result`.`symbols`.`filters`: item property `maxTrailingAboveDelta` deleted + - `result`.`symbols`.`filters`: item property `avgPriceMins` deleted + - `result`.`symbols`.`filters`: item property `limit` deleted + - `result`.`symbols`.`filters`: item property `maxNumOrderAmends` deleted + - `result`.`symbols`.`filters`: item property `maxNumIcebergOrders` deleted + - `result`.`symbols`.`filters`: item property `minTrailingAboveDelta` deleted + - `result`.`symbols`.`filters`: item property `minNotional` deleted + - `result`.`symbols`.`filters`: item property `maxQty` deleted + - `result`.`symbols`.`filters`: item property `stepSize` deleted + - `result`.`symbols`.`filters`: item property `minPrice` deleted + - `result`.`symbols`.`filters`: item property `maxTrailingBelowDelta` deleted + - `result`.`symbols`.`filters`: item property `multiplierDown` deleted + - `result`.`symbols`.`filters`: item property `bidMultiplierDown` deleted + - `result`.`symbols`.`filters`: item property `askMultiplierUp` deleted + - `result`.`symbols`.`filters`: item property `tickSize` deleted + - `result`.`symbols`.`filters`: item property `maxNumOrders` deleted + - `result`.`symbols`.`filters`: item property `maxPosition` deleted + - `result`.`symbols`.`filters`: item property `filterType` deleted + - `result`.`symbols`.`filters`: item property `applyToMarket` deleted + - `result`.`symbols`.`filters`: item property `askMultiplierDown` deleted + - `result`.`symbols`.`filters`: item property `maxNotional` deleted + +- Modified response for `tradesAggregate()` (`trades.aggregate` method): + +#### WebSocket Streams + +- Modified response for `allMiniTicker()` (`!miniTicker@arr` stream): + +- Modified response for `allTicker()` (`!ticker@arr` stream): + +- Modified response for `allMarketRollingWindowTicker()` (`!ticker_@arr` stream): + +- Modified response for `aggTrade()` (`@aggTrade` stream): + +- Modified response for `avgPrice()` (`@avgPrice` stream): + +- Modified response for `bookTicker()` (`@bookTicker` stream): + +- Modified response for `diffBookDepth()` (`@depth@` stream): + +- Modified response for `kline()` (`@kline_` stream): + +- Modified response for `klineOffset()` (`@kline_@+08:00` stream): + +- Modified response for `miniTicker()` (`@miniTicker` stream): + +- Modified response for `ticker()` (`@ticker` stream): + +- Modified response for `rollingWindowTicker()` (`@ticker_` stream): + +- Modified response for `trade()` (`@trade` stream): + ## 6.0.0 - 2025-08-21 ### Added (2) diff --git a/clients/spot/docs/AboveTimeInForce.md b/clients/spot/docs/AboveTimeInForce.md new file mode 100644 index 000000000..bbf816167 --- /dev/null +++ b/clients/spot/docs/AboveTimeInForce.md @@ -0,0 +1,15 @@ + + +# AboveTimeInForce + +## Enum + + +* `GTC` (value: `"GTC"`) + +* `IOC` (value: `"IOC"`) + +* `FOK` (value: `"FOK"`) + + + diff --git a/clients/spot/docs/AccountApi.md b/clients/spot/docs/AccountApi.md index b5546b1ed..d3130654e 100644 --- a/clients/spot/docs/AccountApi.md +++ b/clients/spot/docs/AccountApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://localhost* | [**allOrderLists**](AccountApi.md#allOrderLists) | **POST** /allOrderLists | WebSocket Account order list history | | [**allOrders**](AccountApi.md#allOrders) | **POST** /allOrders | WebSocket Account order history | | [**myAllocations**](AccountApi.md#myAllocations) | **POST** /myAllocations | WebSocket Account allocations | +| [**myFilters**](AccountApi.md#myFilters) | **POST** /myFilters | WebSocket Query Relevant Filters | | [**myPreventedMatches**](AccountApi.md#myPreventedMatches) | **POST** /myPreventedMatches | WebSocket Account prevented matches | | [**myTrades**](AccountApi.md#myTrades) | **POST** /myTrades | WebSocket Account trade history | | [**openOrderListsStatus**](AccountApi.md#openOrderListsStatus) | **POST** /openOrderLists.status | WebSocket Current open Order lists | @@ -391,6 +392,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Account allocations | - | + +# **myFilters** +> MyFiltersResponse myFilters(myFiltersRequest) + +WebSocket Query Relevant Filters + +Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` filters applied to it. Weight: 40 + +### 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.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + AccountApi apiInstance = new AccountApi(defaultClient); + MyFiltersRequest myFiltersRequest = new MyFiltersRequest(); // MyFiltersRequest | + try { + MyFiltersResponse result = apiInstance.myFilters(myFiltersRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#myFilters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **myFiltersRequest** | [**MyFiltersRequest**](MyFiltersRequest.md)| | | + +### Return type + +[**MyFiltersResponse**](MyFiltersResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query Relevant Filters | - | + # **myPreventedMatches** > MyPreventedMatchesResponse myPreventedMatches(myPreventedMatchesRequest) diff --git a/clients/spot/docs/AccountCommissionResponse.md b/clients/spot/docs/AccountCommissionResponse.md index 57bcc8003..667924353 100644 --- a/clients/spot/docs/AccountCommissionResponse.md +++ b/clients/spot/docs/AccountCommissionResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**AccountCommissionResponseResult**](AccountCommissionResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/AccountRateLimitsOrdersRequest.md b/clients/spot/docs/AccountRateLimitsOrdersRequest.md index fce8aeaa9..b7e24f7d3 100644 --- a/clients/spot/docs/AccountRateLimitsOrdersRequest.md +++ b/clients/spot/docs/AccountRateLimitsOrdersRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/AccountRateLimitsOrdersResponse.md b/clients/spot/docs/AccountRateLimitsOrdersResponse.md index 4ec2e96e8..f5ccb2dda 100644 --- a/clients/spot/docs/AccountRateLimitsOrdersResponse.md +++ b/clients/spot/docs/AccountRateLimitsOrdersResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<AccountRateLimitsOrdersResponseResultInner>**](AccountRateLimitsOrdersResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/AccountStatusRequest.md b/clients/spot/docs/AccountStatusRequest.md index bf8c78743..046a60d00 100644 --- a/clients/spot/docs/AccountStatusRequest.md +++ b/clients/spot/docs/AccountStatusRequest.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**omitZeroBalances** | **Boolean** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/AccountStatusResponse.md b/clients/spot/docs/AccountStatusResponse.md index 22c2668de..a5c4e1556 100644 --- a/clients/spot/docs/AccountStatusResponse.md +++ b/clients/spot/docs/AccountStatusResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**AccountStatusResponseResult**](AccountStatusResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/AllOrderListsRequest.md b/clients/spot/docs/AllOrderListsRequest.md index bb2f81d41..d054b2c78 100644 --- a/clients/spot/docs/AllOrderListsRequest.md +++ b/clients/spot/docs/AllOrderListsRequest.md @@ -11,7 +11,7 @@ |**startTime** | **Long** | | [optional] | |**endTime** | **Long** | | [optional] | |**limit** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/AllOrderListsResponse.md b/clients/spot/docs/AllOrderListsResponse.md index fec4455bc..d53a4ec78 100644 --- a/clients/spot/docs/AllOrderListsResponse.md +++ b/clients/spot/docs/AllOrderListsResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<AllOrderListsResponseResultInner>**](AllOrderListsResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/AllOrdersRequest.md b/clients/spot/docs/AllOrdersRequest.md index 923cfa456..8eb155db5 100644 --- a/clients/spot/docs/AllOrdersRequest.md +++ b/clients/spot/docs/AllOrdersRequest.md @@ -12,7 +12,7 @@ |**startTime** | **Long** | | [optional] | |**endTime** | **Long** | | [optional] | |**limit** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/AllOrdersResponse.md b/clients/spot/docs/AllOrdersResponse.md index 4d3b7322a..63db56ef9 100644 --- a/clients/spot/docs/AllOrdersResponse.md +++ b/clients/spot/docs/AllOrdersResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<AllOrdersResponseResultInner>**](AllOrdersResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/AssetFilters.md b/clients/spot/docs/AssetFilters.md new file mode 100644 index 000000000..afba59391 --- /dev/null +++ b/clients/spot/docs/AssetFilters.md @@ -0,0 +1,16 @@ + + +# AssetFilters + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**qtyExponent** | **Integer** | | [optional] | +|**limit** | **String** | | [optional] | +|**asset** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/BelowTimeInForce.md b/clients/spot/docs/BelowTimeInForce.md index e58aa4dbd..eb6d71e83 100644 --- a/clients/spot/docs/BelowTimeInForce.md +++ b/clients/spot/docs/BelowTimeInForce.md @@ -5,11 +5,11 @@ ## Enum -* `belowType` (value: `"belowType"`) +* `GTC` (value: `"GTC"`) -* `STOP_LOSS_LIMIT` (value: `"STOP_LOSS_LIMIT"`) +* `IOC` (value: `"IOC"`) -* `TAKE_PROFIT_LIMIT` (value: `"TAKE_PROFIT_LIMIT"`) +* `FOK` (value: `"FOK"`) diff --git a/clients/spot/docs/DepthResponse.md b/clients/spot/docs/DepthResponse.md index 2fd461f25..d7ec591a6 100644 --- a/clients/spot/docs/DepthResponse.md +++ b/clients/spot/docs/DepthResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**DepthResponseResult**](DepthResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/ExchangeFilters.md b/clients/spot/docs/ExchangeFilters.md index 7fbf89393..6911ac91e 100644 --- a/clients/spot/docs/ExchangeFilters.md +++ b/clients/spot/docs/ExchangeFilters.md @@ -7,6 +7,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumOrders** | **Long** | | [optional] | +|**maxNumAlgoOrders** | **Long** | | [optional] | +|**maxNumIcebergOrders** | **Long** | | [optional] | +|**maxNumOrderLists** | **Long** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponse.md b/clients/spot/docs/ExchangeInfoResponse.md index 020aa39d6..09350806e 100644 --- a/clients/spot/docs/ExchangeInfoResponse.md +++ b/clients/spot/docs/ExchangeInfoResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**ExchangeInfoResponseResult**](ExchangeInfoResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseResult.md b/clients/spot/docs/ExchangeInfoResponseResult.md index 904ab60e0..4b8556d64 100644 --- a/clients/spot/docs/ExchangeInfoResponseResult.md +++ b/clients/spot/docs/ExchangeInfoResponseResult.md @@ -9,8 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**timezone** | **String** | | [optional] | |**serverTime** | **Long** | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | -|**exchangeFilters** | **ExchangeFilters** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | +|**exchangeFilters** | [**List<ExchangeFilters>**](ExchangeFilters.md) | | [optional] | |**symbols** | [**List<ExchangeInfoResponseResultSymbolsInner>**](ExchangeInfoResponseResultSymbolsInner.md) | | [optional] | |**sors** | [**List<ExchangeInfoResponseResultSorsInner>**](ExchangeInfoResponseResultSorsInner.md) | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md b/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md index 1e37946bf..47a68befb 100644 --- a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md +++ b/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md @@ -27,7 +27,7 @@ |**pegInstructionsAllowed** | **Boolean** | | [optional] | |**isSpotTradingAllowed** | **Boolean** | | [optional] | |**isMarginTradingAllowed** | **Boolean** | | [optional] | -|**filters** | **ExchangeFilters** | | [optional] | +|**filters** | [**List<SymbolFilters>**](SymbolFilters.md) | | [optional] | |**permissions** | **List<String>** | | [optional] | |**permissionSets** | **List<List<String>>** | | [optional] | |**defaultSelfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md b/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md index cf75705c2..9c4401580 100644 --- a/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md +++ b/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md @@ -27,7 +27,7 @@ |**pegInstructionsAllowed** | **Boolean** | | [optional] | |**isSpotTradingAllowed** | **Boolean** | | [optional] | |**isMarginTradingAllowed** | **Boolean** | | [optional] | -|**filters** | **ExchangeFilters** | | [optional] | +|**filters** | [**List<SymbolFilters>**](SymbolFilters.md) | | [optional] | |**permissions** | **List<String>** | | [optional] | |**permissionSets** | **List<List<String>>** | | [optional] | |**defaultSelfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/spot/docs/ExchangeMaxNumAlgoOrdersFilter.md b/clients/spot/docs/ExchangeMaxNumAlgoOrdersFilter.md new file mode 100644 index 000000000..2a506cd3d --- /dev/null +++ b/clients/spot/docs/ExchangeMaxNumAlgoOrdersFilter.md @@ -0,0 +1,14 @@ + + +# ExchangeMaxNumAlgoOrdersFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumAlgoOrders** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/ExchangeMaxNumIcebergOrdersFilter.md b/clients/spot/docs/ExchangeMaxNumIcebergOrdersFilter.md new file mode 100644 index 000000000..e1a8cead6 --- /dev/null +++ b/clients/spot/docs/ExchangeMaxNumIcebergOrdersFilter.md @@ -0,0 +1,14 @@ + + +# ExchangeMaxNumIcebergOrdersFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumIcebergOrders** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/ExchangeMaxNumOrderListsFilter.md b/clients/spot/docs/ExchangeMaxNumOrderListsFilter.md new file mode 100644 index 000000000..088b19598 --- /dev/null +++ b/clients/spot/docs/ExchangeMaxNumOrderListsFilter.md @@ -0,0 +1,14 @@ + + +# ExchangeMaxNumOrderListsFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumOrderLists** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/ExchangeMaxNumOrdersFilter.md b/clients/spot/docs/ExchangeMaxNumOrdersFilter.md new file mode 100644 index 000000000..4dddb789f --- /dev/null +++ b/clients/spot/docs/ExchangeMaxNumOrdersFilter.md @@ -0,0 +1,14 @@ + + +# ExchangeMaxNumOrdersFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumOrders** | **Long** | | [optional] | + + + diff --git a/clients/auto-invest/docs/IndexLinkedPlanRebalanceDetailsResponse.md b/clients/spot/docs/IcebergPartsFilter.md similarity index 52% rename from clients/auto-invest/docs/IndexLinkedPlanRebalanceDetailsResponse.md rename to clients/spot/docs/IcebergPartsFilter.md index 3a5336034..92359fa56 100644 --- a/clients/auto-invest/docs/IndexLinkedPlanRebalanceDetailsResponse.md +++ b/clients/spot/docs/IcebergPartsFilter.md @@ -1,12 +1,14 @@ -# IndexLinkedPlanRebalanceDetailsResponse +# IcebergPartsFilter ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**limit** | **Long** | | [optional] | diff --git a/clients/spot/docs/KlinesResponse.md b/clients/spot/docs/KlinesResponse.md index 2db1485e7..e5ed84bcb 100644 --- a/clients/spot/docs/KlinesResponse.md +++ b/clients/spot/docs/KlinesResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | **List<KlinesItem>** | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/LotSizeFilter.md b/clients/spot/docs/LotSizeFilter.md new file mode 100644 index 000000000..790bfb20e --- /dev/null +++ b/clients/spot/docs/LotSizeFilter.md @@ -0,0 +1,17 @@ + + +# LotSizeFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**qtyExponent** | **Integer** | | [optional] | +|**minQty** | **String** | | [optional] | +|**maxQty** | **String** | | [optional] | +|**stepSize** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/MarketLotSizeFilter.md b/clients/spot/docs/MarketLotSizeFilter.md new file mode 100644 index 000000000..c7d8ca99a --- /dev/null +++ b/clients/spot/docs/MarketLotSizeFilter.md @@ -0,0 +1,17 @@ + + +# MarketLotSizeFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**qtyExponent** | **Integer** | | [optional] | +|**minQty** | **String** | | [optional] | +|**maxQty** | **String** | | [optional] | +|**stepSize** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/MaxAssetFilter.md b/clients/spot/docs/MaxAssetFilter.md new file mode 100644 index 000000000..85e6e5647 --- /dev/null +++ b/clients/spot/docs/MaxAssetFilter.md @@ -0,0 +1,16 @@ + + +# MaxAssetFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**qtyExponent** | **Integer** | | [optional] | +|**limit** | **String** | | [optional] | +|**asset** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/MaxNumAlgoOrdersFilter.md b/clients/spot/docs/MaxNumAlgoOrdersFilter.md new file mode 100644 index 000000000..163d1ac8f --- /dev/null +++ b/clients/spot/docs/MaxNumAlgoOrdersFilter.md @@ -0,0 +1,14 @@ + + +# MaxNumAlgoOrdersFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumAlgoOrders** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/MaxNumIcebergOrdersFilter.md b/clients/spot/docs/MaxNumIcebergOrdersFilter.md new file mode 100644 index 000000000..b39994ba6 --- /dev/null +++ b/clients/spot/docs/MaxNumIcebergOrdersFilter.md @@ -0,0 +1,14 @@ + + +# MaxNumIcebergOrdersFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumIcebergOrders** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/MaxNumOrderAmendsFilter.md b/clients/spot/docs/MaxNumOrderAmendsFilter.md new file mode 100644 index 000000000..87e8a56f3 --- /dev/null +++ b/clients/spot/docs/MaxNumOrderAmendsFilter.md @@ -0,0 +1,14 @@ + + +# MaxNumOrderAmendsFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumOrderAmends** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/MaxNumOrderListsFilter.md b/clients/spot/docs/MaxNumOrderListsFilter.md new file mode 100644 index 000000000..ed0411b80 --- /dev/null +++ b/clients/spot/docs/MaxNumOrderListsFilter.md @@ -0,0 +1,14 @@ + + +# MaxNumOrderListsFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumOrderLists** | **Long** | | [optional] | + + + diff --git a/clients/auto-invest/docs/GetTargetAssetRoiDataResponse.md b/clients/spot/docs/MaxNumOrdersFilter.md similarity index 51% rename from clients/auto-invest/docs/GetTargetAssetRoiDataResponse.md rename to clients/spot/docs/MaxNumOrdersFilter.md index e5efcf31c..c693900ef 100644 --- a/clients/auto-invest/docs/GetTargetAssetRoiDataResponse.md +++ b/clients/spot/docs/MaxNumOrdersFilter.md @@ -1,12 +1,14 @@ -# GetTargetAssetRoiDataResponse +# MaxNumOrdersFilter ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**maxNumOrders** | **Long** | | [optional] | diff --git a/clients/spot/docs/MaxPositionFilter.md b/clients/spot/docs/MaxPositionFilter.md new file mode 100644 index 000000000..1a8bf9ceb --- /dev/null +++ b/clients/spot/docs/MaxPositionFilter.md @@ -0,0 +1,15 @@ + + +# MaxPositionFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**qtyExponent** | **Integer** | | [optional] | +|**maxPosition** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/MinNotionalFilter.md b/clients/spot/docs/MinNotionalFilter.md new file mode 100644 index 000000000..0df2dbeb8 --- /dev/null +++ b/clients/spot/docs/MinNotionalFilter.md @@ -0,0 +1,17 @@ + + +# MinNotionalFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**priceExponent** | **Integer** | | [optional] | +|**minNotional** | **String** | | [optional] | +|**applyToMarket** | **Boolean** | | [optional] | +|**avgPriceMins** | **Integer** | | [optional] | + + + diff --git a/clients/spot/docs/MyAllocationsRequest.md b/clients/spot/docs/MyAllocationsRequest.md index 09ff15395..43cf12db4 100644 --- a/clients/spot/docs/MyAllocationsRequest.md +++ b/clients/spot/docs/MyAllocationsRequest.md @@ -13,7 +13,7 @@ |**fromAllocationId** | **Integer** | | [optional] | |**limit** | **Integer** | | [optional] | |**orderId** | **Long** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/MyAllocationsResponse.md b/clients/spot/docs/MyAllocationsResponse.md index 365bc863a..39364a0fb 100644 --- a/clients/spot/docs/MyAllocationsResponse.md +++ b/clients/spot/docs/MyAllocationsResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<MyAllocationsResponseResultInner>**](MyAllocationsResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/auto-invest/docs/DetailsInner.md b/clients/spot/docs/MyFiltersRequest.md similarity index 55% rename from clients/auto-invest/docs/DetailsInner.md rename to clients/spot/docs/MyFiltersRequest.md index dec0fa0a0..3ea2987a8 100644 --- a/clients/auto-invest/docs/DetailsInner.md +++ b/clients/spot/docs/MyFiltersRequest.md @@ -1,14 +1,14 @@ -# DetailsInner +# MyFiltersRequest ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**targetAsset** | **String** | | | -|**percentage** | **String** | | | +|**symbol** | **String** | | | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/MyFiltersResponse.md b/clients/spot/docs/MyFiltersResponse.md new file mode 100644 index 000000000..c06b61b95 --- /dev/null +++ b/clients/spot/docs/MyFiltersResponse.md @@ -0,0 +1,16 @@ + + +# MyFiltersResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**status** | **Long** | | [optional] | +|**result** | [**MyFiltersResponseResult**](MyFiltersResponseResult.md) | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | + + + diff --git a/clients/spot/docs/MyFiltersResponseResult.md b/clients/spot/docs/MyFiltersResponseResult.md new file mode 100644 index 000000000..629c279d0 --- /dev/null +++ b/clients/spot/docs/MyFiltersResponseResult.md @@ -0,0 +1,15 @@ + + +# MyFiltersResponseResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**exchangeFilters** | [**List<ExchangeFilters>**](ExchangeFilters.md) | | [optional] | +|**symbolFilters** | [**List<SymbolFilters>**](SymbolFilters.md) | | [optional] | +|**assetFilters** | [**List<AssetFilters>**](AssetFilters.md) | | [optional] | + + + diff --git a/clients/spot/docs/MyPreventedMatchesRequest.md b/clients/spot/docs/MyPreventedMatchesRequest.md index 2d5d52a78..95e70a9d5 100644 --- a/clients/spot/docs/MyPreventedMatchesRequest.md +++ b/clients/spot/docs/MyPreventedMatchesRequest.md @@ -12,7 +12,7 @@ |**orderId** | **Long** | | [optional] | |**fromPreventedMatchId** | **Long** | | [optional] | |**limit** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/MyPreventedMatchesResponse.md b/clients/spot/docs/MyPreventedMatchesResponse.md index 1c31334eb..3cc95631f 100644 --- a/clients/spot/docs/MyPreventedMatchesResponse.md +++ b/clients/spot/docs/MyPreventedMatchesResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<MyPreventedMatchesResponseResultInner>**](MyPreventedMatchesResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/MyTradesRequest.md b/clients/spot/docs/MyTradesRequest.md index 5c85853c0..0f46b095f 100644 --- a/clients/spot/docs/MyTradesRequest.md +++ b/clients/spot/docs/MyTradesRequest.md @@ -13,7 +13,7 @@ |**endTime** | **Long** | | [optional] | |**fromId** | **Integer** | | [optional] | |**limit** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/MyTradesResponse.md b/clients/spot/docs/MyTradesResponse.md index d897c7160..52ef468aa 100644 --- a/clients/spot/docs/MyTradesResponse.md +++ b/clients/spot/docs/MyTradesResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<MyTradesResponseResultInner>**](MyTradesResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/NewOrderRequest.md b/clients/spot/docs/NewOrderRequest.md index 7b2e0b782..d9bb0bd9e 100644 --- a/clients/spot/docs/NewOrderRequest.md +++ b/clients/spot/docs/NewOrderRequest.md @@ -25,7 +25,7 @@ |**pegPriceType** | **PegPriceType** | | [optional] | |**pegOffsetValue** | **Integer** | | [optional] | |**pegOffsetType** | **PegOffsetType** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/NotionalFilter.md b/clients/spot/docs/NotionalFilter.md new file mode 100644 index 000000000..1f38bb926 --- /dev/null +++ b/clients/spot/docs/NotionalFilter.md @@ -0,0 +1,19 @@ + + +# NotionalFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**priceExponent** | **Integer** | | [optional] | +|**minNotional** | **String** | | [optional] | +|**applyMinToMarket** | **Boolean** | | [optional] | +|**maxNotional** | **String** | | [optional] | +|**applyMaxToMarket** | **Boolean** | | [optional] | +|**avgPriceMins** | **Integer** | | [optional] | + + + diff --git a/clients/spot/docs/OpenOrderListsStatusRequest.md b/clients/spot/docs/OpenOrderListsStatusRequest.md index 89645b367..adbd84a3f 100644 --- a/clients/spot/docs/OpenOrderListsStatusRequest.md +++ b/clients/spot/docs/OpenOrderListsStatusRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OpenOrderListsStatusResponse.md b/clients/spot/docs/OpenOrderListsStatusResponse.md index 619db26dd..706f8bd47 100644 --- a/clients/spot/docs/OpenOrderListsStatusResponse.md +++ b/clients/spot/docs/OpenOrderListsStatusResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<OpenOrderListsStatusResponseResultInner>**](OpenOrderListsStatusResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OpenOrdersCancelAllRequest.md b/clients/spot/docs/OpenOrdersCancelAllRequest.md index 494b2e92f..4d79f9ede 100644 --- a/clients/spot/docs/OpenOrdersCancelAllRequest.md +++ b/clients/spot/docs/OpenOrdersCancelAllRequest.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OpenOrdersCancelAllResponse.md b/clients/spot/docs/OpenOrdersCancelAllResponse.md index 97668ff2d..a5b064ef1 100644 --- a/clients/spot/docs/OpenOrdersCancelAllResponse.md +++ b/clients/spot/docs/OpenOrdersCancelAllResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<OpenOrdersCancelAllResponseResultInner>**](OpenOrdersCancelAllResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OpenOrdersStatusRequest.md b/clients/spot/docs/OpenOrdersStatusRequest.md index e48299ff9..c694a5460 100644 --- a/clients/spot/docs/OpenOrdersStatusRequest.md +++ b/clients/spot/docs/OpenOrdersStatusRequest.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OpenOrdersStatusResponse.md b/clients/spot/docs/OpenOrdersStatusResponse.md index 7197b50a8..b8ccae222 100644 --- a/clients/spot/docs/OpenOrdersStatusResponse.md +++ b/clients/spot/docs/OpenOrdersStatusResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<OpenOrdersStatusResponseResultInner>**](OpenOrdersStatusResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderAmendKeepPriorityRequest.md b/clients/spot/docs/OrderAmendKeepPriorityRequest.md index 2ed6e25d5..9484fd869 100644 --- a/clients/spot/docs/OrderAmendKeepPriorityRequest.md +++ b/clients/spot/docs/OrderAmendKeepPriorityRequest.md @@ -12,7 +12,7 @@ |**origClientOrderId** | **String** | | [optional] | |**newClientOrderId** | **String** | | [optional] | |**newQty** | **Double** | | | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse.md b/clients/spot/docs/OrderAmendKeepPriorityResponse.md index 43dca4573..cdcd7765b 100644 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse.md +++ b/clients/spot/docs/OrderAmendKeepPriorityResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderAmendKeepPriorityResponseResult**](OrderAmendKeepPriorityResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderAmendmentsRequest.md b/clients/spot/docs/OrderAmendmentsRequest.md index 754582538..79f6c8700 100644 --- a/clients/spot/docs/OrderAmendmentsRequest.md +++ b/clients/spot/docs/OrderAmendmentsRequest.md @@ -11,7 +11,7 @@ |**orderId** | **Long** | | | |**fromExecutionId** | **Long** | | [optional] | |**limit** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderAmendmentsResponse.md b/clients/spot/docs/OrderAmendmentsResponse.md index 5ea5f327f..24f16cde5 100644 --- a/clients/spot/docs/OrderAmendmentsResponse.md +++ b/clients/spot/docs/OrderAmendmentsResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<OrderAmendmentsResponseResultInner>**](OrderAmendmentsResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderCancelReplaceRequest.md b/clients/spot/docs/OrderCancelReplaceRequest.md index 78e66047d..3c4c6b1f3 100644 --- a/clients/spot/docs/OrderCancelReplaceRequest.md +++ b/clients/spot/docs/OrderCancelReplaceRequest.md @@ -31,7 +31,7 @@ |**pegPriceType** | **PegPriceType** | | [optional] | |**pegOffsetValue** | **Integer** | | [optional] | |**pegOffsetType** | **PegOffsetType** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderCancelReplaceResponse.md b/clients/spot/docs/OrderCancelReplaceResponse.md index 32991ad0e..94112db22 100644 --- a/clients/spot/docs/OrderCancelReplaceResponse.md +++ b/clients/spot/docs/OrderCancelReplaceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderCancelReplaceResponseResult**](OrderCancelReplaceResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderCancelRequest.md b/clients/spot/docs/OrderCancelRequest.md index 60bd3107b..4e209892c 100644 --- a/clients/spot/docs/OrderCancelRequest.md +++ b/clients/spot/docs/OrderCancelRequest.md @@ -12,7 +12,7 @@ |**origClientOrderId** | **String** | | [optional] | |**newClientOrderId** | **String** | | [optional] | |**cancelRestrictions** | **CancelRestrictions** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderCancelResponse.md b/clients/spot/docs/OrderCancelResponse.md index d64bb1cb2..2cd896581 100644 --- a/clients/spot/docs/OrderCancelResponse.md +++ b/clients/spot/docs/OrderCancelResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderCancelResponseResult**](OrderCancelResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderListCancelRequest.md b/clients/spot/docs/OrderListCancelRequest.md index 931a75dc3..237328133 100644 --- a/clients/spot/docs/OrderListCancelRequest.md +++ b/clients/spot/docs/OrderListCancelRequest.md @@ -11,7 +11,7 @@ |**orderListId** | **Integer** | | [optional] | |**listClientOrderId** | **String** | | [optional] | |**newClientOrderId** | **String** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderListCancelResponse.md b/clients/spot/docs/OrderListCancelResponse.md index aa58e5146..5a123bd1e 100644 --- a/clients/spot/docs/OrderListCancelResponse.md +++ b/clients/spot/docs/OrderListCancelResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListCancelResponseResult**](OrderListCancelResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderListOcoRequest.md b/clients/spot/docs/OrderListOcoRequest.md index 426fd2b94..08a32c460 100644 --- a/clients/spot/docs/OrderListOcoRequest.md +++ b/clients/spot/docs/OrderListOcoRequest.md @@ -17,7 +17,7 @@ |**abovePrice** | **Double** | | [optional] | |**aboveStopPrice** | **Double** | | [optional] | |**aboveTrailingDelta** | **Long** | | [optional] | -|**aboveTimeInForce** | **Double** | | [optional] | +|**aboveTimeInForce** | **AboveTimeInForce** | | [optional] | |**aboveStrategyId** | **Long** | | [optional] | |**aboveStrategyType** | **Integer** | | [optional] | |**abovePegPriceType** | **AbovePegPriceType** | | [optional] | @@ -37,7 +37,7 @@ |**belowPegOffsetValue** | **Integer** | | [optional] | |**newOrderRespType** | **NewOrderRespType** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderListOtoRequest.md b/clients/spot/docs/OrderListOtoRequest.md index e4210e30d..718bb2aef 100644 --- a/clients/spot/docs/OrderListOtoRequest.md +++ b/clients/spot/docs/OrderListOtoRequest.md @@ -37,7 +37,7 @@ |**pendingPegPriceType** | **PendingPegPriceType** | | [optional] | |**pendingPegOffsetType** | **PendingPegOffsetType** | | [optional] | |**pendingPegOffsetValue** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderListOtocoRequest.md b/clients/spot/docs/OrderListOtocoRequest.md index e37028fbc..3fbc5b9ac 100644 --- a/clients/spot/docs/OrderListOtocoRequest.md +++ b/clients/spot/docs/OrderListOtocoRequest.md @@ -49,7 +49,7 @@ |**pendingBelowPegPriceType** | **PendingBelowPegPriceType** | | [optional] | |**pendingBelowPegOffsetType** | **PendingBelowPegOffsetType** | | [optional] | |**pendingBelowPegOffsetValue** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOcoRequest.md b/clients/spot/docs/OrderListPlaceOcoRequest.md index e7513692b..c5eb42693 100644 --- a/clients/spot/docs/OrderListPlaceOcoRequest.md +++ b/clients/spot/docs/OrderListPlaceOcoRequest.md @@ -17,7 +17,7 @@ |**abovePrice** | **Double** | | [optional] | |**aboveStopPrice** | **Double** | | [optional] | |**aboveTrailingDelta** | **Long** | | [optional] | -|**aboveTimeInForce** | **Double** | | [optional] | +|**aboveTimeInForce** | **AboveTimeInForce** | | [optional] | |**aboveStrategyId** | **Long** | | [optional] | |**aboveStrategyType** | **Integer** | | [optional] | |**abovePegPriceType** | **AbovePegPriceType** | | [optional] | @@ -37,7 +37,7 @@ |**belowPegOffsetValue** | **Integer** | | [optional] | |**newOrderRespType** | **NewOrderRespType** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOcoResponse.md b/clients/spot/docs/OrderListPlaceOcoResponse.md index 5e96c2a91..a071620a2 100644 --- a/clients/spot/docs/OrderListPlaceOcoResponse.md +++ b/clients/spot/docs/OrderListPlaceOcoResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListPlaceOcoResponseResult**](OrderListPlaceOcoResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOtoRequest.md b/clients/spot/docs/OrderListPlaceOtoRequest.md index 55a5b4b75..ade0c932c 100644 --- a/clients/spot/docs/OrderListPlaceOtoRequest.md +++ b/clients/spot/docs/OrderListPlaceOtoRequest.md @@ -37,7 +37,7 @@ |**pendingPegOffsetType** | **PendingPegOffsetType** | | [optional] | |**pendingPegPriceType** | **PendingPegPriceType** | | [optional] | |**pendingPegOffsetValue** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOtoResponse.md b/clients/spot/docs/OrderListPlaceOtoResponse.md index 7cf0899dc..61b0ff80a 100644 --- a/clients/spot/docs/OrderListPlaceOtoResponse.md +++ b/clients/spot/docs/OrderListPlaceOtoResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListPlaceOtoResponseResult**](OrderListPlaceOtoResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOtocoRequest.md b/clients/spot/docs/OrderListPlaceOtocoRequest.md index e0c14dd10..47ee2a971 100644 --- a/clients/spot/docs/OrderListPlaceOtocoRequest.md +++ b/clients/spot/docs/OrderListPlaceOtocoRequest.md @@ -49,7 +49,7 @@ |**pendingBelowPegPriceType** | **PendingBelowPegPriceType** | | [optional] | |**pendingBelowPegOffsetType** | **PendingBelowPegOffsetType** | | [optional] | |**pendingBelowPegOffsetValue** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOtocoResponse.md b/clients/spot/docs/OrderListPlaceOtocoResponse.md index 7383c3d61..b8e1fe7b7 100644 --- a/clients/spot/docs/OrderListPlaceOtocoResponse.md +++ b/clients/spot/docs/OrderListPlaceOtocoResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListPlaceOtocoResponseResult**](OrderListPlaceOtocoResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceRequest.md b/clients/spot/docs/OrderListPlaceRequest.md index 0234be01f..79d57f7f1 100644 --- a/clients/spot/docs/OrderListPlaceRequest.md +++ b/clients/spot/docs/OrderListPlaceRequest.md @@ -26,7 +26,7 @@ |**stopStrategyType** | **Integer** | | [optional] | |**newOrderRespType** | **NewOrderRespType** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceResponse.md b/clients/spot/docs/OrderListPlaceResponse.md index f8bc48585..9cf35942a 100644 --- a/clients/spot/docs/OrderListPlaceResponse.md +++ b/clients/spot/docs/OrderListPlaceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListPlaceResponseResult**](OrderListPlaceResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderListStatusRequest.md b/clients/spot/docs/OrderListStatusRequest.md index 68955131a..1f161e0c3 100644 --- a/clients/spot/docs/OrderListStatusRequest.md +++ b/clients/spot/docs/OrderListStatusRequest.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**origClientOrderId** | **String** | | [optional] | |**orderListId** | **Integer** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderListStatusResponse.md b/clients/spot/docs/OrderListStatusResponse.md index a2ed2f61f..978c34bb2 100644 --- a/clients/spot/docs/OrderListStatusResponse.md +++ b/clients/spot/docs/OrderListStatusResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**AllOrderListsResponseResultInner**](AllOrderListsResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderOcoRequest.md b/clients/spot/docs/OrderOcoRequest.md index b1c7c12da..edd8a68eb 100644 --- a/clients/spot/docs/OrderOcoRequest.md +++ b/clients/spot/docs/OrderOcoRequest.md @@ -26,7 +26,7 @@ |**stopLimitTimeInForce** | **StopLimitTimeInForce** | | [optional] | |**newOrderRespType** | **NewOrderRespType** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderPlaceRequest.md b/clients/spot/docs/OrderPlaceRequest.md index e7b73572f..7ee8090f8 100644 --- a/clients/spot/docs/OrderPlaceRequest.md +++ b/clients/spot/docs/OrderPlaceRequest.md @@ -25,7 +25,7 @@ |**pegPriceType** | **PegPriceType** | | [optional] | |**pegOffsetValue** | **Integer** | | [optional] | |**pegOffsetType** | **PegOffsetType** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderPlaceResponse.md b/clients/spot/docs/OrderPlaceResponse.md index 4316c73b0..9e036217b 100644 --- a/clients/spot/docs/OrderPlaceResponse.md +++ b/clients/spot/docs/OrderPlaceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderPlaceResponseResult**](OrderPlaceResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderStatusRequest.md b/clients/spot/docs/OrderStatusRequest.md index 1a5cdabe5..8bc9f6c3d 100644 --- a/clients/spot/docs/OrderStatusRequest.md +++ b/clients/spot/docs/OrderStatusRequest.md @@ -10,7 +10,7 @@ |**symbol** | **String** | | | |**orderId** | **Long** | | [optional] | |**origClientOrderId** | **String** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderStatusResponse.md b/clients/spot/docs/OrderStatusResponse.md index 8319afb27..d6e82c7a8 100644 --- a/clients/spot/docs/OrderStatusResponse.md +++ b/clients/spot/docs/OrderStatusResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderStatusResponseResult**](OrderStatusResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/OrderTestRequest.md b/clients/spot/docs/OrderTestRequest.md index b49a96784..e1dd96efe 100644 --- a/clients/spot/docs/OrderTestRequest.md +++ b/clients/spot/docs/OrderTestRequest.md @@ -26,7 +26,7 @@ |**pegPriceType** | **PegPriceType** | | [optional] | |**pegOffsetValue** | **Integer** | | [optional] | |**pegOffsetType** | **PegOffsetType** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/OrderTestResponse.md b/clients/spot/docs/OrderTestResponse.md index db6266558..594dd2501 100644 --- a/clients/spot/docs/OrderTestResponse.md +++ b/clients/spot/docs/OrderTestResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderTestResponseResult**](OrderTestResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/PercentPriceBySideFilter.md b/clients/spot/docs/PercentPriceBySideFilter.md new file mode 100644 index 000000000..94a958a8c --- /dev/null +++ b/clients/spot/docs/PercentPriceBySideFilter.md @@ -0,0 +1,19 @@ + + +# PercentPriceBySideFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**multiplierExponent** | **Integer** | | [optional] | +|**bidMultiplierUp** | **String** | | [optional] | +|**bidMultiplierDown** | **String** | | [optional] | +|**askMultiplierUp** | **String** | | [optional] | +|**askMultiplierDown** | **String** | | [optional] | +|**avgPriceMins** | **Integer** | | [optional] | + + + diff --git a/clients/spot/docs/PercentPriceFilter.md b/clients/spot/docs/PercentPriceFilter.md new file mode 100644 index 000000000..24727cc2f --- /dev/null +++ b/clients/spot/docs/PercentPriceFilter.md @@ -0,0 +1,17 @@ + + +# PercentPriceFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**multiplierExponent** | **Integer** | | [optional] | +|**multiplierUp** | **String** | | [optional] | +|**multiplierDown** | **String** | | [optional] | +|**avgPriceMins** | **Integer** | | [optional] | + + + diff --git a/clients/spot/docs/PingResponse.md b/clients/spot/docs/PingResponse.md index 89193111a..9ee7217eb 100644 --- a/clients/spot/docs/PingResponse.md +++ b/clients/spot/docs/PingResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | **Object** | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/PriceFilter.md b/clients/spot/docs/PriceFilter.md new file mode 100644 index 000000000..1cd62139a --- /dev/null +++ b/clients/spot/docs/PriceFilter.md @@ -0,0 +1,17 @@ + + +# PriceFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**priceExponent** | **Integer** | | [optional] | +|**minPrice** | **String** | | [optional] | +|**maxPrice** | **String** | | [optional] | +|**tickSize** | **String** | | [optional] | + + + diff --git a/clients/spot/docs/RateLimits.md b/clients/spot/docs/RateLimits.md index 41497398d..7fd5b4dcd 100644 --- a/clients/spot/docs/RateLimits.md +++ b/clients/spot/docs/RateLimits.md @@ -7,6 +7,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**rateLimitType** | **String** | | [optional] | +|**interval** | **String** | | [optional] | +|**intervalNum** | **Long** | | [optional] | +|**limit** | **Long** | | [optional] | +|**count** | **Long** | | [optional] | diff --git a/clients/spot/docs/RateLimitsInner.md b/clients/spot/docs/RateLimitsInner.md deleted file mode 100644 index 3c6492ee3..000000000 --- a/clients/spot/docs/RateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# RateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/SessionLogonRequest.md b/clients/spot/docs/SessionLogonRequest.md index 66d5305a1..78a2da46f 100644 --- a/clients/spot/docs/SessionLogonRequest.md +++ b/clients/spot/docs/SessionLogonRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/SorOrderPlaceRequest.md b/clients/spot/docs/SorOrderPlaceRequest.md index 13875bcae..d2b7e945c 100644 --- a/clients/spot/docs/SorOrderPlaceRequest.md +++ b/clients/spot/docs/SorOrderPlaceRequest.md @@ -19,7 +19,7 @@ |**strategyId** | **Long** | | [optional] | |**strategyType** | **Integer** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/SorOrderPlaceResponse.md b/clients/spot/docs/SorOrderPlaceResponse.md index 22c44ee91..48e3ab896 100644 --- a/clients/spot/docs/SorOrderPlaceResponse.md +++ b/clients/spot/docs/SorOrderPlaceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<SorOrderPlaceResponseResultInner>**](SorOrderPlaceResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/SorOrderRequest.md b/clients/spot/docs/SorOrderRequest.md index 326c58613..8982f2804 100644 --- a/clients/spot/docs/SorOrderRequest.md +++ b/clients/spot/docs/SorOrderRequest.md @@ -19,7 +19,7 @@ |**icebergQty** | **Double** | | [optional] | |**newOrderRespType** | **NewOrderRespType** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/SorOrderTestRequest.md b/clients/spot/docs/SorOrderTestRequest.md index 0e2044445..79f36a6f8 100644 --- a/clients/spot/docs/SorOrderTestRequest.md +++ b/clients/spot/docs/SorOrderTestRequest.md @@ -20,7 +20,7 @@ |**strategyId** | **Long** | | [optional] | |**strategyType** | **Integer** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/SorOrderTestResponse.md b/clients/spot/docs/SorOrderTestResponse.md index c035941e5..423d129a6 100644 --- a/clients/spot/docs/SorOrderTestResponse.md +++ b/clients/spot/docs/SorOrderTestResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**SorOrderTestResponseResult**](SorOrderTestResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/StopLimitTimeInForce.md b/clients/spot/docs/StopLimitTimeInForce.md index eaf4e318f..0e398718d 100644 --- a/clients/spot/docs/StopLimitTimeInForce.md +++ b/clients/spot/docs/StopLimitTimeInForce.md @@ -7,9 +7,9 @@ * `GTC` (value: `"GTC"`) -* `FOK` (value: `"FOK"`) - * `IOC` (value: `"IOC"`) +* `FOK` (value: `"FOK"`) + diff --git a/clients/spot/docs/ExchangeFiltersInner.md b/clients/spot/docs/SymbolFilters.md similarity index 85% rename from clients/spot/docs/ExchangeFiltersInner.md rename to clients/spot/docs/SymbolFilters.md index 622b782ee..d1dda65cd 100644 --- a/clients/spot/docs/ExchangeFiltersInner.md +++ b/clients/spot/docs/SymbolFilters.md @@ -1,6 +1,6 @@ -# ExchangeFiltersInner +# SymbolFilters ## Properties @@ -8,16 +8,19 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**filterType** | **String** | | [optional] | +|**priceExponent** | **Integer** | | [optional] | |**minPrice** | **String** | | [optional] | |**maxPrice** | **String** | | [optional] | |**tickSize** | **String** | | [optional] | +|**multiplierExponent** | **Integer** | | [optional] | |**multiplierUp** | **String** | | [optional] | |**multiplierDown** | **String** | | [optional] | -|**avgPriceMins** | **Long** | | [optional] | +|**avgPriceMins** | **Integer** | | [optional] | |**bidMultiplierUp** | **String** | | [optional] | |**bidMultiplierDown** | **String** | | [optional] | |**askMultiplierUp** | **String** | | [optional] | |**askMultiplierDown** | **String** | | [optional] | +|**qtyExponent** | **Integer** | | [optional] | |**minQty** | **String** | | [optional] | |**maxQty** | **String** | | [optional] | |**stepSize** | **String** | | [optional] | @@ -35,8 +38,9 @@ |**maxTrailingAboveDelta** | **Long** | | [optional] | |**minTrailingBelowDelta** | **Long** | | [optional] | |**maxTrailingBelowDelta** | **Long** | | [optional] | -|**maxNumOrderAmends** | **Long** | | [optional] | +|**endTime** | **Long** | | [optional] | |**maxNumOrderLists** | **Long** | | [optional] | +|**maxNumOrderAmends** | **Long** | | [optional] | diff --git a/clients/auto-invest/docs/Details.md b/clients/spot/docs/TPlusSellFilter.md similarity index 53% rename from clients/auto-invest/docs/Details.md rename to clients/spot/docs/TPlusSellFilter.md index 0e79a6a1b..0cde2ffbe 100644 --- a/clients/auto-invest/docs/Details.md +++ b/clients/spot/docs/TPlusSellFilter.md @@ -1,12 +1,14 @@ -# Details +# TPlusSellFilter ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**endTime** | **Long** | | [optional] | diff --git a/clients/spot/docs/Ticker24hrResponse.md b/clients/spot/docs/Ticker24hrResponse.md index 411ce2bbd..bbaa47a2a 100644 --- a/clients/spot/docs/Ticker24hrResponse.md +++ b/clients/spot/docs/Ticker24hrResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<Ticker24hrResponse2ResultInner>**](Ticker24hrResponse2ResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/Ticker24hrResponse1.md b/clients/spot/docs/Ticker24hrResponse1.md index 6fcd5e6be..2a12d16f6 100644 --- a/clients/spot/docs/Ticker24hrResponse1.md +++ b/clients/spot/docs/Ticker24hrResponse1.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**Ticker24hrResponse1Result**](Ticker24hrResponse1Result.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/Ticker24hrResponse2.md b/clients/spot/docs/Ticker24hrResponse2.md index b179eed22..97fae071b 100644 --- a/clients/spot/docs/Ticker24hrResponse2.md +++ b/clients/spot/docs/Ticker24hrResponse2.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<Ticker24hrResponse2ResultInner>**](Ticker24hrResponse2ResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TickerBookResponse.md b/clients/spot/docs/TickerBookResponse.md index 3701a9872..40f9dc823 100644 --- a/clients/spot/docs/TickerBookResponse.md +++ b/clients/spot/docs/TickerBookResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerBookResponse1Result>**](TickerBookResponse1Result.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TickerBookResponse1.md b/clients/spot/docs/TickerBookResponse1.md index 5c79f0501..5c8c4d616 100644 --- a/clients/spot/docs/TickerBookResponse1.md +++ b/clients/spot/docs/TickerBookResponse1.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**TickerBookResponse1Result**](TickerBookResponse1Result.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TickerBookResponse2.md b/clients/spot/docs/TickerBookResponse2.md index d51b6a0fb..7ef7d1368 100644 --- a/clients/spot/docs/TickerBookResponse2.md +++ b/clients/spot/docs/TickerBookResponse2.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerBookResponse1Result>**](TickerBookResponse1Result.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TickerPriceResponse.md b/clients/spot/docs/TickerPriceResponse.md index 151a88e9d..d5869dcad 100644 --- a/clients/spot/docs/TickerPriceResponse.md +++ b/clients/spot/docs/TickerPriceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerPriceResponse2ResultInner>**](TickerPriceResponse2ResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TickerPriceResponse1.md b/clients/spot/docs/TickerPriceResponse1.md index 7e61ba120..f0e660ee2 100644 --- a/clients/spot/docs/TickerPriceResponse1.md +++ b/clients/spot/docs/TickerPriceResponse1.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**TickerPriceResponse1Result**](TickerPriceResponse1Result.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TickerPriceResponse2.md b/clients/spot/docs/TickerPriceResponse2.md index 4444aa97b..77017731b 100644 --- a/clients/spot/docs/TickerPriceResponse2.md +++ b/clients/spot/docs/TickerPriceResponse2.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerPriceResponse2ResultInner>**](TickerPriceResponse2ResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TickerResponse1.md b/clients/spot/docs/TickerResponse1.md index 2866bb4b7..df9f5e1f3 100644 --- a/clients/spot/docs/TickerResponse1.md +++ b/clients/spot/docs/TickerResponse1.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**TickerResponse1Result**](TickerResponse1Result.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TickerResponse2.md b/clients/spot/docs/TickerResponse2.md index 370cd800e..db8ba5f27 100644 --- a/clients/spot/docs/TickerResponse2.md +++ b/clients/spot/docs/TickerResponse2.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerResponse2ResultInner>**](TickerResponse2ResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TickerTradingDayResponse.md b/clients/spot/docs/TickerTradingDayResponse.md index dcb45d15e..d3f9fc2ba 100644 --- a/clients/spot/docs/TickerTradingDayResponse.md +++ b/clients/spot/docs/TickerTradingDayResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerTradingDayResponseResultInner>**](TickerTradingDayResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TimeResponse.md b/clients/spot/docs/TimeResponse.md index 406dc391d..f11e30b6d 100644 --- a/clients/spot/docs/TimeResponse.md +++ b/clients/spot/docs/TimeResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**TimeResponseResult**](TimeResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TradesAggregateResponse.md b/clients/spot/docs/TradesAggregateResponse.md index 485fbe70c..f2b8670b0 100644 --- a/clients/spot/docs/TradesAggregateResponse.md +++ b/clients/spot/docs/TradesAggregateResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TradesAggregateResponseResultInner>**](TradesAggregateResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TradesHistoricalResponse.md b/clients/spot/docs/TradesHistoricalResponse.md index 40d03c720..6f7932129 100644 --- a/clients/spot/docs/TradesHistoricalResponse.md +++ b/clients/spot/docs/TradesHistoricalResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TradesHistoricalResponseResultInner>**](TradesHistoricalResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TradesRecentResponse.md b/clients/spot/docs/TradesRecentResponse.md index 28158ddc1..642baf618 100644 --- a/clients/spot/docs/TradesRecentResponse.md +++ b/clients/spot/docs/TradesRecentResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TradesRecentResponseResultInner>**](TradesRecentResponseResultInner.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/TrailingDeltaFilter.md b/clients/spot/docs/TrailingDeltaFilter.md new file mode 100644 index 000000000..59f1649e9 --- /dev/null +++ b/clients/spot/docs/TrailingDeltaFilter.md @@ -0,0 +1,17 @@ + + +# TrailingDeltaFilter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filterType** | **String** | | [optional] | +|**minTrailingAboveDelta** | **Long** | | [optional] | +|**maxTrailingAboveDelta** | **Long** | | [optional] | +|**minTrailingBelowDelta** | **Long** | | [optional] | +|**maxTrailingBelowDelta** | **Long** | | [optional] | + + + diff --git a/clients/spot/docs/UiKlinesResponse.md b/clients/spot/docs/UiKlinesResponse.md index 51c53c0d5..ab01c119a 100644 --- a/clients/spot/docs/UiKlinesResponse.md +++ b/clients/spot/docs/UiKlinesResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | **List<UiKlinesItem>** | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/UserDataStreamApi.md b/clients/spot/docs/UserDataStreamApi.md index 304ecce29..786d108d4 100644 --- a/clients/spot/docs/UserDataStreamApi.md +++ b/clients/spot/docs/UserDataStreamApi.md @@ -77,7 +77,7 @@ No authorization required WebSocket Ping user data stream -Ping a user data stream to keep it alive. User data streams close automatically after 60 minutes, even if you're listening to them on WebSocket Streams. In order to keep the stream open, you have to regularly send pings using the `userDataStream.ping` request. It is recommended to send a ping once every 30 minutes. Weight: 2 +Ping a user data stream to keep it alive. User data streams close automatically after 60 minutes, even if you're listening to them on WebSocket Streams. In order to keep the stream open, you have to regularly send pings using the `userDataStream.ping` request. It is recommended to send a ping once every 30 minutes. This request does not require `signature`. Weight: 2 ### Example ```java @@ -139,7 +139,7 @@ No authorization required WebSocket Start user data stream -Start a new user data stream. Weight: 2 +Start a new user data stream. Note the stream will close in 60 minutes unless `userDataStream.ping` requests are sent regularly. This request does not require `signature`. Weight: 2 ### Example ```java @@ -197,7 +197,7 @@ No authorization required WebSocket Stop user data stream -Explicitly stop and close the user data stream. Weight: 2 +Explicitly stop and close the user data stream. This request does not require `signature`. Weight: 2 ### Example ```java diff --git a/clients/spot/docs/UserDataStreamPingResponse.md b/clients/spot/docs/UserDataStreamPingResponse.md index a2f9e8a1d..a734f04f4 100644 --- a/clients/spot/docs/UserDataStreamPingResponse.md +++ b/clients/spot/docs/UserDataStreamPingResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**response** | **Object** | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/UserDataStreamStartResponse.md b/clients/spot/docs/UserDataStreamStartResponse.md index af480623d..9c7fbc364 100644 --- a/clients/spot/docs/UserDataStreamStartResponse.md +++ b/clients/spot/docs/UserDataStreamStartResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**UserDataStreamStartResponseResult**](UserDataStreamStartResponseResult.md) | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/UserDataStreamStopResponse.md b/clients/spot/docs/UserDataStreamStopResponse.md index a0f8115ef..bc7e734cf 100644 --- a/clients/spot/docs/UserDataStreamStopResponse.md +++ b/clients/spot/docs/UserDataStreamStopResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**response** | **Object** | | [optional] | -|**rateLimits** | **RateLimits** | | [optional] | +|**rateLimits** | [**List<RateLimits>**](RateLimits.md) | | [optional] | diff --git a/clients/spot/docs/rest-api/migration-guide.md b/clients/spot/docs/rest-api/migration-guide.md index fa8d7d4ca..f56ebe6ad 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 - 6.0.0 + 7.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-spot - 6.0.0 + 7.0.0 ``` diff --git a/clients/spot/example_rest.md b/clients/spot/example_rest.md index 70054a63c..4cabc9e1d 100644 --- a/clients/spot/example_rest.md +++ b/clients/spot/example_rest.md @@ -16,6 +16,8 @@ [GET /api/v3/myAllocations](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-allocations-user_data) - myAllocations - [MyAllocationsExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyAllocationsExample.java#L46) +[GET /api/v3/myFilters](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-relevant-filters-user_data) - myFilters - [MyFiltersExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyFiltersExample.java#L48) + [GET /api/v3/myPreventedMatches](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-prevented-matches-user_data) - myPreventedMatches - [MyPreventedMatchesExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyPreventedMatchesExample.java#L52) [GET /api/v3/myTrades](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-trade-list-user_data) - myTrades - [MyTradesExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyTradesExample.java#L47) @@ -94,5 +96,5 @@ [POST /api/v3/userDataStream](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/user-data-stream-endpoints---deprecated#start-user-data-stream-user_stream) - newUserDataStream - [NewUserDataStreamExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/NewUserDataStreamExample.java#L47) -[PUT /api/v3/userDataStream](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/user-data-stream-endpoints---deprecated#keepalive-user-data-stream-user_stream) - putUserDataStream - [PutUserDataStreamExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java#L46) +[PUT /api/v3/userDataStream](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/user-data-stream-endpoints---deprecated#keepalive-user-data-stream-user_stream) - putUserDataStream - [PutUserDataStreamExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java#L47) diff --git a/clients/spot/example_websocket_api.md b/clients/spot/example_websocket_api.md index 4beffa3d2..e35984562 100644 --- a/clients/spot/example_websocket_api.md +++ b/clients/spot/example_websocket_api.md @@ -12,6 +12,8 @@ [myAllocations](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-allocations-user_data) - myAllocations - [MyAllocationsExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyAllocationsExample.java#L48) +[myFilters](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-relevant-filters-user_data) - myFilters - [MyFiltersExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyFiltersExample.java#L50) + [myPreventedMatches](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-prevented-matches-user_data) - myPreventedMatches - [MyPreventedMatchesExample.java:54](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyPreventedMatchesExample.java#L54) [myTrades](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data) - myTrades - [MyTradesExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyTradesExample.java#L49) @@ -100,11 +102,11 @@ [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.ping](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#ping-user-data-stream-user_stream) - userDataStreamPing - [UserDataStreamPingExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java#L52) -[userDataStream.start](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#start-user-data-stream-user_stream) - userDataStreamStart - [UserDataStreamStartExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java#L47) +[userDataStream.start](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#start-user-data-stream-user_stream) - userDataStreamStart - [UserDataStreamStartExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java#L49) -[userDataStream.stop](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#stop-user-data-stream-user_stream) - userDataStreamStop - [UserDataStreamStopExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java#L48) +[userDataStream.stop](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#stop-user-data-stream-user_stream) - userDataStreamStop - [UserDataStreamStopExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java#L49) [userDataStream.subscribe](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-Data-Stream-requests#subscribe-to-user-data-stream-user_stream) - userDataStreamSubscribe - [UserDataStreamSubscribeExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeExample.java#L49) diff --git a/clients/spot/pom.xml b/clients/spot/pom.xml index af7156f05..06a4dc683 100644 --- a/clients/spot/pom.xml +++ b/clients/spot/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-spot spot - 6.0.0 + 7.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.1.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 12e92881e..3d0b0e62d 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 @@ -26,6 +26,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -37,6 +38,7 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.HashMap; import java.util.Map; import okio.ByteString; @@ -58,7 +60,242 @@ public class JSON { @SuppressWarnings("unchecked") public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client.spot.rest.model.AssetFilters.class, + new TypeSelector< + com.binance.connector.client.spot.rest.model + .AssetFilters>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot.rest + .model.AssetFilters> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "MAX_ASSET", + com.binance.connector.client.spot.rest.model + .MaxAssetFilter.class); + classByDiscriminatorValue.put( + "MaxAssetFilter", + com.binance.connector.client.spot.rest.model + .MaxAssetFilter.class); + classByDiscriminatorValue.put( + "assetFilters", + com.binance.connector.client.spot.rest.model + .AssetFilters.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "filterType")); + } + }) + .registerTypeSelector( + com.binance.connector.client.spot.rest.model.ExchangeFilters.class, + new TypeSelector< + com.binance.connector.client.spot.rest.model + .ExchangeFilters>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot.rest + .model.ExchangeFilters> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ALGO_ORDERS", + com.binance.connector.client.spot.rest.model + .ExchangeMaxNumAlgoOrdersFilter.class); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ICEBERG_ORDERS", + com.binance.connector.client.spot.rest.model + .ExchangeMaxNumIcebergOrdersFilter.class); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ORDERS", + com.binance.connector.client.spot.rest.model + .ExchangeMaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ORDER_LISTS", + com.binance.connector.client.spot.rest.model + .ExchangeMaxNumOrderListsFilter.class); + classByDiscriminatorValue.put( + "ExchangeMaxNumAlgoOrdersFilter", + com.binance.connector.client.spot.rest.model + .ExchangeMaxNumAlgoOrdersFilter.class); + classByDiscriminatorValue.put( + "ExchangeMaxNumIcebergOrdersFilter", + com.binance.connector.client.spot.rest.model + .ExchangeMaxNumIcebergOrdersFilter.class); + classByDiscriminatorValue.put( + "ExchangeMaxNumOrderListsFilter", + com.binance.connector.client.spot.rest.model + .ExchangeMaxNumOrderListsFilter.class); + classByDiscriminatorValue.put( + "ExchangeMaxNumOrdersFilter", + com.binance.connector.client.spot.rest.model + .ExchangeMaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "exchangeFilters", + com.binance.connector.client.spot.rest.model + .ExchangeFilters.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "filterType")); + } + }) + .registerTypeSelector( + com.binance.connector.client.spot.rest.model.SymbolFilters.class, + new TypeSelector< + com.binance.connector.client.spot.rest.model + .SymbolFilters>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot.rest + .model.SymbolFilters> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "ICEBERG_PARTS", + com.binance.connector.client.spot.rest.model + .IcebergPartsFilter.class); + classByDiscriminatorValue.put( + "LOT_SIZE", + com.binance.connector.client.spot.rest.model + .LotSizeFilter.class); + classByDiscriminatorValue.put( + "MARKET_LOT_SIZE", + com.binance.connector.client.spot.rest.model + .MarketLotSizeFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ALGO_ORDERS", + com.binance.connector.client.spot.rest.model + .MaxNumAlgoOrdersFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ICEBERG_ORDERS", + com.binance.connector.client.spot.rest.model + .MaxNumIcebergOrdersFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ORDERS", + com.binance.connector.client.spot.rest.model + .MaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ORDER_AMENDS", + com.binance.connector.client.spot.rest.model + .MaxNumOrderAmendsFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ORDER_LISTS", + com.binance.connector.client.spot.rest.model + .MaxNumOrderListsFilter.class); + classByDiscriminatorValue.put( + "MAX_POSITION", + com.binance.connector.client.spot.rest.model + .MaxPositionFilter.class); + classByDiscriminatorValue.put( + "MIN_NOTIONAL", + com.binance.connector.client.spot.rest.model + .MinNotionalFilter.class); + classByDiscriminatorValue.put( + "NOTIONAL", + com.binance.connector.client.spot.rest.model + .NotionalFilter.class); + classByDiscriminatorValue.put( + "PERCENT_PRICE", + com.binance.connector.client.spot.rest.model + .PercentPriceFilter.class); + classByDiscriminatorValue.put( + "PERCENT_PRICE_BY_SIDE", + com.binance.connector.client.spot.rest.model + .PercentPriceBySideFilter.class); + classByDiscriminatorValue.put( + "PRICE_FILTER", + com.binance.connector.client.spot.rest.model + .PriceFilter.class); + classByDiscriminatorValue.put( + "TRAILING_DELTA", + com.binance.connector.client.spot.rest.model + .TrailingDeltaFilter.class); + classByDiscriminatorValue.put( + "T_PLUS_SELL", + com.binance.connector.client.spot.rest.model + .TPlusSellFilter.class); + classByDiscriminatorValue.put( + "IcebergPartsFilter", + com.binance.connector.client.spot.rest.model + .IcebergPartsFilter.class); + classByDiscriminatorValue.put( + "LotSizeFilter", + com.binance.connector.client.spot.rest.model + .LotSizeFilter.class); + classByDiscriminatorValue.put( + "MarketLotSizeFilter", + com.binance.connector.client.spot.rest.model + .MarketLotSizeFilter.class); + classByDiscriminatorValue.put( + "MaxNumAlgoOrdersFilter", + com.binance.connector.client.spot.rest.model + .MaxNumAlgoOrdersFilter.class); + classByDiscriminatorValue.put( + "MaxNumIcebergOrdersFilter", + com.binance.connector.client.spot.rest.model + .MaxNumIcebergOrdersFilter.class); + classByDiscriminatorValue.put( + "MaxNumOrderAmendsFilter", + com.binance.connector.client.spot.rest.model + .MaxNumOrderAmendsFilter.class); + classByDiscriminatorValue.put( + "MaxNumOrderListsFilter", + com.binance.connector.client.spot.rest.model + .MaxNumOrderListsFilter.class); + classByDiscriminatorValue.put( + "MaxNumOrdersFilter", + com.binance.connector.client.spot.rest.model + .MaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "MaxPositionFilter", + com.binance.connector.client.spot.rest.model + .MaxPositionFilter.class); + classByDiscriminatorValue.put( + "MinNotionalFilter", + com.binance.connector.client.spot.rest.model + .MinNotionalFilter.class); + classByDiscriminatorValue.put( + "NotionalFilter", + com.binance.connector.client.spot.rest.model + .NotionalFilter.class); + classByDiscriminatorValue.put( + "PercentPriceBySideFilter", + com.binance.connector.client.spot.rest.model + .PercentPriceBySideFilter.class); + classByDiscriminatorValue.put( + "PercentPriceFilter", + com.binance.connector.client.spot.rest.model + .PercentPriceFilter.class); + classByDiscriminatorValue.put( + "PriceFilter", + com.binance.connector.client.spot.rest.model + .PriceFilter.class); + classByDiscriminatorValue.put( + "TPlusSellFilter", + com.binance.connector.client.spot.rest.model + .TPlusSellFilter.class); + classByDiscriminatorValue.put( + "TrailingDeltaFilter", + com.binance.connector.client.spot.rest.model + .TrailingDeltaFilter.class); + classByDiscriminatorValue.put( + "symbolFilters", + com.binance.connector.client.spot.rest.model + .SymbolFilters.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "filterType")); + } + }); GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; } @@ -144,6 +381,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.AllOrdersResponseInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.AssetFilters + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.AvgPriceResponse .CustomTypeAdapterFactory()); @@ -171,15 +411,24 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.ExchangeFilters .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.rest.model.ExchangeFiltersInner - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.ExchangeInfoResponse .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.ExchangeInfoResponseSymbolsInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.ExchangeMaxNumAlgoOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.ExchangeMaxNumIcebergOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.ExchangeMaxNumOrderListsFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.ExchangeMaxNumOrdersFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.GetAccountResponse .CustomTypeAdapterFactory()); @@ -210,6 +459,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.HistoricalTradesResponseInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.IcebergPartsFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.KlinesItem .CustomTypeAdapterFactory()); @@ -219,12 +471,45 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.KlinesResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.LotSizeFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MarketLotSizeFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MaxAssetFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MaxNumAlgoOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MaxNumIcebergOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MaxNumOrderAmendsFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MaxNumOrderListsFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MaxNumOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MaxPositionFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MinNotionalFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.MyAllocationsResponse .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.MyAllocationsResponseInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.MyFiltersResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.MyPreventedMatchesResponse .CustomTypeAdapterFactory()); @@ -249,6 +534,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.NewUserDataStreamResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.NotionalFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.OpenOrderListResponse .CustomTypeAdapterFactory()); @@ -364,9 +652,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model .OrderTestResponseStandardCommissionForOrder.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.PercentPriceBySideFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.PercentPriceFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.Permissions .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.PriceFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.PutUserDataStreamRequest .CustomTypeAdapterFactory()); @@ -379,9 +676,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.RateLimits .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.rest.model.RateLimitsInner - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.SorOrderRequest .CustomTypeAdapterFactory()); @@ -397,9 +691,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.SorOrderTestResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.SymbolFilters + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.Symbols .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.TPlusSellFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.Ticker24hrResponse .CustomTypeAdapterFactory()); @@ -463,6 +763,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.TimeResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.TrailingDeltaFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.UiKlinesItem .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 b4ec20afa..1b16788aa 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 @@ -15,6 +15,7 @@ import com.binance.connector.client.common.ApiClient; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.Pair; import com.binance.connector.client.common.SystemUtil; import com.binance.connector.client.common.configuration.ClientConfiguration; @@ -27,6 +28,7 @@ import com.binance.connector.client.spot.rest.model.GetOrderListResponse; import com.binance.connector.client.spot.rest.model.GetOrderResponse; import com.binance.connector.client.spot.rest.model.MyAllocationsResponse; +import com.binance.connector.client.spot.rest.model.MyFiltersResponse; import com.binance.connector.client.spot.rest.model.MyPreventedMatchesResponse; import com.binance.connector.client.spot.rest.model.MyTradesResponse; import com.binance.connector.client.spot.rest.model.OpenOrderListResponse; @@ -54,7 +56,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-spot/6.0.0 (Java/%s; %s; %s)", + "binance-spot/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; @@ -230,7 +232,9 @@ public ApiResponse accountCommission(@NotNull String * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -245,7 +249,7 @@ public ApiResponse accountCommission(@NotNull String * all Order lists Documentation */ private okhttp3.Call allOrderListCall( - Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) + Long fromId, Long startTime, Long endTime, Integer limit, Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -288,7 +292,9 @@ private okhttp3.Call allOrderListCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -323,7 +329,7 @@ private okhttp3.Call allOrderListCall( @SuppressWarnings("rawtypes") private okhttp3.Call allOrderListValidateBeforeCall( - Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) + Long fromId, Long startTime, Long endTime, Integer limit, Double recvWindow) throws ApiException { try { Validator validator = @@ -343,7 +349,7 @@ private okhttp3.Call allOrderListValidateBeforeCall( Long.class, Long.class, Integer.class, - Long.class); + Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -370,7 +376,9 @@ private okhttp3.Call allOrderListValidateBeforeCall( * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<AllOrderListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -386,7 +394,7 @@ private okhttp3.Call allOrderListValidateBeforeCall( * all Order lists Documentation */ public ApiResponse allOrderList( - Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) + Long fromId, Long startTime, Long endTime, Integer limit, Double recvWindow) throws ApiException { okhttp3.Call localVarCall = allOrderListValidateBeforeCall(fromId, startTime, endTime, limit, recvWindow); @@ -403,7 +411,9 @@ public ApiResponse allOrderList( * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -423,7 +433,7 @@ private okhttp3.Call allOrdersCall( Long startTime, Long endTime, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -470,7 +480,9 @@ private okhttp3.Call allOrdersCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -510,7 +522,7 @@ private okhttp3.Call allOrdersValidateBeforeCall( Long startTime, Long endTime, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { try { Validator validator = @@ -531,7 +543,7 @@ private okhttp3.Call allOrdersValidateBeforeCall( Long.class, Long.class, Integer.class, - Long.class); + Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -557,7 +569,9 @@ private okhttp3.Call allOrdersValidateBeforeCall( * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<AllOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -578,7 +592,7 @@ public ApiResponse allOrders( Long startTime, Long endTime, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { okhttp3.Call localVarCall = allOrdersValidateBeforeCall(symbol, orderId, startTime, endTime, limit, recvWindow); @@ -591,7 +605,9 @@ public ApiResponse allOrders( * * @param omitZeroBalances When set to `true`, emits only the non-zero balances of an * account. <br>Default value: `false` (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -605,7 +621,7 @@ public ApiResponse allOrders( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-information-user_data">Account * information Documentation */ - private okhttp3.Call getAccountCall(Boolean omitZeroBalances, Long recvWindow) + private okhttp3.Call getAccountCall(Boolean omitZeroBalances, Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -637,7 +653,9 @@ private okhttp3.Call getAccountCall(Boolean omitZeroBalances, Long recvWindow) } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -671,7 +689,7 @@ private okhttp3.Call getAccountCall(Boolean omitZeroBalances, Long recvWindow) } @SuppressWarnings("rawtypes") - private okhttp3.Call getAccountValidateBeforeCall(Boolean omitZeroBalances, Long recvWindow) + private okhttp3.Call getAccountValidateBeforeCall(Boolean omitZeroBalances, Double recvWindow) throws ApiException { try { Validator validator = @@ -683,7 +701,7 @@ private okhttp3.Call getAccountValidateBeforeCall(Boolean omitZeroBalances, Long ExecutableValidator executableValidator = validator.forExecutables(); Object[] parameterValues = {omitZeroBalances, recvWindow}; - Method method = this.getClass().getMethod("getAccount", Boolean.class, Long.class); + Method method = this.getClass().getMethod("getAccount", Boolean.class, Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -706,7 +724,9 @@ private okhttp3.Call getAccountValidateBeforeCall(Boolean omitZeroBalances, Long * * @param omitZeroBalances When set to `true`, emits only the non-zero balances of an * account. <br>Default value: `false` (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<GetAccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -721,7 +741,7 @@ private okhttp3.Call getAccountValidateBeforeCall(Boolean omitZeroBalances, Long * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-information-user_data">Account * information Documentation */ - public ApiResponse getAccount(Boolean omitZeroBalances, Long recvWindow) + public ApiResponse getAccount(Boolean omitZeroBalances, Double recvWindow) throws ApiException { okhttp3.Call localVarCall = getAccountValidateBeforeCall(omitZeroBalances, recvWindow); java.lang.reflect.Type localVarReturnType = @@ -733,7 +753,9 @@ public ApiResponse getAccount(Boolean omitZeroBalances, Long * Build call for getOpenOrders * * @param symbol Symbol to query (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -747,7 +769,7 @@ public ApiResponse getAccount(Boolean omitZeroBalances, Long * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#current-open-orders-user_data">Current * open orders Documentation */ - private okhttp3.Call getOpenOrdersCall(String symbol, Long recvWindow) throws ApiException { + private okhttp3.Call getOpenOrdersCall(String symbol, Double recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -777,7 +799,9 @@ private okhttp3.Call getOpenOrdersCall(String symbol, Long recvWindow) throws Ap } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -811,7 +835,7 @@ private okhttp3.Call getOpenOrdersCall(String symbol, Long recvWindow) throws Ap } @SuppressWarnings("rawtypes") - private okhttp3.Call getOpenOrdersValidateBeforeCall(String symbol, Long recvWindow) + private okhttp3.Call getOpenOrdersValidateBeforeCall(String symbol, Double recvWindow) throws ApiException { try { Validator validator = @@ -823,7 +847,7 @@ private okhttp3.Call getOpenOrdersValidateBeforeCall(String symbol, Long recvWin ExecutableValidator executableValidator = validator.forExecutables(); Object[] parameterValues = {symbol, recvWindow}; - Method method = this.getClass().getMethod("getOpenOrders", String.class, Long.class); + Method method = this.getClass().getMethod("getOpenOrders", String.class, Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -846,7 +870,9 @@ private okhttp3.Call getOpenOrdersValidateBeforeCall(String symbol, Long recvWin * symbol. Weight: 6 for a single symbol; **80** when the symbol parameter is omitted * * @param symbol Symbol to query (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<GetOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -861,7 +887,7 @@ private okhttp3.Call getOpenOrdersValidateBeforeCall(String symbol, Long recvWin * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#current-open-orders-user_data">Current * open orders Documentation */ - public ApiResponse getOpenOrders(String symbol, Long recvWindow) + public ApiResponse getOpenOrders(String symbol, Double recvWindow) throws ApiException { okhttp3.Call localVarCall = getOpenOrdersValidateBeforeCall(symbol, recvWindow); java.lang.reflect.Type localVarReturnType = @@ -875,7 +901,9 @@ public ApiResponse getOpenOrders(String symbol, Long recv * @param symbol (required) * @param orderId (optional) * @param origClientOrderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -890,7 +918,7 @@ public ApiResponse getOpenOrders(String symbol, Long recv * order Documentation */ private okhttp3.Call getOrderCall( - String symbol, Long orderId, String origClientOrderId, Long recvWindow) + String symbol, Long orderId, String origClientOrderId, Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -930,7 +958,9 @@ private okhttp3.Call getOrderCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -965,7 +995,7 @@ private okhttp3.Call getOrderCall( @SuppressWarnings("rawtypes") private okhttp3.Call getOrderValidateBeforeCall( - String symbol, Long orderId, String origClientOrderId, Long recvWindow) + String symbol, Long orderId, String origClientOrderId, Double recvWindow) throws ApiException { try { Validator validator = @@ -980,7 +1010,11 @@ private okhttp3.Call getOrderValidateBeforeCall( Method method = this.getClass() .getMethod( - "getOrder", String.class, Long.class, String.class, Long.class); + "getOrder", + String.class, + Long.class, + String.class, + Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -1004,7 +1038,9 @@ private okhttp3.Call getOrderValidateBeforeCall( * @param symbol (required) * @param orderId (optional) * @param origClientOrderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<GetOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1020,7 +1056,7 @@ private okhttp3.Call getOrderValidateBeforeCall( * order Documentation */ public ApiResponse getOrder( - @NotNull String symbol, Long orderId, String origClientOrderId, Long recvWindow) + @NotNull String symbol, Long orderId, String origClientOrderId, Double recvWindow) throws ApiException { okhttp3.Call localVarCall = getOrderValidateBeforeCall(symbol, orderId, origClientOrderId, recvWindow); @@ -1034,7 +1070,9 @@ public ApiResponse getOrder( * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) * @param origClientOrderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1049,7 +1087,7 @@ public ApiResponse getOrder( * Order list Documentation */ private okhttp3.Call getOrderListCall( - Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { + Long orderListId, String origClientOrderId, Double recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1085,7 +1123,9 @@ private okhttp3.Call getOrderListCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -1120,7 +1160,7 @@ private okhttp3.Call getOrderListCall( @SuppressWarnings("rawtypes") private okhttp3.Call getOrderListValidateBeforeCall( - Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { + Long orderListId, String origClientOrderId, Double recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1132,7 +1172,8 @@ private okhttp3.Call getOrderListValidateBeforeCall( Object[] parameterValues = {orderListId, origClientOrderId, recvWindow}; Method method = - this.getClass().getMethod("getOrderList", Long.class, String.class, Long.class); + this.getClass() + .getMethod("getOrderList", Long.class, String.class, Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -1157,7 +1198,9 @@ private okhttp3.Call getOrderListValidateBeforeCall( * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) * @param origClientOrderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<GetOrderListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1173,7 +1216,7 @@ private okhttp3.Call getOrderListValidateBeforeCall( * Order list Documentation */ public ApiResponse getOrderList( - Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { + Long orderListId, String origClientOrderId, Double recvWindow) throws ApiException { okhttp3.Call localVarCall = getOrderListValidateBeforeCall(orderListId, origClientOrderId, recvWindow); java.lang.reflect.Type localVarReturnType = @@ -1190,7 +1233,9 @@ public ApiResponse getOrderList( * @param fromAllocationId (optional) * @param limit Default: 500; Maximum: 1000. (optional) * @param orderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1211,7 +1256,7 @@ private okhttp3.Call myAllocationsCall( Integer fromAllocationId, Integer limit, Long orderId, - Long recvWindow) + Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -1263,7 +1308,9 @@ private okhttp3.Call myAllocationsCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -1304,7 +1351,7 @@ private okhttp3.Call myAllocationsValidateBeforeCall( Integer fromAllocationId, Integer limit, Long orderId, - Long recvWindow) + Double recvWindow) throws ApiException { try { Validator validator = @@ -1328,7 +1375,7 @@ private okhttp3.Call myAllocationsValidateBeforeCall( Integer.class, Integer.class, Long.class, - Long.class); + Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -1356,7 +1403,9 @@ private okhttp3.Call myAllocationsValidateBeforeCall( * @param fromAllocationId (optional) * @param limit Default: 500; Maximum: 1000. (optional) * @param orderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<MyAllocationsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1378,7 +1427,7 @@ public ApiResponse myAllocations( Integer fromAllocationId, Integer limit, Long orderId, - Long recvWindow) + Double recvWindow) throws ApiException { okhttp3.Call localVarCall = myAllocationsValidateBeforeCall( @@ -1388,6 +1437,152 @@ public ApiResponse myAllocations( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for myFilters + * + * @param symbol (required) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Query relevant filters -
+ * + * @see Query + * relevant filters Documentation + */ + private okhttp3.Call myFiltersCall(String symbol, Double recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v3/myFilters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call myFiltersValidateBeforeCall(String symbol, Double recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol, recvWindow}; + Method method = this.getClass().getMethod("myFilters", String.class, Double.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return myFiltersCall(symbol, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Query relevant filters Retrieves the list of [filters](filters.md) relevant to an account on + * a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` + * filters applied to it. Weight: 40 + * + * @param symbol (required) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) + * @return ApiResponse<MyFiltersResponse> + * @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 Query relevant filters -
+ * + * @see Query + * relevant filters Documentation + */ + public ApiResponse myFilters(@NotNull String symbol, Double recvWindow) + throws ApiException { + okhttp3.Call localVarCall = myFiltersValidateBeforeCall(symbol, recvWindow); + java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for myPreventedMatches * @@ -1396,7 +1591,9 @@ public ApiResponse myAllocations( * @param orderId (optional) * @param fromPreventedMatchId (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1416,7 +1613,7 @@ private okhttp3.Call myPreventedMatchesCall( Long orderId, Long fromPreventedMatchId, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -1466,7 +1663,9 @@ private okhttp3.Call myPreventedMatchesCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -1506,7 +1705,7 @@ private okhttp3.Call myPreventedMatchesValidateBeforeCall( Long orderId, Long fromPreventedMatchId, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { try { Validator validator = @@ -1529,7 +1728,7 @@ private okhttp3.Call myPreventedMatchesValidateBeforeCall( Long.class, Long.class, Integer.class, - Long.class); + Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -1562,7 +1761,9 @@ private okhttp3.Call myPreventedMatchesValidateBeforeCall( * @param orderId (optional) * @param fromPreventedMatchId (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<MyPreventedMatchesResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1583,7 +1784,7 @@ public ApiResponse myPreventedMatches( Long orderId, Long fromPreventedMatchId, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { okhttp3.Call localVarCall = myPreventedMatchesValidateBeforeCall( @@ -1602,7 +1803,9 @@ public ApiResponse myPreventedMatches( * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1623,7 +1826,7 @@ private okhttp3.Call myTradesCall( Long endTime, Long fromId, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -1674,7 +1877,9 @@ private okhttp3.Call myTradesCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -1715,7 +1920,7 @@ private okhttp3.Call myTradesValidateBeforeCall( Long endTime, Long fromId, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { try { Validator validator = @@ -1739,7 +1944,7 @@ private okhttp3.Call myTradesValidateBeforeCall( Long.class, Long.class, Integer.class, - Long.class); + Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -1767,7 +1972,9 @@ private okhttp3.Call myTradesValidateBeforeCall( * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<MyTradesResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1789,7 +1996,7 @@ public ApiResponse myTrades( Long endTime, Long fromId, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { okhttp3.Call localVarCall = myTradesValidateBeforeCall( @@ -1801,7 +2008,9 @@ public ApiResponse myTrades( /** * Build call for openOrderList * - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1815,7 +2024,7 @@ public ApiResponse myTrades( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-open-order-lists-user_data">Query * Open Order lists Documentation */ - private okhttp3.Call openOrderListCall(Long recvWindow) throws ApiException { + private okhttp3.Call openOrderListCall(Double recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1841,7 +2050,9 @@ private okhttp3.Call openOrderListCall(Long recvWindow) throws ApiException { Map localVarFormParams = new HashMap(); if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -1875,7 +2086,7 @@ private okhttp3.Call openOrderListCall(Long recvWindow) throws ApiException { } @SuppressWarnings("rawtypes") - private okhttp3.Call openOrderListValidateBeforeCall(Long recvWindow) throws ApiException { + private okhttp3.Call openOrderListValidateBeforeCall(Double recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1886,7 +2097,7 @@ private okhttp3.Call openOrderListValidateBeforeCall(Long recvWindow) throws Api ExecutableValidator executableValidator = validator.forExecutables(); Object[] parameterValues = {recvWindow}; - Method method = this.getClass().getMethod("openOrderList", Long.class); + Method method = this.getClass().getMethod("openOrderList", Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -1907,7 +2118,9 @@ private okhttp3.Call openOrderListValidateBeforeCall(Long recvWindow) throws Api /** * Query Open Order lists Weight: 6 * - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<OpenOrderListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1922,7 +2135,7 @@ private okhttp3.Call openOrderListValidateBeforeCall(Long recvWindow) throws Api * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-open-order-lists-user_data">Query * Open Order lists Documentation */ - public ApiResponse openOrderList(Long recvWindow) throws ApiException { + public ApiResponse openOrderList(Double recvWindow) throws ApiException { okhttp3.Call localVarCall = openOrderListValidateBeforeCall(recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); @@ -1936,7 +2149,9 @@ public ApiResponse openOrderList(Long recvWindow) throws * @param orderId (required) * @param fromExecutionId (optional) * @param limit Default:500; Maximum: 1000 (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1951,7 +2166,7 @@ public ApiResponse openOrderList(Long recvWindow) throws * Order Amendments Documentation */ private okhttp3.Call orderAmendmentsCall( - String symbol, Long orderId, Long fromExecutionId, Long limit, Long recvWindow) + String symbol, Long orderId, Long fromExecutionId, Long limit, Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -1995,7 +2210,9 @@ private okhttp3.Call orderAmendmentsCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -2030,7 +2247,7 @@ private okhttp3.Call orderAmendmentsCall( @SuppressWarnings("rawtypes") private okhttp3.Call orderAmendmentsValidateBeforeCall( - String symbol, Long orderId, Long fromExecutionId, Long limit, Long recvWindow) + String symbol, Long orderId, Long fromExecutionId, Long limit, Double recvWindow) throws ApiException { try { Validator validator = @@ -2050,7 +2267,7 @@ private okhttp3.Call orderAmendmentsValidateBeforeCall( Long.class, Long.class, Long.class, - Long.class); + Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -2075,7 +2292,9 @@ private okhttp3.Call orderAmendmentsValidateBeforeCall( * @param orderId (required) * @param fromExecutionId (optional) * @param limit Default:500; Maximum: 1000 (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<OrderAmendmentsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -2095,7 +2314,7 @@ public ApiResponse orderAmendments( @NotNull Long orderId, Long fromExecutionId, Long limit, - Long recvWindow) + Double recvWindow) throws ApiException { okhttp3.Call localVarCall = orderAmendmentsValidateBeforeCall( @@ -2108,7 +2327,9 @@ public ApiResponse orderAmendments( /** * Build call for rateLimitOrder * - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -2122,7 +2343,7 @@ public ApiResponse orderAmendments( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-unfilled-order-count-user_data">Query * Unfilled Order Count Documentation */ - private okhttp3.Call rateLimitOrderCall(Long recvWindow) throws ApiException { + private okhttp3.Call rateLimitOrderCall(Double recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -2148,7 +2369,9 @@ private okhttp3.Call rateLimitOrderCall(Long recvWindow) throws ApiException { Map localVarFormParams = new HashMap(); if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -2182,7 +2405,7 @@ private okhttp3.Call rateLimitOrderCall(Long recvWindow) throws ApiException { } @SuppressWarnings("rawtypes") - private okhttp3.Call rateLimitOrderValidateBeforeCall(Long recvWindow) throws ApiException { + private okhttp3.Call rateLimitOrderValidateBeforeCall(Double recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -2193,7 +2416,7 @@ private okhttp3.Call rateLimitOrderValidateBeforeCall(Long recvWindow) throws Ap ExecutableValidator executableValidator = validator.forExecutables(); Object[] parameterValues = {recvWindow}; - Method method = this.getClass().getMethod("rateLimitOrder", Long.class); + Method method = this.getClass().getMethod("rateLimitOrder", Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -2215,7 +2438,9 @@ private okhttp3.Call rateLimitOrderValidateBeforeCall(Long recvWindow) throws Ap * Query Unfilled Order Count Displays the user's unfilled order count for all intervals. * Weight: 40 * - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<RateLimitOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -2230,7 +2455,8 @@ private okhttp3.Call rateLimitOrderValidateBeforeCall(Long recvWindow) throws Ap * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-unfilled-order-count-user_data">Query * Unfilled Order Count Documentation */ - public ApiResponse rateLimitOrder(Long recvWindow) throws ApiException { + public ApiResponse rateLimitOrder(Double recvWindow) + throws ApiException { okhttp3.Call localVarCall = rateLimitOrderValidateBeforeCall(recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); 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 e449e745b..0df1ccb35 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/6.0.0 (Java/%s; %s; %s)", + "binance-spot/7.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 db3c19a13..ffa5a8315 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/6.0.0 (Java/%s; %s; %s)", + "binance-spot/7.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/SpotRestApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java index 0a541d33d..7652873cb 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java @@ -25,6 +25,7 @@ import com.binance.connector.client.spot.rest.model.Interval; import com.binance.connector.client.spot.rest.model.KlinesResponse; import com.binance.connector.client.spot.rest.model.MyAllocationsResponse; +import com.binance.connector.client.spot.rest.model.MyFiltersResponse; import com.binance.connector.client.spot.rest.model.MyPreventedMatchesResponse; import com.binance.connector.client.spot.rest.model.MyTradesResponse; import com.binance.connector.client.spot.rest.model.NewOrderRequest; @@ -117,7 +118,9 @@ public ApiResponse accountCommission(String symbol) * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<AllOrderListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -133,7 +136,7 @@ public ApiResponse accountCommission(String symbol) * all Order lists Documentation */ public ApiResponse allOrderList( - Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) + Long fromId, Long startTime, Long endTime, Integer limit, Double recvWindow) throws ApiException { return accountApi.allOrderList(fromId, startTime, endTime, limit, recvWindow); } @@ -146,7 +149,9 @@ public ApiResponse allOrderList( * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<AllOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -167,7 +172,7 @@ public ApiResponse allOrders( Long startTime, Long endTime, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { return accountApi.allOrders(symbol, orderId, startTime, endTime, limit, recvWindow); } @@ -177,7 +182,9 @@ public ApiResponse allOrders( * * @param omitZeroBalances When set to `true`, emits only the non-zero balances of an * account. <br>Default value: `false` (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<GetAccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -192,7 +199,7 @@ public ApiResponse allOrders( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-information-user_data">Account * information Documentation */ - public ApiResponse getAccount(Boolean omitZeroBalances, Long recvWindow) + public ApiResponse getAccount(Boolean omitZeroBalances, Double recvWindow) throws ApiException { return accountApi.getAccount(omitZeroBalances, recvWindow); } @@ -202,7 +209,9 @@ public ApiResponse getAccount(Boolean omitZeroBalances, Long * symbol. Weight: 6 for a single symbol; **80** when the symbol parameter is omitted * * @param symbol Symbol to query (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<GetOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -217,7 +226,7 @@ public ApiResponse getAccount(Boolean omitZeroBalances, Long * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#current-open-orders-user_data">Current * open orders Documentation */ - public ApiResponse getOpenOrders(String symbol, Long recvWindow) + public ApiResponse getOpenOrders(String symbol, Double recvWindow) throws ApiException { return accountApi.getOpenOrders(symbol, recvWindow); } @@ -228,7 +237,9 @@ public ApiResponse getOpenOrders(String symbol, Long recv * @param symbol (required) * @param orderId (optional) * @param origClientOrderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<GetOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -244,7 +255,7 @@ public ApiResponse getOpenOrders(String symbol, Long recv * order Documentation */ public ApiResponse getOrder( - String symbol, Long orderId, String origClientOrderId, Long recvWindow) + String symbol, Long orderId, String origClientOrderId, Double recvWindow) throws ApiException { return accountApi.getOrder(symbol, orderId, origClientOrderId, recvWindow); } @@ -256,7 +267,9 @@ public ApiResponse getOrder( * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) * @param origClientOrderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<GetOrderListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -272,7 +285,7 @@ public ApiResponse getOrder( * Order list Documentation */ public ApiResponse getOrderList( - Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { + Long orderListId, String origClientOrderId, Double recvWindow) throws ApiException { return accountApi.getOrderList(orderListId, origClientOrderId, recvWindow); } @@ -285,7 +298,9 @@ public ApiResponse getOrderList( * @param fromAllocationId (optional) * @param limit Default: 500; Maximum: 1000. (optional) * @param orderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<MyAllocationsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -307,12 +322,40 @@ public ApiResponse myAllocations( Integer fromAllocationId, Integer limit, Long orderId, - Long recvWindow) + Double recvWindow) throws ApiException { return accountApi.myAllocations( symbol, startTime, endTime, fromAllocationId, limit, orderId, recvWindow); } + /** + * Query relevant filters Retrieves the list of [filters](filters.md) relevant to an account on + * a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` + * filters applied to it. Weight: 40 + * + * @param symbol (required) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) + * @return ApiResponse<MyFiltersResponse> + * @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 Query relevant filters -
+ * + * @see Query + * relevant filters Documentation + */ + public ApiResponse myFilters(String symbol, Double recvWindow) + throws ApiException { + return accountApi.myFilters(symbol, recvWindow); + } + /** * Query Prevented Matches Displays the list of orders that were expired due to STP. These are * the combinations supported: * `symbol` + `preventedMatchId` * @@ -327,7 +370,9 @@ public ApiResponse myAllocations( * @param orderId (optional) * @param fromPreventedMatchId (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<MyPreventedMatchesResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -348,7 +393,7 @@ public ApiResponse myPreventedMatches( Long orderId, Long fromPreventedMatchId, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { return accountApi.myPreventedMatches( symbol, preventedMatchId, orderId, fromPreventedMatchId, limit, recvWindow); @@ -364,7 +409,9 @@ public ApiResponse myPreventedMatches( * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<MyTradesResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -386,7 +433,7 @@ public ApiResponse myTrades( Long endTime, Long fromId, Integer limit, - Long recvWindow) + Double recvWindow) throws ApiException { return accountApi.myTrades(symbol, orderId, startTime, endTime, fromId, limit, recvWindow); } @@ -394,7 +441,9 @@ public ApiResponse myTrades( /** * Query Open Order lists Weight: 6 * - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<OpenOrderListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -409,7 +458,7 @@ public ApiResponse myTrades( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-open-order-lists-user_data">Query * Open Order lists Documentation */ - public ApiResponse openOrderList(Long recvWindow) throws ApiException { + public ApiResponse openOrderList(Double recvWindow) throws ApiException { return accountApi.openOrderList(recvWindow); } @@ -420,7 +469,9 @@ public ApiResponse openOrderList(Long recvWindow) throws * @param orderId (required) * @param fromExecutionId (optional) * @param limit Default:500; Maximum: 1000 (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<OrderAmendmentsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -436,7 +487,7 @@ public ApiResponse openOrderList(Long recvWindow) throws * Order Amendments Documentation */ public ApiResponse orderAmendments( - String symbol, Long orderId, Long fromExecutionId, Long limit, Long recvWindow) + String symbol, Long orderId, Long fromExecutionId, Long limit, Double recvWindow) throws ApiException { return accountApi.orderAmendments(symbol, orderId, fromExecutionId, limit, recvWindow); } @@ -445,7 +496,9 @@ public ApiResponse orderAmendments( * Query Unfilled Order Count Displays the user's unfilled order count for all intervals. * Weight: 40 * - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<RateLimitOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -460,7 +513,8 @@ public ApiResponse orderAmendments( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-unfilled-order-count-user_data">Query * Unfilled Order Count Documentation */ - public ApiResponse rateLimitOrder(Long recvWindow) throws ApiException { + public ApiResponse rateLimitOrder(Double recvWindow) + throws ApiException { return accountApi.rateLimitOrder(recvWindow); } @@ -896,7 +950,9 @@ public ApiResponse uiKlines( * orders that are part of an order list. Weight: 1 * * @param symbol (required) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<DeleteOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -911,7 +967,7 @@ public ApiResponse uiKlines( * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade">Cancel * All Open Orders on a Symbol Documentation */ - public ApiResponse deleteOpenOrders(String symbol, Long recvWindow) + public ApiResponse deleteOpenOrders(String symbol, Double recvWindow) throws ApiException { return tradeApi.deleteOpenOrders(symbol, recvWindow); } @@ -926,7 +982,9 @@ public ApiResponse deleteOpenOrders(String symbol, Lon * sent.<br/> Orders with the same `newClientOrderID` can be accepted only * when the previous one is filled, otherwise the order will be rejected. (optional) * @param cancelRestrictions (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<DeleteOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -947,7 +1005,7 @@ public ApiResponse deleteOrder( String origClientOrderId, String newClientOrderId, CancelRestrictions cancelRestrictions, - Long recvWindow) + Double recvWindow) throws ApiException { return tradeApi.deleteOrder( symbol, @@ -968,7 +1026,9 @@ public ApiResponse deleteOrder( * @param newClientOrderId A unique id among open orders. Automatically generated if not * sent.<br/> Orders with the same `newClientOrderID` can be accepted only * when the previous one is filled, otherwise the order will be rejected. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<DeleteOrderListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -988,7 +1048,7 @@ public ApiResponse deleteOrderList( Long orderListId, String listClientOrderId, String newClientOrderId, - Long recvWindow) + Double recvWindow) throws ApiException { return tradeApi.deleteOrderList( symbol, orderListId, listClientOrderId, newClientOrderId, recvWindow); @@ -1302,7 +1362,7 @@ public void deleteUserDataStream(String listenKey) throws ApiException { /** * Start user data stream Start a new user data stream. The stream will close after 60 minutes - * unless a keepalive is sent. Weight: 2 + * unless a keepalive is sent. This request does not require `signature`. Weight: 2 * * @return ApiResponse<NewUserDataStreamResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1325,7 +1385,7 @@ public ApiResponse newUserDataStream() throws ApiExce /** * Keepalive user data stream Keepalive a user data stream to prevent a time out. User data * streams will close after 60 minutes. It's recommended to send a ping about every 30 - * minutes. Weight: 2 + * minutes. This request does not require `signature`. Weight: 2 * * @param putUserDataStreamRequest (required) * @return ApiResponse<Void> 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 9a8939c8e..fbdb32d49 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/6.0.0 (Java/%s; %s; %s)", + "binance-spot/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; @@ -108,7 +108,9 @@ public void setCustomBaseUrl(String customBaseUrl) { * Build call for deleteOpenOrders * * @param symbol (required) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -122,7 +124,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade">Cancel * All Open Orders on a Symbol Documentation */ - private okhttp3.Call deleteOpenOrdersCall(String symbol, Long recvWindow) throws ApiException { + private okhttp3.Call deleteOpenOrdersCall(String symbol, Double recvWindow) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -152,7 +155,9 @@ private okhttp3.Call deleteOpenOrdersCall(String symbol, Long recvWindow) throws } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -186,7 +191,7 @@ private okhttp3.Call deleteOpenOrdersCall(String symbol, Long recvWindow) throws } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteOpenOrdersValidateBeforeCall(String symbol, Long recvWindow) + private okhttp3.Call deleteOpenOrdersValidateBeforeCall(String symbol, Double recvWindow) throws ApiException { try { Validator validator = @@ -198,7 +203,8 @@ private okhttp3.Call deleteOpenOrdersValidateBeforeCall(String symbol, Long recv ExecutableValidator executableValidator = validator.forExecutables(); Object[] parameterValues = {symbol, recvWindow}; - Method method = this.getClass().getMethod("deleteOpenOrders", String.class, Long.class); + Method method = + this.getClass().getMethod("deleteOpenOrders", String.class, Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -221,7 +227,9 @@ private okhttp3.Call deleteOpenOrdersValidateBeforeCall(String symbol, Long recv * orders that are part of an order list. Weight: 1 * * @param symbol (required) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<DeleteOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -237,7 +245,7 @@ private okhttp3.Call deleteOpenOrdersValidateBeforeCall(String symbol, Long recv * All Open Orders on a Symbol Documentation */ public ApiResponse deleteOpenOrders( - @NotNull String symbol, Long recvWindow) throws ApiException { + @NotNull String symbol, Double recvWindow) throws ApiException { okhttp3.Call localVarCall = deleteOpenOrdersValidateBeforeCall(symbol, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); @@ -254,7 +262,9 @@ public ApiResponse deleteOpenOrders( * sent.<br/> Orders with the same `newClientOrderID` can be accepted only * when the previous one is filled, otherwise the order will be rejected. (optional) * @param cancelRestrictions (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -274,7 +284,7 @@ private okhttp3.Call deleteOrderCall( String origClientOrderId, String newClientOrderId, CancelRestrictions cancelRestrictions, - Long recvWindow) + Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -324,7 +334,9 @@ private okhttp3.Call deleteOrderCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -364,7 +376,7 @@ private okhttp3.Call deleteOrderValidateBeforeCall( String origClientOrderId, String newClientOrderId, CancelRestrictions cancelRestrictions, - Long recvWindow) + Double recvWindow) throws ApiException { try { Validator validator = @@ -387,7 +399,7 @@ private okhttp3.Call deleteOrderValidateBeforeCall( String.class, String.class, CancelRestrictions.class, - Long.class); + Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -421,7 +433,9 @@ private okhttp3.Call deleteOrderValidateBeforeCall( * sent.<br/> Orders with the same `newClientOrderID` can be accepted only * when the previous one is filled, otherwise the order will be rejected. (optional) * @param cancelRestrictions (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<DeleteOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -442,7 +456,7 @@ public ApiResponse deleteOrder( String origClientOrderId, String newClientOrderId, CancelRestrictions cancelRestrictions, - Long recvWindow) + Double recvWindow) throws ApiException { okhttp3.Call localVarCall = deleteOrderValidateBeforeCall( @@ -467,7 +481,9 @@ public ApiResponse deleteOrder( * @param newClientOrderId A unique id among open orders. Automatically generated if not * sent.<br/> Orders with the same `newClientOrderID` can be accepted only * when the previous one is filled, otherwise the order will be rejected. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -486,7 +502,7 @@ private okhttp3.Call deleteOrderListCall( Long orderListId, String listClientOrderId, String newClientOrderId, - Long recvWindow) + Double recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -532,7 +548,9 @@ private okhttp3.Call deleteOrderListCall( } if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "recvWindow", DecimalFormatter.getFormatter().format(recvWindow))); } final String[] localVarAccepts = {"application/json"}; @@ -571,7 +589,7 @@ private okhttp3.Call deleteOrderListValidateBeforeCall( Long orderListId, String listClientOrderId, String newClientOrderId, - Long recvWindow) + Double recvWindow) throws ApiException { try { Validator validator = @@ -593,7 +611,7 @@ private okhttp3.Call deleteOrderListValidateBeforeCall( Long.class, String.class, String.class, - Long.class); + Double.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); @@ -622,7 +640,9 @@ private okhttp3.Call deleteOrderListValidateBeforeCall( * @param newClientOrderId A unique id among open orders. Automatically generated if not * sent.<br/> Orders with the same `newClientOrderID` can be accepted only * when the previous one is filled, otherwise the order will be rejected. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) + * @param recvWindow The value cannot be greater than `60000`. <br> Supports up + * to three decimal places of precision (e.g., 6000.346) so that microseconds may be + * specified. (optional) * @return ApiResponse<DeleteOrderListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -642,7 +662,7 @@ public ApiResponse deleteOrderList( Long orderListId, String listClientOrderId, String newClientOrderId, - Long recvWindow) + Double recvWindow) throws ApiException { okhttp3.Call localVarCall = deleteOrderListValidateBeforeCall( @@ -777,7 +797,9 @@ private okhttp3.Call newOrderCall(NewOrderRequest newOrderRequest) throws ApiExc } if (newOrderRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", newOrderRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(newOrderRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; @@ -936,7 +958,10 @@ private okhttp3.Call orderAmendKeepPriorityCall( } if (orderAmendKeepPriorityRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", orderAmendKeepPriorityRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter() + .format(orderAmendKeepPriorityRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; @@ -1199,7 +1224,10 @@ private okhttp3.Call orderCancelReplaceCall(OrderCancelReplaceRequest orderCance } if (orderCancelReplaceRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", orderCancelReplaceRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter() + .format(orderCancelReplaceRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; @@ -1389,10 +1417,7 @@ private okhttp3.Call orderListOcoCall(OrderListOcoRequest orderListOcoRequest) } if (orderListOcoRequest.getAboveTimeInForce() != null) { - localVarFormParams.put( - "aboveTimeInForce", - DecimalFormatter.getFormatter() - .format(orderListOcoRequest.getAboveTimeInForce())); + localVarFormParams.put("aboveTimeInForce", orderListOcoRequest.getAboveTimeInForce()); } if (orderListOcoRequest.getAboveStrategyId() != null) { @@ -1484,7 +1509,9 @@ private okhttp3.Call orderListOcoCall(OrderListOcoRequest orderListOcoRequest) } if (orderListOcoRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", orderListOcoRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(orderListOcoRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; @@ -1786,7 +1813,9 @@ private okhttp3.Call orderListOtoCall(OrderListOtoRequest orderListOtoRequest) } if (orderListOtoRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", orderListOtoRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(orderListOtoRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; @@ -2169,7 +2198,9 @@ private okhttp3.Call orderListOtocoCall(OrderListOtocoRequest orderListOtocoRequ } if (orderListOtocoRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", orderListOtocoRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(orderListOtocoRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; @@ -2401,7 +2432,9 @@ private okhttp3.Call orderOcoCall(OrderOcoRequest orderOcoRequest) throws ApiExc } if (orderOcoRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", orderOcoRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(orderOcoRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; @@ -2625,7 +2658,9 @@ private okhttp3.Call orderTestCall(OrderTestRequest orderTestRequest) throws Api } if (orderTestRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", orderTestRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(orderTestRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; @@ -2814,7 +2849,9 @@ private okhttp3.Call sorOrderCall(SorOrderRequest sorOrderRequest) throws ApiExc } if (sorOrderRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", sorOrderRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(sorOrderRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; @@ -3009,7 +3046,9 @@ private okhttp3.Call sorOrderTestCall(SorOrderTestRequest sorOrderTestRequest) } if (sorOrderTestRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", sorOrderTestRequest.getRecvWindow()); + localVarFormParams.put( + "recvWindow", + DecimalFormatter.getFormatter().format(sorOrderTestRequest.getRecvWindow())); } final String[] localVarAccepts = {"application/json"}; 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 dd7904106..ba3cf8c77 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/6.0.0 (Java/%s; %s; %s)", + "binance-spot/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; @@ -314,7 +314,7 @@ private okhttp3.Call newUserDataStreamValidateBeforeCall() throws ApiException { /** * Start user data stream Start a new user data stream. The stream will close after 60 minutes - * unless a keepalive is sent. Weight: 2 + * unless a keepalive is sent. This request does not require `signature`. Weight: 2 * * @return ApiResponse<NewUserDataStreamResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -449,7 +449,7 @@ private okhttp3.Call putUserDataStreamValidateBeforeCall( /** * Keepalive user data stream Keepalive a user data stream to prevent a time out. User data * streams will close after 60 minutes. It's recommended to send a ping about every 30 - * minutes. Weight: 2 + * minutes. This request does not require `signature`. Weight: 2 * * @param putUserDataStreamRequest (required) * @return ApiResponse<Void> diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AboveTimeInForce.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AboveTimeInForce.java new file mode 100644 index 000000000..0361fe54c --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AboveTimeInForce.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 aboveTimeInForce */ +@JsonAdapter(AboveTimeInForce.Adapter.class) +public enum AboveTimeInForce { + GTC("GTC"), + + IOC("IOC"), + + FOK("FOK"); + + private String value; + + AboveTimeInForce(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AboveTimeInForce fromValue(String value) { + for (AboveTimeInForce b : AboveTimeInForce.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 AboveTimeInForce enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AboveTimeInForce read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AboveTimeInForce.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AboveTimeInForce.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AssetFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AssetFilters.java new file mode 100644 index 000000000..af44c3955 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AssetFilters.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.common.AbstractOpenApiSchema; +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.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.hibernate.validator.constraints.*; + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AssetFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AssetFilters.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterMaxAssetFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxAssetFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetFilters value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `MaxAssetFilter` + if (value.getActualInstance() instanceof MaxAssetFilter) { + JsonElement element = + adapterMaxAssetFilter.toJsonTree( + (MaxAssetFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " MaxAssetFilter"); + } + + @Override + public AssetFilters read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + AssetFilters newAssetFilters = new AssetFilters(); + if (jsonObject.get("filterType") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for AssetFilters as" + + " `filterType` was not found in the payload or the" + + " payload is empty."); + } else { + // look up the discriminator value in the field `filterType` + switch (jsonObject.get("filterType").getAsString()) { + case "MAX_ASSET": + deserialized = + adapterMaxAssetFilter.fromJsonTree(jsonObject); + newAssetFilters.setActualInstance(deserialized); + return newAssetFilters; + case "MaxAssetFilter": + deserialized = + adapterMaxAssetFilter.fromJsonTree(jsonObject); + newAssetFilters.setActualInstance(deserialized); + return newAssetFilters; + default: + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for AssetFilters. Possible values:" + + " MAX_ASSET MaxAssetFilter", + jsonObject + .get("filterType") + .getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize MaxAssetFilter + try { + // validate the JSON object to see if any exception is thrown + MaxAssetFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxAssetFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'MaxAssetFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxAssetFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxAssetFilter'", + e); + } + + if (match == 1) { + AssetFilters ret = new AssetFilters(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for AssetFilters: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public AssetFilters() { + super("oneOf", Boolean.FALSE); + } + + public AssetFilters(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("MaxAssetFilter", MaxAssetFilter.class); + } + + @Override + public Map> getSchemas() { + return AssetFilters.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: MaxAssetFilter + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof MaxAssetFilter) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be MaxAssetFilter"); + } + + /** + * Get the actual instance, which can be the following: MaxAssetFilter + * + * @return The actual instance (MaxAssetFilter) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxAssetFilter`. If the actual instance is not `MaxAssetFilter`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `MaxAssetFilter` + * @throws ClassCastException if the instance is not `MaxAssetFilter` + */ + public MaxAssetFilter getMaxAssetFilter() throws ClassCastException { + return (MaxAssetFilter) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with MaxAssetFilter + try { + MaxAssetFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxAssetFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for AssetFilters with oneOf schemas:" + + " MaxAssetFilter. %d class(es) match the result, expected 1." + + " Detailed failure message for oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of AssetFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetFilters + * @throws IOException if the JSON string is invalid with respect to AssetFilters + */ + public static AssetFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetFilters.class); + } + + /** + * Convert an instance of AssetFilters 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/BelowTimeInForce.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/BelowTimeInForce.java index 32da96f4c..6c27e5ccf 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/BelowTimeInForce.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/BelowTimeInForce.java @@ -24,11 +24,11 @@ /** Gets or Sets belowTimeInForce */ @JsonAdapter(BelowTimeInForce.Adapter.class) public enum BelowTimeInForce { - belowType("belowType"), + GTC("GTC"), - STOP_LOSS_LIMIT("STOP_LOSS_LIMIT"), + IOC("IOC"), - TAKE_PROFIT_LIMIT("TAKE_PROFIT_LIMIT"); + FOK("FOK"); private String value; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFilters.java index d89d4b7ea..9d6622518 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFilters.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFilters.java @@ -12,10 +12,11 @@ package com.binance.connector.client.spot.rest.model; +import com.binance.connector.client.common.AbstractOpenApiSchema; import com.binance.connector.client.spot.rest.JSON; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; @@ -23,80 +24,422 @@ import com.google.gson.stream.JsonWriter; import jakarta.validation.constraints.*; import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.HashSet; -import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; import org.hibernate.validator.constraints.*; -/** ExchangeFilters */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class ExchangeFilters extends ArrayList { - public ExchangeFilters() {} +public class ExchangeFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ExchangeFilters.class.getName()); - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterExchangeMaxNumOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeMaxNumOrdersFilter.class)); + final TypeAdapter + adapterExchangeMaxNumAlgoOrdersFilter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumAlgoOrdersFilter.class)); + final TypeAdapter + adapterExchangeMaxNumIcebergOrdersFilter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumIcebergOrdersFilter.class)); + final TypeAdapter + adapterExchangeMaxNumOrderListsFilter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumOrderListsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeFilters value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ExchangeMaxNumOrdersFilter` + if (value.getActualInstance() instanceof ExchangeMaxNumOrdersFilter) { + JsonElement element = + adapterExchangeMaxNumOrdersFilter.toJsonTree( + (ExchangeMaxNumOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ExchangeMaxNumAlgoOrdersFilter` + if (value.getActualInstance() + instanceof ExchangeMaxNumAlgoOrdersFilter) { + JsonElement element = + adapterExchangeMaxNumAlgoOrdersFilter.toJsonTree( + (ExchangeMaxNumAlgoOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ExchangeMaxNumIcebergOrdersFilter` + if (value.getActualInstance() + instanceof ExchangeMaxNumIcebergOrdersFilter) { + JsonElement element = + adapterExchangeMaxNumIcebergOrdersFilter.toJsonTree( + (ExchangeMaxNumIcebergOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ExchangeMaxNumOrderListsFilter` + if (value.getActualInstance() + instanceof ExchangeMaxNumOrderListsFilter) { + JsonElement element = + adapterExchangeMaxNumOrderListsFilter.toJsonTree( + (ExchangeMaxNumOrderListsFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " ExchangeMaxNumAlgoOrdersFilter," + + " ExchangeMaxNumIcebergOrdersFilter," + + " ExchangeMaxNumOrderListsFilter," + + " ExchangeMaxNumOrdersFilter"); + } + + @Override + public ExchangeFilters read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + ExchangeFilters newExchangeFilters = new ExchangeFilters(); + if (jsonObject.get("filterType") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for ExchangeFilters" + + " as `filterType` was not found in the payload or the" + + " payload is empty."); + } else { + // look up the discriminator value in the field `filterType` + switch (jsonObject.get("filterType").getAsString()) { + case "EXCHANGE_MAX_NUM_ALGO_ORDERS": + deserialized = + adapterExchangeMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "EXCHANGE_MAX_NUM_ICEBERG_ORDERS": + deserialized = + adapterExchangeMaxNumIcebergOrdersFilter + .fromJsonTree(jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "EXCHANGE_MAX_NUM_ORDERS": + deserialized = + adapterExchangeMaxNumOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "EXCHANGE_MAX_NUM_ORDER_LISTS": + deserialized = + adapterExchangeMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumAlgoOrdersFilter": + deserialized = + adapterExchangeMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumIcebergOrdersFilter": + deserialized = + adapterExchangeMaxNumIcebergOrdersFilter + .fromJsonTree(jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumOrderListsFilter": + deserialized = + adapterExchangeMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumOrdersFilter": + deserialized = + adapterExchangeMaxNumOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + default: + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for ExchangeFilters. Possible" + + " values:" + + " EXCHANGE_MAX_NUM_ALGO_ORDERS" + + " EXCHANGE_MAX_NUM_ICEBERG_ORDERS" + + " EXCHANGE_MAX_NUM_ORDERS" + + " EXCHANGE_MAX_NUM_ORDER_LISTS" + + " ExchangeMaxNumAlgoOrdersFilter" + + " ExchangeMaxNumIcebergOrdersFilter" + + " ExchangeMaxNumOrderListsFilter" + + " ExchangeMaxNumOrdersFilter", + jsonObject + .get("filterType") + .getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ExchangeMaxNumOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'ExchangeMaxNumOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrdersFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumOrdersFilter'", + e); + } + // deserialize ExchangeMaxNumAlgoOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumAlgoOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ExchangeMaxNumAlgoOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumAlgoOrdersFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumAlgoOrdersFilter'", + e); + } + // deserialize ExchangeMaxNumIcebergOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumIcebergOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ExchangeMaxNumIcebergOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ExchangeMaxNumIcebergOrdersFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumIcebergOrdersFilter'", + e); + } + // deserialize ExchangeMaxNumOrderListsFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumOrderListsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumOrderListsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ExchangeMaxNumOrderListsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrderListsFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumOrderListsFilter'", + e); + } + + if (match == 1) { + ExchangeFilters ret = new ExchangeFilters(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for ExchangeFilters: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); } - return super.equals(o); } - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public ExchangeFilters() { + super("oneOf", Boolean.FALSE); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeFilters {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); + public ExchangeFilters(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); } - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); + static { + schemas.put("ExchangeMaxNumOrdersFilter", ExchangeMaxNumOrdersFilter.class); + schemas.put("ExchangeMaxNumAlgoOrdersFilter", ExchangeMaxNumAlgoOrdersFilter.class); + schemas.put("ExchangeMaxNumIcebergOrdersFilter", ExchangeMaxNumIcebergOrdersFilter.class); + schemas.put("ExchangeMaxNumOrderListsFilter", ExchangeMaxNumOrderListsFilter.class); + } - return sb.toString(); + @Override + public Map> getSchemas() { + return ExchangeFilters.schemas; } - 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); + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ExchangeMaxNumAlgoOrdersFilter, + * ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter, ExchangeMaxNumOrdersFilter + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ExchangeMaxNumOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExchangeMaxNumAlgoOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExchangeMaxNumIcebergOrdersFilter) { + super.setActualInstance(instance); + return; } + + if (instance instanceof ExchangeMaxNumOrderListsFilter) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be ExchangeMaxNumAlgoOrdersFilter," + + " ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter," + + " ExchangeMaxNumOrdersFilter"); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * Get the actual instance, which can be the following: ExchangeMaxNumAlgoOrdersFilter, + * ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter, ExchangeMaxNumOrdersFilter + * + * @return The actual instance (ExchangeMaxNumAlgoOrdersFilter, + * ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter, + * ExchangeMaxNumOrdersFilter) */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + /** + * Get the actual instance of `ExchangeMaxNumOrdersFilter`. If the actual instance is not + * `ExchangeMaxNumOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumOrdersFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumOrdersFilter` + */ + public ExchangeMaxNumOrdersFilter getExchangeMaxNumOrdersFilter() throws ClassCastException { + return (ExchangeMaxNumOrdersFilter) super.getActualInstance(); + } - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); + /** + * Get the actual instance of `ExchangeMaxNumAlgoOrdersFilter`. If the actual instance is not + * `ExchangeMaxNumAlgoOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumAlgoOrdersFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumAlgoOrdersFilter` + */ + public ExchangeMaxNumAlgoOrdersFilter getExchangeMaxNumAlgoOrdersFilter() + throws ClassCastException { + return (ExchangeMaxNumAlgoOrdersFilter) super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); + /** + * Get the actual instance of `ExchangeMaxNumIcebergOrdersFilter`. If the actual instance is not + * `ExchangeMaxNumIcebergOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumIcebergOrdersFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumIcebergOrdersFilter` + */ + public ExchangeMaxNumIcebergOrdersFilter getExchangeMaxNumIcebergOrdersFilter() + throws ClassCastException { + return (ExchangeMaxNumIcebergOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `ExchangeMaxNumOrderListsFilter`. If the actual instance is not + * `ExchangeMaxNumOrderListsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumOrderListsFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumOrderListsFilter` + */ + public ExchangeMaxNumOrderListsFilter getExchangeMaxNumOrderListsFilter() + throws ClassCastException { + return (ExchangeMaxNumOrderListsFilter) super.getActualInstance(); } /** @@ -106,57 +449,64 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to ExchangeFilters */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (!jsonElement.isJsonArray()) { - throw new IllegalArgumentException( + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ExchangeMaxNumOrdersFilter + try { + ExchangeMaxNumOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( String.format( - "Expected json element to be a array type in the JSON string but got" - + " `%s`", - jsonElement.toString())); + "Deserialization for ExchangeMaxNumOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one } - JsonArray array = jsonElement.getAsJsonArray(); - // validate array items - for (JsonElement element : array) { - ExchangeFiltersInner.validateJsonElement(element); + // validate the json string with ExchangeMaxNumAlgoOrdersFilter + try { + ExchangeMaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumAlgoOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one } - if (jsonElement == null) { - if (!ExchangeFilters.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExchangeFilters is not found in the" - + " empty JSON string", - ExchangeFilters.openapiRequiredFields.toString())); - } + // validate the json string with ExchangeMaxNumIcebergOrdersFilter + try { + ExchangeMaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumIcebergOrdersFilter failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeFilters.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExchangeFilters' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExchangeFilters.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExchangeFilters value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); - elementAdapter.write(out, obj); - } - - @Override - public ExchangeFilters read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); + // validate the json string with ExchangeMaxNumOrderListsFilter + try { + ExchangeMaxNumOrderListsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrderListsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for ExchangeFilters with oneOf schemas:" + + " ExchangeMaxNumAlgoOrdersFilter," + + " ExchangeMaxNumIcebergOrdersFilter," + + " ExchangeMaxNumOrderListsFilter, ExchangeMaxNumOrdersFilter. %d" + + " class(es) match the result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); } } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java deleted file mode 100644 index f708c7990..000000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java +++ /dev/null @@ -1,1335 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.rest.model; - -import com.binance.connector.client.spot.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** ExchangeFiltersInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class ExchangeFiltersInner { - public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; - - @SerializedName(SERIALIZED_NAME_FILTER_TYPE) - @jakarta.annotation.Nullable - private String filterType; - - public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; - - @SerializedName(SERIALIZED_NAME_MIN_PRICE) - @jakarta.annotation.Nullable - private String minPrice; - - public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; - - @SerializedName(SERIALIZED_NAME_MAX_PRICE) - @jakarta.annotation.Nullable - private String maxPrice; - - public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; - - @SerializedName(SERIALIZED_NAME_TICK_SIZE) - @jakarta.annotation.Nullable - private String tickSize; - - public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; - - @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) - @jakarta.annotation.Nullable - private String multiplierUp; - - public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; - - @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) - @jakarta.annotation.Nullable - private String multiplierDown; - - public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; - - @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) - @jakarta.annotation.Nullable - private Long avgPriceMins; - - public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; - - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) - @jakarta.annotation.Nullable - private String bidMultiplierUp; - - public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; - - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) - @jakarta.annotation.Nullable - private String bidMultiplierDown; - - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; - - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) - @jakarta.annotation.Nullable - private String askMultiplierUp; - - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; - - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) - @jakarta.annotation.Nullable - private String askMultiplierDown; - - public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; - - @SerializedName(SERIALIZED_NAME_MIN_QTY) - @jakarta.annotation.Nullable - private String minQty; - - public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; - - @SerializedName(SERIALIZED_NAME_MAX_QTY) - @jakarta.annotation.Nullable - private String maxQty; - - public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; - - @SerializedName(SERIALIZED_NAME_STEP_SIZE) - @jakarta.annotation.Nullable - private String stepSize; - - public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; - - @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) - @jakarta.annotation.Nullable - private String minNotional; - - public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyToMarket; - - public static final String SERIALIZED_NAME_APPLY_MIN_TO_MARKET = "applyMinToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_MIN_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyMinToMarket; - - public static final String SERIALIZED_NAME_MAX_NOTIONAL = "maxNotional"; - - @SerializedName(SERIALIZED_NAME_MAX_NOTIONAL) - @jakarta.annotation.Nullable - private String maxNotional; - - public static final String SERIALIZED_NAME_APPLY_MAX_TO_MARKET = "applyMaxToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_MAX_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyMaxToMarket; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; - - @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) - @jakarta.annotation.Nullable - private Long maxNumOrders; - - public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; - - @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) - @jakarta.annotation.Nullable - private Long maxNumAlgoOrders; - - public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; - - @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) - @jakarta.annotation.Nullable - private Long maxNumIcebergOrders; - - public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; - - @SerializedName(SERIALIZED_NAME_MAX_POSITION) - @jakarta.annotation.Nullable - private String maxPosition; - - public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; - - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) - @jakarta.annotation.Nullable - private Long minTrailingAboveDelta; - - public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; - - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) - @jakarta.annotation.Nullable - private Long maxTrailingAboveDelta; - - public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; - - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) - @jakarta.annotation.Nullable - private Long minTrailingBelowDelta; - - public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; - - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) - @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) { - this.filterType = filterType; - return this; - } - - /** - * Get filterType - * - * @return filterType - */ - @jakarta.annotation.Nullable - public String getFilterType() { - return filterType; - } - - public void setFilterType(@jakarta.annotation.Nullable String filterType) { - this.filterType = filterType; - } - - public ExchangeFiltersInner minPrice(@jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; - return this; - } - - /** - * Get minPrice - * - * @return minPrice - */ - @jakarta.annotation.Nullable - public String getMinPrice() { - return minPrice; - } - - public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; - } - - public ExchangeFiltersInner maxPrice(@jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; - return this; - } - - /** - * Get maxPrice - * - * @return maxPrice - */ - @jakarta.annotation.Nullable - public String getMaxPrice() { - return maxPrice; - } - - public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; - } - - public ExchangeFiltersInner tickSize(@jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; - return this; - } - - /** - * Get tickSize - * - * @return tickSize - */ - @jakarta.annotation.Nullable - public String getTickSize() { - return tickSize; - } - - public void setTickSize(@jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; - } - - public ExchangeFiltersInner multiplierUp(@jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; - return this; - } - - /** - * Get multiplierUp - * - * @return multiplierUp - */ - @jakarta.annotation.Nullable - public String getMultiplierUp() { - return multiplierUp; - } - - public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; - } - - public ExchangeFiltersInner multiplierDown(@jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; - return this; - } - - /** - * Get multiplierDown - * - * @return multiplierDown - */ - @jakarta.annotation.Nullable - public String getMultiplierDown() { - return multiplierDown; - } - - public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; - } - - public ExchangeFiltersInner avgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - return this; - } - - /** - * Get avgPriceMins - * - * @return avgPriceMins - */ - @jakarta.annotation.Nullable - public Long getAvgPriceMins() { - return avgPriceMins; - } - - public void setAvgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - } - - public ExchangeFiltersInner bidMultiplierUp( - @jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; - return this; - } - - /** - * Get bidMultiplierUp - * - * @return bidMultiplierUp - */ - @jakarta.annotation.Nullable - public String getBidMultiplierUp() { - return bidMultiplierUp; - } - - public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; - } - - public ExchangeFiltersInner bidMultiplierDown( - @jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; - return this; - } - - /** - * Get bidMultiplierDown - * - * @return bidMultiplierDown - */ - @jakarta.annotation.Nullable - public String getBidMultiplierDown() { - return bidMultiplierDown; - } - - public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; - } - - public ExchangeFiltersInner askMultiplierUp( - @jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; - return this; - } - - /** - * Get askMultiplierUp - * - * @return askMultiplierUp - */ - @jakarta.annotation.Nullable - public String getAskMultiplierUp() { - return askMultiplierUp; - } - - public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; - } - - public ExchangeFiltersInner askMultiplierDown( - @jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; - return this; - } - - /** - * Get askMultiplierDown - * - * @return askMultiplierDown - */ - @jakarta.annotation.Nullable - public String getAskMultiplierDown() { - return askMultiplierDown; - } - - public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; - } - - public ExchangeFiltersInner minQty(@jakarta.annotation.Nullable String minQty) { - this.minQty = minQty; - return this; - } - - /** - * Get minQty - * - * @return minQty - */ - @jakarta.annotation.Nullable - public String getMinQty() { - return minQty; - } - - public void setMinQty(@jakarta.annotation.Nullable String minQty) { - this.minQty = minQty; - } - - public ExchangeFiltersInner maxQty(@jakarta.annotation.Nullable String maxQty) { - this.maxQty = maxQty; - return this; - } - - /** - * Get maxQty - * - * @return maxQty - */ - @jakarta.annotation.Nullable - public String getMaxQty() { - return maxQty; - } - - public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { - this.maxQty = maxQty; - } - - public ExchangeFiltersInner stepSize(@jakarta.annotation.Nullable String stepSize) { - this.stepSize = stepSize; - return this; - } - - /** - * Get stepSize - * - * @return stepSize - */ - @jakarta.annotation.Nullable - public String getStepSize() { - return stepSize; - } - - public void setStepSize(@jakarta.annotation.Nullable String stepSize) { - this.stepSize = stepSize; - } - - public ExchangeFiltersInner minNotional(@jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; - return this; - } - - /** - * Get minNotional - * - * @return minNotional - */ - @jakarta.annotation.Nullable - public String getMinNotional() { - return minNotional; - } - - public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; - } - - public ExchangeFiltersInner applyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - return this; - } - - /** - * Get applyToMarket - * - * @return applyToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyToMarket() { - return applyToMarket; - } - - public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - } - - public ExchangeFiltersInner applyMinToMarket( - @jakarta.annotation.Nullable Boolean applyMinToMarket) { - this.applyMinToMarket = applyMinToMarket; - return this; - } - - /** - * Get applyMinToMarket - * - * @return applyMinToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyMinToMarket() { - return applyMinToMarket; - } - - public void setApplyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { - this.applyMinToMarket = applyMinToMarket; - } - - public ExchangeFiltersInner maxNotional(@jakarta.annotation.Nullable String maxNotional) { - this.maxNotional = maxNotional; - return this; - } - - /** - * Get maxNotional - * - * @return maxNotional - */ - @jakarta.annotation.Nullable - public String getMaxNotional() { - return maxNotional; - } - - public void setMaxNotional(@jakarta.annotation.Nullable String maxNotional) { - this.maxNotional = maxNotional; - } - - public ExchangeFiltersInner applyMaxToMarket( - @jakarta.annotation.Nullable Boolean applyMaxToMarket) { - this.applyMaxToMarket = applyMaxToMarket; - return this; - } - - /** - * Get applyMaxToMarket - * - * @return applyMaxToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyMaxToMarket() { - return applyMaxToMarket; - } - - public void setApplyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { - this.applyMaxToMarket = applyMaxToMarket; - } - - public ExchangeFiltersInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public ExchangeFiltersInner maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; - return this; - } - - /** - * Get maxNumOrders - * - * @return maxNumOrders - */ - @jakarta.annotation.Nullable - public Long getMaxNumOrders() { - return maxNumOrders; - } - - public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; - } - - public ExchangeFiltersInner maxNumAlgoOrders( - @jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; - return this; - } - - /** - * Get maxNumAlgoOrders - * - * @return maxNumAlgoOrders - */ - @jakarta.annotation.Nullable - public Long getMaxNumAlgoOrders() { - return maxNumAlgoOrders; - } - - public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; - } - - public ExchangeFiltersInner maxNumIcebergOrders( - @jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; - return this; - } - - /** - * Get maxNumIcebergOrders - * - * @return maxNumIcebergOrders - */ - @jakarta.annotation.Nullable - public Long getMaxNumIcebergOrders() { - return maxNumIcebergOrders; - } - - public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; - } - - public ExchangeFiltersInner maxPosition(@jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; - return this; - } - - /** - * Get maxPosition - * - * @return maxPosition - */ - @jakarta.annotation.Nullable - public String getMaxPosition() { - return maxPosition; - } - - public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; - } - - public ExchangeFiltersInner minTrailingAboveDelta( - @jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; - return this; - } - - /** - * Get minTrailingAboveDelta - * - * @return minTrailingAboveDelta - */ - @jakarta.annotation.Nullable - public Long getMinTrailingAboveDelta() { - return minTrailingAboveDelta; - } - - public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; - } - - public ExchangeFiltersInner maxTrailingAboveDelta( - @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; - return this; - } - - /** - * Get maxTrailingAboveDelta - * - * @return maxTrailingAboveDelta - */ - @jakarta.annotation.Nullable - public Long getMaxTrailingAboveDelta() { - return maxTrailingAboveDelta; - } - - public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; - } - - public ExchangeFiltersInner minTrailingBelowDelta( - @jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; - return this; - } - - /** - * Get minTrailingBelowDelta - * - * @return minTrailingBelowDelta - */ - @jakarta.annotation.Nullable - public Long getMinTrailingBelowDelta() { - return minTrailingBelowDelta; - } - - public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; - } - - public ExchangeFiltersInner maxTrailingBelowDelta( - @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - this.maxTrailingBelowDelta = maxTrailingBelowDelta; - return this; - } - - /** - * Get maxTrailingBelowDelta - * - * @return maxTrailingBelowDelta - */ - @jakarta.annotation.Nullable - public Long getMaxTrailingBelowDelta() { - return maxTrailingBelowDelta; - } - - public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - 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) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExchangeFiltersInner exchangeFiltersInner = (ExchangeFiltersInner) o; - return Objects.equals(this.filterType, exchangeFiltersInner.filterType) - && Objects.equals(this.minPrice, exchangeFiltersInner.minPrice) - && Objects.equals(this.maxPrice, exchangeFiltersInner.maxPrice) - && Objects.equals(this.tickSize, exchangeFiltersInner.tickSize) - && Objects.equals(this.multiplierUp, exchangeFiltersInner.multiplierUp) - && Objects.equals(this.multiplierDown, exchangeFiltersInner.multiplierDown) - && Objects.equals(this.avgPriceMins, exchangeFiltersInner.avgPriceMins) - && Objects.equals(this.bidMultiplierUp, exchangeFiltersInner.bidMultiplierUp) - && Objects.equals(this.bidMultiplierDown, exchangeFiltersInner.bidMultiplierDown) - && Objects.equals(this.askMultiplierUp, exchangeFiltersInner.askMultiplierUp) - && Objects.equals(this.askMultiplierDown, exchangeFiltersInner.askMultiplierDown) - && Objects.equals(this.minQty, exchangeFiltersInner.minQty) - && Objects.equals(this.maxQty, exchangeFiltersInner.maxQty) - && Objects.equals(this.stepSize, exchangeFiltersInner.stepSize) - && Objects.equals(this.minNotional, exchangeFiltersInner.minNotional) - && Objects.equals(this.applyToMarket, exchangeFiltersInner.applyToMarket) - && Objects.equals(this.applyMinToMarket, exchangeFiltersInner.applyMinToMarket) - && Objects.equals(this.maxNotional, exchangeFiltersInner.maxNotional) - && Objects.equals(this.applyMaxToMarket, exchangeFiltersInner.applyMaxToMarket) - && Objects.equals(this.limit, exchangeFiltersInner.limit) - && Objects.equals(this.maxNumOrders, exchangeFiltersInner.maxNumOrders) - && Objects.equals(this.maxNumAlgoOrders, exchangeFiltersInner.maxNumAlgoOrders) - && Objects.equals( - this.maxNumIcebergOrders, exchangeFiltersInner.maxNumIcebergOrders) - && Objects.equals(this.maxPosition, exchangeFiltersInner.maxPosition) - && Objects.equals( - this.minTrailingAboveDelta, exchangeFiltersInner.minTrailingAboveDelta) - && Objects.equals( - this.maxTrailingAboveDelta, exchangeFiltersInner.maxTrailingAboveDelta) - && Objects.equals( - this.minTrailingBelowDelta, exchangeFiltersInner.minTrailingBelowDelta) - && Objects.equals( - this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta) - && Objects.equals(this.maxNumOrderAmends, exchangeFiltersInner.maxNumOrderAmends) - && Objects.equals(this.maxNumOrderLists, exchangeFiltersInner.maxNumOrderLists); - } - - @Override - public int hashCode() { - return Objects.hash( - filterType, - minPrice, - maxPrice, - tickSize, - multiplierUp, - multiplierDown, - avgPriceMins, - bidMultiplierUp, - bidMultiplierDown, - askMultiplierUp, - askMultiplierDown, - minQty, - maxQty, - stepSize, - minNotional, - applyToMarket, - applyMinToMarket, - maxNotional, - applyMaxToMarket, - limit, - maxNumOrders, - maxNumAlgoOrders, - maxNumIcebergOrders, - maxPosition, - minTrailingAboveDelta, - maxTrailingAboveDelta, - minTrailingBelowDelta, - maxTrailingBelowDelta, - maxNumOrderAmends, - maxNumOrderLists); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeFiltersInner {\n"); - sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); - sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); - sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); - sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); - sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); - sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); - sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); - sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); - sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); - sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); - sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); - sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); - sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); - sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); - sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); - sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); - sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); - sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); - sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); - sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); - sb.append(" maxNumIcebergOrders: ") - .append(toIndentedString(maxNumIcebergOrders)) - .append("\n"); - sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); - sb.append(" minTrailingAboveDelta: ") - .append(toIndentedString(minTrailingAboveDelta)) - .append("\n"); - sb.append(" maxTrailingAboveDelta: ") - .append(toIndentedString(maxTrailingAboveDelta)) - .append("\n"); - sb.append(" minTrailingBelowDelta: ") - .append(toIndentedString(minTrailingBelowDelta)) - .append("\n"); - 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(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object filterTypeValue = getFilterType(); - String filterTypeValueAsString = ""; - filterTypeValueAsString = filterTypeValue.toString(); - sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); - Object minPriceValue = getMinPrice(); - String minPriceValueAsString = ""; - minPriceValueAsString = minPriceValue.toString(); - sb.append("minPrice=").append(urlEncode(minPriceValueAsString)).append(""); - Object maxPriceValue = getMaxPrice(); - String maxPriceValueAsString = ""; - maxPriceValueAsString = maxPriceValue.toString(); - sb.append("maxPrice=").append(urlEncode(maxPriceValueAsString)).append(""); - Object tickSizeValue = getTickSize(); - String tickSizeValueAsString = ""; - tickSizeValueAsString = tickSizeValue.toString(); - sb.append("tickSize=").append(urlEncode(tickSizeValueAsString)).append(""); - Object multiplierUpValue = getMultiplierUp(); - String multiplierUpValueAsString = ""; - multiplierUpValueAsString = multiplierUpValue.toString(); - sb.append("multiplierUp=").append(urlEncode(multiplierUpValueAsString)).append(""); - Object multiplierDownValue = getMultiplierDown(); - String multiplierDownValueAsString = ""; - multiplierDownValueAsString = multiplierDownValue.toString(); - sb.append("multiplierDown=").append(urlEncode(multiplierDownValueAsString)).append(""); - Object avgPriceMinsValue = getAvgPriceMins(); - String avgPriceMinsValueAsString = ""; - avgPriceMinsValueAsString = avgPriceMinsValue.toString(); - sb.append("avgPriceMins=").append(urlEncode(avgPriceMinsValueAsString)).append(""); - Object bidMultiplierUpValue = getBidMultiplierUp(); - String bidMultiplierUpValueAsString = ""; - bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); - sb.append("bidMultiplierUp=").append(urlEncode(bidMultiplierUpValueAsString)).append(""); - Object bidMultiplierDownValue = getBidMultiplierDown(); - String bidMultiplierDownValueAsString = ""; - bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); - sb.append("bidMultiplierDown=") - .append(urlEncode(bidMultiplierDownValueAsString)) - .append(""); - Object askMultiplierUpValue = getAskMultiplierUp(); - String askMultiplierUpValueAsString = ""; - askMultiplierUpValueAsString = askMultiplierUpValue.toString(); - sb.append("askMultiplierUp=").append(urlEncode(askMultiplierUpValueAsString)).append(""); - Object askMultiplierDownValue = getAskMultiplierDown(); - String askMultiplierDownValueAsString = ""; - askMultiplierDownValueAsString = askMultiplierDownValue.toString(); - sb.append("askMultiplierDown=") - .append(urlEncode(askMultiplierDownValueAsString)) - .append(""); - Object minQtyValue = getMinQty(); - String minQtyValueAsString = ""; - minQtyValueAsString = minQtyValue.toString(); - sb.append("minQty=").append(urlEncode(minQtyValueAsString)).append(""); - Object maxQtyValue = getMaxQty(); - String maxQtyValueAsString = ""; - maxQtyValueAsString = maxQtyValue.toString(); - sb.append("maxQty=").append(urlEncode(maxQtyValueAsString)).append(""); - Object stepSizeValue = getStepSize(); - String stepSizeValueAsString = ""; - stepSizeValueAsString = stepSizeValue.toString(); - sb.append("stepSize=").append(urlEncode(stepSizeValueAsString)).append(""); - Object minNotionalValue = getMinNotional(); - String minNotionalValueAsString = ""; - minNotionalValueAsString = minNotionalValue.toString(); - sb.append("minNotional=").append(urlEncode(minNotionalValueAsString)).append(""); - Object applyToMarketValue = getApplyToMarket(); - String applyToMarketValueAsString = ""; - applyToMarketValueAsString = applyToMarketValue.toString(); - sb.append("applyToMarket=").append(urlEncode(applyToMarketValueAsString)).append(""); - Object applyMinToMarketValue = getApplyMinToMarket(); - String applyMinToMarketValueAsString = ""; - applyMinToMarketValueAsString = applyMinToMarketValue.toString(); - sb.append("applyMinToMarket=").append(urlEncode(applyMinToMarketValueAsString)).append(""); - Object maxNotionalValue = getMaxNotional(); - String maxNotionalValueAsString = ""; - maxNotionalValueAsString = maxNotionalValue.toString(); - sb.append("maxNotional=").append(urlEncode(maxNotionalValueAsString)).append(""); - Object applyMaxToMarketValue = getApplyMaxToMarket(); - String applyMaxToMarketValueAsString = ""; - applyMaxToMarketValueAsString = applyMaxToMarketValue.toString(); - sb.append("applyMaxToMarket=").append(urlEncode(applyMaxToMarketValueAsString)).append(""); - Object limitValue = getLimit(); - String limitValueAsString = ""; - limitValueAsString = limitValue.toString(); - sb.append("limit=").append(urlEncode(limitValueAsString)).append(""); - Object maxNumOrdersValue = getMaxNumOrders(); - String maxNumOrdersValueAsString = ""; - maxNumOrdersValueAsString = maxNumOrdersValue.toString(); - sb.append("maxNumOrders=").append(urlEncode(maxNumOrdersValueAsString)).append(""); - Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); - String maxNumAlgoOrdersValueAsString = ""; - maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); - sb.append("maxNumAlgoOrders=").append(urlEncode(maxNumAlgoOrdersValueAsString)).append(""); - Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); - String maxNumIcebergOrdersValueAsString = ""; - maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); - sb.append("maxNumIcebergOrders=") - .append(urlEncode(maxNumIcebergOrdersValueAsString)) - .append(""); - Object maxPositionValue = getMaxPosition(); - String maxPositionValueAsString = ""; - maxPositionValueAsString = maxPositionValue.toString(); - sb.append("maxPosition=").append(urlEncode(maxPositionValueAsString)).append(""); - Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); - String minTrailingAboveDeltaValueAsString = ""; - minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); - sb.append("minTrailingAboveDelta=") - .append(urlEncode(minTrailingAboveDeltaValueAsString)) - .append(""); - Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); - String maxTrailingAboveDeltaValueAsString = ""; - maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); - sb.append("maxTrailingAboveDelta=") - .append(urlEncode(maxTrailingAboveDeltaValueAsString)) - .append(""); - Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); - String minTrailingBelowDeltaValueAsString = ""; - minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); - sb.append("minTrailingBelowDelta=") - .append(urlEncode(minTrailingBelowDeltaValueAsString)) - .append(""); - Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); - String maxTrailingBelowDeltaValueAsString = ""; - maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); - 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(); - } - - 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("filterType"); - openapiFields.add("minPrice"); - openapiFields.add("maxPrice"); - openapiFields.add("tickSize"); - openapiFields.add("multiplierUp"); - openapiFields.add("multiplierDown"); - openapiFields.add("avgPriceMins"); - openapiFields.add("bidMultiplierUp"); - openapiFields.add("bidMultiplierDown"); - openapiFields.add("askMultiplierUp"); - openapiFields.add("askMultiplierDown"); - openapiFields.add("minQty"); - openapiFields.add("maxQty"); - openapiFields.add("stepSize"); - openapiFields.add("minNotional"); - openapiFields.add("applyToMarket"); - openapiFields.add("applyMinToMarket"); - openapiFields.add("maxNotional"); - openapiFields.add("applyMaxToMarket"); - openapiFields.add("limit"); - openapiFields.add("maxNumOrders"); - openapiFields.add("maxNumAlgoOrders"); - openapiFields.add("maxNumIcebergOrders"); - openapiFields.add("maxPosition"); - openapiFields.add("minTrailingAboveDelta"); - 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(); - } - - /** - * 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 ExchangeFiltersInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExchangeFiltersInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExchangeFiltersInner is not found in" - + " the empty JSON string", - ExchangeFiltersInner.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) - && !jsonObj.get("filterType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("filterType").toString())); - } - if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) - && !jsonObj.get("minPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("minPrice").toString())); - } - if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) - && !jsonObj.get("maxPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("maxPrice").toString())); - } - if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) - && !jsonObj.get("tickSize").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `tickSize` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("tickSize").toString())); - } - if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) - && !jsonObj.get("multiplierUp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `multiplierUp` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("multiplierUp").toString())); - } - if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) - && !jsonObj.get("multiplierDown").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `multiplierDown` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("multiplierDown").toString())); - } - if ((jsonObj.get("bidMultiplierUp") != null && !jsonObj.get("bidMultiplierUp").isJsonNull()) - && !jsonObj.get("bidMultiplierUp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bidMultiplierUp` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("bidMultiplierUp").toString())); - } - if ((jsonObj.get("bidMultiplierDown") != null - && !jsonObj.get("bidMultiplierDown").isJsonNull()) - && !jsonObj.get("bidMultiplierDown").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bidMultiplierDown` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("bidMultiplierDown").toString())); - } - if ((jsonObj.get("askMultiplierUp") != null && !jsonObj.get("askMultiplierUp").isJsonNull()) - && !jsonObj.get("askMultiplierUp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `askMultiplierUp` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("askMultiplierUp").toString())); - } - if ((jsonObj.get("askMultiplierDown") != null - && !jsonObj.get("askMultiplierDown").isJsonNull()) - && !jsonObj.get("askMultiplierDown").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `askMultiplierDown` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("askMultiplierDown").toString())); - } - if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) - && !jsonObj.get("minQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("minQty").toString())); - } - if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) - && !jsonObj.get("maxQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("maxQty").toString())); - } - if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) - && !jsonObj.get("stepSize").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `stepSize` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("stepSize").toString())); - } - if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) - && !jsonObj.get("minNotional").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minNotional` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("minNotional").toString())); - } - if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) - && !jsonObj.get("maxNotional").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxNotional` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("maxNotional").toString())); - } - if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) - && !jsonObj.get("maxPosition").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxPosition` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("maxPosition").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeFiltersInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExchangeFiltersInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExchangeFiltersInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExchangeFiltersInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ExchangeFiltersInner read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ExchangeFiltersInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExchangeFiltersInner - * @throws IOException if the JSON string is invalid with respect to ExchangeFiltersInner - */ - public static ExchangeFiltersInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExchangeFiltersInner.class); - } - - /** - * Convert an instance of ExchangeFiltersInner 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/ExchangeInfoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponse.java index e4b8d60ed..6e8da2e53 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponse.java @@ -58,13 +58,13 @@ public class ExchangeInfoResponse { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public static final String SERIALIZED_NAME_EXCHANGE_FILTERS = "exchangeFilters"; @SerializedName(SERIALIZED_NAME_EXCHANGE_FILTERS) @jakarta.annotation.Nullable - private ExchangeFilters exchangeFilters; + private List exchangeFilters; public static final String SERIALIZED_NAME_SYMBOLS = "symbols"; @@ -112,11 +112,20 @@ public void setServerTime(@jakarta.annotation.Nullable Long serverTime) { this.serverTime = serverTime; } - public ExchangeInfoResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public ExchangeInfoResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public ExchangeInfoResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -124,20 +133,28 @@ public ExchangeInfoResponse rateLimits(@jakarta.annotation.Nullable RateLimits r */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } public ExchangeInfoResponse exchangeFilters( - @jakarta.annotation.Nullable ExchangeFilters exchangeFilters) { + @jakarta.annotation.Nullable List exchangeFilters) { this.exchangeFilters = exchangeFilters; return this; } + public ExchangeInfoResponse addExchangeFiltersItem(ExchangeFilters exchangeFiltersItem) { + if (this.exchangeFilters == null) { + this.exchangeFilters = new ArrayList<>(); + } + this.exchangeFilters.add(exchangeFiltersItem); + return this; + } + /** * Get exchangeFilters * @@ -145,11 +162,12 @@ public ExchangeInfoResponse exchangeFilters( */ @jakarta.annotation.Nullable @Valid - public ExchangeFilters getExchangeFilters() { + public List getExchangeFilters() { return exchangeFilters; } - public void setExchangeFilters(@jakarta.annotation.Nullable ExchangeFilters exchangeFilters) { + public void setExchangeFilters( + @jakarta.annotation.Nullable List exchangeFilters) { this.exchangeFilters = exchangeFilters; } @@ -230,11 +248,17 @@ public String toUrlQueryString() { sb.append("serverTime=").append(urlEncode(serverTimeValueAsString)).append(""); Object rateLimitsValue = getRateLimits(); String rateLimitsValueAsString = ""; - rateLimitsValueAsString = rateLimitsValue.toString(); + rateLimitsValueAsString = + (String) + ((Collection) rateLimitsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); sb.append("rateLimits=").append(urlEncode(rateLimitsValueAsString)).append(""); Object exchangeFiltersValue = getExchangeFilters(); String exchangeFiltersValueAsString = ""; - exchangeFiltersValueAsString = exchangeFiltersValue.toString(); + exchangeFiltersValueAsString = + (String) + ((Collection) exchangeFiltersValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); sb.append("exchangeFilters=").append(urlEncode(exchangeFiltersValueAsString)).append(""); Object symbolsValue = getSymbols(); String symbolsValueAsString = ""; @@ -307,6 +331,45 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("timezone").toString())); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } + if (jsonObj.get("exchangeFilters") != null + && !jsonObj.get("exchangeFilters").isJsonNull()) { + JsonArray jsonArrayexchangeFilters = jsonObj.getAsJsonArray("exchangeFilters"); + if (jsonArrayexchangeFilters != null) { + // ensure the json data is an array + if (!jsonObj.get("exchangeFilters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `exchangeFilters` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("exchangeFilters").toString())); + } + + // validate the optional field `exchangeFilters` (array) + for (int i = 0; i < jsonArrayexchangeFilters.size(); i++) { + ExchangeFilters.validateJsonElement(jsonArrayexchangeFilters.get(i)); + } + ; + } + } if (jsonObj.get("symbols") != null && !jsonObj.get("symbols").isJsonNull()) { JsonArray jsonArraysymbols = jsonObj.getAsJsonArray("symbols"); if (jsonArraysymbols != null) { 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 c78db1f28..fc7c7bba3 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 @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.rest.JSON; import com.google.gson.Gson; +import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -168,7 +169,7 @@ public class ExchangeInfoResponseSymbolsInner { @SerializedName(SERIALIZED_NAME_FILTERS) @jakarta.annotation.Nullable - private ExchangeFilters filters; + private List filters; public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @@ -610,11 +611,19 @@ public void setIsMarginTradingAllowed( } public ExchangeInfoResponseSymbolsInner filters( - @jakarta.annotation.Nullable ExchangeFilters filters) { + @jakarta.annotation.Nullable List filters) { this.filters = filters; return this; } + public ExchangeInfoResponseSymbolsInner addFiltersItem(SymbolFilters filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + /** * Get filters * @@ -622,11 +631,11 @@ public ExchangeInfoResponseSymbolsInner filters( */ @jakarta.annotation.Nullable @Valid - public ExchangeFilters getFilters() { + public List getFilters() { return filters; } - public void setFilters(@jakarta.annotation.Nullable ExchangeFilters filters) { + public void setFilters(@jakarta.annotation.Nullable List filters) { this.filters = filters; } @@ -994,7 +1003,10 @@ public String toUrlQueryString() { .append(""); Object filtersValue = getFilters(); String filtersValueAsString = ""; - filtersValueAsString = filtersValue.toString(); + filtersValueAsString = + (String) + ((Collection) filtersValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); sb.append("filters=").append(urlEncode(filtersValueAsString)).append(""); Object permissionsValue = getPermissions(); String permissionsValueAsString = ""; @@ -1145,6 +1157,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("orderTypes").toString())); } + if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { + JsonArray jsonArrayfilters = jsonObj.getAsJsonArray("filters"); + if (jsonArrayfilters != null) { + // ensure the json data is an array + if (!jsonObj.get("filters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filters` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("filters").toString())); + } + + // validate the optional field `filters` (array) + for (int i = 0; i < jsonArrayfilters.size(); i++) { + SymbolFilters.validateJsonElement(jsonArrayfilters.get(i)); + } + ; + } + } // ensure the optional json data is an array if present if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull() diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanCreationResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumAlgoOrdersFilter.java similarity index 50% rename from clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanCreationResponse.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumAlgoOrdersFilter.java index e0d24b0b2..8a670dd08 100644 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/InvestmentPlanCreationResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumAlgoOrdersFilter.java @@ -1,6 +1,6 @@ /* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API + * 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 * @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package com.binance.connector.client.auto_invest.rest.model; +package com.binance.connector.client.spot.rest.model; -import com.binance.connector.client.auto_invest.rest.JSON; +import com.binance.connector.client.spot.rest.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -28,67 +28,66 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; -/** InvestmentPlanCreationResponse */ +/** ExchangeMaxNumAlgoOrdersFilter */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class InvestmentPlanCreationResponse { - public static final String SERIALIZED_NAME_PLAN_ID = "planId"; +public class ExchangeMaxNumAlgoOrdersFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; - @SerializedName(SERIALIZED_NAME_PLAN_ID) + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) @jakarta.annotation.Nullable - private Long planId; + private String filterType; - public static final String SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME = "nextExecutionDateTime"; + public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; - @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION_DATE_TIME) + @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) @jakarta.annotation.Nullable - private Long nextExecutionDateTime; + private Long maxNumAlgoOrders; - public InvestmentPlanCreationResponse() {} + public ExchangeMaxNumAlgoOrdersFilter() {} - public InvestmentPlanCreationResponse planId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; + public ExchangeMaxNumAlgoOrdersFilter filterType( + @jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; return this; } /** - * Get planId + * Get filterType * - * @return planId + * @return filterType */ @jakarta.annotation.Nullable - public Long getPlanId() { - return planId; + public String getFilterType() { + return filterType; } - public void setPlanId(@jakarta.annotation.Nullable Long planId) { - this.planId = planId; + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; } - public InvestmentPlanCreationResponse nextExecutionDateTime( - @jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; + public ExchangeMaxNumAlgoOrdersFilter maxNumAlgoOrders( + @jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; return this; } /** - * Get nextExecutionDateTime + * Get maxNumAlgoOrders * - * @return nextExecutionDateTime + * @return maxNumAlgoOrders */ @jakarta.annotation.Nullable - public Long getNextExecutionDateTime() { - return nextExecutionDateTime; + public Long getMaxNumAlgoOrders() { + return maxNumAlgoOrders; } - public void setNextExecutionDateTime(@jakarta.annotation.Nullable Long nextExecutionDateTime) { - this.nextExecutionDateTime = nextExecutionDateTime; + public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; } @Override @@ -99,27 +98,24 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - InvestmentPlanCreationResponse investmentPlanCreationResponse = - (InvestmentPlanCreationResponse) o; - return Objects.equals(this.planId, investmentPlanCreationResponse.planId) + ExchangeMaxNumAlgoOrdersFilter exchangeMaxNumAlgoOrdersFilter = + (ExchangeMaxNumAlgoOrdersFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumAlgoOrdersFilter.filterType) && Objects.equals( - this.nextExecutionDateTime, - investmentPlanCreationResponse.nextExecutionDateTime); + this.maxNumAlgoOrders, exchangeMaxNumAlgoOrdersFilter.maxNumAlgoOrders); } @Override public int hashCode() { - return Objects.hash(planId, nextExecutionDateTime); + return Objects.hash(filterType, maxNumAlgoOrders); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class InvestmentPlanCreationResponse {\n"); - sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); - sb.append(" nextExecutionDateTime: ") - .append(toIndentedString(nextExecutionDateTime)) - .append("\n"); + sb.append("class ExchangeMaxNumAlgoOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); sb.append("}"); return sb.toString(); } @@ -127,16 +123,14 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object planIdValue = getPlanId(); - String planIdValueAsString = ""; - planIdValueAsString = planIdValue.toString(); - sb.append("planId=").append(urlEncode(planIdValueAsString)).append(""); - Object nextExecutionDateTimeValue = getNextExecutionDateTime(); - String nextExecutionDateTimeValueAsString = ""; - nextExecutionDateTimeValueAsString = nextExecutionDateTimeValue.toString(); - sb.append("nextExecutionDateTime=") - .append(urlEncode(nextExecutionDateTimeValueAsString)) - .append(""); + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + String maxNumAlgoOrdersValueAsString = ""; + maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); + sb.append("maxNumAlgoOrders=").append(urlEncode(maxNumAlgoOrdersValueAsString)).append(""); return sb.toString(); } @@ -165,8 +159,8 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("planId"); - openapiFields.add("nextExecutionDateTime"); + openapiFields.add("filterType"); + openapiFields.add("maxNumAlgoOrders"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -177,58 +171,54 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * InvestmentPlanCreationResponse + * ExchangeMaxNumAlgoOrdersFilter */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!InvestmentPlanCreationResponse.openapiRequiredFields + if (!ExchangeMaxNumAlgoOrdersFilter.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in InvestmentPlanCreationResponse is not" + "The required field(s) %s in ExchangeMaxNumAlgoOrdersFilter is not" + " found in the empty JSON string", - InvestmentPlanCreationResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!InvestmentPlanCreationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `InvestmentPlanCreationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); + ExchangeMaxNumAlgoOrdersFilter.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!InvestmentPlanCreationResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InvestmentPlanCreationResponse' and its + if (!ExchangeMaxNumAlgoOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumAlgoOrdersFilter' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(InvestmentPlanCreationResponse.class)); + this, TypeToken.get(ExchangeMaxNumAlgoOrdersFilter.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, InvestmentPlanCreationResponse value) + public void write(JsonWriter out, ExchangeMaxNumAlgoOrdersFilter value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public InvestmentPlanCreationResponse read(JsonReader in) + public ExchangeMaxNumAlgoOrdersFilter read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -239,19 +229,19 @@ public InvestmentPlanCreationResponse read(JsonReader in) } /** - * Create an instance of InvestmentPlanCreationResponse given an JSON string + * Create an instance of ExchangeMaxNumAlgoOrdersFilter given an JSON string * * @param jsonString JSON string - * @return An instance of InvestmentPlanCreationResponse + * @return An instance of ExchangeMaxNumAlgoOrdersFilter * @throws IOException if the JSON string is invalid with respect to - * InvestmentPlanCreationResponse + * ExchangeMaxNumAlgoOrdersFilter */ - public static InvestmentPlanCreationResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InvestmentPlanCreationResponse.class); + public static ExchangeMaxNumAlgoOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumAlgoOrdersFilter.class); } /** - * Convert an instance of InvestmentPlanCreationResponse to an JSON string + * Convert an instance of ExchangeMaxNumAlgoOrdersFilter to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumIcebergOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumIcebergOrdersFilter.java new file mode 100644 index 000000000..0a30f8897 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumIcebergOrdersFilter.java @@ -0,0 +1,257 @@ +/* + * 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.*; + +/** ExchangeMaxNumIcebergOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumIcebergOrdersFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumIcebergOrders; + + public ExchangeMaxNumIcebergOrdersFilter() {} + + public ExchangeMaxNumIcebergOrdersFilter filterType( + @jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumIcebergOrdersFilter maxNumIcebergOrders( + @jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + return this; + } + + /** + * Get maxNumIcebergOrders + * + * @return maxNumIcebergOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumIcebergOrders() { + return maxNumIcebergOrders; + } + + public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumIcebergOrdersFilter exchangeMaxNumIcebergOrdersFilter = + (ExchangeMaxNumIcebergOrdersFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumIcebergOrdersFilter.filterType) + && Objects.equals( + this.maxNumIcebergOrders, + exchangeMaxNumIcebergOrdersFilter.maxNumIcebergOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumIcebergOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumIcebergOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumIcebergOrders: ") + .append(toIndentedString(maxNumIcebergOrders)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + String maxNumIcebergOrdersValueAsString = ""; + maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); + sb.append("maxNumIcebergOrders=") + .append(urlEncode(maxNumIcebergOrdersValueAsString)) + .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("filterType"); + openapiFields.add("maxNumIcebergOrders"); + + // 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 + * ExchangeMaxNumIcebergOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumIcebergOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumIcebergOrdersFilter is" + + " not found in the empty JSON string", + ExchangeMaxNumIcebergOrdersFilter.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumIcebergOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumIcebergOrdersFilter' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumIcebergOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumIcebergOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumIcebergOrdersFilter read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumIcebergOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumIcebergOrdersFilter + * @throws IOException if the JSON string is invalid with respect to + * ExchangeMaxNumIcebergOrdersFilter + */ + public static ExchangeMaxNumIcebergOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumIcebergOrdersFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumIcebergOrdersFilter 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/ExchangeMaxNumOrderListsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumOrderListsFilter.java new file mode 100644 index 000000000..8b18465e8 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumOrderListsFilter.java @@ -0,0 +1,251 @@ +/* + * 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.*; + +/** ExchangeMaxNumOrderListsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumOrderListsFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + 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 ExchangeMaxNumOrderListsFilter() {} + + public ExchangeMaxNumOrderListsFilter filterType( + @jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumOrderListsFilter 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumOrderListsFilter exchangeMaxNumOrderListsFilter = + (ExchangeMaxNumOrderListsFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumOrderListsFilter.filterType) + && Objects.equals( + this.maxNumOrderLists, exchangeMaxNumOrderListsFilter.maxNumOrderLists); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrderLists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumOrderListsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrderLists: ").append(toIndentedString(maxNumOrderLists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object maxNumOrderListsValue = getMaxNumOrderLists(); + String maxNumOrderListsValueAsString = ""; + maxNumOrderListsValueAsString = maxNumOrderListsValue.toString(); + sb.append("maxNumOrderLists=").append(urlEncode(maxNumOrderListsValueAsString)).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("filterType"); + openapiFields.add("maxNumOrderLists"); + + // 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 + * ExchangeMaxNumOrderListsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumOrderListsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumOrderListsFilter is not" + + " found in the empty JSON string", + ExchangeMaxNumOrderListsFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumOrderListsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumOrderListsFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumOrderListsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumOrderListsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumOrderListsFilter read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumOrderListsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumOrderListsFilter + * @throws IOException if the JSON string is invalid with respect to + * ExchangeMaxNumOrderListsFilter + */ + public static ExchangeMaxNumOrderListsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumOrderListsFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumOrderListsFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/OneTimeTransactionResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumOrdersFilter.java similarity index 51% rename from clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/OneTimeTransactionResponse.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumOrdersFilter.java index 6dd3feeb4..fe973789e 100644 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/OneTimeTransactionResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeMaxNumOrdersFilter.java @@ -1,6 +1,6 @@ /* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API + * 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 * @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package com.binance.connector.client.auto_invest.rest.model; +package com.binance.connector.client.spot.rest.model; -import com.binance.connector.client.auto_invest.rest.JSON; +import com.binance.connector.client.spot.rest.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -28,67 +28,64 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; -/** OneTimeTransactionResponse */ +/** ExchangeMaxNumOrdersFilter */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class OneTimeTransactionResponse { - public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; +public class ExchangeMaxNumOrdersFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; - @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) @jakarta.annotation.Nullable - private Long transactionId; + private String filterType; - public static final String SERIALIZED_NAME_WAIT_SECOND = "waitSecond"; + public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; - @SerializedName(SERIALIZED_NAME_WAIT_SECOND) + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) @jakarta.annotation.Nullable - private Long waitSecond; + private Long maxNumOrders; - public OneTimeTransactionResponse() {} + public ExchangeMaxNumOrdersFilter() {} - public OneTimeTransactionResponse transactionId( - @jakarta.annotation.Nullable Long transactionId) { - this.transactionId = transactionId; + public ExchangeMaxNumOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; return this; } /** - * Get transactionId + * Get filterType * - * @return transactionId + * @return filterType */ @jakarta.annotation.Nullable - public Long getTransactionId() { - return transactionId; + public String getFilterType() { + return filterType; } - public void setTransactionId(@jakarta.annotation.Nullable Long transactionId) { - this.transactionId = transactionId; + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; } - public OneTimeTransactionResponse waitSecond(@jakarta.annotation.Nullable Long waitSecond) { - this.waitSecond = waitSecond; + public ExchangeMaxNumOrdersFilter maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; return this; } /** - * Get waitSecond + * Get maxNumOrders * - * @return waitSecond + * @return maxNumOrders */ @jakarta.annotation.Nullable - public Long getWaitSecond() { - return waitSecond; + public Long getMaxNumOrders() { + return maxNumOrders; } - public void setWaitSecond(@jakarta.annotation.Nullable Long waitSecond) { - this.waitSecond = waitSecond; + public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; } @Override @@ -99,22 +96,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - OneTimeTransactionResponse oneTimeTransactionResponse = (OneTimeTransactionResponse) o; - return Objects.equals(this.transactionId, oneTimeTransactionResponse.transactionId) - && Objects.equals(this.waitSecond, oneTimeTransactionResponse.waitSecond); + ExchangeMaxNumOrdersFilter exchangeMaxNumOrdersFilter = (ExchangeMaxNumOrdersFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumOrdersFilter.filterType) + && Objects.equals(this.maxNumOrders, exchangeMaxNumOrdersFilter.maxNumOrders); } @Override public int hashCode() { - return Objects.hash(transactionId, waitSecond); + return Objects.hash(filterType, maxNumOrders); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class OneTimeTransactionResponse {\n"); - sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); - sb.append(" waitSecond: ").append(toIndentedString(waitSecond)).append("\n"); + sb.append("class ExchangeMaxNumOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); sb.append("}"); return sb.toString(); } @@ -122,14 +119,14 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object transactionIdValue = getTransactionId(); - String transactionIdValueAsString = ""; - transactionIdValueAsString = transactionIdValue.toString(); - sb.append("transactionId=").append(urlEncode(transactionIdValueAsString)).append(""); - Object waitSecondValue = getWaitSecond(); - String waitSecondValueAsString = ""; - waitSecondValueAsString = waitSecondValue.toString(); - sb.append("waitSecond=").append(urlEncode(waitSecondValueAsString)).append(""); + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object maxNumOrdersValue = getMaxNumOrders(); + String maxNumOrdersValueAsString = ""; + maxNumOrdersValueAsString = maxNumOrdersValue.toString(); + sb.append("maxNumOrders=").append(urlEncode(maxNumOrdersValueAsString)).append(""); return sb.toString(); } @@ -158,8 +155,8 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("transactionId"); - openapiFields.add("waitSecond"); + openapiFields.add("filterType"); + openapiFields.add("maxNumOrders"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -169,57 +166,53 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OneTimeTransactionResponse + * @throws IOException if the JSON Element is invalid with respect to ExchangeMaxNumOrdersFilter */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!OneTimeTransactionResponse.openapiRequiredFields + if (!ExchangeMaxNumOrdersFilter.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in OneTimeTransactionResponse is not" + "The required field(s) %s in ExchangeMaxNumOrdersFilter is not" + " found in the empty JSON string", - OneTimeTransactionResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OneTimeTransactionResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OneTimeTransactionResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); + ExchangeMaxNumOrdersFilter.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!OneTimeTransactionResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OneTimeTransactionResponse' and its + if (!ExchangeMaxNumOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumOrdersFilter' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(OneTimeTransactionResponse.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeMaxNumOrdersFilter.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, OneTimeTransactionResponse value) + public void write(JsonWriter out, ExchangeMaxNumOrdersFilter value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public OneTimeTransactionResponse read(JsonReader in) throws IOException { + public ExchangeMaxNumOrdersFilter read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -229,18 +222,18 @@ public OneTimeTransactionResponse read(JsonReader in) throws IOException { } /** - * Create an instance of OneTimeTransactionResponse given an JSON string + * Create an instance of ExchangeMaxNumOrdersFilter given an JSON string * * @param jsonString JSON string - * @return An instance of OneTimeTransactionResponse - * @throws IOException if the JSON string is invalid with respect to OneTimeTransactionResponse + * @return An instance of ExchangeMaxNumOrdersFilter + * @throws IOException if the JSON string is invalid with respect to ExchangeMaxNumOrdersFilter */ - public static OneTimeTransactionResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OneTimeTransactionResponse.class); + public static ExchangeMaxNumOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumOrdersFilter.class); } /** - * Convert an instance of OneTimeTransactionResponse to an JSON string + * Convert an instance of ExchangeMaxNumOrdersFilter to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/IcebergPartsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/IcebergPartsFilter.java new file mode 100644 index 000000000..6d36eeaf3 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/IcebergPartsFilter.java @@ -0,0 +1,242 @@ +/* + * 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.*; + +/** IcebergPartsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class IcebergPartsFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @jakarta.annotation.Nullable + private Long limit; + + public IcebergPartsFilter() {} + + public IcebergPartsFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public IcebergPartsFilter limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @jakarta.annotation.Nullable + public Long getLimit() { + return limit; + } + + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IcebergPartsFilter icebergPartsFilter = (IcebergPartsFilter) o; + return Objects.equals(this.filterType, icebergPartsFilter.filterType) + && Objects.equals(this.limit, icebergPartsFilter.limit); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IcebergPartsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object limitValue = getLimit(); + String limitValueAsString = ""; + limitValueAsString = limitValue.toString(); + sb.append("limit=").append(urlEncode(limitValueAsString)).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("filterType"); + openapiFields.add("limit"); + + // 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 IcebergPartsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IcebergPartsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in IcebergPartsFilter is not found in the" + + " empty JSON string", + IcebergPartsFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IcebergPartsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IcebergPartsFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(IcebergPartsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, IcebergPartsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IcebergPartsFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of IcebergPartsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of IcebergPartsFilter + * @throws IOException if the JSON string is invalid with respect to IcebergPartsFilter + */ + public static IcebergPartsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IcebergPartsFilter.class); + } + + /** + * Convert an instance of IcebergPartsFilter 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/LotSizeFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/LotSizeFilter.java new file mode 100644 index 000000000..ee76642bb --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/LotSizeFilter.java @@ -0,0 +1,361 @@ +/* + * 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.*; + +/** LotSizeFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class LotSizeFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; + + @SerializedName(SERIALIZED_NAME_MIN_QTY) + @jakarta.annotation.Nullable + private String minQty; + + public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; + + @SerializedName(SERIALIZED_NAME_MAX_QTY) + @jakarta.annotation.Nullable + private String maxQty; + + public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; + + @SerializedName(SERIALIZED_NAME_STEP_SIZE) + @jakarta.annotation.Nullable + private String stepSize; + + public LotSizeFilter() {} + + public LotSizeFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public LotSizeFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public LotSizeFilter minQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + return this; + } + + /** + * Get minQty + * + * @return minQty + */ + @jakarta.annotation.Nullable + public String getMinQty() { + return minQty; + } + + public void setMinQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + } + + public LotSizeFilter maxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + return this; + } + + /** + * Get maxQty + * + * @return maxQty + */ + @jakarta.annotation.Nullable + public String getMaxQty() { + return maxQty; + } + + public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + } + + public LotSizeFilter stepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + return this; + } + + /** + * Get stepSize + * + * @return stepSize + */ + @jakarta.annotation.Nullable + public String getStepSize() { + return stepSize; + } + + public void setStepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LotSizeFilter lotSizeFilter = (LotSizeFilter) o; + return Objects.equals(this.filterType, lotSizeFilter.filterType) + && Objects.equals(this.qtyExponent, lotSizeFilter.qtyExponent) + && Objects.equals(this.minQty, lotSizeFilter.minQty) + && Objects.equals(this.maxQty, lotSizeFilter.maxQty) + && Objects.equals(this.stepSize, lotSizeFilter.stepSize); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, minQty, maxQty, stepSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LotSizeFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); + sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); + sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object qtyExponentValue = getQtyExponent(); + String qtyExponentValueAsString = ""; + qtyExponentValueAsString = qtyExponentValue.toString(); + sb.append("qtyExponent=").append(urlEncode(qtyExponentValueAsString)).append(""); + Object minQtyValue = getMinQty(); + String minQtyValueAsString = ""; + minQtyValueAsString = minQtyValue.toString(); + sb.append("minQty=").append(urlEncode(minQtyValueAsString)).append(""); + Object maxQtyValue = getMaxQty(); + String maxQtyValueAsString = ""; + maxQtyValueAsString = maxQtyValue.toString(); + sb.append("maxQty=").append(urlEncode(maxQtyValueAsString)).append(""); + Object stepSizeValue = getStepSize(); + String stepSizeValueAsString = ""; + stepSizeValueAsString = stepSizeValue.toString(); + sb.append("stepSize=").append(urlEncode(stepSizeValueAsString)).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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("minQty"); + openapiFields.add("maxQty"); + openapiFields.add("stepSize"); + + // 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 LotSizeFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LotSizeFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in LotSizeFilter is not found in the" + + " empty JSON string", + LotSizeFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) + && !jsonObj.get("minQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minQty").toString())); + } + if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) + && !jsonObj.get("maxQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxQty").toString())); + } + if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) + && !jsonObj.get("stepSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stepSize").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LotSizeFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LotSizeFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(LotSizeFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, LotSizeFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LotSizeFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of LotSizeFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of LotSizeFilter + * @throws IOException if the JSON string is invalid with respect to LotSizeFilter + */ + public static LotSizeFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LotSizeFilter.class); + } + + /** + * Convert an instance of LotSizeFilter 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/MarketLotSizeFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MarketLotSizeFilter.java new file mode 100644 index 000000000..748ab1a3c --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MarketLotSizeFilter.java @@ -0,0 +1,362 @@ +/* + * 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.*; + +/** MarketLotSizeFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MarketLotSizeFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; + + @SerializedName(SERIALIZED_NAME_MIN_QTY) + @jakarta.annotation.Nullable + private String minQty; + + public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; + + @SerializedName(SERIALIZED_NAME_MAX_QTY) + @jakarta.annotation.Nullable + private String maxQty; + + public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; + + @SerializedName(SERIALIZED_NAME_STEP_SIZE) + @jakarta.annotation.Nullable + private String stepSize; + + public MarketLotSizeFilter() {} + + public MarketLotSizeFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MarketLotSizeFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public MarketLotSizeFilter minQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + return this; + } + + /** + * Get minQty + * + * @return minQty + */ + @jakarta.annotation.Nullable + public String getMinQty() { + return minQty; + } + + public void setMinQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + } + + public MarketLotSizeFilter maxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + return this; + } + + /** + * Get maxQty + * + * @return maxQty + */ + @jakarta.annotation.Nullable + public String getMaxQty() { + return maxQty; + } + + public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + } + + public MarketLotSizeFilter stepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + return this; + } + + /** + * Get stepSize + * + * @return stepSize + */ + @jakarta.annotation.Nullable + public String getStepSize() { + return stepSize; + } + + public void setStepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarketLotSizeFilter marketLotSizeFilter = (MarketLotSizeFilter) o; + return Objects.equals(this.filterType, marketLotSizeFilter.filterType) + && Objects.equals(this.qtyExponent, marketLotSizeFilter.qtyExponent) + && Objects.equals(this.minQty, marketLotSizeFilter.minQty) + && Objects.equals(this.maxQty, marketLotSizeFilter.maxQty) + && Objects.equals(this.stepSize, marketLotSizeFilter.stepSize); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, minQty, maxQty, stepSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarketLotSizeFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); + sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); + sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object qtyExponentValue = getQtyExponent(); + String qtyExponentValueAsString = ""; + qtyExponentValueAsString = qtyExponentValue.toString(); + sb.append("qtyExponent=").append(urlEncode(qtyExponentValueAsString)).append(""); + Object minQtyValue = getMinQty(); + String minQtyValueAsString = ""; + minQtyValueAsString = minQtyValue.toString(); + sb.append("minQty=").append(urlEncode(minQtyValueAsString)).append(""); + Object maxQtyValue = getMaxQty(); + String maxQtyValueAsString = ""; + maxQtyValueAsString = maxQtyValue.toString(); + sb.append("maxQty=").append(urlEncode(maxQtyValueAsString)).append(""); + Object stepSizeValue = getStepSize(); + String stepSizeValueAsString = ""; + stepSizeValueAsString = stepSizeValue.toString(); + sb.append("stepSize=").append(urlEncode(stepSizeValueAsString)).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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("minQty"); + openapiFields.add("maxQty"); + openapiFields.add("stepSize"); + + // 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 MarketLotSizeFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MarketLotSizeFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MarketLotSizeFilter is not found in" + + " the empty JSON string", + MarketLotSizeFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) + && !jsonObj.get("minQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minQty").toString())); + } + if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) + && !jsonObj.get("maxQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxQty").toString())); + } + if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) + && !jsonObj.get("stepSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stepSize").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MarketLotSizeFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MarketLotSizeFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MarketLotSizeFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MarketLotSizeFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MarketLotSizeFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MarketLotSizeFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MarketLotSizeFilter + * @throws IOException if the JSON string is invalid with respect to MarketLotSizeFilter + */ + public static MarketLotSizeFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MarketLotSizeFilter.class); + } + + /** + * Convert an instance of MarketLotSizeFilter 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/MaxAssetFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxAssetFilter.java new file mode 100644 index 000000000..92f75e7cd --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxAssetFilter.java @@ -0,0 +1,321 @@ +/* + * 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.*; + +/** MaxAssetFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxAssetFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @jakarta.annotation.Nullable + private String limit; + + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nullable + private String asset; + + public MaxAssetFilter() {} + + public MaxAssetFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxAssetFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public MaxAssetFilter limit(@jakarta.annotation.Nullable String limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @jakarta.annotation.Nullable + public String getLimit() { + return limit; + } + + public void setLimit(@jakarta.annotation.Nullable String limit) { + this.limit = limit; + } + + public MaxAssetFilter asset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxAssetFilter maxAssetFilter = (MaxAssetFilter) o; + return Objects.equals(this.filterType, maxAssetFilter.filterType) + && Objects.equals(this.qtyExponent, maxAssetFilter.qtyExponent) + && Objects.equals(this.limit, maxAssetFilter.limit) + && Objects.equals(this.asset, maxAssetFilter.asset); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, limit, asset); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxAssetFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object qtyExponentValue = getQtyExponent(); + String qtyExponentValueAsString = ""; + qtyExponentValueAsString = qtyExponentValue.toString(); + sb.append("qtyExponent=").append(urlEncode(qtyExponentValueAsString)).append(""); + Object limitValue = getLimit(); + String limitValueAsString = ""; + limitValueAsString = limitValue.toString(); + sb.append("limit=").append(urlEncode(limitValueAsString)).append(""); + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("limit"); + openapiFields.add("asset"); + + // 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 MaxAssetFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxAssetFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxAssetFilter is not found in the" + + " empty JSON string", + MaxAssetFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("limit") != null && !jsonObj.get("limit").isJsonNull()) + && !jsonObj.get("limit").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `limit` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("limit").toString())); + } + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxAssetFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxAssetFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxAssetFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxAssetFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxAssetFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxAssetFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxAssetFilter + * @throws IOException if the JSON string is invalid with respect to MaxAssetFilter + */ + public static MaxAssetFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxAssetFilter.class); + } + + /** + * Convert an instance of MaxAssetFilter 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/MaxNumAlgoOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumAlgoOrdersFilter.java new file mode 100644 index 000000000..06135eef5 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumAlgoOrdersFilter.java @@ -0,0 +1,243 @@ +/* + * 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.*; + +/** MaxNumAlgoOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumAlgoOrdersFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumAlgoOrders; + + public MaxNumAlgoOrdersFilter() {} + + public MaxNumAlgoOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumAlgoOrdersFilter maxNumAlgoOrders( + @jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + return this; + } + + /** + * Get maxNumAlgoOrders + * + * @return maxNumAlgoOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumAlgoOrders() { + return maxNumAlgoOrders; + } + + public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumAlgoOrdersFilter maxNumAlgoOrdersFilter = (MaxNumAlgoOrdersFilter) o; + return Objects.equals(this.filterType, maxNumAlgoOrdersFilter.filterType) + && Objects.equals(this.maxNumAlgoOrders, maxNumAlgoOrdersFilter.maxNumAlgoOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumAlgoOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumAlgoOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + String maxNumAlgoOrdersValueAsString = ""; + maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); + sb.append("maxNumAlgoOrders=").append(urlEncode(maxNumAlgoOrdersValueAsString)).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("filterType"); + openapiFields.add("maxNumAlgoOrders"); + + // 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 MaxNumAlgoOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumAlgoOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumAlgoOrdersFilter is not found in" + + " the empty JSON string", + MaxNumAlgoOrdersFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumAlgoOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumAlgoOrdersFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumAlgoOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumAlgoOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumAlgoOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumAlgoOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumAlgoOrdersFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumAlgoOrdersFilter + */ + public static MaxNumAlgoOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumAlgoOrdersFilter.class); + } + + /** + * Convert an instance of MaxNumAlgoOrdersFilter 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/MaxNumIcebergOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumIcebergOrdersFilter.java new file mode 100644 index 000000000..5da4a5785 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumIcebergOrdersFilter.java @@ -0,0 +1,249 @@ +/* + * 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.*; + +/** MaxNumIcebergOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumIcebergOrdersFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumIcebergOrders; + + public MaxNumIcebergOrdersFilter() {} + + public MaxNumIcebergOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumIcebergOrdersFilter maxNumIcebergOrders( + @jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + return this; + } + + /** + * Get maxNumIcebergOrders + * + * @return maxNumIcebergOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumIcebergOrders() { + return maxNumIcebergOrders; + } + + public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumIcebergOrdersFilter maxNumIcebergOrdersFilter = (MaxNumIcebergOrdersFilter) o; + return Objects.equals(this.filterType, maxNumIcebergOrdersFilter.filterType) + && Objects.equals( + this.maxNumIcebergOrders, maxNumIcebergOrdersFilter.maxNumIcebergOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumIcebergOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumIcebergOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumIcebergOrders: ") + .append(toIndentedString(maxNumIcebergOrders)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + String maxNumIcebergOrdersValueAsString = ""; + maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); + sb.append("maxNumIcebergOrders=") + .append(urlEncode(maxNumIcebergOrdersValueAsString)) + .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("filterType"); + openapiFields.add("maxNumIcebergOrders"); + + // 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 MaxNumIcebergOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumIcebergOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumIcebergOrdersFilter is not found" + + " in the empty JSON string", + MaxNumIcebergOrdersFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumIcebergOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumIcebergOrdersFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumIcebergOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumIcebergOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumIcebergOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumIcebergOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumIcebergOrdersFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumIcebergOrdersFilter + */ + public static MaxNumIcebergOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumIcebergOrdersFilter.class); + } + + /** + * Convert an instance of MaxNumIcebergOrdersFilter 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/MaxNumOrderAmendsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumOrderAmendsFilter.java new file mode 100644 index 000000000..e0ee917e8 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumOrderAmendsFilter.java @@ -0,0 +1,247 @@ +/* + * 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.*; + +/** MaxNumOrderAmendsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumOrderAmendsFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + 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 MaxNumOrderAmendsFilter() {} + + public MaxNumOrderAmendsFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumOrderAmendsFilter 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumOrderAmendsFilter maxNumOrderAmendsFilter = (MaxNumOrderAmendsFilter) o; + return Objects.equals(this.filterType, maxNumOrderAmendsFilter.filterType) + && Objects.equals( + this.maxNumOrderAmends, maxNumOrderAmendsFilter.maxNumOrderAmends); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrderAmends); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumOrderAmendsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrderAmends: ").append(toIndentedString(maxNumOrderAmends)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object maxNumOrderAmendsValue = getMaxNumOrderAmends(); + String maxNumOrderAmendsValueAsString = ""; + maxNumOrderAmendsValueAsString = maxNumOrderAmendsValue.toString(); + sb.append("maxNumOrderAmends=") + .append(urlEncode(maxNumOrderAmendsValueAsString)) + .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("filterType"); + openapiFields.add("maxNumOrderAmends"); + + // 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 MaxNumOrderAmendsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumOrderAmendsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumOrderAmendsFilter is not found" + + " in the empty JSON string", + MaxNumOrderAmendsFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumOrderAmendsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumOrderAmendsFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderAmendsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumOrderAmendsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumOrderAmendsFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumOrderAmendsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumOrderAmendsFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumOrderAmendsFilter + */ + public static MaxNumOrderAmendsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumOrderAmendsFilter.class); + } + + /** + * Convert an instance of MaxNumOrderAmendsFilter 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/MaxNumOrderListsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumOrderListsFilter.java new file mode 100644 index 000000000..f32496d0f --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumOrderListsFilter.java @@ -0,0 +1,243 @@ +/* + * 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.*; + +/** MaxNumOrderListsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumOrderListsFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + 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 MaxNumOrderListsFilter() {} + + public MaxNumOrderListsFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumOrderListsFilter 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumOrderListsFilter maxNumOrderListsFilter = (MaxNumOrderListsFilter) o; + return Objects.equals(this.filterType, maxNumOrderListsFilter.filterType) + && Objects.equals(this.maxNumOrderLists, maxNumOrderListsFilter.maxNumOrderLists); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrderLists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumOrderListsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrderLists: ").append(toIndentedString(maxNumOrderLists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object maxNumOrderListsValue = getMaxNumOrderLists(); + String maxNumOrderListsValueAsString = ""; + maxNumOrderListsValueAsString = maxNumOrderListsValue.toString(); + sb.append("maxNumOrderLists=").append(urlEncode(maxNumOrderListsValueAsString)).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("filterType"); + openapiFields.add("maxNumOrderLists"); + + // 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 MaxNumOrderListsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumOrderListsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumOrderListsFilter is not found in" + + " the empty JSON string", + MaxNumOrderListsFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumOrderListsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumOrderListsFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderListsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumOrderListsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumOrderListsFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumOrderListsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumOrderListsFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumOrderListsFilter + */ + public static MaxNumOrderListsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumOrderListsFilter.class); + } + + /** + * Convert an instance of MaxNumOrderListsFilter 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/MaxNumOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumOrdersFilter.java new file mode 100644 index 000000000..6ae1f9833 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxNumOrdersFilter.java @@ -0,0 +1,242 @@ +/* + * 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.*; + +/** MaxNumOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumOrdersFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumOrders; + + public MaxNumOrdersFilter() {} + + public MaxNumOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumOrdersFilter maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + return this; + } + + /** + * Get maxNumOrders + * + * @return maxNumOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrders() { + return maxNumOrders; + } + + public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumOrdersFilter maxNumOrdersFilter = (MaxNumOrdersFilter) o; + return Objects.equals(this.filterType, maxNumOrdersFilter.filterType) + && Objects.equals(this.maxNumOrders, maxNumOrdersFilter.maxNumOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object maxNumOrdersValue = getMaxNumOrders(); + String maxNumOrdersValueAsString = ""; + maxNumOrdersValueAsString = maxNumOrdersValue.toString(); + sb.append("maxNumOrders=").append(urlEncode(maxNumOrdersValueAsString)).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("filterType"); + openapiFields.add("maxNumOrders"); + + // 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 MaxNumOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumOrdersFilter is not found in the" + + " empty JSON string", + MaxNumOrdersFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumOrdersFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumOrdersFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumOrdersFilter + */ + public static MaxNumOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumOrdersFilter.class); + } + + /** + * Convert an instance of MaxNumOrdersFilter 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/MaxPositionFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxPositionFilter.java new file mode 100644 index 000000000..ca3b3a58b --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MaxPositionFilter.java @@ -0,0 +1,282 @@ +/* + * 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.*; + +/** MaxPositionFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxPositionFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; + + @SerializedName(SERIALIZED_NAME_MAX_POSITION) + @jakarta.annotation.Nullable + private String maxPosition; + + public MaxPositionFilter() {} + + public MaxPositionFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxPositionFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public MaxPositionFilter maxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; + return this; + } + + /** + * Get maxPosition + * + * @return maxPosition + */ + @jakarta.annotation.Nullable + public String getMaxPosition() { + return maxPosition; + } + + public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxPositionFilter maxPositionFilter = (MaxPositionFilter) o; + return Objects.equals(this.filterType, maxPositionFilter.filterType) + && Objects.equals(this.qtyExponent, maxPositionFilter.qtyExponent) + && Objects.equals(this.maxPosition, maxPositionFilter.maxPosition); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, maxPosition); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxPositionFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object qtyExponentValue = getQtyExponent(); + String qtyExponentValueAsString = ""; + qtyExponentValueAsString = qtyExponentValue.toString(); + sb.append("qtyExponent=").append(urlEncode(qtyExponentValueAsString)).append(""); + Object maxPositionValue = getMaxPosition(); + String maxPositionValueAsString = ""; + maxPositionValueAsString = maxPositionValue.toString(); + sb.append("maxPosition=").append(urlEncode(maxPositionValueAsString)).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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("maxPosition"); + + // 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 MaxPositionFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxPositionFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxPositionFilter is not found in the" + + " empty JSON string", + MaxPositionFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) + && !jsonObj.get("maxPosition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxPosition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPosition").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxPositionFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxPositionFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxPositionFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxPositionFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxPositionFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxPositionFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxPositionFilter + * @throws IOException if the JSON string is invalid with respect to MaxPositionFilter + */ + public static MaxPositionFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxPositionFilter.class); + } + + /** + * Convert an instance of MaxPositionFilter 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/MinNotionalFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MinNotionalFilter.java new file mode 100644 index 000000000..4ca68d7bd --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MinNotionalFilter.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.*; + +/** MinNotionalFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MinNotionalFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_PRICE_EXPONENT = "priceExponent"; + + @SerializedName(SERIALIZED_NAME_PRICE_EXPONENT) + @jakarta.annotation.Nullable + private Integer priceExponent; + + public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; + + @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) + @jakarta.annotation.Nullable + private String minNotional; + + public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyToMarket; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public MinNotionalFilter() {} + + public MinNotionalFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MinNotionalFilter priceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + return this; + } + + /** + * Get priceExponent + * + * @return priceExponent + */ + @jakarta.annotation.Nullable + public Integer getPriceExponent() { + return priceExponent; + } + + public void setPriceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + } + + public MinNotionalFilter minNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + return this; + } + + /** + * Get minNotional + * + * @return minNotional + */ + @jakarta.annotation.Nullable + public String getMinNotional() { + return minNotional; + } + + public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + } + + public MinNotionalFilter applyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; + return this; + } + + /** + * Get applyToMarket + * + * @return applyToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyToMarket() { + return applyToMarket; + } + + public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; + } + + public MinNotionalFilter avgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MinNotionalFilter minNotionalFilter = (MinNotionalFilter) o; + return Objects.equals(this.filterType, minNotionalFilter.filterType) + && Objects.equals(this.priceExponent, minNotionalFilter.priceExponent) + && Objects.equals(this.minNotional, minNotionalFilter.minNotional) + && Objects.equals(this.applyToMarket, minNotionalFilter.applyToMarket) + && Objects.equals(this.avgPriceMins, minNotionalFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, priceExponent, minNotional, applyToMarket, avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MinNotionalFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" priceExponent: ").append(toIndentedString(priceExponent)).append("\n"); + sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); + sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object priceExponentValue = getPriceExponent(); + String priceExponentValueAsString = ""; + priceExponentValueAsString = priceExponentValue.toString(); + sb.append("priceExponent=").append(urlEncode(priceExponentValueAsString)).append(""); + Object minNotionalValue = getMinNotional(); + String minNotionalValueAsString = ""; + minNotionalValueAsString = minNotionalValue.toString(); + sb.append("minNotional=").append(urlEncode(minNotionalValueAsString)).append(""); + Object applyToMarketValue = getApplyToMarket(); + String applyToMarketValueAsString = ""; + applyToMarketValueAsString = applyToMarketValue.toString(); + sb.append("applyToMarket=").append(urlEncode(applyToMarketValueAsString)).append(""); + Object avgPriceMinsValue = getAvgPriceMins(); + String avgPriceMinsValueAsString = ""; + avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + sb.append("avgPriceMins=").append(urlEncode(avgPriceMinsValueAsString)).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("filterType"); + openapiFields.add("priceExponent"); + openapiFields.add("minNotional"); + openapiFields.add("applyToMarket"); + openapiFields.add("avgPriceMins"); + + // 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 MinNotionalFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MinNotionalFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MinNotionalFilter is not found in the" + + " empty JSON string", + MinNotionalFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) + && !jsonObj.get("minNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minNotional").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MinNotionalFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MinNotionalFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MinNotionalFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MinNotionalFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MinNotionalFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MinNotionalFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MinNotionalFilter + * @throws IOException if the JSON string is invalid with respect to MinNotionalFilter + */ + public static MinNotionalFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MinNotionalFilter.class); + } + + /** + * Convert an instance of MinNotionalFilter 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/MyFiltersResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyFiltersResponse.java new file mode 100644 index 000000000..2b0c42bbb --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyFiltersResponse.java @@ -0,0 +1,434 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.rest.model; + +import com.binance.connector.client.spot.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MyFiltersResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MyFiltersResponse { + public static final String SERIALIZED_NAME_EXCHANGE_FILTERS = "exchangeFilters"; + + @SerializedName(SERIALIZED_NAME_EXCHANGE_FILTERS) + @jakarta.annotation.Nullable + private List exchangeFilters; + + public static final String SERIALIZED_NAME_SYMBOL_FILTERS = "symbolFilters"; + + @SerializedName(SERIALIZED_NAME_SYMBOL_FILTERS) + @jakarta.annotation.Nullable + private List symbolFilters; + + public static final String SERIALIZED_NAME_ASSET_FILTERS = "assetFilters"; + + @SerializedName(SERIALIZED_NAME_ASSET_FILTERS) + @jakarta.annotation.Nullable + private List assetFilters; + + public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; + + @SerializedName(SERIALIZED_NAME_RATE_LIMITS) + @jakarta.annotation.Nullable + private List<@Valid RateLimits> rateLimits; + + public MyFiltersResponse() {} + + public MyFiltersResponse exchangeFilters( + @jakarta.annotation.Nullable List exchangeFilters) { + this.exchangeFilters = exchangeFilters; + return this; + } + + public MyFiltersResponse addExchangeFiltersItem(ExchangeFilters exchangeFiltersItem) { + if (this.exchangeFilters == null) { + this.exchangeFilters = new ArrayList<>(); + } + this.exchangeFilters.add(exchangeFiltersItem); + return this; + } + + /** + * Get exchangeFilters + * + * @return exchangeFilters + */ + @jakarta.annotation.Nullable + @Valid + public List getExchangeFilters() { + return exchangeFilters; + } + + public void setExchangeFilters( + @jakarta.annotation.Nullable List exchangeFilters) { + this.exchangeFilters = exchangeFilters; + } + + public MyFiltersResponse symbolFilters( + @jakarta.annotation.Nullable List symbolFilters) { + this.symbolFilters = symbolFilters; + return this; + } + + public MyFiltersResponse addSymbolFiltersItem(SymbolFilters symbolFiltersItem) { + if (this.symbolFilters == null) { + this.symbolFilters = new ArrayList<>(); + } + this.symbolFilters.add(symbolFiltersItem); + return this; + } + + /** + * Get symbolFilters + * + * @return symbolFilters + */ + @jakarta.annotation.Nullable + @Valid + public List getSymbolFilters() { + return symbolFilters; + } + + public void setSymbolFilters(@jakarta.annotation.Nullable List symbolFilters) { + this.symbolFilters = symbolFilters; + } + + public MyFiltersResponse assetFilters( + @jakarta.annotation.Nullable List assetFilters) { + this.assetFilters = assetFilters; + return this; + } + + public MyFiltersResponse addAssetFiltersItem(AssetFilters assetFiltersItem) { + if (this.assetFilters == null) { + this.assetFilters = new ArrayList<>(); + } + this.assetFilters.add(assetFiltersItem); + return this; + } + + /** + * Get assetFilters + * + * @return assetFilters + */ + @jakarta.annotation.Nullable + @Valid + public List getAssetFilters() { + return assetFilters; + } + + public void setAssetFilters(@jakarta.annotation.Nullable List assetFilters) { + this.assetFilters = assetFilters; + } + + public MyFiltersResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { + this.rateLimits = rateLimits; + return this; + } + + public MyFiltersResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + + /** + * Get rateLimits + * + * @return rateLimits + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid RateLimits> getRateLimits() { + return rateLimits; + } + + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { + this.rateLimits = rateLimits; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MyFiltersResponse myFiltersResponse = (MyFiltersResponse) o; + return Objects.equals(this.exchangeFilters, myFiltersResponse.exchangeFilters) + && Objects.equals(this.symbolFilters, myFiltersResponse.symbolFilters) + && Objects.equals(this.assetFilters, myFiltersResponse.assetFilters) + && Objects.equals(this.rateLimits, myFiltersResponse.rateLimits); + } + + @Override + public int hashCode() { + return Objects.hash(exchangeFilters, symbolFilters, assetFilters, rateLimits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MyFiltersResponse {\n"); + sb.append(" exchangeFilters: ").append(toIndentedString(exchangeFilters)).append("\n"); + sb.append(" symbolFilters: ").append(toIndentedString(symbolFilters)).append("\n"); + sb.append(" assetFilters: ").append(toIndentedString(assetFilters)).append("\n"); + sb.append(" rateLimits: ").append(toIndentedString(rateLimits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object exchangeFiltersValue = getExchangeFilters(); + String exchangeFiltersValueAsString = ""; + exchangeFiltersValueAsString = + (String) + ((Collection) exchangeFiltersValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("exchangeFilters=").append(urlEncode(exchangeFiltersValueAsString)).append(""); + Object symbolFiltersValue = getSymbolFilters(); + String symbolFiltersValueAsString = ""; + symbolFiltersValueAsString = + (String) + ((Collection) symbolFiltersValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("symbolFilters=").append(urlEncode(symbolFiltersValueAsString)).append(""); + Object assetFiltersValue = getAssetFilters(); + String assetFiltersValueAsString = ""; + assetFiltersValueAsString = + (String) + ((Collection) assetFiltersValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("assetFilters=").append(urlEncode(assetFiltersValueAsString)).append(""); + Object rateLimitsValue = getRateLimits(); + String rateLimitsValueAsString = ""; + rateLimitsValueAsString = + (String) + ((Collection) rateLimitsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rateLimits=").append(urlEncode(rateLimitsValueAsString)).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("exchangeFilters"); + openapiFields.add("symbolFilters"); + openapiFields.add("assetFilters"); + openapiFields.add("rateLimits"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MyFiltersResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MyFiltersResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MyFiltersResponse is not found in the" + + " empty JSON string", + MyFiltersResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("exchangeFilters") != null + && !jsonObj.get("exchangeFilters").isJsonNull()) { + JsonArray jsonArrayexchangeFilters = jsonObj.getAsJsonArray("exchangeFilters"); + if (jsonArrayexchangeFilters != null) { + // ensure the json data is an array + if (!jsonObj.get("exchangeFilters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `exchangeFilters` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("exchangeFilters").toString())); + } + + // validate the optional field `exchangeFilters` (array) + for (int i = 0; i < jsonArrayexchangeFilters.size(); i++) { + ExchangeFilters.validateJsonElement(jsonArrayexchangeFilters.get(i)); + } + ; + } + } + if (jsonObj.get("symbolFilters") != null && !jsonObj.get("symbolFilters").isJsonNull()) { + JsonArray jsonArraysymbolFilters = jsonObj.getAsJsonArray("symbolFilters"); + if (jsonArraysymbolFilters != null) { + // ensure the json data is an array + if (!jsonObj.get("symbolFilters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbolFilters` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("symbolFilters").toString())); + } + + // validate the optional field `symbolFilters` (array) + for (int i = 0; i < jsonArraysymbolFilters.size(); i++) { + SymbolFilters.validateJsonElement(jsonArraysymbolFilters.get(i)); + } + ; + } + } + if (jsonObj.get("assetFilters") != null && !jsonObj.get("assetFilters").isJsonNull()) { + JsonArray jsonArrayassetFilters = jsonObj.getAsJsonArray("assetFilters"); + if (jsonArrayassetFilters != null) { + // ensure the json data is an array + if (!jsonObj.get("assetFilters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `assetFilters` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("assetFilters").toString())); + } + + // validate the optional field `assetFilters` (array) + for (int i = 0; i < jsonArrayassetFilters.size(); i++) { + AssetFilters.validateJsonElement(jsonArrayassetFilters.get(i)); + } + ; + } + } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MyFiltersResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MyFiltersResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MyFiltersResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MyFiltersResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MyFiltersResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MyFiltersResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of MyFiltersResponse + * @throws IOException if the JSON string is invalid with respect to MyFiltersResponse + */ + public static MyFiltersResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MyFiltersResponse.class); + } + + /** + * Convert an instance of MyFiltersResponse 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/NewOrderRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderRequest.java index 163ac1e1c..7d887b85c 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 @@ -150,7 +150,7 @@ public class NewOrderRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public NewOrderRequest() {} @@ -515,7 +515,7 @@ public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffse this.pegOffsetType = pegOffsetType; } - public NewOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public NewOrderRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -526,11 +526,12 @@ public NewOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NotionalFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NotionalFilter.java new file mode 100644 index 000000000..5d688bd98 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NotionalFilter.java @@ -0,0 +1,424 @@ +/* + * 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.*; + +/** NotionalFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NotionalFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_PRICE_EXPONENT = "priceExponent"; + + @SerializedName(SERIALIZED_NAME_PRICE_EXPONENT) + @jakarta.annotation.Nullable + private Integer priceExponent; + + public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; + + @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) + @jakarta.annotation.Nullable + private String minNotional; + + public static final String SERIALIZED_NAME_APPLY_MIN_TO_MARKET = "applyMinToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_MIN_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyMinToMarket; + + public static final String SERIALIZED_NAME_MAX_NOTIONAL = "maxNotional"; + + @SerializedName(SERIALIZED_NAME_MAX_NOTIONAL) + @jakarta.annotation.Nullable + private String maxNotional; + + public static final String SERIALIZED_NAME_APPLY_MAX_TO_MARKET = "applyMaxToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_MAX_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyMaxToMarket; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public NotionalFilter() {} + + public NotionalFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public NotionalFilter priceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + return this; + } + + /** + * Get priceExponent + * + * @return priceExponent + */ + @jakarta.annotation.Nullable + public Integer getPriceExponent() { + return priceExponent; + } + + public void setPriceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + } + + public NotionalFilter minNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + return this; + } + + /** + * Get minNotional + * + * @return minNotional + */ + @jakarta.annotation.Nullable + public String getMinNotional() { + return minNotional; + } + + public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + } + + public NotionalFilter applyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { + this.applyMinToMarket = applyMinToMarket; + return this; + } + + /** + * Get applyMinToMarket + * + * @return applyMinToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyMinToMarket() { + return applyMinToMarket; + } + + public void setApplyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { + this.applyMinToMarket = applyMinToMarket; + } + + public NotionalFilter maxNotional(@jakarta.annotation.Nullable String maxNotional) { + this.maxNotional = maxNotional; + return this; + } + + /** + * Get maxNotional + * + * @return maxNotional + */ + @jakarta.annotation.Nullable + public String getMaxNotional() { + return maxNotional; + } + + public void setMaxNotional(@jakarta.annotation.Nullable String maxNotional) { + this.maxNotional = maxNotional; + } + + public NotionalFilter applyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { + this.applyMaxToMarket = applyMaxToMarket; + return this; + } + + /** + * Get applyMaxToMarket + * + * @return applyMaxToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyMaxToMarket() { + return applyMaxToMarket; + } + + public void setApplyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { + this.applyMaxToMarket = applyMaxToMarket; + } + + public NotionalFilter avgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotionalFilter notionalFilter = (NotionalFilter) o; + return Objects.equals(this.filterType, notionalFilter.filterType) + && Objects.equals(this.priceExponent, notionalFilter.priceExponent) + && Objects.equals(this.minNotional, notionalFilter.minNotional) + && Objects.equals(this.applyMinToMarket, notionalFilter.applyMinToMarket) + && Objects.equals(this.maxNotional, notionalFilter.maxNotional) + && Objects.equals(this.applyMaxToMarket, notionalFilter.applyMaxToMarket) + && Objects.equals(this.avgPriceMins, notionalFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + priceExponent, + minNotional, + applyMinToMarket, + maxNotional, + applyMaxToMarket, + avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotionalFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" priceExponent: ").append(toIndentedString(priceExponent)).append("\n"); + sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); + sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); + sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); + sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object priceExponentValue = getPriceExponent(); + String priceExponentValueAsString = ""; + priceExponentValueAsString = priceExponentValue.toString(); + sb.append("priceExponent=").append(urlEncode(priceExponentValueAsString)).append(""); + Object minNotionalValue = getMinNotional(); + String minNotionalValueAsString = ""; + minNotionalValueAsString = minNotionalValue.toString(); + sb.append("minNotional=").append(urlEncode(minNotionalValueAsString)).append(""); + Object applyMinToMarketValue = getApplyMinToMarket(); + String applyMinToMarketValueAsString = ""; + applyMinToMarketValueAsString = applyMinToMarketValue.toString(); + sb.append("applyMinToMarket=").append(urlEncode(applyMinToMarketValueAsString)).append(""); + Object maxNotionalValue = getMaxNotional(); + String maxNotionalValueAsString = ""; + maxNotionalValueAsString = maxNotionalValue.toString(); + sb.append("maxNotional=").append(urlEncode(maxNotionalValueAsString)).append(""); + Object applyMaxToMarketValue = getApplyMaxToMarket(); + String applyMaxToMarketValueAsString = ""; + applyMaxToMarketValueAsString = applyMaxToMarketValue.toString(); + sb.append("applyMaxToMarket=").append(urlEncode(applyMaxToMarketValueAsString)).append(""); + Object avgPriceMinsValue = getAvgPriceMins(); + String avgPriceMinsValueAsString = ""; + avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + sb.append("avgPriceMins=").append(urlEncode(avgPriceMinsValueAsString)).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("filterType"); + openapiFields.add("priceExponent"); + openapiFields.add("minNotional"); + openapiFields.add("applyMinToMarket"); + openapiFields.add("maxNotional"); + openapiFields.add("applyMaxToMarket"); + openapiFields.add("avgPriceMins"); + + // 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 NotionalFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NotionalFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NotionalFilter is not found in the" + + " empty JSON string", + NotionalFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) + && !jsonObj.get("minNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minNotional").toString())); + } + if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) + && !jsonObj.get("maxNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxNotional").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NotionalFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NotionalFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NotionalFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NotionalFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NotionalFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NotionalFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotionalFilter + * @throws IOException if the JSON string is invalid with respect to NotionalFilter + */ + public static NotionalFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NotionalFilter.class); + } + + /** + * Convert an instance of NotionalFilter 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/OrderAmendKeepPriorityRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityRequest.java index fbf54d68c..9c6d24bd7 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityRequest.java @@ -71,7 +71,7 @@ public class OrderAmendKeepPriorityRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderAmendKeepPriorityRequest() {} @@ -175,7 +175,8 @@ public void setNewQty(@jakarta.annotation.Nonnull Double newQty) { this.newQty = newQty; } - public OrderAmendKeepPriorityRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderAmendKeepPriorityRequest recvWindow( + @jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -186,11 +187,12 @@ public OrderAmendKeepPriorityRequest recvWindow(@jakarta.annotation.Nullable Lon * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } 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 15343af35..769256d7f 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 @@ -189,7 +189,7 @@ public class OrderCancelReplaceRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderCancelReplaceRequest() {} @@ -691,7 +691,7 @@ public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffse this.pegOffsetType = pegOffsetType; } - public OrderCancelReplaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderCancelReplaceRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -702,11 +702,12 @@ public OrderCancelReplaceRequest recvWindow(@jakarta.annotation.Nullable Long re * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } 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 f5cbe9233..3914a93a7 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 @@ -101,7 +101,7 @@ public class OrderListOcoRequest { @SerializedName(SERIALIZED_NAME_ABOVE_TIME_IN_FORCE) @jakarta.annotation.Nullable - private Double aboveTimeInForce; + private AboveTimeInForce aboveTimeInForce; public static final String SERIALIZED_NAME_ABOVE_STRATEGY_ID = "aboveStrategyId"; @@ -222,7 +222,7 @@ public class OrderListOcoRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderListOcoRequest() {} @@ -429,7 +429,7 @@ public void setAboveTrailingDelta(@jakarta.annotation.Nullable Long aboveTrailin } public OrderListOcoRequest aboveTimeInForce( - @jakarta.annotation.Nullable Double aboveTimeInForce) { + @jakarta.annotation.Nullable AboveTimeInForce aboveTimeInForce) { this.aboveTimeInForce = aboveTimeInForce; return this; } @@ -441,11 +441,12 @@ public OrderListOcoRequest aboveTimeInForce( */ @jakarta.annotation.Nullable @Valid - public Double getAboveTimeInForce() { + public AboveTimeInForce getAboveTimeInForce() { return aboveTimeInForce; } - public void setAboveTimeInForce(@jakarta.annotation.Nullable Double aboveTimeInForce) { + public void setAboveTimeInForce( + @jakarta.annotation.Nullable AboveTimeInForce aboveTimeInForce) { this.aboveTimeInForce = aboveTimeInForce; } @@ -841,7 +842,7 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } - public OrderListOcoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderListOcoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -852,11 +853,12 @@ public OrderListOcoRequest recvWindow(@jakarta.annotation.Nullable Long recvWind * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -1277,6 +1279,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("aboveClientOrderId").toString())); } + // validate the optional field `aboveTimeInForce` + if (jsonObj.get("aboveTimeInForce") != null + && !jsonObj.get("aboveTimeInForce").isJsonNull()) { + AboveTimeInForce.validateJsonElement(jsonObj.get("aboveTimeInForce")); + } // validate the optional field `abovePegPriceType` if (jsonObj.get("abovePegPriceType") != null && !jsonObj.get("abovePegPriceType").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 cbe56d0d6..d1d645416 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 @@ -222,7 +222,7 @@ public class OrderListOtoRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderListOtoRequest() {} @@ -855,7 +855,7 @@ public void setPendingPegOffsetValue( this.pendingPegOffsetValue = pendingPegOffsetValue; } - public OrderListOtoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderListOtoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -866,11 +866,12 @@ public OrderListOtoRequest recvWindow(@jakarta.annotation.Nullable Long recvWind * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } 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 953ae947d..45ae00bb4 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 @@ -308,7 +308,7 @@ public class OrderListOtocoRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderListOtocoRequest() {} @@ -1210,7 +1210,7 @@ public void setPendingBelowPegOffsetValue( this.pendingBelowPegOffsetValue = pendingBelowPegOffsetValue; } - public OrderListOtocoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderListOtocoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -1221,11 +1221,12 @@ public OrderListOtocoRequest recvWindow(@jakarta.annotation.Nullable Long recvWi * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoRequest.java index 6719b3f67..31b88db2e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoRequest.java @@ -156,7 +156,7 @@ public class OrderOcoRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderOcoRequest() {} @@ -546,7 +546,7 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } - public OrderOcoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderOcoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -557,11 +557,12 @@ public OrderOcoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } 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 cd6accca1..4a169ae2d 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 @@ -156,7 +156,7 @@ public class OrderTestRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderTestRequest() {} @@ -543,7 +543,7 @@ public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffse this.pegOffsetType = pegOffsetType; } - public OrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderTestRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -554,11 +554,12 @@ public OrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PercentPriceBySideFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PercentPriceBySideFilter.java new file mode 100644 index 000000000..5fbbadcd8 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PercentPriceBySideFilter.java @@ -0,0 +1,461 @@ +/* + * 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.*; + +/** PercentPriceBySideFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PercentPriceBySideFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MULTIPLIER_EXPONENT = "multiplierExponent"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_EXPONENT) + @jakarta.annotation.Nullable + private Integer multiplierExponent; + + public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String bidMultiplierUp; + + public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String bidMultiplierDown; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String askMultiplierUp; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String askMultiplierDown; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public PercentPriceBySideFilter() {} + + public PercentPriceBySideFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public PercentPriceBySideFilter multiplierExponent( + @jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + return this; + } + + /** + * Get multiplierExponent + * + * @return multiplierExponent + */ + @jakarta.annotation.Nullable + public Integer getMultiplierExponent() { + return multiplierExponent; + } + + public void setMultiplierExponent(@jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + } + + public PercentPriceBySideFilter bidMultiplierUp( + @jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; + return this; + } + + /** + * Get bidMultiplierUp + * + * @return bidMultiplierUp + */ + @jakarta.annotation.Nullable + public String getBidMultiplierUp() { + return bidMultiplierUp; + } + + public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; + } + + public PercentPriceBySideFilter bidMultiplierDown( + @jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + return this; + } + + /** + * Get bidMultiplierDown + * + * @return bidMultiplierDown + */ + @jakarta.annotation.Nullable + public String getBidMultiplierDown() { + return bidMultiplierDown; + } + + public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + } + + public PercentPriceBySideFilter askMultiplierUp( + @jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + return this; + } + + /** + * Get askMultiplierUp + * + * @return askMultiplierUp + */ + @jakarta.annotation.Nullable + public String getAskMultiplierUp() { + return askMultiplierUp; + } + + public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + } + + public PercentPriceBySideFilter askMultiplierDown( + @jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + return this; + } + + /** + * Get askMultiplierDown + * + * @return askMultiplierDown + */ + @jakarta.annotation.Nullable + public String getAskMultiplierDown() { + return askMultiplierDown; + } + + public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + } + + public PercentPriceBySideFilter avgPriceMins( + @jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PercentPriceBySideFilter percentPriceBySideFilter = (PercentPriceBySideFilter) o; + return Objects.equals(this.filterType, percentPriceBySideFilter.filterType) + && Objects.equals( + this.multiplierExponent, percentPriceBySideFilter.multiplierExponent) + && Objects.equals(this.bidMultiplierUp, percentPriceBySideFilter.bidMultiplierUp) + && Objects.equals( + this.bidMultiplierDown, percentPriceBySideFilter.bidMultiplierDown) + && Objects.equals(this.askMultiplierUp, percentPriceBySideFilter.askMultiplierUp) + && Objects.equals( + this.askMultiplierDown, percentPriceBySideFilter.askMultiplierDown) + && Objects.equals(this.avgPriceMins, percentPriceBySideFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + multiplierExponent, + bidMultiplierUp, + bidMultiplierDown, + askMultiplierUp, + askMultiplierDown, + avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PercentPriceBySideFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" multiplierExponent: ") + .append(toIndentedString(multiplierExponent)) + .append("\n"); + sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); + sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); + sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); + sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object multiplierExponentValue = getMultiplierExponent(); + String multiplierExponentValueAsString = ""; + multiplierExponentValueAsString = multiplierExponentValue.toString(); + sb.append("multiplierExponent=") + .append(urlEncode(multiplierExponentValueAsString)) + .append(""); + Object bidMultiplierUpValue = getBidMultiplierUp(); + String bidMultiplierUpValueAsString = ""; + bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); + sb.append("bidMultiplierUp=").append(urlEncode(bidMultiplierUpValueAsString)).append(""); + Object bidMultiplierDownValue = getBidMultiplierDown(); + String bidMultiplierDownValueAsString = ""; + bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); + sb.append("bidMultiplierDown=") + .append(urlEncode(bidMultiplierDownValueAsString)) + .append(""); + Object askMultiplierUpValue = getAskMultiplierUp(); + String askMultiplierUpValueAsString = ""; + askMultiplierUpValueAsString = askMultiplierUpValue.toString(); + sb.append("askMultiplierUp=").append(urlEncode(askMultiplierUpValueAsString)).append(""); + Object askMultiplierDownValue = getAskMultiplierDown(); + String askMultiplierDownValueAsString = ""; + askMultiplierDownValueAsString = askMultiplierDownValue.toString(); + sb.append("askMultiplierDown=") + .append(urlEncode(askMultiplierDownValueAsString)) + .append(""); + Object avgPriceMinsValue = getAvgPriceMins(); + String avgPriceMinsValueAsString = ""; + avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + sb.append("avgPriceMins=").append(urlEncode(avgPriceMinsValueAsString)).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("filterType"); + openapiFields.add("multiplierExponent"); + openapiFields.add("bidMultiplierUp"); + openapiFields.add("bidMultiplierDown"); + openapiFields.add("askMultiplierUp"); + openapiFields.add("askMultiplierDown"); + openapiFields.add("avgPriceMins"); + + // 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 PercentPriceBySideFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PercentPriceBySideFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PercentPriceBySideFilter is not found" + + " in the empty JSON string", + PercentPriceBySideFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("bidMultiplierUp") != null && !jsonObj.get("bidMultiplierUp").isJsonNull()) + && !jsonObj.get("bidMultiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidMultiplierUp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("bidMultiplierUp").toString())); + } + if ((jsonObj.get("bidMultiplierDown") != null + && !jsonObj.get("bidMultiplierDown").isJsonNull()) + && !jsonObj.get("bidMultiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidMultiplierDown` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("bidMultiplierDown").toString())); + } + if ((jsonObj.get("askMultiplierUp") != null && !jsonObj.get("askMultiplierUp").isJsonNull()) + && !jsonObj.get("askMultiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askMultiplierUp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("askMultiplierUp").toString())); + } + if ((jsonObj.get("askMultiplierDown") != null + && !jsonObj.get("askMultiplierDown").isJsonNull()) + && !jsonObj.get("askMultiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askMultiplierDown` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("askMultiplierDown").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PercentPriceBySideFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PercentPriceBySideFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceBySideFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PercentPriceBySideFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PercentPriceBySideFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PercentPriceBySideFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of PercentPriceBySideFilter + * @throws IOException if the JSON string is invalid with respect to PercentPriceBySideFilter + */ + public static PercentPriceBySideFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PercentPriceBySideFilter.class); + } + + /** + * Convert an instance of PercentPriceBySideFilter 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/PercentPriceFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PercentPriceFilter.java new file mode 100644 index 000000000..436fd04d8 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PercentPriceFilter.java @@ -0,0 +1,360 @@ +/* + * 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.*; + +/** PercentPriceFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PercentPriceFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MULTIPLIER_EXPONENT = "multiplierExponent"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_EXPONENT) + @jakarta.annotation.Nullable + private Integer multiplierExponent; + + public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String multiplierUp; + + public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String multiplierDown; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public PercentPriceFilter() {} + + public PercentPriceFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public PercentPriceFilter multiplierExponent( + @jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + return this; + } + + /** + * Get multiplierExponent + * + * @return multiplierExponent + */ + @jakarta.annotation.Nullable + public Integer getMultiplierExponent() { + return multiplierExponent; + } + + public void setMultiplierExponent(@jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + } + + public PercentPriceFilter multiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; + return this; + } + + /** + * Get multiplierUp + * + * @return multiplierUp + */ + @jakarta.annotation.Nullable + public String getMultiplierUp() { + return multiplierUp; + } + + public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; + } + + public PercentPriceFilter multiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; + return this; + } + + /** + * Get multiplierDown + * + * @return multiplierDown + */ + @jakarta.annotation.Nullable + public String getMultiplierDown() { + return multiplierDown; + } + + public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; + } + + public PercentPriceFilter avgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PercentPriceFilter percentPriceFilter = (PercentPriceFilter) o; + return Objects.equals(this.filterType, percentPriceFilter.filterType) + && Objects.equals(this.multiplierExponent, percentPriceFilter.multiplierExponent) + && Objects.equals(this.multiplierUp, percentPriceFilter.multiplierUp) + && Objects.equals(this.multiplierDown, percentPriceFilter.multiplierDown) + && Objects.equals(this.avgPriceMins, percentPriceFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, multiplierExponent, multiplierUp, multiplierDown, avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PercentPriceFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" multiplierExponent: ") + .append(toIndentedString(multiplierExponent)) + .append("\n"); + sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); + sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object multiplierExponentValue = getMultiplierExponent(); + String multiplierExponentValueAsString = ""; + multiplierExponentValueAsString = multiplierExponentValue.toString(); + sb.append("multiplierExponent=") + .append(urlEncode(multiplierExponentValueAsString)) + .append(""); + Object multiplierUpValue = getMultiplierUp(); + String multiplierUpValueAsString = ""; + multiplierUpValueAsString = multiplierUpValue.toString(); + sb.append("multiplierUp=").append(urlEncode(multiplierUpValueAsString)).append(""); + Object multiplierDownValue = getMultiplierDown(); + String multiplierDownValueAsString = ""; + multiplierDownValueAsString = multiplierDownValue.toString(); + sb.append("multiplierDown=").append(urlEncode(multiplierDownValueAsString)).append(""); + Object avgPriceMinsValue = getAvgPriceMins(); + String avgPriceMinsValueAsString = ""; + avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + sb.append("avgPriceMins=").append(urlEncode(avgPriceMinsValueAsString)).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("filterType"); + openapiFields.add("multiplierExponent"); + openapiFields.add("multiplierUp"); + openapiFields.add("multiplierDown"); + openapiFields.add("avgPriceMins"); + + // 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 PercentPriceFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PercentPriceFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PercentPriceFilter is not found in the" + + " empty JSON string", + PercentPriceFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) + && !jsonObj.get("multiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierUp` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("multiplierUp").toString())); + } + if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) + && !jsonObj.get("multiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierDown` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("multiplierDown").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PercentPriceFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PercentPriceFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PercentPriceFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PercentPriceFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PercentPriceFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of PercentPriceFilter + * @throws IOException if the JSON string is invalid with respect to PercentPriceFilter + */ + public static PercentPriceFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PercentPriceFilter.class); + } + + /** + * Convert an instance of PercentPriceFilter 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/PriceFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PriceFilter.java new file mode 100644 index 000000000..45e0f3bab --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PriceFilter.java @@ -0,0 +1,361 @@ +/* + * 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.*; + +/** PriceFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PriceFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_PRICE_EXPONENT = "priceExponent"; + + @SerializedName(SERIALIZED_NAME_PRICE_EXPONENT) + @jakarta.annotation.Nullable + private Integer priceExponent; + + public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; + + @SerializedName(SERIALIZED_NAME_MIN_PRICE) + @jakarta.annotation.Nullable + private String minPrice; + + public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; + + @SerializedName(SERIALIZED_NAME_MAX_PRICE) + @jakarta.annotation.Nullable + private String maxPrice; + + public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; + + @SerializedName(SERIALIZED_NAME_TICK_SIZE) + @jakarta.annotation.Nullable + private String tickSize; + + public PriceFilter() {} + + public PriceFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public PriceFilter priceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + return this; + } + + /** + * Get priceExponent + * + * @return priceExponent + */ + @jakarta.annotation.Nullable + public Integer getPriceExponent() { + return priceExponent; + } + + public void setPriceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + } + + public PriceFilter minPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; + return this; + } + + /** + * Get minPrice + * + * @return minPrice + */ + @jakarta.annotation.Nullable + public String getMinPrice() { + return minPrice; + } + + public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; + } + + public PriceFilter maxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; + return this; + } + + /** + * Get maxPrice + * + * @return maxPrice + */ + @jakarta.annotation.Nullable + public String getMaxPrice() { + return maxPrice; + } + + public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; + } + + public PriceFilter tickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; + return this; + } + + /** + * Get tickSize + * + * @return tickSize + */ + @jakarta.annotation.Nullable + public String getTickSize() { + return tickSize; + } + + public void setTickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PriceFilter priceFilter = (PriceFilter) o; + return Objects.equals(this.filterType, priceFilter.filterType) + && Objects.equals(this.priceExponent, priceFilter.priceExponent) + && Objects.equals(this.minPrice, priceFilter.minPrice) + && Objects.equals(this.maxPrice, priceFilter.maxPrice) + && Objects.equals(this.tickSize, priceFilter.tickSize); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, priceExponent, minPrice, maxPrice, tickSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PriceFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" priceExponent: ").append(toIndentedString(priceExponent)).append("\n"); + sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); + sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); + sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object priceExponentValue = getPriceExponent(); + String priceExponentValueAsString = ""; + priceExponentValueAsString = priceExponentValue.toString(); + sb.append("priceExponent=").append(urlEncode(priceExponentValueAsString)).append(""); + Object minPriceValue = getMinPrice(); + String minPriceValueAsString = ""; + minPriceValueAsString = minPriceValue.toString(); + sb.append("minPrice=").append(urlEncode(minPriceValueAsString)).append(""); + Object maxPriceValue = getMaxPrice(); + String maxPriceValueAsString = ""; + maxPriceValueAsString = maxPriceValue.toString(); + sb.append("maxPrice=").append(urlEncode(maxPriceValueAsString)).append(""); + Object tickSizeValue = getTickSize(); + String tickSizeValueAsString = ""; + tickSizeValueAsString = tickSizeValue.toString(); + sb.append("tickSize=").append(urlEncode(tickSizeValueAsString)).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("filterType"); + openapiFields.add("priceExponent"); + openapiFields.add("minPrice"); + openapiFields.add("maxPrice"); + openapiFields.add("tickSize"); + + // 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 PriceFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PriceFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PriceFilter is not found in the empty" + + " JSON string", + PriceFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) + && !jsonObj.get("minPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minPrice").toString())); + } + if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) + && !jsonObj.get("maxPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPrice").toString())); + } + if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) + && !jsonObj.get("tickSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tickSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tickSize").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PriceFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PriceFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PriceFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PriceFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PriceFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PriceFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of PriceFilter + * @throws IOException if the JSON string is invalid with respect to PriceFilter + */ + public static PriceFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PriceFilter.class); + } + + /** + * Convert an instance of PriceFilter 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/RateLimits.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimits.java index 696cbbc89..e4845e5de 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimits.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimits.java @@ -14,10 +14,11 @@ import com.binance.connector.client.spot.rest.JSON; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; @@ -26,7 +27,6 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; import java.util.HashSet; import java.util.Objects; import org.hibernate.validator.constraints.*; @@ -35,9 +35,134 @@ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class RateLimits extends ArrayList { +public class RateLimits { + public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; + + @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) + @jakarta.annotation.Nullable + private String rateLimitType; + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + @jakarta.annotation.Nullable + private String interval; + + public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; + + @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) + @jakarta.annotation.Nullable + private Long intervalNum; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @jakarta.annotation.Nullable + private Long limit; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + @jakarta.annotation.Nullable + private Long count; + public RateLimits() {} + public RateLimits rateLimitType(@jakarta.annotation.Nullable String rateLimitType) { + this.rateLimitType = rateLimitType; + return this; + } + + /** + * Get rateLimitType + * + * @return rateLimitType + */ + @jakarta.annotation.Nullable + public String getRateLimitType() { + return rateLimitType; + } + + public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { + this.rateLimitType = rateLimitType; + } + + public RateLimits interval(@jakarta.annotation.Nullable String interval) { + this.interval = interval; + return this; + } + + /** + * Get interval + * + * @return interval + */ + @jakarta.annotation.Nullable + public String getInterval() { + return interval; + } + + public void setInterval(@jakarta.annotation.Nullable String interval) { + this.interval = interval; + } + + public RateLimits intervalNum(@jakarta.annotation.Nullable Long intervalNum) { + this.intervalNum = intervalNum; + return this; + } + + /** + * Get intervalNum + * + * @return intervalNum + */ + @jakarta.annotation.Nullable + public Long getIntervalNum() { + return intervalNum; + } + + public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { + this.intervalNum = intervalNum; + } + + public RateLimits limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @jakarta.annotation.Nullable + public Long getLimit() { + return limit; + } + + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + } + + public RateLimits count(@jakarta.annotation.Nullable Long count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count + */ + @jakarta.annotation.Nullable + public Long getCount() { + return count; + } + + public void setCount(@jakarta.annotation.Nullable Long count) { + this.count = count; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -46,19 +171,28 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - return super.equals(o); + RateLimits rateLimits = (RateLimits) o; + return Objects.equals(this.rateLimitType, rateLimits.rateLimitType) + && Objects.equals(this.interval, rateLimits.interval) + && Objects.equals(this.intervalNum, rateLimits.intervalNum) + && Objects.equals(this.limit, rateLimits.limit) + && Objects.equals(this.count, rateLimits.count); } @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return Objects.hash(rateLimitType, interval, intervalNum, limit, count); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RateLimits {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" rateLimitType: ").append(toIndentedString(rateLimitType)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" intervalNum: ").append(toIndentedString(intervalNum)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); sb.append("}"); return sb.toString(); } @@ -66,6 +200,26 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); + Object rateLimitTypeValue = getRateLimitType(); + String rateLimitTypeValueAsString = ""; + rateLimitTypeValueAsString = rateLimitTypeValue.toString(); + sb.append("rateLimitType=").append(urlEncode(rateLimitTypeValueAsString)).append(""); + Object intervalValue = getInterval(); + String intervalValueAsString = ""; + intervalValueAsString = intervalValue.toString(); + sb.append("interval=").append(urlEncode(intervalValueAsString)).append(""); + Object intervalNumValue = getIntervalNum(); + String intervalNumValueAsString = ""; + intervalNumValueAsString = intervalNumValue.toString(); + sb.append("intervalNum=").append(urlEncode(intervalNumValueAsString)).append(""); + Object limitValue = getLimit(); + String limitValueAsString = ""; + limitValueAsString = limitValue.toString(); + sb.append("limit=").append(urlEncode(limitValueAsString)).append(""); + Object countValue = getCount(); + String countValueAsString = ""; + countValueAsString = countValue.toString(); + sb.append("count=").append(urlEncode(countValueAsString)).append(""); return sb.toString(); } @@ -94,6 +248,11 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("rateLimitType"); + openapiFields.add("interval"); + openapiFields.add("intervalNum"); + openapiFields.add("limit"); + openapiFields.add("count"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -106,18 +265,6 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to RateLimits */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (!jsonElement.isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected json element to be a array type in the JSON string but got" - + " `%s`", - jsonElement.toString())); - } - JsonArray array = jsonElement.getAsJsonArray(); - // validate array items - for (JsonElement element : array) { - RateLimitsInner.validateJsonElement(element); - } if (jsonElement == null) { if (!RateLimits.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -128,6 +275,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti RateLimits.openapiRequiredFields.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) + && !jsonObj.get("rateLimitType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimitType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimitType").toString())); + } + if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) + && !jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -145,7 +309,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { new TypeAdapter() { @Override public void write(JsonWriter out, RateLimits value) throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitsInner.java deleted file mode 100644 index 06f86aeac..000000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitsInner.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.rest.model; - -import com.binance.connector.client.spot.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** RateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class RateLimitsInner { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public RateLimitsInner() {} - - public RateLimitsInner rateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public RateLimitsInner interval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public RateLimitsInner intervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public RateLimitsInner count(@jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RateLimitsInner rateLimitsInner = (RateLimitsInner) o; - return Objects.equals(this.rateLimitType, rateLimitsInner.rateLimitType) - && Objects.equals(this.interval, rateLimitsInner.interval) - && Objects.equals(this.intervalNum, rateLimitsInner.intervalNum) - && Objects.equals(this.limit, rateLimitsInner.limit) - && Objects.equals(this.count, rateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RateLimitsInner {\n"); - sb.append(" rateLimitType: ").append(toIndentedString(rateLimitType)).append("\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append(" intervalNum: ").append(toIndentedString(intervalNum)).append("\n"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object rateLimitTypeValue = getRateLimitType(); - String rateLimitTypeValueAsString = ""; - rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - sb.append("rateLimitType=").append(urlEncode(rateLimitTypeValueAsString)).append(""); - Object intervalValue = getInterval(); - String intervalValueAsString = ""; - intervalValueAsString = intervalValue.toString(); - sb.append("interval=").append(urlEncode(intervalValueAsString)).append(""); - Object intervalNumValue = getIntervalNum(); - String intervalNumValueAsString = ""; - intervalNumValueAsString = intervalNumValue.toString(); - sb.append("intervalNum=").append(urlEncode(intervalNumValueAsString)).append(""); - Object limitValue = getLimit(); - String limitValueAsString = ""; - limitValueAsString = limitValue.toString(); - sb.append("limit=").append(urlEncode(limitValueAsString)).append(""); - Object countValue = getCount(); - String countValueAsString = ""; - countValueAsString = countValue.toString(); - sb.append("count=").append(urlEncode(countValueAsString)).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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 RateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RateLimitsInner is not found in the" - + " empty JSON string", - RateLimitsInner.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RateLimitsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RateLimitsInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RateLimitsInner read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of RateLimitsInner - * @throws IOException if the JSON string is invalid with respect to RateLimitsInner - */ - public static RateLimitsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RateLimitsInner.class); - } - - /** - * Convert an instance of RateLimitsInner 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/SorOrderRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderRequest.java index a30c291d0..8ec9f6393 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderRequest.java @@ -114,7 +114,7 @@ public class SorOrderRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public SorOrderRequest() {} @@ -362,7 +362,7 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } - public SorOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public SorOrderRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -373,11 +373,12 @@ public SorOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestRequest.java index 1496eae3b..0f1038fa7 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestRequest.java @@ -120,7 +120,7 @@ public class SorOrderTestRequest { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public SorOrderTestRequest() {} @@ -390,7 +390,7 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } - public SorOrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public SorOrderTestRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -401,11 +401,12 @@ public SorOrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWind * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/StopLimitTimeInForce.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/StopLimitTimeInForce.java index 68b0bb07e..ec550e26d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/StopLimitTimeInForce.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/StopLimitTimeInForce.java @@ -26,9 +26,9 @@ public enum StopLimitTimeInForce { GTC("GTC"), - FOK("FOK"), + IOC("IOC"), - IOC("IOC"); + FOK("FOK"); private String value; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SymbolFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SymbolFilters.java new file mode 100644 index 000000000..0eb4e9d1c --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SymbolFilters.java @@ -0,0 +1,1356 @@ +/* + * 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.common.AbstractOpenApiSchema; +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.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.hibernate.validator.constraints.*; + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SymbolFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SymbolFilters.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SymbolFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SymbolFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterPriceFilter = + gson.getDelegateAdapter(this, TypeToken.get(PriceFilter.class)); + final TypeAdapter adapterPercentPriceFilter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceFilter.class)); + final TypeAdapter adapterPercentPriceBySideFilter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceBySideFilter.class)); + final TypeAdapter adapterLotSizeFilter = + gson.getDelegateAdapter(this, TypeToken.get(LotSizeFilter.class)); + final TypeAdapter adapterMinNotionalFilter = + gson.getDelegateAdapter(this, TypeToken.get(MinNotionalFilter.class)); + final TypeAdapter adapterNotionalFilter = + gson.getDelegateAdapter(this, TypeToken.get(NotionalFilter.class)); + final TypeAdapter adapterIcebergPartsFilter = + gson.getDelegateAdapter(this, TypeToken.get(IcebergPartsFilter.class)); + final TypeAdapter adapterMarketLotSizeFilter = + gson.getDelegateAdapter(this, TypeToken.get(MarketLotSizeFilter.class)); + final TypeAdapter adapterMaxNumOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrdersFilter.class)); + final TypeAdapter adapterMaxNumAlgoOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumAlgoOrdersFilter.class)); + final TypeAdapter adapterMaxNumIcebergOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumIcebergOrdersFilter.class)); + final TypeAdapter adapterMaxPositionFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxPositionFilter.class)); + final TypeAdapter adapterTrailingDeltaFilter = + gson.getDelegateAdapter(this, TypeToken.get(TrailingDeltaFilter.class)); + final TypeAdapter adapterTPlusSellFilter = + gson.getDelegateAdapter(this, TypeToken.get(TPlusSellFilter.class)); + final TypeAdapter adapterMaxNumOrderListsFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderListsFilter.class)); + final TypeAdapter adapterMaxNumOrderAmendsFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderAmendsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SymbolFilters value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `PriceFilter` + if (value.getActualInstance() instanceof PriceFilter) { + JsonElement element = + adapterPriceFilter.toJsonTree( + (PriceFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `PercentPriceFilter` + if (value.getActualInstance() instanceof PercentPriceFilter) { + JsonElement element = + adapterPercentPriceFilter.toJsonTree( + (PercentPriceFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `PercentPriceBySideFilter` + if (value.getActualInstance() instanceof PercentPriceBySideFilter) { + JsonElement element = + adapterPercentPriceBySideFilter.toJsonTree( + (PercentPriceBySideFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `LotSizeFilter` + if (value.getActualInstance() instanceof LotSizeFilter) { + JsonElement element = + adapterLotSizeFilter.toJsonTree( + (LotSizeFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MinNotionalFilter` + if (value.getActualInstance() instanceof MinNotionalFilter) { + JsonElement element = + adapterMinNotionalFilter.toJsonTree( + (MinNotionalFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `NotionalFilter` + if (value.getActualInstance() instanceof NotionalFilter) { + JsonElement element = + adapterNotionalFilter.toJsonTree( + (NotionalFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `IcebergPartsFilter` + if (value.getActualInstance() instanceof IcebergPartsFilter) { + JsonElement element = + adapterIcebergPartsFilter.toJsonTree( + (IcebergPartsFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MarketLotSizeFilter` + if (value.getActualInstance() instanceof MarketLotSizeFilter) { + JsonElement element = + adapterMarketLotSizeFilter.toJsonTree( + (MarketLotSizeFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumOrdersFilter` + if (value.getActualInstance() instanceof MaxNumOrdersFilter) { + JsonElement element = + adapterMaxNumOrdersFilter.toJsonTree( + (MaxNumOrdersFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumAlgoOrdersFilter` + if (value.getActualInstance() instanceof MaxNumAlgoOrdersFilter) { + JsonElement element = + adapterMaxNumAlgoOrdersFilter.toJsonTree( + (MaxNumAlgoOrdersFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `MaxNumIcebergOrdersFilter` + if (value.getActualInstance() instanceof MaxNumIcebergOrdersFilter) { + JsonElement element = + adapterMaxNumIcebergOrdersFilter.toJsonTree( + (MaxNumIcebergOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxPositionFilter` + if (value.getActualInstance() instanceof MaxPositionFilter) { + JsonElement element = + adapterMaxPositionFilter.toJsonTree( + (MaxPositionFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TrailingDeltaFilter` + if (value.getActualInstance() instanceof TrailingDeltaFilter) { + JsonElement element = + adapterTrailingDeltaFilter.toJsonTree( + (TrailingDeltaFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TPlusSellFilter` + if (value.getActualInstance() instanceof TPlusSellFilter) { + JsonElement element = + adapterTPlusSellFilter.toJsonTree( + (TPlusSellFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumOrderListsFilter` + if (value.getActualInstance() instanceof MaxNumOrderListsFilter) { + JsonElement element = + adapterMaxNumOrderListsFilter.toJsonTree( + (MaxNumOrderListsFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumOrderAmendsFilter` + if (value.getActualInstance() instanceof MaxNumOrderAmendsFilter) { + JsonElement element = + adapterMaxNumOrderAmendsFilter.toJsonTree( + (MaxNumOrderAmendsFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter," + + " MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter," + + " MaxNumOrderAmendsFilter, MaxNumOrderListsFilter," + + " MaxNumOrdersFilter, MaxPositionFilter," + + " MinNotionalFilter, NotionalFilter," + + " PercentPriceBySideFilter, PercentPriceFilter," + + " PriceFilter, TPlusSellFilter, TrailingDeltaFilter"); + } + + @Override + public SymbolFilters read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + SymbolFilters newSymbolFilters = new SymbolFilters(); + if (jsonObject.get("filterType") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for SymbolFilters as" + + " `filterType` was not found in the payload or the" + + " payload is empty."); + } else { + // look up the discriminator value in the field `filterType` + switch (jsonObject.get("filterType").getAsString()) { + case "ICEBERG_PARTS": + deserialized = + adapterIcebergPartsFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "LOT_SIZE": + deserialized = + adapterLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MARKET_LOT_SIZE": + deserialized = + adapterMarketLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ALGO_ORDERS": + deserialized = + adapterMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ICEBERG_ORDERS": + deserialized = + adapterMaxNumIcebergOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ORDERS": + deserialized = + adapterMaxNumOrdersFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ORDER_AMENDS": + deserialized = + adapterMaxNumOrderAmendsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ORDER_LISTS": + deserialized = + adapterMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_POSITION": + deserialized = + adapterMaxPositionFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MIN_NOTIONAL": + deserialized = + adapterMinNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "NOTIONAL": + deserialized = + adapterNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PERCENT_PRICE": + deserialized = + adapterPercentPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PERCENT_PRICE_BY_SIDE": + deserialized = + adapterPercentPriceBySideFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PRICE_FILTER": + deserialized = adapterPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "TRAILING_DELTA": + deserialized = + adapterTrailingDeltaFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "T_PLUS_SELL": + deserialized = + adapterTPlusSellFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "IcebergPartsFilter": + deserialized = + adapterIcebergPartsFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "LotSizeFilter": + deserialized = + adapterLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MarketLotSizeFilter": + deserialized = + adapterMarketLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumAlgoOrdersFilter": + deserialized = + adapterMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumIcebergOrdersFilter": + deserialized = + adapterMaxNumIcebergOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumOrderAmendsFilter": + deserialized = + adapterMaxNumOrderAmendsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumOrderListsFilter": + deserialized = + adapterMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumOrdersFilter": + deserialized = + adapterMaxNumOrdersFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxPositionFilter": + deserialized = + adapterMaxPositionFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MinNotionalFilter": + deserialized = + adapterMinNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "NotionalFilter": + deserialized = + adapterNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PercentPriceBySideFilter": + deserialized = + adapterPercentPriceBySideFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PercentPriceFilter": + deserialized = + adapterPercentPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PriceFilter": + deserialized = adapterPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "TPlusSellFilter": + deserialized = + adapterTPlusSellFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "TrailingDeltaFilter": + deserialized = + adapterTrailingDeltaFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + default: + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for SymbolFilters. Possible values:" + + " ICEBERG_PARTS LOT_SIZE" + + " MARKET_LOT_SIZE MAX_NUM_ALGO_ORDERS" + + " MAX_NUM_ICEBERG_ORDERS" + + " MAX_NUM_ORDERS MAX_NUM_ORDER_AMENDS" + + " MAX_NUM_ORDER_LISTS MAX_POSITION" + + " MIN_NOTIONAL NOTIONAL PERCENT_PRICE" + + " PERCENT_PRICE_BY_SIDE PRICE_FILTER" + + " TRAILING_DELTA T_PLUS_SELL" + + " IcebergPartsFilter LotSizeFilter" + + " MarketLotSizeFilter" + + " MaxNumAlgoOrdersFilter" + + " MaxNumIcebergOrdersFilter" + + " MaxNumOrderAmendsFilter" + + " MaxNumOrderListsFilter" + + " MaxNumOrdersFilter" + + " MaxPositionFilter MinNotionalFilter" + + " NotionalFilter" + + " PercentPriceBySideFilter" + + " PercentPriceFilter PriceFilter" + + " TPlusSellFilter" + + " TrailingDeltaFilter", + jsonObject + .get("filterType") + .getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize PriceFilter + try { + // validate the JSON object to see if any exception is thrown + PriceFilter.validateJsonElement(jsonElement); + actualAdapter = adapterPriceFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'PriceFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PriceFilter failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'PriceFilter'", + e); + } + // deserialize PercentPriceFilter + try { + // validate the JSON object to see if any exception is thrown + PercentPriceFilter.validateJsonElement(jsonElement); + actualAdapter = adapterPercentPriceFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'PercentPriceFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PercentPriceFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'PercentPriceFilter'", + e); + } + // deserialize PercentPriceBySideFilter + try { + // validate the JSON object to see if any exception is thrown + PercentPriceBySideFilter.validateJsonElement(jsonElement); + actualAdapter = adapterPercentPriceBySideFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'PercentPriceBySideFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PercentPriceBySideFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'PercentPriceBySideFilter'", + e); + } + // deserialize LotSizeFilter + try { + // validate the JSON object to see if any exception is thrown + LotSizeFilter.validateJsonElement(jsonElement); + actualAdapter = adapterLotSizeFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'LotSizeFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for LotSizeFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'LotSizeFilter'", + e); + } + // deserialize MinNotionalFilter + try { + // validate the JSON object to see if any exception is thrown + MinNotionalFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMinNotionalFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MinNotionalFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MinNotionalFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MinNotionalFilter'", + e); + } + // deserialize NotionalFilter + try { + // validate the JSON object to see if any exception is thrown + NotionalFilter.validateJsonElement(jsonElement); + actualAdapter = adapterNotionalFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'NotionalFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for NotionalFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'NotionalFilter'", + e); + } + // deserialize IcebergPartsFilter + try { + // validate the JSON object to see if any exception is thrown + IcebergPartsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterIcebergPartsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'IcebergPartsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for IcebergPartsFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'IcebergPartsFilter'", + e); + } + // deserialize MarketLotSizeFilter + try { + // validate the JSON object to see if any exception is thrown + MarketLotSizeFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMarketLotSizeFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MarketLotSizeFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MarketLotSizeFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MarketLotSizeFilter'", + e); + } + // deserialize MaxNumOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumOrdersFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxNumOrdersFilter'", + e); + } + // deserialize MaxNumAlgoOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumAlgoOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumAlgoOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumAlgoOrdersFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxNumAlgoOrdersFilter'", + e); + } + // deserialize MaxNumIcebergOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumIcebergOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumIcebergOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumIcebergOrdersFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'MaxNumIcebergOrdersFilter'", + e); + } + // deserialize MaxPositionFilter + try { + // validate the JSON object to see if any exception is thrown + MaxPositionFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxPositionFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxPositionFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxPositionFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxPositionFilter'", + e); + } + // deserialize TrailingDeltaFilter + try { + // validate the JSON object to see if any exception is thrown + TrailingDeltaFilter.validateJsonElement(jsonElement); + actualAdapter = adapterTrailingDeltaFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'TrailingDeltaFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for TrailingDeltaFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'TrailingDeltaFilter'", + e); + } + // deserialize TPlusSellFilter + try { + // validate the JSON object to see if any exception is thrown + TPlusSellFilter.validateJsonElement(jsonElement); + actualAdapter = adapterTPlusSellFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'TPlusSellFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for TPlusSellFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'TPlusSellFilter'", + e); + } + // deserialize MaxNumOrderListsFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumOrderListsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumOrderListsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumOrderListsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderListsFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxNumOrderListsFilter'", + e); + } + // deserialize MaxNumOrderAmendsFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumOrderAmendsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumOrderAmendsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumOrderAmendsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderAmendsFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'MaxNumOrderAmendsFilter'", + e); + } + + if (match == 1) { + SymbolFilters ret = new SymbolFilters(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for SymbolFilters: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public SymbolFilters() { + super("oneOf", Boolean.FALSE); + } + + public SymbolFilters(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("PriceFilter", PriceFilter.class); + schemas.put("PercentPriceFilter", PercentPriceFilter.class); + schemas.put("PercentPriceBySideFilter", PercentPriceBySideFilter.class); + schemas.put("LotSizeFilter", LotSizeFilter.class); + schemas.put("MinNotionalFilter", MinNotionalFilter.class); + schemas.put("NotionalFilter", NotionalFilter.class); + schemas.put("IcebergPartsFilter", IcebergPartsFilter.class); + schemas.put("MarketLotSizeFilter", MarketLotSizeFilter.class); + schemas.put("MaxNumOrdersFilter", MaxNumOrdersFilter.class); + schemas.put("MaxNumAlgoOrdersFilter", MaxNumAlgoOrdersFilter.class); + schemas.put("MaxNumIcebergOrdersFilter", MaxNumIcebergOrdersFilter.class); + schemas.put("MaxPositionFilter", MaxPositionFilter.class); + schemas.put("TrailingDeltaFilter", TrailingDeltaFilter.class); + schemas.put("TPlusSellFilter", TPlusSellFilter.class); + schemas.put("MaxNumOrderListsFilter", MaxNumOrderListsFilter.class); + schemas.put("MaxNumOrderAmendsFilter", MaxNumOrderAmendsFilter.class); + } + + @Override + public Map> getSchemas() { + return SymbolFilters.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter, + * MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter, MaxNumOrderAmendsFilter, + * MaxNumOrderListsFilter, MaxNumOrdersFilter, MaxPositionFilter, MinNotionalFilter, + * NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, TPlusSellFilter, + * TrailingDeltaFilter + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof PriceFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof PercentPriceFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof PercentPriceBySideFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LotSizeFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MinNotionalFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NotionalFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IcebergPartsFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MarketLotSizeFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumAlgoOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumIcebergOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxPositionFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TrailingDeltaFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TPlusSellFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumOrderListsFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumOrderAmendsFilter) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be IcebergPartsFilter, LotSizeFilter," + + " MarketLotSizeFilter, MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter," + + " MaxNumOrderAmendsFilter, MaxNumOrderListsFilter, MaxNumOrdersFilter," + + " MaxPositionFilter, MinNotionalFilter, NotionalFilter," + + " PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, TPlusSellFilter," + + " TrailingDeltaFilter"); + } + + /** + * Get the actual instance, which can be the following: IcebergPartsFilter, LotSizeFilter, + * MarketLotSizeFilter, MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter, + * MaxNumOrderAmendsFilter, MaxNumOrderListsFilter, MaxNumOrdersFilter, MaxPositionFilter, + * MinNotionalFilter, NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, + * TPlusSellFilter, TrailingDeltaFilter + * + * @return The actual instance (IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter, + * MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter, MaxNumOrderAmendsFilter, + * MaxNumOrderListsFilter, MaxNumOrdersFilter, MaxPositionFilter, MinNotionalFilter, + * NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, + * TPlusSellFilter, TrailingDeltaFilter) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `PriceFilter`. If the actual instance is not `PriceFilter`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `PriceFilter` + * @throws ClassCastException if the instance is not `PriceFilter` + */ + public PriceFilter getPriceFilter() throws ClassCastException { + return (PriceFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `PercentPriceFilter`. If the actual instance is not + * `PercentPriceFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `PercentPriceFilter` + * @throws ClassCastException if the instance is not `PercentPriceFilter` + */ + public PercentPriceFilter getPercentPriceFilter() throws ClassCastException { + return (PercentPriceFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `PercentPriceBySideFilter`. If the actual instance is not + * `PercentPriceBySideFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `PercentPriceBySideFilter` + * @throws ClassCastException if the instance is not `PercentPriceBySideFilter` + */ + public PercentPriceBySideFilter getPercentPriceBySideFilter() throws ClassCastException { + return (PercentPriceBySideFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `LotSizeFilter`. If the actual instance is not `LotSizeFilter`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LotSizeFilter` + * @throws ClassCastException if the instance is not `LotSizeFilter` + */ + public LotSizeFilter getLotSizeFilter() throws ClassCastException { + return (LotSizeFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MinNotionalFilter`. If the actual instance is not + * `MinNotionalFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MinNotionalFilter` + * @throws ClassCastException if the instance is not `MinNotionalFilter` + */ + public MinNotionalFilter getMinNotionalFilter() throws ClassCastException { + return (MinNotionalFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `NotionalFilter`. If the actual instance is not `NotionalFilter`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `NotionalFilter` + * @throws ClassCastException if the instance is not `NotionalFilter` + */ + public NotionalFilter getNotionalFilter() throws ClassCastException { + return (NotionalFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `IcebergPartsFilter`. If the actual instance is not + * `IcebergPartsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `IcebergPartsFilter` + * @throws ClassCastException if the instance is not `IcebergPartsFilter` + */ + public IcebergPartsFilter getIcebergPartsFilter() throws ClassCastException { + return (IcebergPartsFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MarketLotSizeFilter`. If the actual instance is not + * `MarketLotSizeFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MarketLotSizeFilter` + * @throws ClassCastException if the instance is not `MarketLotSizeFilter` + */ + public MarketLotSizeFilter getMarketLotSizeFilter() throws ClassCastException { + return (MarketLotSizeFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumOrdersFilter`. If the actual instance is not + * `MaxNumOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumOrdersFilter` + * @throws ClassCastException if the instance is not `MaxNumOrdersFilter` + */ + public MaxNumOrdersFilter getMaxNumOrdersFilter() throws ClassCastException { + return (MaxNumOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumAlgoOrdersFilter`. If the actual instance is not + * `MaxNumAlgoOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumAlgoOrdersFilter` + * @throws ClassCastException if the instance is not `MaxNumAlgoOrdersFilter` + */ + public MaxNumAlgoOrdersFilter getMaxNumAlgoOrdersFilter() throws ClassCastException { + return (MaxNumAlgoOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumIcebergOrdersFilter`. If the actual instance is not + * `MaxNumIcebergOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumIcebergOrdersFilter` + * @throws ClassCastException if the instance is not `MaxNumIcebergOrdersFilter` + */ + public MaxNumIcebergOrdersFilter getMaxNumIcebergOrdersFilter() throws ClassCastException { + return (MaxNumIcebergOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxPositionFilter`. If the actual instance is not + * `MaxPositionFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxPositionFilter` + * @throws ClassCastException if the instance is not `MaxPositionFilter` + */ + public MaxPositionFilter getMaxPositionFilter() throws ClassCastException { + return (MaxPositionFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `TrailingDeltaFilter`. If the actual instance is not + * `TrailingDeltaFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `TrailingDeltaFilter` + * @throws ClassCastException if the instance is not `TrailingDeltaFilter` + */ + public TrailingDeltaFilter getTrailingDeltaFilter() throws ClassCastException { + return (TrailingDeltaFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `TPlusSellFilter`. If the actual instance is not + * `TPlusSellFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `TPlusSellFilter` + * @throws ClassCastException if the instance is not `TPlusSellFilter` + */ + public TPlusSellFilter getTPlusSellFilter() throws ClassCastException { + return (TPlusSellFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumOrderListsFilter`. If the actual instance is not + * `MaxNumOrderListsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumOrderListsFilter` + * @throws ClassCastException if the instance is not `MaxNumOrderListsFilter` + */ + public MaxNumOrderListsFilter getMaxNumOrderListsFilter() throws ClassCastException { + return (MaxNumOrderListsFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumOrderAmendsFilter`. If the actual instance is not + * `MaxNumOrderAmendsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumOrderAmendsFilter` + * @throws ClassCastException if the instance is not `MaxNumOrderAmendsFilter` + */ + public MaxNumOrderAmendsFilter getMaxNumOrderAmendsFilter() throws ClassCastException { + return (MaxNumOrderAmendsFilter) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SymbolFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with PriceFilter + try { + PriceFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PriceFilter failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with PercentPriceFilter + try { + PercentPriceFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PercentPriceFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with PercentPriceBySideFilter + try { + PercentPriceBySideFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PercentPriceBySideFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with LotSizeFilter + try { + LotSizeFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for LotSizeFilter failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with MinNotionalFilter + try { + MinNotionalFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MinNotionalFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with NotionalFilter + try { + NotionalFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for NotionalFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with IcebergPartsFilter + try { + IcebergPartsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for IcebergPartsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MarketLotSizeFilter + try { + MarketLotSizeFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MarketLotSizeFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumOrdersFilter + try { + MaxNumOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumAlgoOrdersFilter + try { + MaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumAlgoOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumIcebergOrdersFilter + try { + MaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumIcebergOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxPositionFilter + try { + MaxPositionFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxPositionFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with TrailingDeltaFilter + try { + TrailingDeltaFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for TrailingDeltaFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with TPlusSellFilter + try { + TPlusSellFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for TPlusSellFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumOrderListsFilter + try { + MaxNumOrderListsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderListsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumOrderAmendsFilter + try { + MaxNumOrderAmendsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderAmendsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for SymbolFilters with oneOf schemas:" + + " IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter," + + " MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter," + + " MaxNumOrderAmendsFilter, MaxNumOrderListsFilter," + + " MaxNumOrdersFilter, MaxPositionFilter, MinNotionalFilter," + + " NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter," + + " PriceFilter, TPlusSellFilter, TrailingDeltaFilter. %d class(es)" + + " match the result, expected 1. Detailed failure message for" + + " oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of SymbolFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SymbolFilters + * @throws IOException if the JSON string is invalid with respect to SymbolFilters + */ + public static SymbolFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SymbolFilters.class); + } + + /** + * Convert an instance of SymbolFilters 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/TPlusSellFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TPlusSellFilter.java new file mode 100644 index 000000000..c6aeddc86 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TPlusSellFilter.java @@ -0,0 +1,242 @@ +/* + * 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.*; + +/** TPlusSellFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TPlusSellFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + + @SerializedName(SERIALIZED_NAME_END_TIME) + @jakarta.annotation.Nullable + private Long endTime; + + public TPlusSellFilter() {} + + public TPlusSellFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public TPlusSellFilter endTime(@jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * + * @return endTime + */ + @jakarta.annotation.Nullable + public Long getEndTime() { + return endTime; + } + + public void setEndTime(@jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TPlusSellFilter tplusSellFilter = (TPlusSellFilter) o; + return Objects.equals(this.filterType, tplusSellFilter.filterType) + && Objects.equals(this.endTime, tplusSellFilter.endTime); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, endTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TPlusSellFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object endTimeValue = getEndTime(); + String endTimeValueAsString = ""; + endTimeValueAsString = endTimeValue.toString(); + sb.append("endTime=").append(urlEncode(endTimeValueAsString)).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("filterType"); + openapiFields.add("endTime"); + + // 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 TPlusSellFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TPlusSellFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TPlusSellFilter is not found in the" + + " empty JSON string", + TPlusSellFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TPlusSellFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TPlusSellFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TPlusSellFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TPlusSellFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TPlusSellFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TPlusSellFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of TPlusSellFilter + * @throws IOException if the JSON string is invalid with respect to TPlusSellFilter + */ + public static TPlusSellFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TPlusSellFilter.class); + } + + /** + * Convert an instance of TPlusSellFilter 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/TrailingDeltaFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TrailingDeltaFilter.java new file mode 100644 index 000000000..45ab2b151 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TrailingDeltaFilter.java @@ -0,0 +1,367 @@ +/* + * 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.*; + +/** TrailingDeltaFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TrailingDeltaFilter { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; + + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) + @jakarta.annotation.Nullable + private Long minTrailingAboveDelta; + + public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; + + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) + @jakarta.annotation.Nullable + private Long maxTrailingAboveDelta; + + public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; + + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) + @jakarta.annotation.Nullable + private Long minTrailingBelowDelta; + + public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; + + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) + @jakarta.annotation.Nullable + private Long maxTrailingBelowDelta; + + public TrailingDeltaFilter() {} + + public TrailingDeltaFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public TrailingDeltaFilter minTrailingAboveDelta( + @jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; + return this; + } + + /** + * Get minTrailingAboveDelta + * + * @return minTrailingAboveDelta + */ + @jakarta.annotation.Nullable + public Long getMinTrailingAboveDelta() { + return minTrailingAboveDelta; + } + + public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; + } + + public TrailingDeltaFilter maxTrailingAboveDelta( + @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; + return this; + } + + /** + * Get maxTrailingAboveDelta + * + * @return maxTrailingAboveDelta + */ + @jakarta.annotation.Nullable + public Long getMaxTrailingAboveDelta() { + return maxTrailingAboveDelta; + } + + public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; + } + + public TrailingDeltaFilter minTrailingBelowDelta( + @jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; + return this; + } + + /** + * Get minTrailingBelowDelta + * + * @return minTrailingBelowDelta + */ + @jakarta.annotation.Nullable + public Long getMinTrailingBelowDelta() { + return minTrailingBelowDelta; + } + + public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; + } + + public TrailingDeltaFilter maxTrailingBelowDelta( + @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; + return this; + } + + /** + * Get maxTrailingBelowDelta + * + * @return maxTrailingBelowDelta + */ + @jakarta.annotation.Nullable + public Long getMaxTrailingBelowDelta() { + return maxTrailingBelowDelta; + } + + public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrailingDeltaFilter trailingDeltaFilter = (TrailingDeltaFilter) o; + return Objects.equals(this.filterType, trailingDeltaFilter.filterType) + && Objects.equals( + this.minTrailingAboveDelta, trailingDeltaFilter.minTrailingAboveDelta) + && Objects.equals( + this.maxTrailingAboveDelta, trailingDeltaFilter.maxTrailingAboveDelta) + && Objects.equals( + this.minTrailingBelowDelta, trailingDeltaFilter.minTrailingBelowDelta) + && Objects.equals( + this.maxTrailingBelowDelta, trailingDeltaFilter.maxTrailingBelowDelta); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + minTrailingAboveDelta, + maxTrailingAboveDelta, + minTrailingBelowDelta, + maxTrailingBelowDelta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrailingDeltaFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" minTrailingAboveDelta: ") + .append(toIndentedString(minTrailingAboveDelta)) + .append("\n"); + sb.append(" maxTrailingAboveDelta: ") + .append(toIndentedString(maxTrailingAboveDelta)) + .append("\n"); + sb.append(" minTrailingBelowDelta: ") + .append(toIndentedString(minTrailingBelowDelta)) + .append("\n"); + sb.append(" maxTrailingBelowDelta: ") + .append(toIndentedString(maxTrailingBelowDelta)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object filterTypeValue = getFilterType(); + String filterTypeValueAsString = ""; + filterTypeValueAsString = filterTypeValue.toString(); + sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); + Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + String minTrailingAboveDeltaValueAsString = ""; + minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); + sb.append("minTrailingAboveDelta=") + .append(urlEncode(minTrailingAboveDeltaValueAsString)) + .append(""); + Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + String maxTrailingAboveDeltaValueAsString = ""; + maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); + sb.append("maxTrailingAboveDelta=") + .append(urlEncode(maxTrailingAboveDeltaValueAsString)) + .append(""); + Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + String minTrailingBelowDeltaValueAsString = ""; + minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); + sb.append("minTrailingBelowDelta=") + .append(urlEncode(minTrailingBelowDeltaValueAsString)) + .append(""); + Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + String maxTrailingBelowDeltaValueAsString = ""; + maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); + sb.append("maxTrailingBelowDelta=") + .append(urlEncode(maxTrailingBelowDeltaValueAsString)) + .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("filterType"); + openapiFields.add("minTrailingAboveDelta"); + openapiFields.add("maxTrailingAboveDelta"); + openapiFields.add("minTrailingBelowDelta"); + openapiFields.add("maxTrailingBelowDelta"); + + // 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 TrailingDeltaFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrailingDeltaFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TrailingDeltaFilter is not found in" + + " the empty JSON string", + TrailingDeltaFilter.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrailingDeltaFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrailingDeltaFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TrailingDeltaFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TrailingDeltaFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrailingDeltaFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TrailingDeltaFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrailingDeltaFilter + * @throws IOException if the JSON string is invalid with respect to TrailingDeltaFilter + */ + public static TrailingDeltaFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrailingDeltaFilter.class); + } + + /** + * Convert an instance of TrailingDeltaFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java index 5394cfcb5..be8d9cfa6 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 @@ -62,6 +62,252 @@ public class JSON { public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client.spot.websocket.api.model.AssetFilters + .class, + new TypeSelector< + com.binance.connector.client.spot.websocket.api.model + .AssetFilters>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot + .websocket.api.model + .AssetFilters> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "MAX_ASSET", + com.binance.connector.client.spot.websocket.api + .model.MaxAssetFilter.class); + classByDiscriminatorValue.put( + "MaxAssetFilter", + com.binance.connector.client.spot.websocket.api + .model.MaxAssetFilter.class); + classByDiscriminatorValue.put( + "assetFilters", + com.binance.connector.client.spot.websocket.api + .model.AssetFilters.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "filterType")); + } + }) + .registerTypeSelector( + com.binance.connector.client.spot.websocket.api.model + .ExchangeFilters.class, + new TypeSelector< + com.binance.connector.client.spot.websocket.api.model + .ExchangeFilters>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot + .websocket.api.model + .ExchangeFilters> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ALGO_ORDERS", + com.binance.connector.client.spot.websocket.api + .model.ExchangeMaxNumAlgoOrdersFilter + .class); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ICEBERG_ORDERS", + com.binance.connector.client.spot.websocket.api + .model.ExchangeMaxNumIcebergOrdersFilter + .class); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ORDERS", + com.binance.connector.client.spot.websocket.api + .model.ExchangeMaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ORDER_LISTS", + com.binance.connector.client.spot.websocket.api + .model.ExchangeMaxNumOrderListsFilter + .class); + classByDiscriminatorValue.put( + "ExchangeMaxNumAlgoOrdersFilter", + com.binance.connector.client.spot.websocket.api + .model.ExchangeMaxNumAlgoOrdersFilter + .class); + classByDiscriminatorValue.put( + "ExchangeMaxNumIcebergOrdersFilter", + com.binance.connector.client.spot.websocket.api + .model.ExchangeMaxNumIcebergOrdersFilter + .class); + classByDiscriminatorValue.put( + "ExchangeMaxNumOrderListsFilter", + com.binance.connector.client.spot.websocket.api + .model.ExchangeMaxNumOrderListsFilter + .class); + classByDiscriminatorValue.put( + "ExchangeMaxNumOrdersFilter", + com.binance.connector.client.spot.websocket.api + .model.ExchangeMaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "exchangeFilters", + com.binance.connector.client.spot.websocket.api + .model.ExchangeFilters.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "filterType")); + } + }) + .registerTypeSelector( + com.binance.connector.client.spot.websocket.api.model.SymbolFilters + .class, + new TypeSelector< + com.binance.connector.client.spot.websocket.api.model + .SymbolFilters>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot + .websocket.api.model + .SymbolFilters> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "ICEBERG_PARTS", + com.binance.connector.client.spot.websocket.api + .model.IcebergPartsFilter.class); + classByDiscriminatorValue.put( + "LOT_SIZE", + com.binance.connector.client.spot.websocket.api + .model.LotSizeFilter.class); + classByDiscriminatorValue.put( + "MARKET_LOT_SIZE", + com.binance.connector.client.spot.websocket.api + .model.MarketLotSizeFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ALGO_ORDERS", + com.binance.connector.client.spot.websocket.api + .model.MaxNumAlgoOrdersFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ICEBERG_ORDERS", + com.binance.connector.client.spot.websocket.api + .model.MaxNumIcebergOrdersFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ORDERS", + com.binance.connector.client.spot.websocket.api + .model.MaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ORDER_AMENDS", + com.binance.connector.client.spot.websocket.api + .model.MaxNumOrderAmendsFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ORDER_LISTS", + com.binance.connector.client.spot.websocket.api + .model.MaxNumOrderListsFilter.class); + classByDiscriminatorValue.put( + "MAX_POSITION", + com.binance.connector.client.spot.websocket.api + .model.MaxPositionFilter.class); + classByDiscriminatorValue.put( + "MIN_NOTIONAL", + com.binance.connector.client.spot.websocket.api + .model.MinNotionalFilter.class); + classByDiscriminatorValue.put( + "NOTIONAL", + com.binance.connector.client.spot.websocket.api + .model.NotionalFilter.class); + classByDiscriminatorValue.put( + "PERCENT_PRICE", + com.binance.connector.client.spot.websocket.api + .model.PercentPriceFilter.class); + classByDiscriminatorValue.put( + "PERCENT_PRICE_BY_SIDE", + com.binance.connector.client.spot.websocket.api + .model.PercentPriceBySideFilter.class); + classByDiscriminatorValue.put( + "PRICE_FILTER", + com.binance.connector.client.spot.websocket.api + .model.PriceFilter.class); + classByDiscriminatorValue.put( + "TRAILING_DELTA", + com.binance.connector.client.spot.websocket.api + .model.TrailingDeltaFilter.class); + classByDiscriminatorValue.put( + "T_PLUS_SELL", + com.binance.connector.client.spot.websocket.api + .model.TPlusSellFilter.class); + classByDiscriminatorValue.put( + "IcebergPartsFilter", + com.binance.connector.client.spot.websocket.api + .model.IcebergPartsFilter.class); + classByDiscriminatorValue.put( + "LotSizeFilter", + com.binance.connector.client.spot.websocket.api + .model.LotSizeFilter.class); + classByDiscriminatorValue.put( + "MarketLotSizeFilter", + com.binance.connector.client.spot.websocket.api + .model.MarketLotSizeFilter.class); + classByDiscriminatorValue.put( + "MaxNumAlgoOrdersFilter", + com.binance.connector.client.spot.websocket.api + .model.MaxNumAlgoOrdersFilter.class); + classByDiscriminatorValue.put( + "MaxNumIcebergOrdersFilter", + com.binance.connector.client.spot.websocket.api + .model.MaxNumIcebergOrdersFilter.class); + classByDiscriminatorValue.put( + "MaxNumOrderAmendsFilter", + com.binance.connector.client.spot.websocket.api + .model.MaxNumOrderAmendsFilter.class); + classByDiscriminatorValue.put( + "MaxNumOrderListsFilter", + com.binance.connector.client.spot.websocket.api + .model.MaxNumOrderListsFilter.class); + classByDiscriminatorValue.put( + "MaxNumOrdersFilter", + com.binance.connector.client.spot.websocket.api + .model.MaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "MaxPositionFilter", + com.binance.connector.client.spot.websocket.api + .model.MaxPositionFilter.class); + classByDiscriminatorValue.put( + "MinNotionalFilter", + com.binance.connector.client.spot.websocket.api + .model.MinNotionalFilter.class); + classByDiscriminatorValue.put( + "NotionalFilter", + com.binance.connector.client.spot.websocket.api + .model.NotionalFilter.class); + classByDiscriminatorValue.put( + "PercentPriceBySideFilter", + com.binance.connector.client.spot.websocket.api + .model.PercentPriceBySideFilter.class); + classByDiscriminatorValue.put( + "PercentPriceFilter", + com.binance.connector.client.spot.websocket.api + .model.PercentPriceFilter.class); + classByDiscriminatorValue.put( + "PriceFilter", + com.binance.connector.client.spot.websocket.api + .model.PriceFilter.class); + classByDiscriminatorValue.put( + "TPlusSellFilter", + com.binance.connector.client.spot.websocket.api + .model.TPlusSellFilter.class); + classByDiscriminatorValue.put( + "TrailingDeltaFilter", + com.binance.connector.client.spot.websocket.api + .model.TrailingDeltaFilter.class); + classByDiscriminatorValue.put( + "symbolFilters", + com.binance.connector.client.spot.websocket.api + .model.SymbolFilters.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "filterType")); + } + }) .registerTypeSelector( com.binance.connector.client.spot.websocket.api.model .UserDataStreamEventsResponse.class, @@ -228,6 +474,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .AllOrdersResponseResultInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.AssetFilters + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.AvgPriceRequest .CustomTypeAdapterFactory()); @@ -255,9 +504,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.ExchangeFilters .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model.ExchangeFiltersInner - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.ExchangeInfoRequest .CustomTypeAdapterFactory()); @@ -273,12 +519,27 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .ExchangeInfoResponseResultSymbolsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .ExchangeMaxNumAlgoOrdersFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .ExchangeMaxNumIcebergOrdersFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .ExchangeMaxNumOrderListsFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.ExchangeMaxNumOrdersFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.ExecutionReport .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.ExternalLockUpdate .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.IcebergPartsFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.KlinesItem .CustomTypeAdapterFactory()); @@ -300,6 +561,36 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.ListenKeyExpired .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.LotSizeFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MarketLotSizeFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MaxAssetFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MaxNumAlgoOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MaxNumIcebergOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MaxNumOrderAmendsFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MaxNumOrderListsFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MaxNumOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MaxPositionFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MinNotionalFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.MyAllocationsRequest .CustomTypeAdapterFactory()); @@ -309,6 +600,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .MyAllocationsResponseResultInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MyFiltersRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MyFiltersResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.MyFiltersResponseResult + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.MyPreventedMatchesRequest .CustomTypeAdapterFactory()); @@ -327,6 +627,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .MyTradesResponseResultInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.NotionalFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OpenOrderListsStatusRequest.CustomTypeAdapterFactory()); @@ -548,6 +851,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OutboundAccountPositionBInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.PercentPriceBySideFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.PercentPriceFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.Permissions .CustomTypeAdapterFactory()); @@ -555,10 +864,10 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.spot.websocket.api.model.PingResponse .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model.RateLimits + new com.binance.connector.client.spot.websocket.api.model.PriceFilter .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model.RateLimitsInner + new com.binance.connector.client.spot.websocket.api.model.RateLimits .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.SessionLogonRequest @@ -608,9 +917,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.SorOrderTestResponseResult .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.SymbolFilters + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.Symbols .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.TPlusSellFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.Ticker24hrRequest .CustomTypeAdapterFactory()); @@ -722,6 +1037,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .TradesRecentResponseResultInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.TrailingDeltaFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.UiKlinesItem .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 13db675d7..3fda197fa 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 @@ -28,6 +28,8 @@ import com.binance.connector.client.spot.websocket.api.model.AllOrdersResponse; import com.binance.connector.client.spot.websocket.api.model.MyAllocationsRequest; import com.binance.connector.client.spot.websocket.api.model.MyAllocationsResponse; +import com.binance.connector.client.spot.websocket.api.model.MyFiltersRequest; +import com.binance.connector.client.spot.websocket.api.model.MyFiltersResponse; import com.binance.connector.client.spot.websocket.api.model.MyPreventedMatchesRequest; import com.binance.connector.client.spot.websocket.api.model.MyPreventedMatchesResponse; import com.binance.connector.client.spot.websocket.api.model.MyTradesRequest; @@ -434,6 +436,69 @@ private void myAllocationsValidateBeforeCall(MyAllocationsRequest myAllocationsR } } + /** + * WebSocket Query Relevant Filters Retrieves the list of [filters](filters.md) relevant to an + * account on a given symbol. This is the only endpoint that shows if an account has + * `MAX_ASSET` filters applied to it. Weight: 40 + * + * @param myFiltersRequest (required) + * @return MyFiltersResponse + * @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 Query Relevant Filters -
+ * + * @see WebSocket + * Query Relevant Filters Documentation + */ + public CompletableFuture myFilters(MyFiltersRequest myFiltersRequest) + throws ApiException { + myFiltersValidateBeforeCall(myFiltersRequest); + String methodName = "/myFilters".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder() + .id(getRequestID()) + .method(methodName) + .params(myFiltersRequest) + .responseType(MyFiltersResponse.class) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @SuppressWarnings("rawtypes") + private void myFiltersValidateBeforeCall(MyFiltersRequest myFiltersRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(myFiltersRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + /** * WebSocket Account prevented matches Displays the list of orders that were expired due to STP. * These are the combinations supported: * `symbol` + `preventedMatchId` * 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 bb7c87aaa..62d401215 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 @@ -28,6 +28,8 @@ import com.binance.connector.client.spot.websocket.api.model.KlinesResponse; import com.binance.connector.client.spot.websocket.api.model.MyAllocationsRequest; import com.binance.connector.client.spot.websocket.api.model.MyAllocationsResponse; +import com.binance.connector.client.spot.websocket.api.model.MyFiltersRequest; +import com.binance.connector.client.spot.websocket.api.model.MyFiltersResponse; import com.binance.connector.client.spot.websocket.api.model.MyPreventedMatchesRequest; import com.binance.connector.client.spot.websocket.api.model.MyPreventedMatchesResponse; import com.binance.connector.client.spot.websocket.api.model.MyTradesRequest; @@ -110,7 +112,7 @@ public class SpotWebSocketApi { private static final String USER_AGENT = String.format( - "binance-spot/6.0.0 (Java/%s; %s; %s)", + "binance-spot/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; @@ -180,6 +182,11 @@ public CompletableFuture myAllocations( return accountApi.myAllocations(myAllocationsRequest); } + public CompletableFuture myFilters(MyFiltersRequest myFiltersRequest) + throws ApiException { + return accountApi.myFilters(myFiltersRequest); + } + public CompletableFuture myPreventedMatches( MyPreventedMatchesRequest myPreventedMatchesRequest) throws ApiException { return accountApi.myPreventedMatches(myPreventedMatchesRequest); 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 7d7623f0c..1af5e1892 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 @@ -98,7 +98,7 @@ private void sessionSubscriptionsValidateBeforeCall() throws ApiException {} * close automatically after 60 minutes, even if you're listening to them on WebSocket * Streams. In order to keep the stream open, you have to regularly send pings using the * `userDataStream.ping` request. It is recommended to send a ping once every 30 - * minutes. Weight: 2 + * minutes. This request does not require `signature`. Weight: 2 * * @param userDataStreamPingRequest (required) * @return UserDataStreamPingResponse @@ -162,7 +162,9 @@ private void userDataStreamPingValidateBeforeCall( } /** - * WebSocket Start user data stream Start a new user data stream. Weight: 2 + * WebSocket Start user data stream Start a new user data stream. Note the stream will close in + * 60 minutes unless `userDataStream.ping` requests are sent regularly. This request + * does not require `signature`. Weight: 2 * * @return UserDataStreamStartResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -204,7 +206,8 @@ public CompletableFuture userDataStreamStart() private void userDataStreamStartValidateBeforeCall() throws ApiException {} /** - * WebSocket Stop user data stream Explicitly stop and close the user data stream. Weight: 2 + * WebSocket Stop user data stream Explicitly stop and close the user data stream. This request + * does not require `signature`. Weight: 2 * * @param userDataStreamStopRequest (required) * @return UserDataStreamStopResponse diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AboveTimeInForce.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AboveTimeInForce.java new file mode 100644 index 000000000..70c154dab --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AboveTimeInForce.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 aboveTimeInForce */ +@JsonAdapter(AboveTimeInForce.Adapter.class) +public enum AboveTimeInForce { + GTC("GTC"), + + IOC("IOC"), + + FOK("FOK"); + + private String value; + + AboveTimeInForce(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AboveTimeInForce fromValue(String value) { + for (AboveTimeInForce b : AboveTimeInForce.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 AboveTimeInForce enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AboveTimeInForce read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AboveTimeInForce.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AboveTimeInForce.fromValue(value); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponse.java index 6ed2ed320..1f6a37506 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class AccountCommissionResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public AccountCommissionResponse() {} @@ -126,11 +129,19 @@ public void setResult(@jakarta.annotation.Nullable AccountCommissionResponseResu } public AccountCommissionResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public AccountCommissionResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -138,11 +149,11 @@ public AccountCommissionResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -197,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -306,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { AccountCommissionResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersRequest.java index 24d02e81a..339f36a8c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -43,11 +45,12 @@ public class AccountRateLimitsOrdersRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public AccountRateLimitsOrdersRequest() {} - public AccountRateLimitsOrdersRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public AccountRateLimitsOrdersRequest recvWindow( + @jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -58,11 +61,12 @@ public AccountRateLimitsOrdersRequest recvWindow(@jakarta.annotation.Nullable Lo * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -97,9 +101,10 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponse.java index 2432b3231..e34804797 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponse.java @@ -65,7 +65,7 @@ public class AccountRateLimitsOrdersResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public AccountRateLimitsOrdersResponse() {} @@ -141,11 +141,19 @@ public void setResult( } public AccountRateLimitsOrdersResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public AccountRateLimitsOrdersResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -153,11 +161,11 @@ public AccountRateLimitsOrdersResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -213,7 +221,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -339,6 +347,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusRequest.java index 953896c6e..90af3c7d0 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -49,7 +51,7 @@ public class AccountStatusRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public AccountStatusRequest() {} @@ -73,7 +75,7 @@ public void setOmitZeroBalances(@jakarta.annotation.Nullable Boolean omitZeroBal this.omitZeroBalances = omitZeroBalances; } - public AccountStatusRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public AccountStatusRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -84,11 +86,12 @@ public AccountStatusRequest recvWindow(@jakarta.annotation.Nullable Long recvWin * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -129,9 +132,10 @@ public String toUrlQueryString() { String omitZeroBalancesValueAsString = omitZeroBalancesValue.toString(); valMap.put("omitZeroBalances", omitZeroBalancesValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusResponse.java index 7e812d32f..d57988548 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class AccountStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public AccountStatusResponse() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable AccountStatusResponseResult r this.result = result; } - public AccountStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public AccountStatusResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public AccountStatusResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public AccountStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { AccountStatusResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsRequest.java index ae1431209..be5bde0df 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -67,7 +69,7 @@ public class AllOrderListsRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public AllOrderListsRequest() {} @@ -147,7 +149,7 @@ public void setLimit(@jakarta.annotation.Nullable Integer limit) { this.limit = limit; } - public AllOrderListsRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public AllOrderListsRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -158,11 +160,12 @@ public AllOrderListsRequest recvWindow(@jakarta.annotation.Nullable Long recvWin * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -224,9 +227,10 @@ public String toUrlQueryString() { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponse.java index dd879c89a..b040e59a0 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponse.java @@ -65,7 +65,7 @@ public class AllOrderListsResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public AllOrderListsResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public AllOrderListsResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public AllOrderListsResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public AllOrderListsResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public AllOrderListsResponse rateLimits(@jakarta.annotation.Nullable RateLimits */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersRequest.java index 92a6c7580..35b0bff41 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -73,7 +75,7 @@ public class AllOrdersRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public AllOrdersRequest() {} @@ -173,7 +175,7 @@ public void setLimit(@jakarta.annotation.Nullable Integer limit) { this.limit = limit; } - public AllOrdersRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public AllOrdersRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -184,11 +186,12 @@ public AllOrdersRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -257,9 +260,10 @@ public String toUrlQueryString() { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersResponse.java index c8a2a1ab6..44475ae84 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersResponse.java @@ -65,7 +65,7 @@ public class AllOrdersResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public AllOrdersResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public AllOrdersResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public AllOrdersResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public AllOrdersResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public AllOrdersResponse rateLimits(@jakarta.annotation.Nullable RateLimits rate */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AssetFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AssetFilters.java new file mode 100644 index 000000000..0c5be8987 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AssetFilters.java @@ -0,0 +1,266 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.hibernate.validator.constraints.*; + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AssetFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AssetFilters.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterMaxAssetFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxAssetFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetFilters value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `MaxAssetFilter` + if (value.getActualInstance() instanceof MaxAssetFilter) { + JsonElement element = + adapterMaxAssetFilter.toJsonTree( + (MaxAssetFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " MaxAssetFilter"); + } + + @Override + public AssetFilters read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + AssetFilters newAssetFilters = new AssetFilters(); + if (jsonObject.get("filterType") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for AssetFilters as" + + " `filterType` was not found in the payload or the" + + " payload is empty."); + } else { + // look up the discriminator value in the field `filterType` + switch (jsonObject.get("filterType").getAsString()) { + case "MAX_ASSET": + deserialized = + adapterMaxAssetFilter.fromJsonTree(jsonObject); + newAssetFilters.setActualInstance(deserialized); + return newAssetFilters; + case "MaxAssetFilter": + deserialized = + adapterMaxAssetFilter.fromJsonTree(jsonObject); + newAssetFilters.setActualInstance(deserialized); + return newAssetFilters; + default: + newAssetFilters.setActualInstance(jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for AssetFilters. Possible values:" + + " MAX_ASSET MaxAssetFilter. Falling" + + " back to String.", + jsonObject + .get("filterType") + .getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize MaxAssetFilter + try { + // validate the JSON object to see if any exception is thrown + MaxAssetFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxAssetFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'MaxAssetFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxAssetFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxAssetFilter'", + e); + } + + if (match == 1) { + AssetFilters ret = new AssetFilters(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for AssetFilters: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public AssetFilters() { + super("oneOf", Boolean.FALSE); + } + + public AssetFilters(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("MaxAssetFilter", MaxAssetFilter.class); + } + + @Override + public Map> getSchemas() { + return AssetFilters.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: MaxAssetFilter + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof MaxAssetFilter) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be MaxAssetFilter"); + } + + /** + * Get the actual instance, which can be the following: MaxAssetFilter + * + * @return The actual instance (MaxAssetFilter) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxAssetFilter`. If the actual instance is not `MaxAssetFilter`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `MaxAssetFilter` + * @throws ClassCastException if the instance is not `MaxAssetFilter` + */ + public MaxAssetFilter getMaxAssetFilter() throws ClassCastException { + return (MaxAssetFilter) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with MaxAssetFilter + try { + MaxAssetFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxAssetFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for AssetFilters with oneOf schemas:" + + " MaxAssetFilter. %d class(es) match the result, expected 1." + + " Detailed failure message for oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of AssetFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetFilters + * @throws IOException if the JSON string is invalid with respect to AssetFilters + */ + public static AssetFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetFilters.class); + } + + /** + * Convert an instance of AssetFilters 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/AvgPriceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponse.java index 48f9724a5..af4aab626 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class AvgPriceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public AvgPriceResponse() {} @@ -124,11 +127,20 @@ public void setResult(@jakarta.annotation.Nullable AvgPriceResponseResult result this.result = result; } - public AvgPriceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public AvgPriceResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public AvgPriceResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -136,11 +148,11 @@ public AvgPriceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateL */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -195,7 +207,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -304,6 +316,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { AvgPriceResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BelowTimeInForce.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BelowTimeInForce.java index d3daf1b95..4057995a3 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BelowTimeInForce.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/BelowTimeInForce.java @@ -24,11 +24,11 @@ /** Gets or Sets belowTimeInForce */ @JsonAdapter(BelowTimeInForce.Adapter.class) public enum BelowTimeInForce { - belowType("belowType"), + GTC("GTC"), - STOP_LOSS_LIMIT("STOP_LOSS_LIMIT"), + IOC("IOC"), - TAKE_PROFIT_LIMIT("TAKE_PROFIT_LIMIT"); + FOK("FOK"); private String value; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthResponse.java index d953e41de..2dfe7f401 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class DepthResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public DepthResponse() {} @@ -124,11 +127,20 @@ public void setResult(@jakarta.annotation.Nullable DepthResponseResult result) { this.result = result; } - public DepthResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public DepthResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public DepthResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -136,11 +148,11 @@ public DepthResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimi */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -195,7 +207,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -304,6 +316,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { DepthResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFilters.java index 39dd4d706..698b67f72 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFilters.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFilters.java @@ -12,9 +12,11 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.AbstractOpenApiSchema; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; @@ -22,88 +24,425 @@ import com.google.gson.stream.JsonWriter; import jakarta.validation.constraints.*; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.HashSet; +import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; +import java.util.logging.Level; +import java.util.logging.Logger; import org.hibernate.validator.constraints.*; -/** ExchangeFilters */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class ExchangeFilters extends ArrayList { - public ExchangeFilters() {} +public class ExchangeFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ExchangeFilters.class.getName()); - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterExchangeMaxNumOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeMaxNumOrdersFilter.class)); + final TypeAdapter + adapterExchangeMaxNumAlgoOrdersFilter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumAlgoOrdersFilter.class)); + final TypeAdapter + adapterExchangeMaxNumIcebergOrdersFilter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumIcebergOrdersFilter.class)); + final TypeAdapter + adapterExchangeMaxNumOrderListsFilter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumOrderListsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeFilters value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ExchangeMaxNumOrdersFilter` + if (value.getActualInstance() instanceof ExchangeMaxNumOrdersFilter) { + JsonElement element = + adapterExchangeMaxNumOrdersFilter.toJsonTree( + (ExchangeMaxNumOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ExchangeMaxNumAlgoOrdersFilter` + if (value.getActualInstance() + instanceof ExchangeMaxNumAlgoOrdersFilter) { + JsonElement element = + adapterExchangeMaxNumAlgoOrdersFilter.toJsonTree( + (ExchangeMaxNumAlgoOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ExchangeMaxNumIcebergOrdersFilter` + if (value.getActualInstance() + instanceof ExchangeMaxNumIcebergOrdersFilter) { + JsonElement element = + adapterExchangeMaxNumIcebergOrdersFilter.toJsonTree( + (ExchangeMaxNumIcebergOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ExchangeMaxNumOrderListsFilter` + if (value.getActualInstance() + instanceof ExchangeMaxNumOrderListsFilter) { + JsonElement element = + adapterExchangeMaxNumOrderListsFilter.toJsonTree( + (ExchangeMaxNumOrderListsFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " ExchangeMaxNumAlgoOrdersFilter," + + " ExchangeMaxNumIcebergOrdersFilter," + + " ExchangeMaxNumOrderListsFilter," + + " ExchangeMaxNumOrdersFilter"); + } + + @Override + public ExchangeFilters read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + ExchangeFilters newExchangeFilters = new ExchangeFilters(); + if (jsonObject.get("filterType") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for ExchangeFilters" + + " as `filterType` was not found in the payload or the" + + " payload is empty."); + } else { + // look up the discriminator value in the field `filterType` + switch (jsonObject.get("filterType").getAsString()) { + case "EXCHANGE_MAX_NUM_ALGO_ORDERS": + deserialized = + adapterExchangeMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "EXCHANGE_MAX_NUM_ICEBERG_ORDERS": + deserialized = + adapterExchangeMaxNumIcebergOrdersFilter + .fromJsonTree(jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "EXCHANGE_MAX_NUM_ORDERS": + deserialized = + adapterExchangeMaxNumOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "EXCHANGE_MAX_NUM_ORDER_LISTS": + deserialized = + adapterExchangeMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumAlgoOrdersFilter": + deserialized = + adapterExchangeMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumIcebergOrdersFilter": + deserialized = + adapterExchangeMaxNumIcebergOrdersFilter + .fromJsonTree(jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumOrderListsFilter": + deserialized = + adapterExchangeMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumOrdersFilter": + deserialized = + adapterExchangeMaxNumOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + default: + newExchangeFilters.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for ExchangeFilters. Possible" + + " values:" + + " EXCHANGE_MAX_NUM_ALGO_ORDERS" + + " EXCHANGE_MAX_NUM_ICEBERG_ORDERS" + + " EXCHANGE_MAX_NUM_ORDERS" + + " EXCHANGE_MAX_NUM_ORDER_LISTS" + + " ExchangeMaxNumAlgoOrdersFilter" + + " ExchangeMaxNumIcebergOrdersFilter" + + " ExchangeMaxNumOrderListsFilter" + + " ExchangeMaxNumOrdersFilter. Falling" + + " back to String.", + jsonObject + .get("filterType") + .getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ExchangeMaxNumOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'ExchangeMaxNumOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrdersFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumOrdersFilter'", + e); + } + // deserialize ExchangeMaxNumAlgoOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumAlgoOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ExchangeMaxNumAlgoOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumAlgoOrdersFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumAlgoOrdersFilter'", + e); + } + // deserialize ExchangeMaxNumIcebergOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumIcebergOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ExchangeMaxNumIcebergOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ExchangeMaxNumIcebergOrdersFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumIcebergOrdersFilter'", + e); + } + // deserialize ExchangeMaxNumOrderListsFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumOrderListsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumOrderListsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ExchangeMaxNumOrderListsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrderListsFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumOrderListsFilter'", + e); + } + + if (match == 1) { + ExchangeFilters ret = new ExchangeFilters(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for ExchangeFilters: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); } - return super.equals(o); } - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public ExchangeFilters() { + super("oneOf", Boolean.FALSE); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeFilters {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); + public ExchangeFilters(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); } - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); + static { + schemas.put("ExchangeMaxNumOrdersFilter", ExchangeMaxNumOrdersFilter.class); + schemas.put("ExchangeMaxNumAlgoOrdersFilter", ExchangeMaxNumAlgoOrdersFilter.class); + schemas.put("ExchangeMaxNumIcebergOrdersFilter", ExchangeMaxNumIcebergOrdersFilter.class); + schemas.put("ExchangeMaxNumOrderListsFilter", ExchangeMaxNumOrderListsFilter.class); + } - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); + @Override + public Map> getSchemas() { + return ExchangeFilters.schemas; } - public Map toMap() { - Map valMap = new TreeMap(); + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ExchangeMaxNumAlgoOrdersFilter, + * ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter, ExchangeMaxNumOrdersFilter + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ExchangeMaxNumOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExchangeMaxNumAlgoOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExchangeMaxNumIcebergOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExchangeMaxNumOrderListsFilter) { + super.setActualInstance(instance); + return; + } - return valMap; + throw new RuntimeException( + "Invalid instance type. Must be ExchangeMaxNumAlgoOrdersFilter," + + " ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter," + + " ExchangeMaxNumOrdersFilter"); } - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); + /** + * Get the actual instance, which can be the following: ExchangeMaxNumAlgoOrdersFilter, + * ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter, ExchangeMaxNumOrdersFilter + * + * @return The actual instance (ExchangeMaxNumAlgoOrdersFilter, + * ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter, + * ExchangeMaxNumOrdersFilter) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * Get the actual instance of `ExchangeMaxNumOrdersFilter`. If the actual instance is not + * `ExchangeMaxNumOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumOrdersFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumOrdersFilter` */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + public ExchangeMaxNumOrdersFilter getExchangeMaxNumOrdersFilter() throws ClassCastException { + return (ExchangeMaxNumOrdersFilter) super.getActualInstance(); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + /** + * Get the actual instance of `ExchangeMaxNumAlgoOrdersFilter`. If the actual instance is not + * `ExchangeMaxNumAlgoOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumAlgoOrdersFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumAlgoOrdersFilter` + */ + public ExchangeMaxNumAlgoOrdersFilter getExchangeMaxNumAlgoOrdersFilter() + throws ClassCastException { + return (ExchangeMaxNumAlgoOrdersFilter) super.getActualInstance(); + } - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); + /** + * Get the actual instance of `ExchangeMaxNumIcebergOrdersFilter`. If the actual instance is not + * `ExchangeMaxNumIcebergOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumIcebergOrdersFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumIcebergOrdersFilter` + */ + public ExchangeMaxNumIcebergOrdersFilter getExchangeMaxNumIcebergOrdersFilter() + throws ClassCastException { + return (ExchangeMaxNumIcebergOrdersFilter) super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); + /** + * Get the actual instance of `ExchangeMaxNumOrderListsFilter`. If the actual instance is not + * `ExchangeMaxNumOrderListsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumOrderListsFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumOrderListsFilter` + */ + public ExchangeMaxNumOrderListsFilter getExchangeMaxNumOrderListsFilter() + throws ClassCastException { + return (ExchangeMaxNumOrderListsFilter) super.getActualInstance(); } /** @@ -113,57 +452,64 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to ExchangeFilters */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExchangeFilters.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExchangeFilters is not found in the" - + " empty JSON string", - ExchangeFilters.openapiRequiredFields.toString())); - } + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ExchangeMaxNumOrdersFilter + try { + ExchangeMaxNumOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeFilters.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeFilters` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } + // validate the json string with ExchangeMaxNumAlgoOrdersFilter + try { + ExchangeMaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumAlgoOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeFilters.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExchangeFilters' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExchangeFilters.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExchangeFilters value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); - elementAdapter.write(out, obj); - } - - @Override - public ExchangeFilters read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); + // validate the json string with ExchangeMaxNumIcebergOrdersFilter + try { + ExchangeMaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumIcebergOrdersFilter failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ExchangeMaxNumOrderListsFilter + try { + ExchangeMaxNumOrderListsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrderListsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for ExchangeFilters with oneOf schemas:" + + " ExchangeMaxNumAlgoOrdersFilter," + + " ExchangeMaxNumIcebergOrdersFilter," + + " ExchangeMaxNumOrderListsFilter, ExchangeMaxNumOrdersFilter. %d" + + " class(es) match the result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); } } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java deleted file mode 100644 index 76cf16f2d..000000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java +++ /dev/null @@ -1,1494 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.websocket.api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** ExchangeFiltersInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class ExchangeFiltersInner extends BaseDTO { - public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; - - @SerializedName(SERIALIZED_NAME_FILTER_TYPE) - @jakarta.annotation.Nullable - private String filterType; - - public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; - - @SerializedName(SERIALIZED_NAME_MIN_PRICE) - @jakarta.annotation.Nullable - private String minPrice; - - public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; - - @SerializedName(SERIALIZED_NAME_MAX_PRICE) - @jakarta.annotation.Nullable - private String maxPrice; - - public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; - - @SerializedName(SERIALIZED_NAME_TICK_SIZE) - @jakarta.annotation.Nullable - private String tickSize; - - public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; - - @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) - @jakarta.annotation.Nullable - private String multiplierUp; - - public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; - - @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) - @jakarta.annotation.Nullable - private String multiplierDown; - - public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; - - @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) - @jakarta.annotation.Nullable - private Long avgPriceMins; - - public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; - - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) - @jakarta.annotation.Nullable - private String bidMultiplierUp; - - public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; - - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) - @jakarta.annotation.Nullable - private String bidMultiplierDown; - - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; - - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) - @jakarta.annotation.Nullable - private String askMultiplierUp; - - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; - - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) - @jakarta.annotation.Nullable - private String askMultiplierDown; - - public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; - - @SerializedName(SERIALIZED_NAME_MIN_QTY) - @jakarta.annotation.Nullable - private String minQty; - - public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; - - @SerializedName(SERIALIZED_NAME_MAX_QTY) - @jakarta.annotation.Nullable - private String maxQty; - - public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; - - @SerializedName(SERIALIZED_NAME_STEP_SIZE) - @jakarta.annotation.Nullable - private String stepSize; - - public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; - - @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) - @jakarta.annotation.Nullable - private String minNotional; - - public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyToMarket; - - public static final String SERIALIZED_NAME_APPLY_MIN_TO_MARKET = "applyMinToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_MIN_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyMinToMarket; - - public static final String SERIALIZED_NAME_MAX_NOTIONAL = "maxNotional"; - - @SerializedName(SERIALIZED_NAME_MAX_NOTIONAL) - @jakarta.annotation.Nullable - private String maxNotional; - - public static final String SERIALIZED_NAME_APPLY_MAX_TO_MARKET = "applyMaxToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_MAX_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyMaxToMarket; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; - - @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) - @jakarta.annotation.Nullable - private Long maxNumOrders; - - public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; - - @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) - @jakarta.annotation.Nullable - private Long maxNumAlgoOrders; - - public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; - - @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) - @jakarta.annotation.Nullable - private Long maxNumIcebergOrders; - - public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; - - @SerializedName(SERIALIZED_NAME_MAX_POSITION) - @jakarta.annotation.Nullable - private String maxPosition; - - public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; - - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) - @jakarta.annotation.Nullable - private Long minTrailingAboveDelta; - - public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; - - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) - @jakarta.annotation.Nullable - private Long maxTrailingAboveDelta; - - public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; - - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) - @jakarta.annotation.Nullable - private Long minTrailingBelowDelta; - - public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; - - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) - @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) { - this.filterType = filterType; - return this; - } - - /** - * Get filterType - * - * @return filterType - */ - @jakarta.annotation.Nullable - public String getFilterType() { - return filterType; - } - - public void setFilterType(@jakarta.annotation.Nullable String filterType) { - this.filterType = filterType; - } - - public ExchangeFiltersInner minPrice(@jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; - return this; - } - - /** - * Get minPrice - * - * @return minPrice - */ - @jakarta.annotation.Nullable - public String getMinPrice() { - return minPrice; - } - - public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; - } - - public ExchangeFiltersInner maxPrice(@jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; - return this; - } - - /** - * Get maxPrice - * - * @return maxPrice - */ - @jakarta.annotation.Nullable - public String getMaxPrice() { - return maxPrice; - } - - public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; - } - - public ExchangeFiltersInner tickSize(@jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; - return this; - } - - /** - * Get tickSize - * - * @return tickSize - */ - @jakarta.annotation.Nullable - public String getTickSize() { - return tickSize; - } - - public void setTickSize(@jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; - } - - public ExchangeFiltersInner multiplierUp(@jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; - return this; - } - - /** - * Get multiplierUp - * - * @return multiplierUp - */ - @jakarta.annotation.Nullable - public String getMultiplierUp() { - return multiplierUp; - } - - public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; - } - - public ExchangeFiltersInner multiplierDown(@jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; - return this; - } - - /** - * Get multiplierDown - * - * @return multiplierDown - */ - @jakarta.annotation.Nullable - public String getMultiplierDown() { - return multiplierDown; - } - - public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; - } - - public ExchangeFiltersInner avgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - return this; - } - - /** - * Get avgPriceMins - * - * @return avgPriceMins - */ - @jakarta.annotation.Nullable - public Long getAvgPriceMins() { - return avgPriceMins; - } - - public void setAvgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - } - - public ExchangeFiltersInner bidMultiplierUp( - @jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; - return this; - } - - /** - * Get bidMultiplierUp - * - * @return bidMultiplierUp - */ - @jakarta.annotation.Nullable - public String getBidMultiplierUp() { - return bidMultiplierUp; - } - - public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; - } - - public ExchangeFiltersInner bidMultiplierDown( - @jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; - return this; - } - - /** - * Get bidMultiplierDown - * - * @return bidMultiplierDown - */ - @jakarta.annotation.Nullable - public String getBidMultiplierDown() { - return bidMultiplierDown; - } - - public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; - } - - public ExchangeFiltersInner askMultiplierUp( - @jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; - return this; - } - - /** - * Get askMultiplierUp - * - * @return askMultiplierUp - */ - @jakarta.annotation.Nullable - public String getAskMultiplierUp() { - return askMultiplierUp; - } - - public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; - } - - public ExchangeFiltersInner askMultiplierDown( - @jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; - return this; - } - - /** - * Get askMultiplierDown - * - * @return askMultiplierDown - */ - @jakarta.annotation.Nullable - public String getAskMultiplierDown() { - return askMultiplierDown; - } - - public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; - } - - public ExchangeFiltersInner minQty(@jakarta.annotation.Nullable String minQty) { - this.minQty = minQty; - return this; - } - - /** - * Get minQty - * - * @return minQty - */ - @jakarta.annotation.Nullable - public String getMinQty() { - return minQty; - } - - public void setMinQty(@jakarta.annotation.Nullable String minQty) { - this.minQty = minQty; - } - - public ExchangeFiltersInner maxQty(@jakarta.annotation.Nullable String maxQty) { - this.maxQty = maxQty; - return this; - } - - /** - * Get maxQty - * - * @return maxQty - */ - @jakarta.annotation.Nullable - public String getMaxQty() { - return maxQty; - } - - public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { - this.maxQty = maxQty; - } - - public ExchangeFiltersInner stepSize(@jakarta.annotation.Nullable String stepSize) { - this.stepSize = stepSize; - return this; - } - - /** - * Get stepSize - * - * @return stepSize - */ - @jakarta.annotation.Nullable - public String getStepSize() { - return stepSize; - } - - public void setStepSize(@jakarta.annotation.Nullable String stepSize) { - this.stepSize = stepSize; - } - - public ExchangeFiltersInner minNotional(@jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; - return this; - } - - /** - * Get minNotional - * - * @return minNotional - */ - @jakarta.annotation.Nullable - public String getMinNotional() { - return minNotional; - } - - public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; - } - - public ExchangeFiltersInner applyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - return this; - } - - /** - * Get applyToMarket - * - * @return applyToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyToMarket() { - return applyToMarket; - } - - public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - } - - public ExchangeFiltersInner applyMinToMarket( - @jakarta.annotation.Nullable Boolean applyMinToMarket) { - this.applyMinToMarket = applyMinToMarket; - return this; - } - - /** - * Get applyMinToMarket - * - * @return applyMinToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyMinToMarket() { - return applyMinToMarket; - } - - public void setApplyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { - this.applyMinToMarket = applyMinToMarket; - } - - public ExchangeFiltersInner maxNotional(@jakarta.annotation.Nullable String maxNotional) { - this.maxNotional = maxNotional; - return this; - } - - /** - * Get maxNotional - * - * @return maxNotional - */ - @jakarta.annotation.Nullable - public String getMaxNotional() { - return maxNotional; - } - - public void setMaxNotional(@jakarta.annotation.Nullable String maxNotional) { - this.maxNotional = maxNotional; - } - - public ExchangeFiltersInner applyMaxToMarket( - @jakarta.annotation.Nullable Boolean applyMaxToMarket) { - this.applyMaxToMarket = applyMaxToMarket; - return this; - } - - /** - * Get applyMaxToMarket - * - * @return applyMaxToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyMaxToMarket() { - return applyMaxToMarket; - } - - public void setApplyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { - this.applyMaxToMarket = applyMaxToMarket; - } - - public ExchangeFiltersInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public ExchangeFiltersInner maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; - return this; - } - - /** - * Get maxNumOrders - * - * @return maxNumOrders - */ - @jakarta.annotation.Nullable - public Long getMaxNumOrders() { - return maxNumOrders; - } - - public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; - } - - public ExchangeFiltersInner maxNumAlgoOrders( - @jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; - return this; - } - - /** - * Get maxNumAlgoOrders - * - * @return maxNumAlgoOrders - */ - @jakarta.annotation.Nullable - public Long getMaxNumAlgoOrders() { - return maxNumAlgoOrders; - } - - public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; - } - - public ExchangeFiltersInner maxNumIcebergOrders( - @jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; - return this; - } - - /** - * Get maxNumIcebergOrders - * - * @return maxNumIcebergOrders - */ - @jakarta.annotation.Nullable - public Long getMaxNumIcebergOrders() { - return maxNumIcebergOrders; - } - - public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; - } - - public ExchangeFiltersInner maxPosition(@jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; - return this; - } - - /** - * Get maxPosition - * - * @return maxPosition - */ - @jakarta.annotation.Nullable - public String getMaxPosition() { - return maxPosition; - } - - public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; - } - - public ExchangeFiltersInner minTrailingAboveDelta( - @jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; - return this; - } - - /** - * Get minTrailingAboveDelta - * - * @return minTrailingAboveDelta - */ - @jakarta.annotation.Nullable - public Long getMinTrailingAboveDelta() { - return minTrailingAboveDelta; - } - - public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; - } - - public ExchangeFiltersInner maxTrailingAboveDelta( - @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; - return this; - } - - /** - * Get maxTrailingAboveDelta - * - * @return maxTrailingAboveDelta - */ - @jakarta.annotation.Nullable - public Long getMaxTrailingAboveDelta() { - return maxTrailingAboveDelta; - } - - public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; - } - - public ExchangeFiltersInner minTrailingBelowDelta( - @jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; - return this; - } - - /** - * Get minTrailingBelowDelta - * - * @return minTrailingBelowDelta - */ - @jakarta.annotation.Nullable - public Long getMinTrailingBelowDelta() { - return minTrailingBelowDelta; - } - - public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; - } - - public ExchangeFiltersInner maxTrailingBelowDelta( - @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - this.maxTrailingBelowDelta = maxTrailingBelowDelta; - return this; - } - - /** - * Get maxTrailingBelowDelta - * - * @return maxTrailingBelowDelta - */ - @jakarta.annotation.Nullable - public Long getMaxTrailingBelowDelta() { - return maxTrailingBelowDelta; - } - - public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - 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) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExchangeFiltersInner exchangeFiltersInner = (ExchangeFiltersInner) o; - return Objects.equals(this.filterType, exchangeFiltersInner.filterType) - && Objects.equals(this.minPrice, exchangeFiltersInner.minPrice) - && Objects.equals(this.maxPrice, exchangeFiltersInner.maxPrice) - && Objects.equals(this.tickSize, exchangeFiltersInner.tickSize) - && Objects.equals(this.multiplierUp, exchangeFiltersInner.multiplierUp) - && Objects.equals(this.multiplierDown, exchangeFiltersInner.multiplierDown) - && Objects.equals(this.avgPriceMins, exchangeFiltersInner.avgPriceMins) - && Objects.equals(this.bidMultiplierUp, exchangeFiltersInner.bidMultiplierUp) - && Objects.equals(this.bidMultiplierDown, exchangeFiltersInner.bidMultiplierDown) - && Objects.equals(this.askMultiplierUp, exchangeFiltersInner.askMultiplierUp) - && Objects.equals(this.askMultiplierDown, exchangeFiltersInner.askMultiplierDown) - && Objects.equals(this.minQty, exchangeFiltersInner.minQty) - && Objects.equals(this.maxQty, exchangeFiltersInner.maxQty) - && Objects.equals(this.stepSize, exchangeFiltersInner.stepSize) - && Objects.equals(this.minNotional, exchangeFiltersInner.minNotional) - && Objects.equals(this.applyToMarket, exchangeFiltersInner.applyToMarket) - && Objects.equals(this.applyMinToMarket, exchangeFiltersInner.applyMinToMarket) - && Objects.equals(this.maxNotional, exchangeFiltersInner.maxNotional) - && Objects.equals(this.applyMaxToMarket, exchangeFiltersInner.applyMaxToMarket) - && Objects.equals(this.limit, exchangeFiltersInner.limit) - && Objects.equals(this.maxNumOrders, exchangeFiltersInner.maxNumOrders) - && Objects.equals(this.maxNumAlgoOrders, exchangeFiltersInner.maxNumAlgoOrders) - && Objects.equals( - this.maxNumIcebergOrders, exchangeFiltersInner.maxNumIcebergOrders) - && Objects.equals(this.maxPosition, exchangeFiltersInner.maxPosition) - && Objects.equals( - this.minTrailingAboveDelta, exchangeFiltersInner.minTrailingAboveDelta) - && Objects.equals( - this.maxTrailingAboveDelta, exchangeFiltersInner.maxTrailingAboveDelta) - && Objects.equals( - this.minTrailingBelowDelta, exchangeFiltersInner.minTrailingBelowDelta) - && Objects.equals( - this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta) - && Objects.equals(this.maxNumOrderAmends, exchangeFiltersInner.maxNumOrderAmends) - && Objects.equals(this.maxNumOrderLists, exchangeFiltersInner.maxNumOrderLists); - } - - @Override - public int hashCode() { - return Objects.hash( - filterType, - minPrice, - maxPrice, - tickSize, - multiplierUp, - multiplierDown, - avgPriceMins, - bidMultiplierUp, - bidMultiplierDown, - askMultiplierUp, - askMultiplierDown, - minQty, - maxQty, - stepSize, - minNotional, - applyToMarket, - applyMinToMarket, - maxNotional, - applyMaxToMarket, - limit, - maxNumOrders, - maxNumAlgoOrders, - maxNumIcebergOrders, - maxPosition, - minTrailingAboveDelta, - maxTrailingAboveDelta, - minTrailingBelowDelta, - maxTrailingBelowDelta, - maxNumOrderAmends, - maxNumOrderLists); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeFiltersInner {\n"); - sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); - sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); - sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); - sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); - sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); - sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); - sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); - sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); - sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); - sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); - sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); - sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); - sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); - sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); - sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); - sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); - sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); - sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); - sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); - sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); - sb.append(" maxNumIcebergOrders: ") - .append(toIndentedString(maxNumIcebergOrders)) - .append("\n"); - sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); - sb.append(" minTrailingAboveDelta: ") - .append(toIndentedString(minTrailingAboveDelta)) - .append("\n"); - sb.append(" maxTrailingAboveDelta: ") - .append(toIndentedString(maxTrailingAboveDelta)) - .append("\n"); - sb.append(" minTrailingBelowDelta: ") - .append(toIndentedString(minTrailingBelowDelta)) - .append("\n"); - 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(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String filterTypeValue = getFilterType(); - if (filterTypeValue != null) { - String filterTypeValueAsString = filterTypeValue.toString(); - valMap.put("filterType", filterTypeValueAsString); - } - String minPriceValue = getMinPrice(); - if (minPriceValue != null) { - String minPriceValueAsString = minPriceValue.toString(); - valMap.put("minPrice", minPriceValueAsString); - } - String maxPriceValue = getMaxPrice(); - if (maxPriceValue != null) { - String maxPriceValueAsString = maxPriceValue.toString(); - valMap.put("maxPrice", maxPriceValueAsString); - } - String tickSizeValue = getTickSize(); - if (tickSizeValue != null) { - String tickSizeValueAsString = tickSizeValue.toString(); - valMap.put("tickSize", tickSizeValueAsString); - } - String multiplierUpValue = getMultiplierUp(); - if (multiplierUpValue != null) { - String multiplierUpValueAsString = multiplierUpValue.toString(); - valMap.put("multiplierUp", multiplierUpValueAsString); - } - String multiplierDownValue = getMultiplierDown(); - if (multiplierDownValue != null) { - String multiplierDownValueAsString = multiplierDownValue.toString(); - valMap.put("multiplierDown", multiplierDownValueAsString); - } - Long avgPriceMinsValue = getAvgPriceMins(); - if (avgPriceMinsValue != null) { - String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); - valMap.put("avgPriceMins", avgPriceMinsValueAsString); - } - String bidMultiplierUpValue = getBidMultiplierUp(); - if (bidMultiplierUpValue != null) { - String bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); - valMap.put("bidMultiplierUp", bidMultiplierUpValueAsString); - } - String bidMultiplierDownValue = getBidMultiplierDown(); - if (bidMultiplierDownValue != null) { - String bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); - valMap.put("bidMultiplierDown", bidMultiplierDownValueAsString); - } - String askMultiplierUpValue = getAskMultiplierUp(); - if (askMultiplierUpValue != null) { - String askMultiplierUpValueAsString = askMultiplierUpValue.toString(); - valMap.put("askMultiplierUp", askMultiplierUpValueAsString); - } - String askMultiplierDownValue = getAskMultiplierDown(); - if (askMultiplierDownValue != null) { - String askMultiplierDownValueAsString = askMultiplierDownValue.toString(); - valMap.put("askMultiplierDown", askMultiplierDownValueAsString); - } - String minQtyValue = getMinQty(); - if (minQtyValue != null) { - String minQtyValueAsString = minQtyValue.toString(); - valMap.put("minQty", minQtyValueAsString); - } - String maxQtyValue = getMaxQty(); - if (maxQtyValue != null) { - String maxQtyValueAsString = maxQtyValue.toString(); - valMap.put("maxQty", maxQtyValueAsString); - } - String stepSizeValue = getStepSize(); - if (stepSizeValue != null) { - String stepSizeValueAsString = stepSizeValue.toString(); - valMap.put("stepSize", stepSizeValueAsString); - } - String minNotionalValue = getMinNotional(); - if (minNotionalValue != null) { - String minNotionalValueAsString = minNotionalValue.toString(); - valMap.put("minNotional", minNotionalValueAsString); - } - Boolean applyToMarketValue = getApplyToMarket(); - if (applyToMarketValue != null) { - String applyToMarketValueAsString = applyToMarketValue.toString(); - valMap.put("applyToMarket", applyToMarketValueAsString); - } - Boolean applyMinToMarketValue = getApplyMinToMarket(); - if (applyMinToMarketValue != null) { - String applyMinToMarketValueAsString = applyMinToMarketValue.toString(); - valMap.put("applyMinToMarket", applyMinToMarketValueAsString); - } - String maxNotionalValue = getMaxNotional(); - if (maxNotionalValue != null) { - String maxNotionalValueAsString = maxNotionalValue.toString(); - valMap.put("maxNotional", maxNotionalValueAsString); - } - Boolean applyMaxToMarketValue = getApplyMaxToMarket(); - if (applyMaxToMarketValue != null) { - String applyMaxToMarketValueAsString = applyMaxToMarketValue.toString(); - valMap.put("applyMaxToMarket", applyMaxToMarketValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long maxNumOrdersValue = getMaxNumOrders(); - if (maxNumOrdersValue != null) { - String maxNumOrdersValueAsString = maxNumOrdersValue.toString(); - valMap.put("maxNumOrders", maxNumOrdersValueAsString); - } - Long maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); - if (maxNumAlgoOrdersValue != null) { - String maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); - valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValueAsString); - } - Long maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); - if (maxNumIcebergOrdersValue != null) { - String maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); - valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValueAsString); - } - String maxPositionValue = getMaxPosition(); - if (maxPositionValue != null) { - String maxPositionValueAsString = maxPositionValue.toString(); - valMap.put("maxPosition", maxPositionValueAsString); - } - Long minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); - if (minTrailingAboveDeltaValue != null) { - String minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); - valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValueAsString); - } - Long maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); - if (maxTrailingAboveDeltaValue != null) { - String maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); - valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValueAsString); - } - Long minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); - if (minTrailingBelowDeltaValue != null) { - String minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); - valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValueAsString); - } - Long maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); - if (maxTrailingBelowDeltaValue != null) { - 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( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object filterTypeValue = getFilterType(); - if (filterTypeValue != null) { - valMap.put("filterType", filterTypeValue); - } - Object minPriceValue = getMinPrice(); - if (minPriceValue != null) { - valMap.put("minPrice", minPriceValue); - } - Object maxPriceValue = getMaxPrice(); - if (maxPriceValue != null) { - valMap.put("maxPrice", maxPriceValue); - } - Object tickSizeValue = getTickSize(); - if (tickSizeValue != null) { - valMap.put("tickSize", tickSizeValue); - } - Object multiplierUpValue = getMultiplierUp(); - if (multiplierUpValue != null) { - valMap.put("multiplierUp", multiplierUpValue); - } - Object multiplierDownValue = getMultiplierDown(); - if (multiplierDownValue != null) { - valMap.put("multiplierDown", multiplierDownValue); - } - Object avgPriceMinsValue = getAvgPriceMins(); - if (avgPriceMinsValue != null) { - valMap.put("avgPriceMins", avgPriceMinsValue); - } - Object bidMultiplierUpValue = getBidMultiplierUp(); - if (bidMultiplierUpValue != null) { - valMap.put("bidMultiplierUp", bidMultiplierUpValue); - } - Object bidMultiplierDownValue = getBidMultiplierDown(); - if (bidMultiplierDownValue != null) { - valMap.put("bidMultiplierDown", bidMultiplierDownValue); - } - Object askMultiplierUpValue = getAskMultiplierUp(); - if (askMultiplierUpValue != null) { - valMap.put("askMultiplierUp", askMultiplierUpValue); - } - Object askMultiplierDownValue = getAskMultiplierDown(); - if (askMultiplierDownValue != null) { - valMap.put("askMultiplierDown", askMultiplierDownValue); - } - Object minQtyValue = getMinQty(); - if (minQtyValue != null) { - valMap.put("minQty", minQtyValue); - } - Object maxQtyValue = getMaxQty(); - if (maxQtyValue != null) { - valMap.put("maxQty", maxQtyValue); - } - Object stepSizeValue = getStepSize(); - if (stepSizeValue != null) { - valMap.put("stepSize", stepSizeValue); - } - Object minNotionalValue = getMinNotional(); - if (minNotionalValue != null) { - valMap.put("minNotional", minNotionalValue); - } - Object applyToMarketValue = getApplyToMarket(); - if (applyToMarketValue != null) { - valMap.put("applyToMarket", applyToMarketValue); - } - Object applyMinToMarketValue = getApplyMinToMarket(); - if (applyMinToMarketValue != null) { - valMap.put("applyMinToMarket", applyMinToMarketValue); - } - Object maxNotionalValue = getMaxNotional(); - if (maxNotionalValue != null) { - valMap.put("maxNotional", maxNotionalValue); - } - Object applyMaxToMarketValue = getApplyMaxToMarket(); - if (applyMaxToMarketValue != null) { - valMap.put("applyMaxToMarket", applyMaxToMarketValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object maxNumOrdersValue = getMaxNumOrders(); - if (maxNumOrdersValue != null) { - valMap.put("maxNumOrders", maxNumOrdersValue); - } - Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); - if (maxNumAlgoOrdersValue != null) { - valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValue); - } - Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); - if (maxNumIcebergOrdersValue != null) { - valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValue); - } - Object maxPositionValue = getMaxPosition(); - if (maxPositionValue != null) { - valMap.put("maxPosition", maxPositionValue); - } - Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); - if (minTrailingAboveDeltaValue != null) { - valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValue); - } - Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); - if (maxTrailingAboveDeltaValue != null) { - valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValue); - } - Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); - if (minTrailingBelowDeltaValue != null) { - valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValue); - } - Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); - 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; - } - - 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("filterType"); - openapiFields.add("minPrice"); - openapiFields.add("maxPrice"); - openapiFields.add("tickSize"); - openapiFields.add("multiplierUp"); - openapiFields.add("multiplierDown"); - openapiFields.add("avgPriceMins"); - openapiFields.add("bidMultiplierUp"); - openapiFields.add("bidMultiplierDown"); - openapiFields.add("askMultiplierUp"); - openapiFields.add("askMultiplierDown"); - openapiFields.add("minQty"); - openapiFields.add("maxQty"); - openapiFields.add("stepSize"); - openapiFields.add("minNotional"); - openapiFields.add("applyToMarket"); - openapiFields.add("applyMinToMarket"); - openapiFields.add("maxNotional"); - openapiFields.add("applyMaxToMarket"); - openapiFields.add("limit"); - openapiFields.add("maxNumOrders"); - openapiFields.add("maxNumAlgoOrders"); - openapiFields.add("maxNumIcebergOrders"); - openapiFields.add("maxPosition"); - openapiFields.add("minTrailingAboveDelta"); - 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(); - } - - /** - * 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 ExchangeFiltersInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExchangeFiltersInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExchangeFiltersInner is not found in" - + " the empty JSON string", - ExchangeFiltersInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeFiltersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeFiltersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) - && !jsonObj.get("filterType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("filterType").toString())); - } - if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) - && !jsonObj.get("minPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("minPrice").toString())); - } - if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) - && !jsonObj.get("maxPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("maxPrice").toString())); - } - if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) - && !jsonObj.get("tickSize").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `tickSize` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("tickSize").toString())); - } - if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) - && !jsonObj.get("multiplierUp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `multiplierUp` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("multiplierUp").toString())); - } - if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) - && !jsonObj.get("multiplierDown").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `multiplierDown` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("multiplierDown").toString())); - } - if ((jsonObj.get("bidMultiplierUp") != null && !jsonObj.get("bidMultiplierUp").isJsonNull()) - && !jsonObj.get("bidMultiplierUp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bidMultiplierUp` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("bidMultiplierUp").toString())); - } - if ((jsonObj.get("bidMultiplierDown") != null - && !jsonObj.get("bidMultiplierDown").isJsonNull()) - && !jsonObj.get("bidMultiplierDown").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bidMultiplierDown` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("bidMultiplierDown").toString())); - } - if ((jsonObj.get("askMultiplierUp") != null && !jsonObj.get("askMultiplierUp").isJsonNull()) - && !jsonObj.get("askMultiplierUp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `askMultiplierUp` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("askMultiplierUp").toString())); - } - if ((jsonObj.get("askMultiplierDown") != null - && !jsonObj.get("askMultiplierDown").isJsonNull()) - && !jsonObj.get("askMultiplierDown").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `askMultiplierDown` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("askMultiplierDown").toString())); - } - if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) - && !jsonObj.get("minQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("minQty").toString())); - } - if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) - && !jsonObj.get("maxQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("maxQty").toString())); - } - if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) - && !jsonObj.get("stepSize").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `stepSize` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("stepSize").toString())); - } - if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) - && !jsonObj.get("minNotional").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minNotional` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("minNotional").toString())); - } - if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) - && !jsonObj.get("maxNotional").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxNotional` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("maxNotional").toString())); - } - if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) - && !jsonObj.get("maxPosition").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxPosition` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("maxPosition").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeFiltersInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExchangeFiltersInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExchangeFiltersInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExchangeFiltersInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ExchangeFiltersInner read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ExchangeFiltersInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExchangeFiltersInner - * @throws IOException if the JSON string is invalid with respect to ExchangeFiltersInner - */ - public static ExchangeFiltersInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExchangeFiltersInner.class); - } - - /** - * Convert an instance of ExchangeFiltersInner 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/ExchangeInfoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponse.java index 27c258bcb..6505103a8 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class ExchangeInfoResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public ExchangeInfoResponse() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable ExchangeInfoResponseResult re this.result = result; } - public ExchangeInfoResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public ExchangeInfoResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public ExchangeInfoResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public ExchangeInfoResponse rateLimits(@jakarta.annotation.Nullable RateLimits r */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { ExchangeInfoResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResult.java index ff87bcc46..1ed13b18c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResult.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResult.java @@ -59,13 +59,13 @@ public class ExchangeInfoResponseResult extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public static final String SERIALIZED_NAME_EXCHANGE_FILTERS = "exchangeFilters"; @SerializedName(SERIALIZED_NAME_EXCHANGE_FILTERS) @jakarta.annotation.Nullable - private ExchangeFilters exchangeFilters; + private List exchangeFilters; public static final String SERIALIZED_NAME_SYMBOLS = "symbols"; @@ -120,11 +120,19 @@ public void setServerTime(@jakarta.annotation.Nullable Long serverTime) { } public ExchangeInfoResponseResult rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public ExchangeInfoResponseResult addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -132,20 +140,28 @@ public ExchangeInfoResponseResult rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } public ExchangeInfoResponseResult exchangeFilters( - @jakarta.annotation.Nullable ExchangeFilters exchangeFilters) { + @jakarta.annotation.Nullable List exchangeFilters) { this.exchangeFilters = exchangeFilters; return this; } + public ExchangeInfoResponseResult addExchangeFiltersItem(ExchangeFilters exchangeFiltersItem) { + if (this.exchangeFilters == null) { + this.exchangeFilters = new ArrayList<>(); + } + this.exchangeFilters.add(exchangeFiltersItem); + return this; + } + /** * Get exchangeFilters * @@ -153,11 +169,12 @@ public ExchangeInfoResponseResult exchangeFilters( */ @jakarta.annotation.Nullable @Valid - public ExchangeFilters getExchangeFilters() { + public List getExchangeFilters() { return exchangeFilters; } - public void setExchangeFilters(@jakarta.annotation.Nullable ExchangeFilters exchangeFilters) { + public void setExchangeFilters( + @jakarta.annotation.Nullable List exchangeFilters) { this.exchangeFilters = exchangeFilters; } @@ -274,12 +291,12 @@ public String toUrlQueryString() { String serverTimeValueAsString = serverTimeValue.toString(); valMap.put("serverTime", serverTimeValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); } - ExchangeFilters exchangeFiltersValue = getExchangeFilters(); + List exchangeFiltersValue = getExchangeFilters(); if (exchangeFiltersValue != null) { String exchangeFiltersValueAsString = JSON.getGson().toJson(exchangeFiltersValue); valMap.put("exchangeFilters", exchangeFiltersValueAsString); @@ -404,6 +421,45 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("timezone").toString())); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } + if (jsonObj.get("exchangeFilters") != null + && !jsonObj.get("exchangeFilters").isJsonNull()) { + JsonArray jsonArrayexchangeFilters = jsonObj.getAsJsonArray("exchangeFilters"); + if (jsonArrayexchangeFilters != null) { + // ensure the json data is an array + if (!jsonObj.get("exchangeFilters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `exchangeFilters` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("exchangeFilters").toString())); + } + + // validate the optional field `exchangeFilters` (array) + for (int i = 0; i < jsonArrayexchangeFilters.size(); i++) { + ExchangeFilters.validateJsonElement(jsonArrayexchangeFilters.get(i)); + } + ; + } + } if (jsonObj.get("symbols") != null && !jsonObj.get("symbols").isJsonNull()) { JsonArray jsonArraysymbols = jsonObj.getAsJsonArray("symbols"); if (jsonArraysymbols != null) { 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 25316f826..b868c31fa 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 @@ -15,6 +15,7 @@ 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; @@ -169,7 +170,7 @@ public class ExchangeInfoResponseResultSymbolsInner extends BaseDTO { @SerializedName(SERIALIZED_NAME_FILTERS) @jakarta.annotation.Nullable - private ExchangeFilters filters; + private List filters; public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @@ -613,11 +614,19 @@ public void setIsMarginTradingAllowed( } public ExchangeInfoResponseResultSymbolsInner filters( - @jakarta.annotation.Nullable ExchangeFilters filters) { + @jakarta.annotation.Nullable List filters) { this.filters = filters; return this; } + public ExchangeInfoResponseResultSymbolsInner addFiltersItem(SymbolFilters filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + /** * Get filters * @@ -625,11 +634,11 @@ public ExchangeInfoResponseResultSymbolsInner filters( */ @jakarta.annotation.Nullable @Valid - public ExchangeFilters getFilters() { + public List getFilters() { return filters; } - public void setFilters(@jakarta.annotation.Nullable ExchangeFilters filters) { + public void setFilters(@jakarta.annotation.Nullable List filters) { this.filters = filters; } @@ -1002,7 +1011,7 @@ public String toUrlQueryString() { String isMarginTradingAllowedValueAsString = isMarginTradingAllowedValue.toString(); valMap.put("isMarginTradingAllowed", isMarginTradingAllowedValueAsString); } - ExchangeFilters filtersValue = getFilters(); + List filtersValue = getFilters(); if (filtersValue != null) { String filtersValueAsString = JSON.getGson().toJson(filtersValue); valMap.put("filters", filtersValueAsString); @@ -1274,6 +1283,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("orderTypes").toString())); } + if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { + JsonArray jsonArrayfilters = jsonObj.getAsJsonArray("filters"); + if (jsonArrayfilters != null) { + // ensure the json data is an array + if (!jsonObj.get("filters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filters` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("filters").toString())); + } + + // validate the optional field `filters` (array) + for (int i = 0; i < jsonArrayfilters.size(); i++) { + SymbolFilters.validateJsonElement(jsonArrayfilters.get(i)); + } + ; + } + } // ensure the optional json data is an array if present if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull() diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeMaxNumAlgoOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeMaxNumAlgoOrdersFilter.java new file mode 100644 index 000000000..0e2e367e1 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeMaxNumAlgoOrdersFilter.java @@ -0,0 +1,286 @@ +/* + * 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.*; + +/** ExchangeMaxNumAlgoOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumAlgoOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumAlgoOrders; + + public ExchangeMaxNumAlgoOrdersFilter() {} + + public ExchangeMaxNumAlgoOrdersFilter filterType( + @jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumAlgoOrdersFilter maxNumAlgoOrders( + @jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + return this; + } + + /** + * Get maxNumAlgoOrders + * + * @return maxNumAlgoOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumAlgoOrders() { + return maxNumAlgoOrders; + } + + public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumAlgoOrdersFilter exchangeMaxNumAlgoOrdersFilter = + (ExchangeMaxNumAlgoOrdersFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumAlgoOrdersFilter.filterType) + && Objects.equals( + this.maxNumAlgoOrders, exchangeMaxNumAlgoOrdersFilter.maxNumAlgoOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumAlgoOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumAlgoOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + String maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumAlgoOrders"); + + // 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 + * ExchangeMaxNumAlgoOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumAlgoOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumAlgoOrdersFilter is not" + + " found in the empty JSON string", + ExchangeMaxNumAlgoOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeMaxNumAlgoOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeMaxNumAlgoOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumAlgoOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumAlgoOrdersFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumAlgoOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumAlgoOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumAlgoOrdersFilter read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumAlgoOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumAlgoOrdersFilter + * @throws IOException if the JSON string is invalid with respect to + * ExchangeMaxNumAlgoOrdersFilter + */ + public static ExchangeMaxNumAlgoOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumAlgoOrdersFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumAlgoOrdersFilter 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/ExchangeMaxNumIcebergOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeMaxNumIcebergOrdersFilter.java new file mode 100644 index 000000000..bb26391db --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeMaxNumIcebergOrdersFilter.java @@ -0,0 +1,290 @@ +/* + * 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.*; + +/** ExchangeMaxNumIcebergOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumIcebergOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumIcebergOrders; + + public ExchangeMaxNumIcebergOrdersFilter() {} + + public ExchangeMaxNumIcebergOrdersFilter filterType( + @jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumIcebergOrdersFilter maxNumIcebergOrders( + @jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + return this; + } + + /** + * Get maxNumIcebergOrders + * + * @return maxNumIcebergOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumIcebergOrders() { + return maxNumIcebergOrders; + } + + public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumIcebergOrdersFilter exchangeMaxNumIcebergOrdersFilter = + (ExchangeMaxNumIcebergOrdersFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumIcebergOrdersFilter.filterType) + && Objects.equals( + this.maxNumIcebergOrders, + exchangeMaxNumIcebergOrdersFilter.maxNumIcebergOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumIcebergOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumIcebergOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumIcebergOrders: ") + .append(toIndentedString(maxNumIcebergOrders)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + String maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumIcebergOrders"); + + // 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 + * ExchangeMaxNumIcebergOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumIcebergOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumIcebergOrdersFilter is" + + " not found in the empty JSON string", + ExchangeMaxNumIcebergOrdersFilter.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeMaxNumIcebergOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeMaxNumIcebergOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumIcebergOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumIcebergOrdersFilter' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumIcebergOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumIcebergOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumIcebergOrdersFilter read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumIcebergOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumIcebergOrdersFilter + * @throws IOException if the JSON string is invalid with respect to + * ExchangeMaxNumIcebergOrdersFilter + */ + public static ExchangeMaxNumIcebergOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumIcebergOrdersFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumIcebergOrdersFilter 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/ExchangeMaxNumOrderListsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeMaxNumOrderListsFilter.java new file mode 100644 index 000000000..99ccf0d1d --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeMaxNumOrderListsFilter.java @@ -0,0 +1,286 @@ +/* + * 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.*; + +/** ExchangeMaxNumOrderListsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumOrderListsFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + 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 ExchangeMaxNumOrderListsFilter() {} + + public ExchangeMaxNumOrderListsFilter filterType( + @jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumOrderListsFilter 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumOrderListsFilter exchangeMaxNumOrderListsFilter = + (ExchangeMaxNumOrderListsFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumOrderListsFilter.filterType) + && Objects.equals( + this.maxNumOrderLists, exchangeMaxNumOrderListsFilter.maxNumOrderLists); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrderLists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumOrderListsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrderLists: ").append(toIndentedString(maxNumOrderLists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + String maxNumOrderListsValueAsString = maxNumOrderListsValue.toString(); + valMap.put("maxNumOrderLists", maxNumOrderListsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + valMap.put("maxNumOrderLists", maxNumOrderListsValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrderLists"); + + // 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 + * ExchangeMaxNumOrderListsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumOrderListsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumOrderListsFilter is not" + + " found in the empty JSON string", + ExchangeMaxNumOrderListsFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeMaxNumOrderListsFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeMaxNumOrderListsFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumOrderListsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumOrderListsFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumOrderListsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumOrderListsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumOrderListsFilter read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumOrderListsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumOrderListsFilter + * @throws IOException if the JSON string is invalid with respect to + * ExchangeMaxNumOrderListsFilter + */ + public static ExchangeMaxNumOrderListsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumOrderListsFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumOrderListsFilter 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/ExchangeMaxNumOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeMaxNumOrdersFilter.java new file mode 100644 index 000000000..ef4c59aed --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeMaxNumOrdersFilter.java @@ -0,0 +1,278 @@ +/* + * 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.*; + +/** ExchangeMaxNumOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumOrders; + + public ExchangeMaxNumOrdersFilter() {} + + public ExchangeMaxNumOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumOrdersFilter maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + return this; + } + + /** + * Get maxNumOrders + * + * @return maxNumOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrders() { + return maxNumOrders; + } + + public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumOrdersFilter exchangeMaxNumOrdersFilter = (ExchangeMaxNumOrdersFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumOrdersFilter.filterType) + && Objects.equals(this.maxNumOrders, exchangeMaxNumOrdersFilter.maxNumOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + String maxNumOrdersValueAsString = maxNumOrdersValue.toString(); + valMap.put("maxNumOrders", maxNumOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + valMap.put("maxNumOrders", maxNumOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrders"); + + // 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 ExchangeMaxNumOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumOrdersFilter is not" + + " found in the empty JSON string", + ExchangeMaxNumOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeMaxNumOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeMaxNumOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumOrdersFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeMaxNumOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumOrdersFilter + * @throws IOException if the JSON string is invalid with respect to ExchangeMaxNumOrdersFilter + */ + public static ExchangeMaxNumOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumOrdersFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumOrdersFilter 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/IcebergPartsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/IcebergPartsFilter.java new file mode 100644 index 000000000..c53864465 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/IcebergPartsFilter.java @@ -0,0 +1,277 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** IcebergPartsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class IcebergPartsFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @jakarta.annotation.Nullable + private Long limit; + + public IcebergPartsFilter() {} + + public IcebergPartsFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public IcebergPartsFilter limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @jakarta.annotation.Nullable + public Long getLimit() { + return limit; + } + + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IcebergPartsFilter icebergPartsFilter = (IcebergPartsFilter) o; + return Objects.equals(this.filterType, icebergPartsFilter.filterType) + && Objects.equals(this.limit, icebergPartsFilter.limit); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IcebergPartsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long limitValue = getLimit(); + if (limitValue != null) { + String limitValueAsString = limitValue.toString(); + valMap.put("limit", limitValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object limitValue = getLimit(); + if (limitValue != null) { + valMap.put("limit", limitValue); + } + + 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("filterType"); + openapiFields.add("limit"); + + // 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 IcebergPartsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IcebergPartsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in IcebergPartsFilter is not found in the" + + " empty JSON string", + IcebergPartsFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IcebergPartsFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IcebergPartsFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IcebergPartsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IcebergPartsFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(IcebergPartsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, IcebergPartsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IcebergPartsFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of IcebergPartsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of IcebergPartsFilter + * @throws IOException if the JSON string is invalid with respect to IcebergPartsFilter + */ + public static IcebergPartsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IcebergPartsFilter.class); + } + + /** + * Convert an instance of IcebergPartsFilter 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/KlinesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/KlinesResponse.java index 317c7f9fc..effa0fb84 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/KlinesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/KlinesResponse.java @@ -15,6 +15,7 @@ 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; @@ -64,7 +65,7 @@ public class KlinesResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public KlinesResponse() {} @@ -134,11 +135,20 @@ public void setResult(@jakarta.annotation.Nullable List result) { this.result = result; } - public KlinesResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public KlinesResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public KlinesResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -146,11 +156,11 @@ public KlinesResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLim */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -205,7 +215,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -320,6 +330,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " `%s`", jsonObj.get("result").toString())); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/LotSizeFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/LotSizeFilter.java new file mode 100644 index 000000000..f84765372 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/LotSizeFilter.java @@ -0,0 +1,411 @@ +/* + * 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.*; + +/** LotSizeFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class LotSizeFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; + + @SerializedName(SERIALIZED_NAME_MIN_QTY) + @jakarta.annotation.Nullable + private String minQty; + + public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; + + @SerializedName(SERIALIZED_NAME_MAX_QTY) + @jakarta.annotation.Nullable + private String maxQty; + + public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; + + @SerializedName(SERIALIZED_NAME_STEP_SIZE) + @jakarta.annotation.Nullable + private String stepSize; + + public LotSizeFilter() {} + + public LotSizeFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public LotSizeFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public LotSizeFilter minQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + return this; + } + + /** + * Get minQty + * + * @return minQty + */ + @jakarta.annotation.Nullable + public String getMinQty() { + return minQty; + } + + public void setMinQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + } + + public LotSizeFilter maxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + return this; + } + + /** + * Get maxQty + * + * @return maxQty + */ + @jakarta.annotation.Nullable + public String getMaxQty() { + return maxQty; + } + + public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + } + + public LotSizeFilter stepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + return this; + } + + /** + * Get stepSize + * + * @return stepSize + */ + @jakarta.annotation.Nullable + public String getStepSize() { + return stepSize; + } + + public void setStepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LotSizeFilter lotSizeFilter = (LotSizeFilter) o; + return Objects.equals(this.filterType, lotSizeFilter.filterType) + && Objects.equals(this.qtyExponent, lotSizeFilter.qtyExponent) + && Objects.equals(this.minQty, lotSizeFilter.minQty) + && Objects.equals(this.maxQty, lotSizeFilter.maxQty) + && Objects.equals(this.stepSize, lotSizeFilter.stepSize); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, minQty, maxQty, stepSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LotSizeFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); + sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); + sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + String qtyExponentValueAsString = qtyExponentValue.toString(); + valMap.put("qtyExponent", qtyExponentValueAsString); + } + String minQtyValue = getMinQty(); + if (minQtyValue != null) { + String minQtyValueAsString = minQtyValue.toString(); + valMap.put("minQty", minQtyValueAsString); + } + String maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + String maxQtyValueAsString = maxQtyValue.toString(); + valMap.put("maxQty", maxQtyValueAsString); + } + String stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + String stepSizeValueAsString = stepSizeValue.toString(); + valMap.put("stepSize", stepSizeValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + valMap.put("qtyExponent", qtyExponentValue); + } + Object minQtyValue = getMinQty(); + if (minQtyValue != null) { + valMap.put("minQty", minQtyValue); + } + Object maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + valMap.put("maxQty", maxQtyValue); + } + Object stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + valMap.put("stepSize", stepSizeValue); + } + + 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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("minQty"); + openapiFields.add("maxQty"); + openapiFields.add("stepSize"); + + // 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 LotSizeFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LotSizeFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in LotSizeFilter is not found in the" + + " empty JSON string", + LotSizeFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LotSizeFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `LotSizeFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) + && !jsonObj.get("minQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minQty").toString())); + } + if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) + && !jsonObj.get("maxQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxQty").toString())); + } + if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) + && !jsonObj.get("stepSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stepSize").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LotSizeFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LotSizeFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(LotSizeFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, LotSizeFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LotSizeFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of LotSizeFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of LotSizeFilter + * @throws IOException if the JSON string is invalid with respect to LotSizeFilter + */ + public static LotSizeFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LotSizeFilter.class); + } + + /** + * Convert an instance of LotSizeFilter 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/MarketLotSizeFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MarketLotSizeFilter.java new file mode 100644 index 000000000..5079ac407 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MarketLotSizeFilter.java @@ -0,0 +1,412 @@ +/* + * 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.*; + +/** MarketLotSizeFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MarketLotSizeFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; + + @SerializedName(SERIALIZED_NAME_MIN_QTY) + @jakarta.annotation.Nullable + private String minQty; + + public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; + + @SerializedName(SERIALIZED_NAME_MAX_QTY) + @jakarta.annotation.Nullable + private String maxQty; + + public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; + + @SerializedName(SERIALIZED_NAME_STEP_SIZE) + @jakarta.annotation.Nullable + private String stepSize; + + public MarketLotSizeFilter() {} + + public MarketLotSizeFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MarketLotSizeFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public MarketLotSizeFilter minQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + return this; + } + + /** + * Get minQty + * + * @return minQty + */ + @jakarta.annotation.Nullable + public String getMinQty() { + return minQty; + } + + public void setMinQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + } + + public MarketLotSizeFilter maxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + return this; + } + + /** + * Get maxQty + * + * @return maxQty + */ + @jakarta.annotation.Nullable + public String getMaxQty() { + return maxQty; + } + + public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + } + + public MarketLotSizeFilter stepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + return this; + } + + /** + * Get stepSize + * + * @return stepSize + */ + @jakarta.annotation.Nullable + public String getStepSize() { + return stepSize; + } + + public void setStepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarketLotSizeFilter marketLotSizeFilter = (MarketLotSizeFilter) o; + return Objects.equals(this.filterType, marketLotSizeFilter.filterType) + && Objects.equals(this.qtyExponent, marketLotSizeFilter.qtyExponent) + && Objects.equals(this.minQty, marketLotSizeFilter.minQty) + && Objects.equals(this.maxQty, marketLotSizeFilter.maxQty) + && Objects.equals(this.stepSize, marketLotSizeFilter.stepSize); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, minQty, maxQty, stepSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarketLotSizeFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); + sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); + sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + String qtyExponentValueAsString = qtyExponentValue.toString(); + valMap.put("qtyExponent", qtyExponentValueAsString); + } + String minQtyValue = getMinQty(); + if (minQtyValue != null) { + String minQtyValueAsString = minQtyValue.toString(); + valMap.put("minQty", minQtyValueAsString); + } + String maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + String maxQtyValueAsString = maxQtyValue.toString(); + valMap.put("maxQty", maxQtyValueAsString); + } + String stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + String stepSizeValueAsString = stepSizeValue.toString(); + valMap.put("stepSize", stepSizeValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + valMap.put("qtyExponent", qtyExponentValue); + } + Object minQtyValue = getMinQty(); + if (minQtyValue != null) { + valMap.put("minQty", minQtyValue); + } + Object maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + valMap.put("maxQty", maxQtyValue); + } + Object stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + valMap.put("stepSize", stepSizeValue); + } + + 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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("minQty"); + openapiFields.add("maxQty"); + openapiFields.add("stepSize"); + + // 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 MarketLotSizeFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MarketLotSizeFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MarketLotSizeFilter is not found in" + + " the empty JSON string", + MarketLotSizeFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MarketLotSizeFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MarketLotSizeFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) + && !jsonObj.get("minQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minQty").toString())); + } + if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) + && !jsonObj.get("maxQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxQty").toString())); + } + if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) + && !jsonObj.get("stepSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stepSize").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MarketLotSizeFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MarketLotSizeFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MarketLotSizeFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MarketLotSizeFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MarketLotSizeFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MarketLotSizeFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MarketLotSizeFilter + * @throws IOException if the JSON string is invalid with respect to MarketLotSizeFilter + */ + public static MarketLotSizeFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MarketLotSizeFilter.class); + } + + /** + * Convert an instance of MarketLotSizeFilter 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/RateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxAssetFilter.java similarity index 51% rename from clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimitsInner.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxAssetFilter.java index 655e60b3d..f23478c8f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimitsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxAssetFilter.java @@ -34,101 +34,76 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** RateLimitsInner */ +/** MaxAssetFilter */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class RateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; +public class MaxAssetFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) @jakarta.annotation.Nullable - private String rateLimitType; + private String filterType; - public static final String SERIALIZED_NAME_INTERVAL = "interval"; + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; - @SerializedName(SERIALIZED_NAME_INTERVAL) + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; + private Integer qtyExponent; public static final String SERIALIZED_NAME_LIMIT = "limit"; @SerializedName(SERIALIZED_NAME_LIMIT) @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; + private String limit; - public RateLimitsInner() {} + public static final String SERIALIZED_NAME_ASSET = "asset"; - public RateLimitsInner rateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ + @SerializedName(SERIALIZED_NAME_ASSET) @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } + private String asset; - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } + public MaxAssetFilter() {} - public RateLimitsInner interval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; + public MaxAssetFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; return this; } /** - * Get interval + * Get filterType * - * @return interval + * @return filterType */ @jakarta.annotation.Nullable - public String getInterval() { - return interval; + public String getFilterType() { + return filterType; } - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; } - public RateLimitsInner intervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; + public MaxAssetFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; return this; } /** - * Get intervalNum + * Get qtyExponent * - * @return intervalNum + * @return qtyExponent */ @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; + public Integer getQtyExponent() { + return qtyExponent; } - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; } - public RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { + public MaxAssetFilter limit(@jakarta.annotation.Nullable String limit) { this.limit = limit; return this; } @@ -139,31 +114,31 @@ public RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { * @return limit */ @jakarta.annotation.Nullable - public Long getLimit() { + public String getLimit() { return limit; } - public void setLimit(@jakarta.annotation.Nullable Long limit) { + public void setLimit(@jakarta.annotation.Nullable String limit) { this.limit = limit; } - public RateLimitsInner count(@jakarta.annotation.Nullable Long count) { - this.count = count; + public MaxAssetFilter asset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; return this; } /** - * Get count + * Get asset * - * @return count + * @return asset */ @jakarta.annotation.Nullable - public Long getCount() { - return count; + public String getAsset() { + return asset; } - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; } @Override @@ -174,28 +149,26 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - RateLimitsInner rateLimitsInner = (RateLimitsInner) o; - return Objects.equals(this.rateLimitType, rateLimitsInner.rateLimitType) - && Objects.equals(this.interval, rateLimitsInner.interval) - && Objects.equals(this.intervalNum, rateLimitsInner.intervalNum) - && Objects.equals(this.limit, rateLimitsInner.limit) - && Objects.equals(this.count, rateLimitsInner.count); + MaxAssetFilter maxAssetFilter = (MaxAssetFilter) o; + return Objects.equals(this.filterType, maxAssetFilter.filterType) + && Objects.equals(this.qtyExponent, maxAssetFilter.qtyExponent) + && Objects.equals(this.limit, maxAssetFilter.limit) + && Objects.equals(this.asset, maxAssetFilter.asset); } @Override public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); + return Objects.hash(filterType, qtyExponent, limit, asset); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class RateLimitsInner {\n"); - sb.append(" rateLimitType: ").append(toIndentedString(rateLimitType)).append("\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append(" intervalNum: ").append(toIndentedString(intervalNum)).append("\n"); + sb.append("class MaxAssetFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); sb.append("}"); return sb.toString(); } @@ -204,30 +177,25 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); + Integer qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + String qtyExponentValueAsString = qtyExponentValue.toString(); + valMap.put("qtyExponent", qtyExponentValueAsString); } - Long limitValue = getLimit(); + String limitValue = getLimit(); if (limitValue != null) { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); + String assetValue = getAsset(); + if (assetValue != null) { + String assetValueAsString = assetValue.toString(); + valMap.put("asset", assetValueAsString); } valMap.put("timestamp", getTimestamp()); @@ -240,25 +208,21 @@ public String toUrlQueryString() { public Map toMap() { Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - Object rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); + Object filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); + Object qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + valMap.put("qtyExponent", qtyExponentValue); } Object limitValue = getLimit(); if (limitValue != null) { valMap.put("limit", limitValue); } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); + Object assetValue = getAsset(); + if (assetValue != null) { + valMap.put("asset", assetValue); } valMap.put("timestamp", getTimestamp()); @@ -286,11 +250,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); + openapiFields.add("filterType"); + openapiFields.add("qtyExponent"); openapiFields.add("limit"); - openapiFields.add("count"); + openapiFields.add("asset"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -300,47 +263,55 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RateLimitsInner + * @throws IOException if the JSON Element is invalid with respect to MaxAssetFilter */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!RateLimitsInner.openapiRequiredFields + if (!MaxAssetFilter.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in RateLimitsInner is not found in the" + "The required field(s) %s in MaxAssetFilter is not found in the" + " empty JSON string", - RateLimitsInner.openapiRequiredFields.toString())); + MaxAssetFilter.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!RateLimitsInner.openapiFields.contains(entry.getKey())) { + if (!MaxAssetFilter.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `RateLimitsInner` properties. JSON: %s", + + " `MaxAssetFilter` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" + "Expected the field `filterType` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); + jsonObj.get("filterType").toString())); } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { + if ((jsonObj.get("limit") != null && !jsonObj.get("limit").isJsonNull()) + && !jsonObj.get("limit").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); + "Expected the field `limit` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("limit").toString())); + } + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); } } @@ -348,24 +319,23 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!RateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RateLimitsInner' and its subtypes + if (!MaxAssetFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxAssetFilter' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RateLimitsInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxAssetFilter.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, RateLimitsInner value) - throws IOException { + public void write(JsonWriter out, MaxAssetFilter value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public RateLimitsInner read(JsonReader in) throws IOException { + public MaxAssetFilter read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -375,18 +345,18 @@ public RateLimitsInner read(JsonReader in) throws IOException { } /** - * Create an instance of RateLimitsInner given an JSON string + * Create an instance of MaxAssetFilter given an JSON string * * @param jsonString JSON string - * @return An instance of RateLimitsInner - * @throws IOException if the JSON string is invalid with respect to RateLimitsInner + * @return An instance of MaxAssetFilter + * @throws IOException if the JSON string is invalid with respect to MaxAssetFilter */ - public static RateLimitsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RateLimitsInner.class); + public static MaxAssetFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxAssetFilter.class); } /** - * Convert an instance of RateLimitsInner to an JSON string + * Convert an instance of MaxAssetFilter to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumAlgoOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumAlgoOrdersFilter.java new file mode 100644 index 000000000..486f54c7c --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumAlgoOrdersFilter.java @@ -0,0 +1,278 @@ +/* + * 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.*; + +/** MaxNumAlgoOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumAlgoOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumAlgoOrders; + + public MaxNumAlgoOrdersFilter() {} + + public MaxNumAlgoOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumAlgoOrdersFilter maxNumAlgoOrders( + @jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + return this; + } + + /** + * Get maxNumAlgoOrders + * + * @return maxNumAlgoOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumAlgoOrders() { + return maxNumAlgoOrders; + } + + public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumAlgoOrdersFilter maxNumAlgoOrdersFilter = (MaxNumAlgoOrdersFilter) o; + return Objects.equals(this.filterType, maxNumAlgoOrdersFilter.filterType) + && Objects.equals(this.maxNumAlgoOrders, maxNumAlgoOrdersFilter.maxNumAlgoOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumAlgoOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumAlgoOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + String maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumAlgoOrders"); + + // 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 MaxNumAlgoOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumAlgoOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumAlgoOrdersFilter is not found in" + + " the empty JSON string", + MaxNumAlgoOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumAlgoOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumAlgoOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumAlgoOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumAlgoOrdersFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumAlgoOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumAlgoOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumAlgoOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumAlgoOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumAlgoOrdersFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumAlgoOrdersFilter + */ + public static MaxNumAlgoOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumAlgoOrdersFilter.class); + } + + /** + * Convert an instance of MaxNumAlgoOrdersFilter 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/MaxNumIcebergOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumIcebergOrdersFilter.java new file mode 100644 index 000000000..984091afd --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumIcebergOrdersFilter.java @@ -0,0 +1,282 @@ +/* + * 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.*; + +/** MaxNumIcebergOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumIcebergOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumIcebergOrders; + + public MaxNumIcebergOrdersFilter() {} + + public MaxNumIcebergOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumIcebergOrdersFilter maxNumIcebergOrders( + @jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + return this; + } + + /** + * Get maxNumIcebergOrders + * + * @return maxNumIcebergOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumIcebergOrders() { + return maxNumIcebergOrders; + } + + public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumIcebergOrdersFilter maxNumIcebergOrdersFilter = (MaxNumIcebergOrdersFilter) o; + return Objects.equals(this.filterType, maxNumIcebergOrdersFilter.filterType) + && Objects.equals( + this.maxNumIcebergOrders, maxNumIcebergOrdersFilter.maxNumIcebergOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumIcebergOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumIcebergOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumIcebergOrders: ") + .append(toIndentedString(maxNumIcebergOrders)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + String maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumIcebergOrders"); + + // 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 MaxNumIcebergOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumIcebergOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumIcebergOrdersFilter is not found" + + " in the empty JSON string", + MaxNumIcebergOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumIcebergOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumIcebergOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumIcebergOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumIcebergOrdersFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumIcebergOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumIcebergOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumIcebergOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumIcebergOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumIcebergOrdersFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumIcebergOrdersFilter + */ + public static MaxNumIcebergOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumIcebergOrdersFilter.class); + } + + /** + * Convert an instance of MaxNumIcebergOrdersFilter 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/MaxNumOrderAmendsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumOrderAmendsFilter.java new file mode 100644 index 000000000..8194edff4 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumOrderAmendsFilter.java @@ -0,0 +1,280 @@ +/* + * 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.*; + +/** MaxNumOrderAmendsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumOrderAmendsFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + 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 MaxNumOrderAmendsFilter() {} + + public MaxNumOrderAmendsFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumOrderAmendsFilter 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumOrderAmendsFilter maxNumOrderAmendsFilter = (MaxNumOrderAmendsFilter) o; + return Objects.equals(this.filterType, maxNumOrderAmendsFilter.filterType) + && Objects.equals( + this.maxNumOrderAmends, maxNumOrderAmendsFilter.maxNumOrderAmends); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrderAmends); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumOrderAmendsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrderAmends: ").append(toIndentedString(maxNumOrderAmends)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrderAmendsValue = getMaxNumOrderAmends(); + if (maxNumOrderAmendsValue != null) { + String maxNumOrderAmendsValueAsString = maxNumOrderAmendsValue.toString(); + valMap.put("maxNumOrderAmends", maxNumOrderAmendsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrderAmendsValue = getMaxNumOrderAmends(); + if (maxNumOrderAmendsValue != null) { + valMap.put("maxNumOrderAmends", maxNumOrderAmendsValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrderAmends"); + + // 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 MaxNumOrderAmendsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumOrderAmendsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumOrderAmendsFilter is not found" + + " in the empty JSON string", + MaxNumOrderAmendsFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumOrderAmendsFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumOrderAmendsFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumOrderAmendsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumOrderAmendsFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderAmendsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumOrderAmendsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumOrderAmendsFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumOrderAmendsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumOrderAmendsFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumOrderAmendsFilter + */ + public static MaxNumOrderAmendsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumOrderAmendsFilter.class); + } + + /** + * Convert an instance of MaxNumOrderAmendsFilter 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/MaxNumOrderListsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumOrderListsFilter.java new file mode 100644 index 000000000..b62480f9a --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumOrderListsFilter.java @@ -0,0 +1,278 @@ +/* + * 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.*; + +/** MaxNumOrderListsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumOrderListsFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + 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 MaxNumOrderListsFilter() {} + + public MaxNumOrderListsFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumOrderListsFilter 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumOrderListsFilter maxNumOrderListsFilter = (MaxNumOrderListsFilter) o; + return Objects.equals(this.filterType, maxNumOrderListsFilter.filterType) + && Objects.equals(this.maxNumOrderLists, maxNumOrderListsFilter.maxNumOrderLists); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrderLists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumOrderListsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrderLists: ").append(toIndentedString(maxNumOrderLists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + String maxNumOrderListsValueAsString = maxNumOrderListsValue.toString(); + valMap.put("maxNumOrderLists", maxNumOrderListsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + valMap.put("maxNumOrderLists", maxNumOrderListsValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrderLists"); + + // 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 MaxNumOrderListsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumOrderListsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumOrderListsFilter is not found in" + + " the empty JSON string", + MaxNumOrderListsFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumOrderListsFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumOrderListsFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumOrderListsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumOrderListsFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderListsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumOrderListsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumOrderListsFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumOrderListsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumOrderListsFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumOrderListsFilter + */ + public static MaxNumOrderListsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumOrderListsFilter.class); + } + + /** + * Convert an instance of MaxNumOrderListsFilter 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/MaxNumOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumOrdersFilter.java new file mode 100644 index 000000000..31536b38f --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxNumOrdersFilter.java @@ -0,0 +1,277 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MaxNumOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumOrders; + + public MaxNumOrdersFilter() {} + + public MaxNumOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumOrdersFilter maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + return this; + } + + /** + * Get maxNumOrders + * + * @return maxNumOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrders() { + return maxNumOrders; + } + + public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumOrdersFilter maxNumOrdersFilter = (MaxNumOrdersFilter) o; + return Objects.equals(this.filterType, maxNumOrdersFilter.filterType) + && Objects.equals(this.maxNumOrders, maxNumOrdersFilter.maxNumOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + String maxNumOrdersValueAsString = maxNumOrdersValue.toString(); + valMap.put("maxNumOrders", maxNumOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + valMap.put("maxNumOrders", maxNumOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrders"); + + // 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 MaxNumOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumOrdersFilter is not found in the" + + " empty JSON string", + MaxNumOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumOrdersFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumOrdersFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumOrdersFilter + */ + public static MaxNumOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumOrdersFilter.class); + } + + /** + * Convert an instance of MaxNumOrdersFilter 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/MaxPositionFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxPositionFilter.java new file mode 100644 index 000000000..be2a4600f --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MaxPositionFilter.java @@ -0,0 +1,322 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MaxPositionFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxPositionFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; + + @SerializedName(SERIALIZED_NAME_MAX_POSITION) + @jakarta.annotation.Nullable + private String maxPosition; + + public MaxPositionFilter() {} + + public MaxPositionFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxPositionFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public MaxPositionFilter maxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; + return this; + } + + /** + * Get maxPosition + * + * @return maxPosition + */ + @jakarta.annotation.Nullable + public String getMaxPosition() { + return maxPosition; + } + + public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxPositionFilter maxPositionFilter = (MaxPositionFilter) o; + return Objects.equals(this.filterType, maxPositionFilter.filterType) + && Objects.equals(this.qtyExponent, maxPositionFilter.qtyExponent) + && Objects.equals(this.maxPosition, maxPositionFilter.maxPosition); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, maxPosition); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxPositionFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + String qtyExponentValueAsString = qtyExponentValue.toString(); + valMap.put("qtyExponent", qtyExponentValueAsString); + } + String maxPositionValue = getMaxPosition(); + if (maxPositionValue != null) { + String maxPositionValueAsString = maxPositionValue.toString(); + valMap.put("maxPosition", maxPositionValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + valMap.put("qtyExponent", qtyExponentValue); + } + Object maxPositionValue = getMaxPosition(); + if (maxPositionValue != null) { + valMap.put("maxPosition", maxPositionValue); + } + + 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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("maxPosition"); + + // 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 MaxPositionFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxPositionFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxPositionFilter is not found in the" + + " empty JSON string", + MaxPositionFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxPositionFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxPositionFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) + && !jsonObj.get("maxPosition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxPosition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPosition").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxPositionFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxPositionFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxPositionFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxPositionFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxPositionFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxPositionFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxPositionFilter + * @throws IOException if the JSON string is invalid with respect to MaxPositionFilter + */ + public static MaxPositionFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxPositionFilter.class); + } + + /** + * Convert an instance of MaxPositionFilter 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/MinNotionalFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MinNotionalFilter.java new file mode 100644 index 000000000..6a7c25ef7 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MinNotionalFilter.java @@ -0,0 +1,396 @@ +/* + * 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.*; + +/** MinNotionalFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MinNotionalFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_PRICE_EXPONENT = "priceExponent"; + + @SerializedName(SERIALIZED_NAME_PRICE_EXPONENT) + @jakarta.annotation.Nullable + private Integer priceExponent; + + public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; + + @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) + @jakarta.annotation.Nullable + private String minNotional; + + public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyToMarket; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public MinNotionalFilter() {} + + public MinNotionalFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MinNotionalFilter priceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + return this; + } + + /** + * Get priceExponent + * + * @return priceExponent + */ + @jakarta.annotation.Nullable + public Integer getPriceExponent() { + return priceExponent; + } + + public void setPriceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + } + + public MinNotionalFilter minNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + return this; + } + + /** + * Get minNotional + * + * @return minNotional + */ + @jakarta.annotation.Nullable + public String getMinNotional() { + return minNotional; + } + + public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + } + + public MinNotionalFilter applyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; + return this; + } + + /** + * Get applyToMarket + * + * @return applyToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyToMarket() { + return applyToMarket; + } + + public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; + } + + public MinNotionalFilter avgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MinNotionalFilter minNotionalFilter = (MinNotionalFilter) o; + return Objects.equals(this.filterType, minNotionalFilter.filterType) + && Objects.equals(this.priceExponent, minNotionalFilter.priceExponent) + && Objects.equals(this.minNotional, minNotionalFilter.minNotional) + && Objects.equals(this.applyToMarket, minNotionalFilter.applyToMarket) + && Objects.equals(this.avgPriceMins, minNotionalFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, priceExponent, minNotional, applyToMarket, avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MinNotionalFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" priceExponent: ").append(toIndentedString(priceExponent)).append("\n"); + sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); + sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + String priceExponentValueAsString = priceExponentValue.toString(); + valMap.put("priceExponent", priceExponentValueAsString); + } + String minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + String minNotionalValueAsString = minNotionalValue.toString(); + valMap.put("minNotional", minNotionalValueAsString); + } + Boolean applyToMarketValue = getApplyToMarket(); + if (applyToMarketValue != null) { + String applyToMarketValueAsString = applyToMarketValue.toString(); + valMap.put("applyToMarket", applyToMarketValueAsString); + } + Integer avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + valMap.put("priceExponent", priceExponentValue); + } + Object minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + valMap.put("minNotional", minNotionalValue); + } + Object applyToMarketValue = getApplyToMarket(); + if (applyToMarketValue != null) { + valMap.put("applyToMarket", applyToMarketValue); + } + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); + } + + 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("filterType"); + openapiFields.add("priceExponent"); + openapiFields.add("minNotional"); + openapiFields.add("applyToMarket"); + openapiFields.add("avgPriceMins"); + + // 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 MinNotionalFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MinNotionalFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MinNotionalFilter is not found in the" + + " empty JSON string", + MinNotionalFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MinNotionalFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MinNotionalFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) + && !jsonObj.get("minNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minNotional").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MinNotionalFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MinNotionalFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MinNotionalFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MinNotionalFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MinNotionalFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MinNotionalFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MinNotionalFilter + * @throws IOException if the JSON string is invalid with respect to MinNotionalFilter + */ + public static MinNotionalFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MinNotionalFilter.class); + } + + /** + * Convert an instance of MinNotionalFilter 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/MyAllocationsRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsRequest.java index c5a641493..52480f3b5 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -79,7 +81,7 @@ public class MyAllocationsRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public MyAllocationsRequest() {} @@ -199,7 +201,7 @@ public void setOrderId(@jakarta.annotation.Nullable Long orderId) { this.orderId = orderId; } - public MyAllocationsRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public MyAllocationsRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -210,11 +212,12 @@ public MyAllocationsRequest recvWindow(@jakarta.annotation.Nullable Long recvWin * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -291,9 +294,10 @@ public String toUrlQueryString() { String orderIdValueAsString = orderIdValue.toString(); valMap.put("orderId", orderIdValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsResponse.java index 164099f23..ed5624480 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsResponse.java @@ -65,7 +65,7 @@ public class MyAllocationsResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public MyAllocationsResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public MyAllocationsResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public MyAllocationsResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public MyAllocationsResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public MyAllocationsResponse rateLimits(@jakarta.annotation.Nullable RateLimits */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/ChangePlanStatusRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyFiltersRequest.java similarity index 52% rename from clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/ChangePlanStatusRequest.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyFiltersRequest.java index abadb4210..d9b2d1d18 100644 --- a/clients/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/model/ChangePlanStatusRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyFiltersRequest.java @@ -1,6 +1,6 @@ /* - * Binance Auto Invest REST API - * OpenAPI Specification for the Binance Auto Invest REST API + * 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 * @@ -10,9 +10,11 @@ * Do not edit the class manually. */ -package com.binance.connector.client.auto_invest.rest.model; +package com.binance.connector.client.spot.websocket.api.model; -import com.binance.connector.client.auto_invest.rest.JSON; +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,83 +24,58 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** ChangePlanStatusRequest */ +/** MyFiltersRequest */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class ChangePlanStatusRequest { - public static final String SERIALIZED_NAME_PLAN_ID = "planId"; +public class MyFiltersRequest extends BaseDTO { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; - @SerializedName(SERIALIZED_NAME_PLAN_ID) + @SerializedName(SERIALIZED_NAME_SYMBOL) @jakarta.annotation.Nonnull - private Long planId; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nonnull - private String status; + private String symbol; public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; - - public ChangePlanStatusRequest() {} - - public ChangePlanStatusRequest planId(@jakarta.annotation.Nonnull Long planId) { - this.planId = planId; - return this; - } - - /** - * Get planId - * - * @return planId - */ - @jakarta.annotation.Nonnull - @NotNull - public Long getPlanId() { - return planId; - } + private Double recvWindow; - public void setPlanId(@jakarta.annotation.Nonnull Long planId) { - this.planId = planId; - } + public MyFiltersRequest() {} - public ChangePlanStatusRequest status(@jakarta.annotation.Nonnull String status) { - this.status = status; + public MyFiltersRequest symbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; return this; } /** - * Get status + * Get symbol * - * @return status + * @return symbol */ @jakarta.annotation.Nonnull @NotNull - public String getStatus() { - return status; + public String getSymbol() { + return symbol; } - public void setStatus(@jakarta.annotation.Nonnull String status) { - this.status = status; + public void setSymbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; } - public ChangePlanStatusRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public MyFiltersRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -109,11 +86,12 @@ public ChangePlanStatusRequest recvWindow(@jakarta.annotation.Nullable Long recv * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -125,23 +103,21 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ChangePlanStatusRequest changePlanStatusRequest = (ChangePlanStatusRequest) o; - return Objects.equals(this.planId, changePlanStatusRequest.planId) - && Objects.equals(this.status, changePlanStatusRequest.status) - && Objects.equals(this.recvWindow, changePlanStatusRequest.recvWindow); + MyFiltersRequest myFiltersRequest = (MyFiltersRequest) o; + return Objects.equals(this.symbol, myFiltersRequest.symbol) + && Objects.equals(this.recvWindow, myFiltersRequest.recvWindow); } @Override public int hashCode() { - return Objects.hash(planId, status, recvWindow); + return Objects.hash(symbol, recvWindow); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ChangePlanStatusRequest {\n"); - sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("class MyFiltersRequest {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -149,28 +125,45 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + Double recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); + valMap.put("recvWindow", recvWindowValueAsString); + } - Object planIdValue = getPlanId(); - String planIdValueAsString = ""; - planIdValueAsString = planIdValue.toString(); - sb.append("planId=").append(urlEncode(planIdValueAsString)).append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object recvWindowValue = getRecvWindow(); - String recvWindowValueAsString = ""; - recvWindowValueAsString = recvWindowValue.toString(); - sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); - return sb.toString(); + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); } - 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); + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + valMap.put("recvWindow", recvWindowValue); } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); } /** @@ -190,48 +183,46 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("planId"); - openapiFields.add("status"); + openapiFields.add("symbol"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("planId"); - openapiRequiredFields.add("status"); + openapiRequiredFields.add("symbol"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ChangePlanStatusRequest + * @throws IOException if the JSON Element is invalid with respect to MyFiltersRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ChangePlanStatusRequest.openapiRequiredFields + if (!MyFiltersRequest.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in ChangePlanStatusRequest is not found" - + " in the empty JSON string", - ChangePlanStatusRequest.openapiRequiredFields.toString())); + "The required field(s) %s in MyFiltersRequest is not found in the" + + " empty JSON string", + MyFiltersRequest.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ChangePlanStatusRequest.openapiFields.contains(entry.getKey())) { + if (!MyFiltersRequest.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ChangePlanStatusRequest` properties. JSON: %s", + + " `MyFiltersRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ChangePlanStatusRequest.openapiRequiredFields) { + for (String requiredField : MyFiltersRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -240,12 +231,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { + if (!jsonObj.get("symbol").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `status` to be a primitive type in the JSON string" + "Expected the field `symbol` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("status").toString())); + jsonObj.get("symbol").toString())); } } @@ -253,25 +244,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ChangePlanStatusRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ChangePlanStatusRequest' and its - // subtypes + if (!MyFiltersRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MyFiltersRequest' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ChangePlanStatusRequest.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MyFiltersRequest.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, ChangePlanStatusRequest value) + public void write(JsonWriter out, MyFiltersRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ChangePlanStatusRequest read(JsonReader in) throws IOException { + public MyFiltersRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -281,18 +271,18 @@ public ChangePlanStatusRequest read(JsonReader in) throws IOException { } /** - * Create an instance of ChangePlanStatusRequest given an JSON string + * Create an instance of MyFiltersRequest given an JSON string * * @param jsonString JSON string - * @return An instance of ChangePlanStatusRequest - * @throws IOException if the JSON string is invalid with respect to ChangePlanStatusRequest + * @return An instance of MyFiltersRequest + * @throws IOException if the JSON string is invalid with respect to MyFiltersRequest */ - public static ChangePlanStatusRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ChangePlanStatusRequest.class); + public static MyFiltersRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MyFiltersRequest.class); } /** - * Convert an instance of ChangePlanStatusRequest to an JSON string + * Convert an instance of MyFiltersRequest to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyFiltersResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyFiltersResponse.java new file mode 100644 index 000000000..b93f8ce33 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyFiltersResponse.java @@ -0,0 +1,389 @@ +/* + * 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.*; + +/** MyFiltersResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MyFiltersResponse 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 MyFiltersResponseResult result; + + public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; + + @SerializedName(SERIALIZED_NAME_RATE_LIMITS) + @jakarta.annotation.Nullable + private List<@Valid RateLimits> rateLimits; + + public MyFiltersResponse() {} + + public MyFiltersResponse 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 MyFiltersResponse 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 MyFiltersResponse result(@jakarta.annotation.Nullable MyFiltersResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * + * @return result + */ + @jakarta.annotation.Nullable + @Valid + public MyFiltersResponseResult getResult() { + return result; + } + + public void setResult(@jakarta.annotation.Nullable MyFiltersResponseResult result) { + this.result = result; + } + + public MyFiltersResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { + this.rateLimits = rateLimits; + return this; + } + + public MyFiltersResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + + /** + * Get rateLimits + * + * @return rateLimits + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid RateLimits> getRateLimits() { + return rateLimits; + } + + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { + this.rateLimits = rateLimits; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MyFiltersResponse myFiltersResponse = (MyFiltersResponse) o; + return Objects.equals(this.id, myFiltersResponse.id) + && Objects.equals(this.status, myFiltersResponse.status) + && Objects.equals(this.result, myFiltersResponse.result) + && Objects.equals(this.rateLimits, myFiltersResponse.rateLimits); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, result, rateLimits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MyFiltersResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" rateLimits: ").append(toIndentedString(rateLimits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + 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); + } + MyFiltersResponseResult resultValue = getResult(); + if (resultValue != null) { + String resultValueAsString = JSON.getGson().toJson(resultValue); + valMap.put("result", resultValueAsString); + } + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); + if (rateLimitsValue != null) { + String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); + valMap.put("rateLimits", rateLimitsValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + 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); + } + Object rateLimitsValue = getRateLimits(); + if (rateLimitsValue != null) { + valMap.put("rateLimits", rateLimitsValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("status"); + openapiFields.add("result"); + openapiFields.add("rateLimits"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MyFiltersResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MyFiltersResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MyFiltersResponse is not found in the" + + " empty JSON string", + MyFiltersResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MyFiltersResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MyFiltersResponse` 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()) { + MyFiltersResponseResult.validateJsonElement(jsonObj.get("result")); + } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MyFiltersResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MyFiltersResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MyFiltersResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MyFiltersResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MyFiltersResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MyFiltersResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of MyFiltersResponse + * @throws IOException if the JSON string is invalid with respect to MyFiltersResponse + */ + public static MyFiltersResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MyFiltersResponse.class); + } + + /** + * Convert an instance of MyFiltersResponse 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/MyFiltersResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyFiltersResponseResult.java new file mode 100644 index 000000000..a7820338a --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyFiltersResponseResult.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.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.*; + +/** MyFiltersResponseResult */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MyFiltersResponseResult extends BaseDTO { + public static final String SERIALIZED_NAME_EXCHANGE_FILTERS = "exchangeFilters"; + + @SerializedName(SERIALIZED_NAME_EXCHANGE_FILTERS) + @jakarta.annotation.Nullable + private List exchangeFilters; + + public static final String SERIALIZED_NAME_SYMBOL_FILTERS = "symbolFilters"; + + @SerializedName(SERIALIZED_NAME_SYMBOL_FILTERS) + @jakarta.annotation.Nullable + private List symbolFilters; + + public static final String SERIALIZED_NAME_ASSET_FILTERS = "assetFilters"; + + @SerializedName(SERIALIZED_NAME_ASSET_FILTERS) + @jakarta.annotation.Nullable + private List assetFilters; + + public MyFiltersResponseResult() {} + + public MyFiltersResponseResult exchangeFilters( + @jakarta.annotation.Nullable List exchangeFilters) { + this.exchangeFilters = exchangeFilters; + return this; + } + + public MyFiltersResponseResult addExchangeFiltersItem(ExchangeFilters exchangeFiltersItem) { + if (this.exchangeFilters == null) { + this.exchangeFilters = new ArrayList<>(); + } + this.exchangeFilters.add(exchangeFiltersItem); + return this; + } + + /** + * Get exchangeFilters + * + * @return exchangeFilters + */ + @jakarta.annotation.Nullable + @Valid + public List getExchangeFilters() { + return exchangeFilters; + } + + public void setExchangeFilters( + @jakarta.annotation.Nullable List exchangeFilters) { + this.exchangeFilters = exchangeFilters; + } + + public MyFiltersResponseResult symbolFilters( + @jakarta.annotation.Nullable List symbolFilters) { + this.symbolFilters = symbolFilters; + return this; + } + + public MyFiltersResponseResult addSymbolFiltersItem(SymbolFilters symbolFiltersItem) { + if (this.symbolFilters == null) { + this.symbolFilters = new ArrayList<>(); + } + this.symbolFilters.add(symbolFiltersItem); + return this; + } + + /** + * Get symbolFilters + * + * @return symbolFilters + */ + @jakarta.annotation.Nullable + @Valid + public List getSymbolFilters() { + return symbolFilters; + } + + public void setSymbolFilters(@jakarta.annotation.Nullable List symbolFilters) { + this.symbolFilters = symbolFilters; + } + + public MyFiltersResponseResult assetFilters( + @jakarta.annotation.Nullable List assetFilters) { + this.assetFilters = assetFilters; + return this; + } + + public MyFiltersResponseResult addAssetFiltersItem(AssetFilters assetFiltersItem) { + if (this.assetFilters == null) { + this.assetFilters = new ArrayList<>(); + } + this.assetFilters.add(assetFiltersItem); + return this; + } + + /** + * Get assetFilters + * + * @return assetFilters + */ + @jakarta.annotation.Nullable + @Valid + public List getAssetFilters() { + return assetFilters; + } + + public void setAssetFilters(@jakarta.annotation.Nullable List assetFilters) { + this.assetFilters = assetFilters; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MyFiltersResponseResult myFiltersResponseResult = (MyFiltersResponseResult) o; + return Objects.equals(this.exchangeFilters, myFiltersResponseResult.exchangeFilters) + && Objects.equals(this.symbolFilters, myFiltersResponseResult.symbolFilters) + && Objects.equals(this.assetFilters, myFiltersResponseResult.assetFilters); + } + + @Override + public int hashCode() { + return Objects.hash(exchangeFilters, symbolFilters, assetFilters); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MyFiltersResponseResult {\n"); + sb.append(" exchangeFilters: ").append(toIndentedString(exchangeFilters)).append("\n"); + sb.append(" symbolFilters: ").append(toIndentedString(symbolFilters)).append("\n"); + sb.append(" assetFilters: ").append(toIndentedString(assetFilters)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + List exchangeFiltersValue = getExchangeFilters(); + if (exchangeFiltersValue != null) { + String exchangeFiltersValueAsString = JSON.getGson().toJson(exchangeFiltersValue); + valMap.put("exchangeFilters", exchangeFiltersValueAsString); + } + List symbolFiltersValue = getSymbolFilters(); + if (symbolFiltersValue != null) { + String symbolFiltersValueAsString = JSON.getGson().toJson(symbolFiltersValue); + valMap.put("symbolFilters", symbolFiltersValueAsString); + } + List assetFiltersValue = getAssetFilters(); + if (assetFiltersValue != null) { + String assetFiltersValueAsString = JSON.getGson().toJson(assetFiltersValue); + valMap.put("assetFilters", assetFiltersValueAsString); + } + + 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 exchangeFiltersValue = getExchangeFilters(); + if (exchangeFiltersValue != null) { + valMap.put("exchangeFilters", exchangeFiltersValue); + } + Object symbolFiltersValue = getSymbolFilters(); + if (symbolFiltersValue != null) { + valMap.put("symbolFilters", symbolFiltersValue); + } + Object assetFiltersValue = getAssetFilters(); + if (assetFiltersValue != null) { + valMap.put("assetFilters", assetFiltersValue); + } + + 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("exchangeFilters"); + openapiFields.add("symbolFilters"); + openapiFields.add("assetFilters"); + + // 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 MyFiltersResponseResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MyFiltersResponseResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MyFiltersResponseResult is not found" + + " in the empty JSON string", + MyFiltersResponseResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MyFiltersResponseResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MyFiltersResponseResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("exchangeFilters") != null + && !jsonObj.get("exchangeFilters").isJsonNull()) { + JsonArray jsonArrayexchangeFilters = jsonObj.getAsJsonArray("exchangeFilters"); + if (jsonArrayexchangeFilters != null) { + // ensure the json data is an array + if (!jsonObj.get("exchangeFilters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `exchangeFilters` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("exchangeFilters").toString())); + } + + // validate the optional field `exchangeFilters` (array) + for (int i = 0; i < jsonArrayexchangeFilters.size(); i++) { + ExchangeFilters.validateJsonElement(jsonArrayexchangeFilters.get(i)); + } + ; + } + } + if (jsonObj.get("symbolFilters") != null && !jsonObj.get("symbolFilters").isJsonNull()) { + JsonArray jsonArraysymbolFilters = jsonObj.getAsJsonArray("symbolFilters"); + if (jsonArraysymbolFilters != null) { + // ensure the json data is an array + if (!jsonObj.get("symbolFilters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbolFilters` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("symbolFilters").toString())); + } + + // validate the optional field `symbolFilters` (array) + for (int i = 0; i < jsonArraysymbolFilters.size(); i++) { + SymbolFilters.validateJsonElement(jsonArraysymbolFilters.get(i)); + } + ; + } + } + if (jsonObj.get("assetFilters") != null && !jsonObj.get("assetFilters").isJsonNull()) { + JsonArray jsonArrayassetFilters = jsonObj.getAsJsonArray("assetFilters"); + if (jsonArrayassetFilters != null) { + // ensure the json data is an array + if (!jsonObj.get("assetFilters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `assetFilters` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("assetFilters").toString())); + } + + // validate the optional field `assetFilters` (array) + for (int i = 0; i < jsonArrayassetFilters.size(); i++) { + AssetFilters.validateJsonElement(jsonArrayassetFilters.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MyFiltersResponseResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MyFiltersResponseResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MyFiltersResponseResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MyFiltersResponseResult value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MyFiltersResponseResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MyFiltersResponseResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of MyFiltersResponseResult + * @throws IOException if the JSON string is invalid with respect to MyFiltersResponseResult + */ + public static MyFiltersResponseResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MyFiltersResponseResult.class); + } + + /** + * Convert an instance of MyFiltersResponseResult 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/MyPreventedMatchesRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesRequest.java index 5bac633f3..0ab25ba05 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -73,7 +75,7 @@ public class MyPreventedMatchesRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public MyPreventedMatchesRequest() {} @@ -175,7 +177,7 @@ public void setLimit(@jakarta.annotation.Nullable Integer limit) { this.limit = limit; } - public MyPreventedMatchesRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public MyPreventedMatchesRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -186,11 +188,12 @@ public MyPreventedMatchesRequest recvWindow(@jakarta.annotation.Nullable Long re * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -263,9 +266,10 @@ public String toUrlQueryString() { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesResponse.java index b90cfdd15..4b2a0d93e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesResponse.java @@ -65,7 +65,7 @@ public class MyPreventedMatchesResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public MyPreventedMatchesResponse() {} @@ -141,11 +141,19 @@ public void setResult( } public MyPreventedMatchesResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public MyPreventedMatchesResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -153,11 +161,11 @@ public MyPreventedMatchesResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +220,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -337,6 +345,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesRequest.java index f7886a084..3dc60421b 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -79,7 +81,7 @@ public class MyTradesRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public MyTradesRequest() {} @@ -198,7 +200,7 @@ public void setLimit(@jakarta.annotation.Nullable Integer limit) { this.limit = limit; } - public MyTradesRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public MyTradesRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -209,11 +211,12 @@ public MyTradesRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -289,9 +292,10 @@ public String toUrlQueryString() { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesResponse.java index c6d8364e8..9f66b0206 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesResponse.java @@ -65,7 +65,7 @@ public class MyTradesResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public MyTradesResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public MyTradesResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public MyTradesResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public MyTradesResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public MyTradesResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateL */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/NotionalFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/NotionalFilter.java new file mode 100644 index 000000000..0c5a07a95 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/NotionalFilter.java @@ -0,0 +1,484 @@ +/* + * 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.*; + +/** NotionalFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NotionalFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_PRICE_EXPONENT = "priceExponent"; + + @SerializedName(SERIALIZED_NAME_PRICE_EXPONENT) + @jakarta.annotation.Nullable + private Integer priceExponent; + + public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; + + @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) + @jakarta.annotation.Nullable + private String minNotional; + + public static final String SERIALIZED_NAME_APPLY_MIN_TO_MARKET = "applyMinToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_MIN_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyMinToMarket; + + public static final String SERIALIZED_NAME_MAX_NOTIONAL = "maxNotional"; + + @SerializedName(SERIALIZED_NAME_MAX_NOTIONAL) + @jakarta.annotation.Nullable + private String maxNotional; + + public static final String SERIALIZED_NAME_APPLY_MAX_TO_MARKET = "applyMaxToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_MAX_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyMaxToMarket; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public NotionalFilter() {} + + public NotionalFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public NotionalFilter priceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + return this; + } + + /** + * Get priceExponent + * + * @return priceExponent + */ + @jakarta.annotation.Nullable + public Integer getPriceExponent() { + return priceExponent; + } + + public void setPriceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + } + + public NotionalFilter minNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + return this; + } + + /** + * Get minNotional + * + * @return minNotional + */ + @jakarta.annotation.Nullable + public String getMinNotional() { + return minNotional; + } + + public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + } + + public NotionalFilter applyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { + this.applyMinToMarket = applyMinToMarket; + return this; + } + + /** + * Get applyMinToMarket + * + * @return applyMinToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyMinToMarket() { + return applyMinToMarket; + } + + public void setApplyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { + this.applyMinToMarket = applyMinToMarket; + } + + public NotionalFilter maxNotional(@jakarta.annotation.Nullable String maxNotional) { + this.maxNotional = maxNotional; + return this; + } + + /** + * Get maxNotional + * + * @return maxNotional + */ + @jakarta.annotation.Nullable + public String getMaxNotional() { + return maxNotional; + } + + public void setMaxNotional(@jakarta.annotation.Nullable String maxNotional) { + this.maxNotional = maxNotional; + } + + public NotionalFilter applyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { + this.applyMaxToMarket = applyMaxToMarket; + return this; + } + + /** + * Get applyMaxToMarket + * + * @return applyMaxToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyMaxToMarket() { + return applyMaxToMarket; + } + + public void setApplyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { + this.applyMaxToMarket = applyMaxToMarket; + } + + public NotionalFilter avgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotionalFilter notionalFilter = (NotionalFilter) o; + return Objects.equals(this.filterType, notionalFilter.filterType) + && Objects.equals(this.priceExponent, notionalFilter.priceExponent) + && Objects.equals(this.minNotional, notionalFilter.minNotional) + && Objects.equals(this.applyMinToMarket, notionalFilter.applyMinToMarket) + && Objects.equals(this.maxNotional, notionalFilter.maxNotional) + && Objects.equals(this.applyMaxToMarket, notionalFilter.applyMaxToMarket) + && Objects.equals(this.avgPriceMins, notionalFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + priceExponent, + minNotional, + applyMinToMarket, + maxNotional, + applyMaxToMarket, + avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotionalFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" priceExponent: ").append(toIndentedString(priceExponent)).append("\n"); + sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); + sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); + sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); + sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + String priceExponentValueAsString = priceExponentValue.toString(); + valMap.put("priceExponent", priceExponentValueAsString); + } + String minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + String minNotionalValueAsString = minNotionalValue.toString(); + valMap.put("minNotional", minNotionalValueAsString); + } + Boolean applyMinToMarketValue = getApplyMinToMarket(); + if (applyMinToMarketValue != null) { + String applyMinToMarketValueAsString = applyMinToMarketValue.toString(); + valMap.put("applyMinToMarket", applyMinToMarketValueAsString); + } + String maxNotionalValue = getMaxNotional(); + if (maxNotionalValue != null) { + String maxNotionalValueAsString = maxNotionalValue.toString(); + valMap.put("maxNotional", maxNotionalValueAsString); + } + Boolean applyMaxToMarketValue = getApplyMaxToMarket(); + if (applyMaxToMarketValue != null) { + String applyMaxToMarketValueAsString = applyMaxToMarketValue.toString(); + valMap.put("applyMaxToMarket", applyMaxToMarketValueAsString); + } + Integer avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + valMap.put("priceExponent", priceExponentValue); + } + Object minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + valMap.put("minNotional", minNotionalValue); + } + Object applyMinToMarketValue = getApplyMinToMarket(); + if (applyMinToMarketValue != null) { + valMap.put("applyMinToMarket", applyMinToMarketValue); + } + Object maxNotionalValue = getMaxNotional(); + if (maxNotionalValue != null) { + valMap.put("maxNotional", maxNotionalValue); + } + Object applyMaxToMarketValue = getApplyMaxToMarket(); + if (applyMaxToMarketValue != null) { + valMap.put("applyMaxToMarket", applyMaxToMarketValue); + } + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); + } + + 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("filterType"); + openapiFields.add("priceExponent"); + openapiFields.add("minNotional"); + openapiFields.add("applyMinToMarket"); + openapiFields.add("maxNotional"); + openapiFields.add("applyMaxToMarket"); + openapiFields.add("avgPriceMins"); + + // 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 NotionalFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NotionalFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NotionalFilter is not found in the" + + " empty JSON string", + NotionalFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NotionalFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `NotionalFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) + && !jsonObj.get("minNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minNotional").toString())); + } + if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) + && !jsonObj.get("maxNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxNotional").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NotionalFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NotionalFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NotionalFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NotionalFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NotionalFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NotionalFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotionalFilter + * @throws IOException if the JSON string is invalid with respect to NotionalFilter + */ + public static NotionalFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NotionalFilter.class); + } + + /** + * Convert an instance of NotionalFilter 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/OpenOrderListsStatusRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusRequest.java index b0d910358..3a9714cd8 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -43,11 +45,11 @@ public class OpenOrderListsStatusRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OpenOrderListsStatusRequest() {} - public OpenOrderListsStatusRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OpenOrderListsStatusRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -58,11 +60,12 @@ public OpenOrderListsStatusRequest recvWindow(@jakarta.annotation.Nullable Long * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -96,9 +99,10 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponse.java index 17b142517..0922f7ada 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponse.java @@ -65,7 +65,7 @@ public class OpenOrderListsStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OpenOrderListsStatusResponse() {} @@ -141,11 +141,19 @@ public void setResult( } public OpenOrderListsStatusResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OpenOrderListsStatusResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -153,11 +161,11 @@ public OpenOrderListsStatusResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -213,7 +221,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -339,6 +347,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllRequest.java index bf217647f..3293c3d82 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -49,7 +51,7 @@ public class OpenOrdersCancelAllRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OpenOrdersCancelAllRequest() {} @@ -73,7 +75,7 @@ public void setSymbol(@jakarta.annotation.Nonnull String symbol) { this.symbol = symbol; } - public OpenOrdersCancelAllRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OpenOrdersCancelAllRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -84,11 +86,12 @@ public OpenOrdersCancelAllRequest recvWindow(@jakarta.annotation.Nullable Long r * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -129,9 +132,10 @@ public String toUrlQueryString() { String symbolValueAsString = symbolValue.toString(); valMap.put("symbol", symbolValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllResponse.java index f0eaeff21..40486fb34 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllResponse.java @@ -65,7 +65,7 @@ public class OpenOrdersCancelAllResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OpenOrdersCancelAllResponse() {} @@ -141,11 +141,19 @@ public void setResult( } public OpenOrdersCancelAllResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OpenOrdersCancelAllResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -153,11 +161,11 @@ public OpenOrdersCancelAllResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +220,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -338,6 +346,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusRequest.java index 8b779affc..1fa62d12b 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -49,7 +51,7 @@ public class OpenOrdersStatusRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OpenOrdersStatusRequest() {} @@ -72,7 +74,7 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } - public OpenOrdersStatusRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OpenOrdersStatusRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -83,11 +85,12 @@ public OpenOrdersStatusRequest recvWindow(@jakarta.annotation.Nullable Long recv * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -128,9 +131,10 @@ public String toUrlQueryString() { String symbolValueAsString = symbolValue.toString(); valMap.put("symbol", symbolValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusResponse.java index 3543a730d..3cd78e4f3 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusResponse.java @@ -65,7 +65,7 @@ public class OpenOrdersStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OpenOrdersStatusResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public OpenOrdersStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public OpenOrdersStatusResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OpenOrdersStatusResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public OpenOrdersStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimi */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityRequest.java index 57d30a02f..55aec357f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityRequest.java @@ -75,7 +75,7 @@ public class OrderAmendKeepPriorityRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderAmendKeepPriorityRequest() {} @@ -179,7 +179,8 @@ public void setNewQty(@jakarta.annotation.Nonnull Double newQty) { this.newQty = newQty; } - public OrderAmendKeepPriorityRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderAmendKeepPriorityRequest recvWindow( + @jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -190,11 +191,12 @@ public OrderAmendKeepPriorityRequest recvWindow(@jakarta.annotation.Nullable Lon * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -267,9 +269,10 @@ public String toUrlQueryString() { String newQtyValueAsString = DecimalFormatter.getFormatter().format(newQtyValue); valMap.put("newQty", newQtyValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityResponse.java index 99afd89ef..a02fce774 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderAmendKeepPriorityResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderAmendKeepPriorityResponse() {} @@ -127,11 +130,19 @@ public void setResult( } public OrderAmendKeepPriorityResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderAmendKeepPriorityResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -139,11 +150,11 @@ public OrderAmendKeepPriorityResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -199,7 +210,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -309,6 +320,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderAmendKeepPriorityResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsRequest.java index 276430ab7..45e0426ed 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -67,7 +69,7 @@ public class OrderAmendmentsRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderAmendmentsRequest() {} @@ -150,7 +152,7 @@ public void setLimit(@jakarta.annotation.Nullable Integer limit) { this.limit = limit; } - public OrderAmendmentsRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderAmendmentsRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -161,11 +163,12 @@ public OrderAmendmentsRequest recvWindow(@jakarta.annotation.Nullable Long recvW * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -227,9 +230,10 @@ public String toUrlQueryString() { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsResponse.java index 91185bf2b..20b280497 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsResponse.java @@ -65,7 +65,7 @@ public class OrderAmendmentsResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderAmendmentsResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public OrderAmendmentsResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public OrderAmendmentsResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderAmendmentsResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public OrderAmendmentsResponse rateLimits(@jakarta.annotation.Nullable RateLimit */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 9a4e3769d..97b93b7f0 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 @@ -193,7 +193,7 @@ public class OrderCancelReplaceRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderCancelReplaceRequest() {} @@ -696,7 +696,7 @@ public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffse this.pegOffsetType = pegOffsetType; } - public OrderCancelReplaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderCancelReplaceRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -707,11 +707,12 @@ public OrderCancelReplaceRequest recvWindow(@jakarta.annotation.Nullable Long re * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -963,9 +964,10 @@ public String toUrlQueryString() { String pegOffsetTypeValueAsString = pegOffsetTypeValue.toString(); valMap.put("pegOffsetType", pegOffsetTypeValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponse.java index 7afe71990..f66c12d1e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderCancelReplaceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderCancelReplaceResponse() {} @@ -126,11 +129,19 @@ public void setResult(@jakarta.annotation.Nullable OrderCancelReplaceResponseRes } public OrderCancelReplaceResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderCancelReplaceResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -138,11 +149,11 @@ public OrderCancelReplaceResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -197,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -306,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderCancelReplaceResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelRequest.java index 098fcb2d2..fb3829f61 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -74,7 +75,7 @@ public class OrderCancelRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderCancelRequest() {} @@ -179,7 +180,7 @@ public void setCancelRestrictions( this.cancelRestrictions = cancelRestrictions; } - public OrderCancelRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderCancelRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -190,11 +191,12 @@ public OrderCancelRequest recvWindow(@jakarta.annotation.Nullable Long recvWindo * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -271,9 +273,10 @@ public String toUrlQueryString() { String cancelRestrictionsValueAsString = cancelRestrictionsValue.toString(); valMap.put("cancelRestrictions", cancelRestrictionsValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponse.java index 362357f2c..6d108f3b3 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderCancelResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderCancelResponse() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable OrderCancelResponseResult res this.result = result; } - public OrderCancelResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public OrderCancelResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderCancelResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public OrderCancelResponse rateLimits(@jakarta.annotation.Nullable RateLimits ra */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderCancelResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelRequest.java index 932dbd498..4848c8123 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -67,7 +69,7 @@ public class OrderListCancelRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderListCancelRequest() {} @@ -150,7 +152,7 @@ public void setNewClientOrderId(@jakarta.annotation.Nullable String newClientOrd this.newClientOrderId = newClientOrderId; } - public OrderListCancelRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderListCancelRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -161,11 +163,12 @@ public OrderListCancelRequest recvWindow(@jakarta.annotation.Nullable Long recvW * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -227,9 +230,10 @@ public String toUrlQueryString() { String newClientOrderIdValueAsString = newClientOrderIdValue.toString(); valMap.put("newClientOrderId", newClientOrderIdValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelResponse.java index 163849726..e88531286 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderListCancelResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderListCancelResponse() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable OrderListCancelResponseResult this.result = result; } - public OrderListCancelResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public OrderListCancelResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderListCancelResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public OrderListCancelResponse rateLimits(@jakarta.annotation.Nullable RateLimit */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListCancelResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } 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 ce7f74869..71e36820c 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 @@ -105,7 +105,7 @@ public class OrderListPlaceOcoRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_ABOVE_TIME_IN_FORCE) @jakarta.annotation.Nullable - private Double aboveTimeInForce; + private AboveTimeInForce aboveTimeInForce; public static final String SERIALIZED_NAME_ABOVE_STRATEGY_ID = "aboveStrategyId"; @@ -226,7 +226,7 @@ public class OrderListPlaceOcoRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderListPlaceOcoRequest() {} @@ -435,7 +435,7 @@ public void setAboveTrailingDelta(@jakarta.annotation.Nullable Long aboveTrailin } public OrderListPlaceOcoRequest aboveTimeInForce( - @jakarta.annotation.Nullable Double aboveTimeInForce) { + @jakarta.annotation.Nullable AboveTimeInForce aboveTimeInForce) { this.aboveTimeInForce = aboveTimeInForce; return this; } @@ -447,11 +447,12 @@ public OrderListPlaceOcoRequest aboveTimeInForce( */ @jakarta.annotation.Nullable @Valid - public Double getAboveTimeInForce() { + public AboveTimeInForce getAboveTimeInForce() { return aboveTimeInForce; } - public void setAboveTimeInForce(@jakarta.annotation.Nullable Double aboveTimeInForce) { + public void setAboveTimeInForce( + @jakarta.annotation.Nullable AboveTimeInForce aboveTimeInForce) { this.aboveTimeInForce = aboveTimeInForce; } @@ -851,7 +852,7 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } - public OrderListPlaceOcoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderListPlaceOcoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -862,11 +863,12 @@ public OrderListPlaceOcoRequest recvWindow(@jakarta.annotation.Nullable Long rec * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -1076,10 +1078,9 @@ public String toUrlQueryString() { String aboveTrailingDeltaValueAsString = aboveTrailingDeltaValue.toString(); valMap.put("aboveTrailingDelta", aboveTrailingDeltaValueAsString); } - Double aboveTimeInForceValue = getAboveTimeInForce(); + AboveTimeInForce aboveTimeInForceValue = getAboveTimeInForce(); if (aboveTimeInForceValue != null) { - String aboveTimeInForceValueAsString = - DecimalFormatter.getFormatter().format(aboveTimeInForceValue); + String aboveTimeInForceValueAsString = aboveTimeInForceValue.toString(); valMap.put("aboveTimeInForce", aboveTimeInForceValueAsString); } Long aboveStrategyIdValue = getAboveStrategyId(); @@ -1179,9 +1180,10 @@ public String toUrlQueryString() { String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } @@ -1455,6 +1457,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("aboveClientOrderId").toString())); } + // validate the optional field `aboveTimeInForce` + if (jsonObj.get("aboveTimeInForce") != null + && !jsonObj.get("aboveTimeInForce").isJsonNull()) { + AboveTimeInForce.validateJsonElement(jsonObj.get("aboveTimeInForce")); + } // validate the optional field `abovePegPriceType` if (jsonObj.get("abovePegPriceType") != null && !jsonObj.get("abovePegPriceType").isJsonNull()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoResponse.java index 1dd599664..1eceec241 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderListPlaceOcoResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderListPlaceOcoResponse() {} @@ -126,11 +129,19 @@ public void setResult(@jakarta.annotation.Nullable OrderListPlaceOcoResponseResu } public OrderListPlaceOcoResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderListPlaceOcoResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -138,11 +149,11 @@ public OrderListPlaceOcoResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -197,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -306,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListPlaceOcoResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 6928f88cf..2346bc738 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 @@ -226,7 +226,7 @@ public class OrderListPlaceOtoRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderListPlaceOtoRequest() {} @@ -865,7 +865,7 @@ public void setPendingPegOffsetValue( this.pendingPegOffsetValue = pendingPegOffsetValue; } - public OrderListPlaceOtoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderListPlaceOtoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -876,11 +876,12 @@ public OrderListPlaceOtoRequest recvWindow(@jakarta.annotation.Nullable Long rec * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -1211,9 +1212,10 @@ public String toUrlQueryString() { String pendingPegOffsetValueValueAsString = pendingPegOffsetValueValue.toString(); valMap.put("pendingPegOffsetValue", pendingPegOffsetValueValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponse.java index e77b23501..a8d9f6c09 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderListPlaceOtoResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderListPlaceOtoResponse() {} @@ -126,11 +129,19 @@ public void setResult(@jakarta.annotation.Nullable OrderListPlaceOtoResponseResu } public OrderListPlaceOtoResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderListPlaceOtoResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -138,11 +149,11 @@ public OrderListPlaceOtoResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -197,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -306,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListPlaceOtoResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } 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 790afd7e9..8a7b0124f 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 @@ -312,7 +312,7 @@ public class OrderListPlaceOtocoRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderListPlaceOtocoRequest() {} @@ -1218,7 +1218,7 @@ public void setPendingBelowPegOffsetValue( this.pendingBelowPegOffsetValue = pendingBelowPegOffsetValue; } - public OrderListPlaceOtocoRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderListPlaceOtocoRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -1229,11 +1229,12 @@ public OrderListPlaceOtocoRequest recvWindow(@jakarta.annotation.Nullable Long r * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -1733,9 +1734,10 @@ public String toUrlQueryString() { pendingBelowPegOffsetValueValue.toString(); valMap.put("pendingBelowPegOffsetValue", pendingBelowPegOffsetValueValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponse.java index 9c2ce1af2..acfbd805c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderListPlaceOtocoResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderListPlaceOtocoResponse() {} @@ -126,11 +129,19 @@ public void setResult(@jakarta.annotation.Nullable OrderListPlaceOtocoResponseRe } public OrderListPlaceOtocoResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderListPlaceOtocoResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -138,11 +149,11 @@ public OrderListPlaceOtocoResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -197,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -307,6 +318,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListPlaceOtocoResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceRequest.java index bcc26c189..8bdd27887 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceRequest.java @@ -160,7 +160,7 @@ public class OrderListPlaceRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderListPlaceRequest() {} @@ -554,7 +554,7 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } - public OrderListPlaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderListPlaceRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -565,11 +565,12 @@ public OrderListPlaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWi * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -767,9 +768,10 @@ public String toUrlQueryString() { String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponse.java index 003f74fbc..2d8d1e953 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderListPlaceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderListPlaceResponse() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable OrderListPlaceResponseResult this.result = result; } - public OrderListPlaceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public OrderListPlaceResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderListPlaceResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public OrderListPlaceResponse rateLimits(@jakarta.annotation.Nullable RateLimits */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListPlaceResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusRequest.java index dbcbcbf26..ebce9e2ea 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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 +57,7 @@ public class OrderListStatusRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderListStatusRequest() {} @@ -98,7 +100,7 @@ public void setOrderListId(@jakarta.annotation.Nullable Integer orderListId) { this.orderListId = orderListId; } - public OrderListStatusRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderListStatusRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -109,11 +111,12 @@ public OrderListStatusRequest recvWindow(@jakarta.annotation.Nullable Long recvW * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -161,9 +164,10 @@ public String toUrlQueryString() { String orderListIdValueAsString = orderListIdValue.toString(); valMap.put("orderListId", orderListIdValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponse.java index bbd18c7a6..6b85b45ba 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderListStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderListStatusResponse() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable AllOrderListsResponseResultIn this.result = result; } - public OrderListStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public OrderListStatusResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderListStatusResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public OrderListStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimit */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { AllOrderListsResponseResultInner.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } 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 c0f11275b..88a65eccd 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 @@ -154,7 +154,7 @@ public class OrderPlaceRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderPlaceRequest() {} @@ -521,7 +521,7 @@ public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffse this.pegOffsetType = pegOffsetType; } - public OrderPlaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderPlaceRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -532,11 +532,12 @@ public OrderPlaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -720,9 +721,10 @@ public String toUrlQueryString() { String pegOffsetTypeValueAsString = pegOffsetTypeValue.toString(); valMap.put("pegOffsetType", pegOffsetTypeValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceResponse.java index 84ac3f261..7ba024764 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderPlaceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderPlaceResponse() {} @@ -124,11 +127,20 @@ public void setResult(@jakarta.annotation.Nullable OrderPlaceResponseResult resu this.result = result; } - public OrderPlaceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public OrderPlaceResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderPlaceResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -136,11 +148,11 @@ public OrderPlaceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rat */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -195,7 +207,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -304,6 +316,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderPlaceResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusRequest.java index 2cd9ef110..257d25a55 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -61,7 +63,7 @@ public class OrderStatusRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderStatusRequest() {} @@ -124,7 +126,7 @@ public void setOrigClientOrderId(@jakarta.annotation.Nullable String origClientO this.origClientOrderId = origClientOrderId; } - public OrderStatusRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderStatusRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -135,11 +137,12 @@ public OrderStatusRequest recvWindow(@jakarta.annotation.Nullable Long recvWindo * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -194,9 +197,10 @@ public String toUrlQueryString() { String origClientOrderIdValueAsString = origClientOrderIdValue.toString(); valMap.put("origClientOrderId", origClientOrderIdValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusResponse.java index 060c09c46..100de1057 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderStatusResponse() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable OrderStatusResponseResult res this.result = result; } - public OrderStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public OrderStatusResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderStatusResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public OrderStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits ra */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderStatusResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } 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 d6f0a85ac..a32ab8eaf 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 @@ -160,7 +160,7 @@ public class OrderTestRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public OrderTestRequest() {} @@ -547,7 +547,7 @@ public void setPegOffsetType(@jakarta.annotation.Nullable PegOffsetType pegOffse this.pegOffsetType = pegOffsetType; } - public OrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public OrderTestRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -558,11 +558,12 @@ public OrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -756,9 +757,10 @@ public String toUrlQueryString() { String pegOffsetTypeValueAsString = pegOffsetTypeValue.toString(); valMap.put("pegOffsetType", pegOffsetTypeValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponse.java index 122eb80af..27b139a5b 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class OrderTestResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public OrderTestResponse() {} @@ -124,11 +127,20 @@ public void setResult(@jakarta.annotation.Nullable OrderTestResponseResult resul this.result = result; } - public OrderTestResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public OrderTestResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public OrderTestResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -136,11 +148,11 @@ public OrderTestResponse rateLimits(@jakarta.annotation.Nullable RateLimits rate */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -195,7 +207,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -304,6 +316,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderTestResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PercentPriceBySideFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PercentPriceBySideFilter.java new file mode 100644 index 000000000..ce6991fc2 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PercentPriceBySideFilter.java @@ -0,0 +1,515 @@ +/* + * 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.*; + +/** PercentPriceBySideFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PercentPriceBySideFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MULTIPLIER_EXPONENT = "multiplierExponent"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_EXPONENT) + @jakarta.annotation.Nullable + private Integer multiplierExponent; + + public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String bidMultiplierUp; + + public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String bidMultiplierDown; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String askMultiplierUp; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String askMultiplierDown; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public PercentPriceBySideFilter() {} + + public PercentPriceBySideFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public PercentPriceBySideFilter multiplierExponent( + @jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + return this; + } + + /** + * Get multiplierExponent + * + * @return multiplierExponent + */ + @jakarta.annotation.Nullable + public Integer getMultiplierExponent() { + return multiplierExponent; + } + + public void setMultiplierExponent(@jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + } + + public PercentPriceBySideFilter bidMultiplierUp( + @jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; + return this; + } + + /** + * Get bidMultiplierUp + * + * @return bidMultiplierUp + */ + @jakarta.annotation.Nullable + public String getBidMultiplierUp() { + return bidMultiplierUp; + } + + public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; + } + + public PercentPriceBySideFilter bidMultiplierDown( + @jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + return this; + } + + /** + * Get bidMultiplierDown + * + * @return bidMultiplierDown + */ + @jakarta.annotation.Nullable + public String getBidMultiplierDown() { + return bidMultiplierDown; + } + + public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + } + + public PercentPriceBySideFilter askMultiplierUp( + @jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + return this; + } + + /** + * Get askMultiplierUp + * + * @return askMultiplierUp + */ + @jakarta.annotation.Nullable + public String getAskMultiplierUp() { + return askMultiplierUp; + } + + public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + } + + public PercentPriceBySideFilter askMultiplierDown( + @jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + return this; + } + + /** + * Get askMultiplierDown + * + * @return askMultiplierDown + */ + @jakarta.annotation.Nullable + public String getAskMultiplierDown() { + return askMultiplierDown; + } + + public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + } + + public PercentPriceBySideFilter avgPriceMins( + @jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PercentPriceBySideFilter percentPriceBySideFilter = (PercentPriceBySideFilter) o; + return Objects.equals(this.filterType, percentPriceBySideFilter.filterType) + && Objects.equals( + this.multiplierExponent, percentPriceBySideFilter.multiplierExponent) + && Objects.equals(this.bidMultiplierUp, percentPriceBySideFilter.bidMultiplierUp) + && Objects.equals( + this.bidMultiplierDown, percentPriceBySideFilter.bidMultiplierDown) + && Objects.equals(this.askMultiplierUp, percentPriceBySideFilter.askMultiplierUp) + && Objects.equals( + this.askMultiplierDown, percentPriceBySideFilter.askMultiplierDown) + && Objects.equals(this.avgPriceMins, percentPriceBySideFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + multiplierExponent, + bidMultiplierUp, + bidMultiplierDown, + askMultiplierUp, + askMultiplierDown, + avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PercentPriceBySideFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" multiplierExponent: ") + .append(toIndentedString(multiplierExponent)) + .append("\n"); + sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); + sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); + sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); + sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer multiplierExponentValue = getMultiplierExponent(); + if (multiplierExponentValue != null) { + String multiplierExponentValueAsString = multiplierExponentValue.toString(); + valMap.put("multiplierExponent", multiplierExponentValueAsString); + } + String bidMultiplierUpValue = getBidMultiplierUp(); + if (bidMultiplierUpValue != null) { + String bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); + valMap.put("bidMultiplierUp", bidMultiplierUpValueAsString); + } + String bidMultiplierDownValue = getBidMultiplierDown(); + if (bidMultiplierDownValue != null) { + String bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); + valMap.put("bidMultiplierDown", bidMultiplierDownValueAsString); + } + String askMultiplierUpValue = getAskMultiplierUp(); + if (askMultiplierUpValue != null) { + String askMultiplierUpValueAsString = askMultiplierUpValue.toString(); + valMap.put("askMultiplierUp", askMultiplierUpValueAsString); + } + String askMultiplierDownValue = getAskMultiplierDown(); + if (askMultiplierDownValue != null) { + String askMultiplierDownValueAsString = askMultiplierDownValue.toString(); + valMap.put("askMultiplierDown", askMultiplierDownValueAsString); + } + Integer avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object multiplierExponentValue = getMultiplierExponent(); + if (multiplierExponentValue != null) { + valMap.put("multiplierExponent", multiplierExponentValue); + } + Object bidMultiplierUpValue = getBidMultiplierUp(); + if (bidMultiplierUpValue != null) { + valMap.put("bidMultiplierUp", bidMultiplierUpValue); + } + Object bidMultiplierDownValue = getBidMultiplierDown(); + if (bidMultiplierDownValue != null) { + valMap.put("bidMultiplierDown", bidMultiplierDownValue); + } + Object askMultiplierUpValue = getAskMultiplierUp(); + if (askMultiplierUpValue != null) { + valMap.put("askMultiplierUp", askMultiplierUpValue); + } + Object askMultiplierDownValue = getAskMultiplierDown(); + if (askMultiplierDownValue != null) { + valMap.put("askMultiplierDown", askMultiplierDownValue); + } + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); + } + + 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("filterType"); + openapiFields.add("multiplierExponent"); + openapiFields.add("bidMultiplierUp"); + openapiFields.add("bidMultiplierDown"); + openapiFields.add("askMultiplierUp"); + openapiFields.add("askMultiplierDown"); + openapiFields.add("avgPriceMins"); + + // 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 PercentPriceBySideFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PercentPriceBySideFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PercentPriceBySideFilter is not found" + + " in the empty JSON string", + PercentPriceBySideFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PercentPriceBySideFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PercentPriceBySideFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("bidMultiplierUp") != null && !jsonObj.get("bidMultiplierUp").isJsonNull()) + && !jsonObj.get("bidMultiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidMultiplierUp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("bidMultiplierUp").toString())); + } + if ((jsonObj.get("bidMultiplierDown") != null + && !jsonObj.get("bidMultiplierDown").isJsonNull()) + && !jsonObj.get("bidMultiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidMultiplierDown` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("bidMultiplierDown").toString())); + } + if ((jsonObj.get("askMultiplierUp") != null && !jsonObj.get("askMultiplierUp").isJsonNull()) + && !jsonObj.get("askMultiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askMultiplierUp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("askMultiplierUp").toString())); + } + if ((jsonObj.get("askMultiplierDown") != null + && !jsonObj.get("askMultiplierDown").isJsonNull()) + && !jsonObj.get("askMultiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askMultiplierDown` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("askMultiplierDown").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PercentPriceBySideFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PercentPriceBySideFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceBySideFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PercentPriceBySideFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PercentPriceBySideFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PercentPriceBySideFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of PercentPriceBySideFilter + * @throws IOException if the JSON string is invalid with respect to PercentPriceBySideFilter + */ + public static PercentPriceBySideFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PercentPriceBySideFilter.class); + } + + /** + * Convert an instance of PercentPriceBySideFilter 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/PercentPriceFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PercentPriceFilter.java new file mode 100644 index 000000000..436fbaf37 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PercentPriceFilter.java @@ -0,0 +1,408 @@ +/* + * 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.*; + +/** PercentPriceFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PercentPriceFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MULTIPLIER_EXPONENT = "multiplierExponent"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_EXPONENT) + @jakarta.annotation.Nullable + private Integer multiplierExponent; + + public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String multiplierUp; + + public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String multiplierDown; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public PercentPriceFilter() {} + + public PercentPriceFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public PercentPriceFilter multiplierExponent( + @jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + return this; + } + + /** + * Get multiplierExponent + * + * @return multiplierExponent + */ + @jakarta.annotation.Nullable + public Integer getMultiplierExponent() { + return multiplierExponent; + } + + public void setMultiplierExponent(@jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + } + + public PercentPriceFilter multiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; + return this; + } + + /** + * Get multiplierUp + * + * @return multiplierUp + */ + @jakarta.annotation.Nullable + public String getMultiplierUp() { + return multiplierUp; + } + + public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; + } + + public PercentPriceFilter multiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; + return this; + } + + /** + * Get multiplierDown + * + * @return multiplierDown + */ + @jakarta.annotation.Nullable + public String getMultiplierDown() { + return multiplierDown; + } + + public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; + } + + public PercentPriceFilter avgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PercentPriceFilter percentPriceFilter = (PercentPriceFilter) o; + return Objects.equals(this.filterType, percentPriceFilter.filterType) + && Objects.equals(this.multiplierExponent, percentPriceFilter.multiplierExponent) + && Objects.equals(this.multiplierUp, percentPriceFilter.multiplierUp) + && Objects.equals(this.multiplierDown, percentPriceFilter.multiplierDown) + && Objects.equals(this.avgPriceMins, percentPriceFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, multiplierExponent, multiplierUp, multiplierDown, avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PercentPriceFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" multiplierExponent: ") + .append(toIndentedString(multiplierExponent)) + .append("\n"); + sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); + sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer multiplierExponentValue = getMultiplierExponent(); + if (multiplierExponentValue != null) { + String multiplierExponentValueAsString = multiplierExponentValue.toString(); + valMap.put("multiplierExponent", multiplierExponentValueAsString); + } + String multiplierUpValue = getMultiplierUp(); + if (multiplierUpValue != null) { + String multiplierUpValueAsString = multiplierUpValue.toString(); + valMap.put("multiplierUp", multiplierUpValueAsString); + } + String multiplierDownValue = getMultiplierDown(); + if (multiplierDownValue != null) { + String multiplierDownValueAsString = multiplierDownValue.toString(); + valMap.put("multiplierDown", multiplierDownValueAsString); + } + Integer avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object multiplierExponentValue = getMultiplierExponent(); + if (multiplierExponentValue != null) { + valMap.put("multiplierExponent", multiplierExponentValue); + } + Object multiplierUpValue = getMultiplierUp(); + if (multiplierUpValue != null) { + valMap.put("multiplierUp", multiplierUpValue); + } + Object multiplierDownValue = getMultiplierDown(); + if (multiplierDownValue != null) { + valMap.put("multiplierDown", multiplierDownValue); + } + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); + } + + 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("filterType"); + openapiFields.add("multiplierExponent"); + openapiFields.add("multiplierUp"); + openapiFields.add("multiplierDown"); + openapiFields.add("avgPriceMins"); + + // 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 PercentPriceFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PercentPriceFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PercentPriceFilter is not found in the" + + " empty JSON string", + PercentPriceFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PercentPriceFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PercentPriceFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) + && !jsonObj.get("multiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierUp` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("multiplierUp").toString())); + } + if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) + && !jsonObj.get("multiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierDown` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("multiplierDown").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PercentPriceFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PercentPriceFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PercentPriceFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PercentPriceFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PercentPriceFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of PercentPriceFilter + * @throws IOException if the JSON string is invalid with respect to PercentPriceFilter + */ + public static PercentPriceFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PercentPriceFilter.class); + } + + /** + * Convert an instance of PercentPriceFilter 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/PingResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PingResponse.java index 5df33a8ad..2f60d5e05 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PingResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PingResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class PingResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public PingResponse() {} @@ -123,11 +126,20 @@ public void setResult(@jakarta.annotation.Nullable Object result) { this.result = result; } - public PingResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public PingResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public PingResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -135,11 +147,11 @@ public PingResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimit */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -194,7 +206,7 @@ public String toUrlQueryString() { String resultValueAsString = resultValue.toString(); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -299,6 +311,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("id").toString())); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PriceFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PriceFilter.java new file mode 100644 index 000000000..8a544b354 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PriceFilter.java @@ -0,0 +1,411 @@ +/* + * 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.*; + +/** PriceFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PriceFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_PRICE_EXPONENT = "priceExponent"; + + @SerializedName(SERIALIZED_NAME_PRICE_EXPONENT) + @jakarta.annotation.Nullable + private Integer priceExponent; + + public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; + + @SerializedName(SERIALIZED_NAME_MIN_PRICE) + @jakarta.annotation.Nullable + private String minPrice; + + public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; + + @SerializedName(SERIALIZED_NAME_MAX_PRICE) + @jakarta.annotation.Nullable + private String maxPrice; + + public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; + + @SerializedName(SERIALIZED_NAME_TICK_SIZE) + @jakarta.annotation.Nullable + private String tickSize; + + public PriceFilter() {} + + public PriceFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public PriceFilter priceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + return this; + } + + /** + * Get priceExponent + * + * @return priceExponent + */ + @jakarta.annotation.Nullable + public Integer getPriceExponent() { + return priceExponent; + } + + public void setPriceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + } + + public PriceFilter minPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; + return this; + } + + /** + * Get minPrice + * + * @return minPrice + */ + @jakarta.annotation.Nullable + public String getMinPrice() { + return minPrice; + } + + public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; + } + + public PriceFilter maxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; + return this; + } + + /** + * Get maxPrice + * + * @return maxPrice + */ + @jakarta.annotation.Nullable + public String getMaxPrice() { + return maxPrice; + } + + public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; + } + + public PriceFilter tickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; + return this; + } + + /** + * Get tickSize + * + * @return tickSize + */ + @jakarta.annotation.Nullable + public String getTickSize() { + return tickSize; + } + + public void setTickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PriceFilter priceFilter = (PriceFilter) o; + return Objects.equals(this.filterType, priceFilter.filterType) + && Objects.equals(this.priceExponent, priceFilter.priceExponent) + && Objects.equals(this.minPrice, priceFilter.minPrice) + && Objects.equals(this.maxPrice, priceFilter.maxPrice) + && Objects.equals(this.tickSize, priceFilter.tickSize); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, priceExponent, minPrice, maxPrice, tickSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PriceFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" priceExponent: ").append(toIndentedString(priceExponent)).append("\n"); + sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); + sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); + sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + String priceExponentValueAsString = priceExponentValue.toString(); + valMap.put("priceExponent", priceExponentValueAsString); + } + String minPriceValue = getMinPrice(); + if (minPriceValue != null) { + String minPriceValueAsString = minPriceValue.toString(); + valMap.put("minPrice", minPriceValueAsString); + } + String maxPriceValue = getMaxPrice(); + if (maxPriceValue != null) { + String maxPriceValueAsString = maxPriceValue.toString(); + valMap.put("maxPrice", maxPriceValueAsString); + } + String tickSizeValue = getTickSize(); + if (tickSizeValue != null) { + String tickSizeValueAsString = tickSizeValue.toString(); + valMap.put("tickSize", tickSizeValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + valMap.put("priceExponent", priceExponentValue); + } + Object minPriceValue = getMinPrice(); + if (minPriceValue != null) { + valMap.put("minPrice", minPriceValue); + } + Object maxPriceValue = getMaxPrice(); + if (maxPriceValue != null) { + valMap.put("maxPrice", maxPriceValue); + } + Object tickSizeValue = getTickSize(); + if (tickSizeValue != null) { + valMap.put("tickSize", tickSizeValue); + } + + 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("filterType"); + openapiFields.add("priceExponent"); + openapiFields.add("minPrice"); + openapiFields.add("maxPrice"); + openapiFields.add("tickSize"); + + // 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 PriceFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PriceFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PriceFilter is not found in the empty" + + " JSON string", + PriceFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PriceFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PriceFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) + && !jsonObj.get("minPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minPrice").toString())); + } + if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) + && !jsonObj.get("maxPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPrice").toString())); + } + if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) + && !jsonObj.get("tickSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tickSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tickSize").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PriceFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PriceFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PriceFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PriceFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PriceFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PriceFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of PriceFilter + * @throws IOException if the JSON string is invalid with respect to PriceFilter + */ + public static PriceFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PriceFilter.class); + } + + /** + * Convert an instance of PriceFilter 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/RateLimits.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimits.java index b266b74ac..8452bce96 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimits.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimits.java @@ -12,18 +12,20 @@ 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.ArrayList; import java.util.HashSet; import java.util.Map; import java.util.Objects; @@ -36,9 +38,134 @@ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class RateLimits extends ArrayList { +public class RateLimits extends BaseDTO { + public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; + + @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) + @jakarta.annotation.Nullable + private String rateLimitType; + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + @jakarta.annotation.Nullable + private String interval; + + public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; + + @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) + @jakarta.annotation.Nullable + private Long intervalNum; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @jakarta.annotation.Nullable + private Long limit; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + @jakarta.annotation.Nullable + private Long count; + public RateLimits() {} + public RateLimits rateLimitType(@jakarta.annotation.Nullable String rateLimitType) { + this.rateLimitType = rateLimitType; + return this; + } + + /** + * Get rateLimitType + * + * @return rateLimitType + */ + @jakarta.annotation.Nullable + public String getRateLimitType() { + return rateLimitType; + } + + public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { + this.rateLimitType = rateLimitType; + } + + public RateLimits interval(@jakarta.annotation.Nullable String interval) { + this.interval = interval; + return this; + } + + /** + * Get interval + * + * @return interval + */ + @jakarta.annotation.Nullable + public String getInterval() { + return interval; + } + + public void setInterval(@jakarta.annotation.Nullable String interval) { + this.interval = interval; + } + + public RateLimits intervalNum(@jakarta.annotation.Nullable Long intervalNum) { + this.intervalNum = intervalNum; + return this; + } + + /** + * Get intervalNum + * + * @return intervalNum + */ + @jakarta.annotation.Nullable + public Long getIntervalNum() { + return intervalNum; + } + + public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { + this.intervalNum = intervalNum; + } + + public RateLimits limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @jakarta.annotation.Nullable + public Long getLimit() { + return limit; + } + + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + } + + public RateLimits count(@jakarta.annotation.Nullable Long count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count + */ + @jakarta.annotation.Nullable + public Long getCount() { + return count; + } + + public void setCount(@jakarta.annotation.Nullable Long count) { + this.count = count; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -47,19 +174,28 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - return super.equals(o); + RateLimits rateLimits = (RateLimits) o; + return Objects.equals(this.rateLimitType, rateLimits.rateLimitType) + && Objects.equals(this.interval, rateLimits.interval) + && Objects.equals(this.intervalNum, rateLimits.intervalNum) + && Objects.equals(this.limit, rateLimits.limit) + && Objects.equals(this.count, rateLimits.count); } @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return Objects.hash(rateLimitType, interval, intervalNum, limit, count); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RateLimits {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" rateLimitType: ").append(toIndentedString(rateLimitType)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" intervalNum: ").append(toIndentedString(intervalNum)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); sb.append("}"); return sb.toString(); } @@ -67,7 +203,34 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String rateLimitTypeValue = getRateLimitType(); + if (rateLimitTypeValue != null) { + String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); + valMap.put("rateLimitType", rateLimitTypeValueAsString); + } + String intervalValue = getInterval(); + if (intervalValue != null) { + String intervalValueAsString = intervalValue.toString(); + valMap.put("interval", intervalValueAsString); + } + Long intervalNumValue = getIntervalNum(); + if (intervalNumValue != null) { + String intervalNumValueAsString = intervalNumValue.toString(); + valMap.put("intervalNum", intervalNumValueAsString); + } + Long limitValue = getLimit(); + if (limitValue != null) { + String limitValueAsString = limitValue.toString(); + valMap.put("limit", limitValueAsString); + } + Long countValue = getCount(); + if (countValue != null) { + String countValueAsString = countValue.toString(); + valMap.put("count", countValueAsString); + } + valMap.put("timestamp", getTimestamp()); return asciiEncode( valMap.keySet().stream() .map(key -> key + "=" + valMap.get(key)) @@ -76,7 +239,29 @@ public String toUrlQueryString() { public Map toMap() { Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object rateLimitTypeValue = getRateLimitType(); + if (rateLimitTypeValue != null) { + valMap.put("rateLimitType", rateLimitTypeValue); + } + Object intervalValue = getInterval(); + if (intervalValue != null) { + valMap.put("interval", intervalValue); + } + Object intervalNumValue = getIntervalNum(); + if (intervalNumValue != null) { + valMap.put("intervalNum", intervalNumValue); + } + Object limitValue = getLimit(); + if (limitValue != null) { + valMap.put("limit", limitValue); + } + Object countValue = getCount(); + if (countValue != null) { + valMap.put("count", countValue); + } + valMap.put("timestamp", getTimestamp()); return valMap; } @@ -101,6 +286,11 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("rateLimitType"); + openapiFields.add("interval"); + openapiFields.add("intervalNum"); + openapiFields.add("limit"); + openapiFields.add("count"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -135,6 +325,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) + && !jsonObj.get("rateLimitType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimitType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimitType").toString())); + } + if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) + && !jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -152,7 +359,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { new TypeAdapter() { @Override public void write(JsonWriter out, RateLimits value) throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SessionLogonRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SessionLogonRequest.java index fdeff7ac5..4cbe831c0 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SessionLogonRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SessionLogonRequest.java @@ -12,6 +12,7 @@ package com.binance.connector.client.spot.websocket.api.model; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.api.JSON; import com.google.gson.Gson; @@ -23,6 +24,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; @@ -43,11 +45,11 @@ public class SessionLogonRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public SessionLogonRequest() {} - public SessionLogonRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public SessionLogonRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -58,11 +60,12 @@ public SessionLogonRequest recvWindow(@jakarta.annotation.Nullable Long recvWind * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -96,9 +99,10 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceRequest.java index 2b2d66fad..f4682e98d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceRequest.java @@ -118,7 +118,7 @@ public class SorOrderPlaceRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public SorOrderPlaceRequest() {} @@ -367,7 +367,7 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } - public SorOrderPlaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public SorOrderPlaceRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -378,11 +378,12 @@ public SorOrderPlaceRequest recvWindow(@jakarta.annotation.Nullable Long recvWin * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -517,9 +518,10 @@ public String toUrlQueryString() { String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceResponse.java index 9050a5862..e7b404771 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceResponse.java @@ -65,7 +65,7 @@ public class SorOrderPlaceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public SorOrderPlaceResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public SorOrderPlaceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public SorOrderPlaceResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public SorOrderPlaceResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public SorOrderPlaceResponse rateLimits(@jakarta.annotation.Nullable RateLimits */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestRequest.java index 03169ffe5..1d44f2133 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestRequest.java @@ -124,7 +124,7 @@ public class SorOrderTestRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private Double recvWindow; public SorOrderTestRequest() {} @@ -394,7 +394,7 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } - public SorOrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public SorOrderTestRequest recvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; return this; } @@ -405,11 +405,12 @@ public SorOrderTestRequest recvWindow(@jakarta.annotation.Nullable Long recvWind * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + @Valid + public Double getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { this.recvWindow = recvWindow; } @@ -555,9 +556,10 @@ public String toUrlQueryString() { String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); } - Long recvWindowValue = getRecvWindow(); + Double recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { - String recvWindowValueAsString = recvWindowValue.toString(); + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); valMap.put("recvWindow", recvWindowValueAsString); } 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 bbe8726e1..4e84e9f2f 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 @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class SorOrderTestResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public SorOrderTestResponse() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable SorOrderTestResponseResult re this.result = result; } - public SorOrderTestResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public SorOrderTestResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public SorOrderTestResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public SorOrderTestResponse rateLimits(@jakarta.annotation.Nullable RateLimits r */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { SorOrderTestResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/StopLimitTimeInForce.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/StopLimitTimeInForce.java index 102b67735..08acfe2c1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/StopLimitTimeInForce.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/StopLimitTimeInForce.java @@ -26,9 +26,9 @@ public enum StopLimitTimeInForce { GTC("GTC"), - FOK("FOK"), + IOC("IOC"), - IOC("IOC"); + FOK("FOK"); private String value; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SymbolFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SymbolFilters.java new file mode 100644 index 000000000..91da7e63b --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SymbolFilters.java @@ -0,0 +1,1358 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.hibernate.validator.constraints.*; + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SymbolFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SymbolFilters.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SymbolFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SymbolFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterPriceFilter = + gson.getDelegateAdapter(this, TypeToken.get(PriceFilter.class)); + final TypeAdapter adapterPercentPriceFilter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceFilter.class)); + final TypeAdapter adapterPercentPriceBySideFilter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceBySideFilter.class)); + final TypeAdapter adapterLotSizeFilter = + gson.getDelegateAdapter(this, TypeToken.get(LotSizeFilter.class)); + final TypeAdapter adapterMinNotionalFilter = + gson.getDelegateAdapter(this, TypeToken.get(MinNotionalFilter.class)); + final TypeAdapter adapterNotionalFilter = + gson.getDelegateAdapter(this, TypeToken.get(NotionalFilter.class)); + final TypeAdapter adapterIcebergPartsFilter = + gson.getDelegateAdapter(this, TypeToken.get(IcebergPartsFilter.class)); + final TypeAdapter adapterMarketLotSizeFilter = + gson.getDelegateAdapter(this, TypeToken.get(MarketLotSizeFilter.class)); + final TypeAdapter adapterMaxNumOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrdersFilter.class)); + final TypeAdapter adapterMaxNumAlgoOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumAlgoOrdersFilter.class)); + final TypeAdapter adapterMaxNumIcebergOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumIcebergOrdersFilter.class)); + final TypeAdapter adapterMaxPositionFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxPositionFilter.class)); + final TypeAdapter adapterTrailingDeltaFilter = + gson.getDelegateAdapter(this, TypeToken.get(TrailingDeltaFilter.class)); + final TypeAdapter adapterTPlusSellFilter = + gson.getDelegateAdapter(this, TypeToken.get(TPlusSellFilter.class)); + final TypeAdapter adapterMaxNumOrderListsFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderListsFilter.class)); + final TypeAdapter adapterMaxNumOrderAmendsFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderAmendsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SymbolFilters value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `PriceFilter` + if (value.getActualInstance() instanceof PriceFilter) { + JsonElement element = + adapterPriceFilter.toJsonTree( + (PriceFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `PercentPriceFilter` + if (value.getActualInstance() instanceof PercentPriceFilter) { + JsonElement element = + adapterPercentPriceFilter.toJsonTree( + (PercentPriceFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `PercentPriceBySideFilter` + if (value.getActualInstance() instanceof PercentPriceBySideFilter) { + JsonElement element = + adapterPercentPriceBySideFilter.toJsonTree( + (PercentPriceBySideFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `LotSizeFilter` + if (value.getActualInstance() instanceof LotSizeFilter) { + JsonElement element = + adapterLotSizeFilter.toJsonTree( + (LotSizeFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MinNotionalFilter` + if (value.getActualInstance() instanceof MinNotionalFilter) { + JsonElement element = + adapterMinNotionalFilter.toJsonTree( + (MinNotionalFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `NotionalFilter` + if (value.getActualInstance() instanceof NotionalFilter) { + JsonElement element = + adapterNotionalFilter.toJsonTree( + (NotionalFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `IcebergPartsFilter` + if (value.getActualInstance() instanceof IcebergPartsFilter) { + JsonElement element = + adapterIcebergPartsFilter.toJsonTree( + (IcebergPartsFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MarketLotSizeFilter` + if (value.getActualInstance() instanceof MarketLotSizeFilter) { + JsonElement element = + adapterMarketLotSizeFilter.toJsonTree( + (MarketLotSizeFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumOrdersFilter` + if (value.getActualInstance() instanceof MaxNumOrdersFilter) { + JsonElement element = + adapterMaxNumOrdersFilter.toJsonTree( + (MaxNumOrdersFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumAlgoOrdersFilter` + if (value.getActualInstance() instanceof MaxNumAlgoOrdersFilter) { + JsonElement element = + adapterMaxNumAlgoOrdersFilter.toJsonTree( + (MaxNumAlgoOrdersFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `MaxNumIcebergOrdersFilter` + if (value.getActualInstance() instanceof MaxNumIcebergOrdersFilter) { + JsonElement element = + adapterMaxNumIcebergOrdersFilter.toJsonTree( + (MaxNumIcebergOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxPositionFilter` + if (value.getActualInstance() instanceof MaxPositionFilter) { + JsonElement element = + adapterMaxPositionFilter.toJsonTree( + (MaxPositionFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TrailingDeltaFilter` + if (value.getActualInstance() instanceof TrailingDeltaFilter) { + JsonElement element = + adapterTrailingDeltaFilter.toJsonTree( + (TrailingDeltaFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TPlusSellFilter` + if (value.getActualInstance() instanceof TPlusSellFilter) { + JsonElement element = + adapterTPlusSellFilter.toJsonTree( + (TPlusSellFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumOrderListsFilter` + if (value.getActualInstance() instanceof MaxNumOrderListsFilter) { + JsonElement element = + adapterMaxNumOrderListsFilter.toJsonTree( + (MaxNumOrderListsFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumOrderAmendsFilter` + if (value.getActualInstance() instanceof MaxNumOrderAmendsFilter) { + JsonElement element = + adapterMaxNumOrderAmendsFilter.toJsonTree( + (MaxNumOrderAmendsFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter," + + " MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter," + + " MaxNumOrderAmendsFilter, MaxNumOrderListsFilter," + + " MaxNumOrdersFilter, MaxPositionFilter," + + " MinNotionalFilter, NotionalFilter," + + " PercentPriceBySideFilter, PercentPriceFilter," + + " PriceFilter, TPlusSellFilter, TrailingDeltaFilter"); + } + + @Override + public SymbolFilters read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + SymbolFilters newSymbolFilters = new SymbolFilters(); + if (jsonObject.get("filterType") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for SymbolFilters as" + + " `filterType` was not found in the payload or the" + + " payload is empty."); + } else { + // look up the discriminator value in the field `filterType` + switch (jsonObject.get("filterType").getAsString()) { + case "ICEBERG_PARTS": + deserialized = + adapterIcebergPartsFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "LOT_SIZE": + deserialized = + adapterLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MARKET_LOT_SIZE": + deserialized = + adapterMarketLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ALGO_ORDERS": + deserialized = + adapterMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ICEBERG_ORDERS": + deserialized = + adapterMaxNumIcebergOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ORDERS": + deserialized = + adapterMaxNumOrdersFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ORDER_AMENDS": + deserialized = + adapterMaxNumOrderAmendsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ORDER_LISTS": + deserialized = + adapterMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_POSITION": + deserialized = + adapterMaxPositionFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MIN_NOTIONAL": + deserialized = + adapterMinNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "NOTIONAL": + deserialized = + adapterNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PERCENT_PRICE": + deserialized = + adapterPercentPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PERCENT_PRICE_BY_SIDE": + deserialized = + adapterPercentPriceBySideFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PRICE_FILTER": + deserialized = adapterPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "TRAILING_DELTA": + deserialized = + adapterTrailingDeltaFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "T_PLUS_SELL": + deserialized = + adapterTPlusSellFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "IcebergPartsFilter": + deserialized = + adapterIcebergPartsFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "LotSizeFilter": + deserialized = + adapterLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MarketLotSizeFilter": + deserialized = + adapterMarketLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumAlgoOrdersFilter": + deserialized = + adapterMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumIcebergOrdersFilter": + deserialized = + adapterMaxNumIcebergOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumOrderAmendsFilter": + deserialized = + adapterMaxNumOrderAmendsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumOrderListsFilter": + deserialized = + adapterMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumOrdersFilter": + deserialized = + adapterMaxNumOrdersFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxPositionFilter": + deserialized = + adapterMaxPositionFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MinNotionalFilter": + deserialized = + adapterMinNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "NotionalFilter": + deserialized = + adapterNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PercentPriceBySideFilter": + deserialized = + adapterPercentPriceBySideFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PercentPriceFilter": + deserialized = + adapterPercentPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PriceFilter": + deserialized = adapterPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "TPlusSellFilter": + deserialized = + adapterTPlusSellFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "TrailingDeltaFilter": + deserialized = + adapterTrailingDeltaFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + default: + newSymbolFilters.setActualInstance(jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for SymbolFilters. Possible values:" + + " ICEBERG_PARTS LOT_SIZE" + + " MARKET_LOT_SIZE MAX_NUM_ALGO_ORDERS" + + " MAX_NUM_ICEBERG_ORDERS" + + " MAX_NUM_ORDERS MAX_NUM_ORDER_AMENDS" + + " MAX_NUM_ORDER_LISTS MAX_POSITION" + + " MIN_NOTIONAL NOTIONAL PERCENT_PRICE" + + " PERCENT_PRICE_BY_SIDE PRICE_FILTER" + + " TRAILING_DELTA T_PLUS_SELL" + + " IcebergPartsFilter LotSizeFilter" + + " MarketLotSizeFilter" + + " MaxNumAlgoOrdersFilter" + + " MaxNumIcebergOrdersFilter" + + " MaxNumOrderAmendsFilter" + + " MaxNumOrderListsFilter" + + " MaxNumOrdersFilter" + + " MaxPositionFilter MinNotionalFilter" + + " NotionalFilter" + + " PercentPriceBySideFilter" + + " PercentPriceFilter PriceFilter" + + " TPlusSellFilter" + + " TrailingDeltaFilter. Falling back" + + " to String.", + jsonObject + .get("filterType") + .getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize PriceFilter + try { + // validate the JSON object to see if any exception is thrown + PriceFilter.validateJsonElement(jsonElement); + actualAdapter = adapterPriceFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'PriceFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PriceFilter failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'PriceFilter'", + e); + } + // deserialize PercentPriceFilter + try { + // validate the JSON object to see if any exception is thrown + PercentPriceFilter.validateJsonElement(jsonElement); + actualAdapter = adapterPercentPriceFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'PercentPriceFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PercentPriceFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'PercentPriceFilter'", + e); + } + // deserialize PercentPriceBySideFilter + try { + // validate the JSON object to see if any exception is thrown + PercentPriceBySideFilter.validateJsonElement(jsonElement); + actualAdapter = adapterPercentPriceBySideFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'PercentPriceBySideFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PercentPriceBySideFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'PercentPriceBySideFilter'", + e); + } + // deserialize LotSizeFilter + try { + // validate the JSON object to see if any exception is thrown + LotSizeFilter.validateJsonElement(jsonElement); + actualAdapter = adapterLotSizeFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'LotSizeFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for LotSizeFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'LotSizeFilter'", + e); + } + // deserialize MinNotionalFilter + try { + // validate the JSON object to see if any exception is thrown + MinNotionalFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMinNotionalFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MinNotionalFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MinNotionalFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MinNotionalFilter'", + e); + } + // deserialize NotionalFilter + try { + // validate the JSON object to see if any exception is thrown + NotionalFilter.validateJsonElement(jsonElement); + actualAdapter = adapterNotionalFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'NotionalFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for NotionalFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'NotionalFilter'", + e); + } + // deserialize IcebergPartsFilter + try { + // validate the JSON object to see if any exception is thrown + IcebergPartsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterIcebergPartsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'IcebergPartsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for IcebergPartsFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'IcebergPartsFilter'", + e); + } + // deserialize MarketLotSizeFilter + try { + // validate the JSON object to see if any exception is thrown + MarketLotSizeFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMarketLotSizeFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MarketLotSizeFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MarketLotSizeFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MarketLotSizeFilter'", + e); + } + // deserialize MaxNumOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumOrdersFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxNumOrdersFilter'", + e); + } + // deserialize MaxNumAlgoOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumAlgoOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumAlgoOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumAlgoOrdersFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxNumAlgoOrdersFilter'", + e); + } + // deserialize MaxNumIcebergOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumIcebergOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumIcebergOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumIcebergOrdersFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'MaxNumIcebergOrdersFilter'", + e); + } + // deserialize MaxPositionFilter + try { + // validate the JSON object to see if any exception is thrown + MaxPositionFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxPositionFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxPositionFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxPositionFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxPositionFilter'", + e); + } + // deserialize TrailingDeltaFilter + try { + // validate the JSON object to see if any exception is thrown + TrailingDeltaFilter.validateJsonElement(jsonElement); + actualAdapter = adapterTrailingDeltaFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'TrailingDeltaFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for TrailingDeltaFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'TrailingDeltaFilter'", + e); + } + // deserialize TPlusSellFilter + try { + // validate the JSON object to see if any exception is thrown + TPlusSellFilter.validateJsonElement(jsonElement); + actualAdapter = adapterTPlusSellFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'TPlusSellFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for TPlusSellFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'TPlusSellFilter'", + e); + } + // deserialize MaxNumOrderListsFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumOrderListsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumOrderListsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumOrderListsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderListsFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxNumOrderListsFilter'", + e); + } + // deserialize MaxNumOrderAmendsFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumOrderAmendsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumOrderAmendsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumOrderAmendsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderAmendsFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'MaxNumOrderAmendsFilter'", + e); + } + + if (match == 1) { + SymbolFilters ret = new SymbolFilters(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for SymbolFilters: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public SymbolFilters() { + super("oneOf", Boolean.FALSE); + } + + public SymbolFilters(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("PriceFilter", PriceFilter.class); + schemas.put("PercentPriceFilter", PercentPriceFilter.class); + schemas.put("PercentPriceBySideFilter", PercentPriceBySideFilter.class); + schemas.put("LotSizeFilter", LotSizeFilter.class); + schemas.put("MinNotionalFilter", MinNotionalFilter.class); + schemas.put("NotionalFilter", NotionalFilter.class); + schemas.put("IcebergPartsFilter", IcebergPartsFilter.class); + schemas.put("MarketLotSizeFilter", MarketLotSizeFilter.class); + schemas.put("MaxNumOrdersFilter", MaxNumOrdersFilter.class); + schemas.put("MaxNumAlgoOrdersFilter", MaxNumAlgoOrdersFilter.class); + schemas.put("MaxNumIcebergOrdersFilter", MaxNumIcebergOrdersFilter.class); + schemas.put("MaxPositionFilter", MaxPositionFilter.class); + schemas.put("TrailingDeltaFilter", TrailingDeltaFilter.class); + schemas.put("TPlusSellFilter", TPlusSellFilter.class); + schemas.put("MaxNumOrderListsFilter", MaxNumOrderListsFilter.class); + schemas.put("MaxNumOrderAmendsFilter", MaxNumOrderAmendsFilter.class); + } + + @Override + public Map> getSchemas() { + return SymbolFilters.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter, + * MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter, MaxNumOrderAmendsFilter, + * MaxNumOrderListsFilter, MaxNumOrdersFilter, MaxPositionFilter, MinNotionalFilter, + * NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, TPlusSellFilter, + * TrailingDeltaFilter + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof PriceFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof PercentPriceFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof PercentPriceBySideFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LotSizeFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MinNotionalFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NotionalFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IcebergPartsFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MarketLotSizeFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumAlgoOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumIcebergOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxPositionFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TrailingDeltaFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TPlusSellFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumOrderListsFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumOrderAmendsFilter) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be IcebergPartsFilter, LotSizeFilter," + + " MarketLotSizeFilter, MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter," + + " MaxNumOrderAmendsFilter, MaxNumOrderListsFilter, MaxNumOrdersFilter," + + " MaxPositionFilter, MinNotionalFilter, NotionalFilter," + + " PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, TPlusSellFilter," + + " TrailingDeltaFilter"); + } + + /** + * Get the actual instance, which can be the following: IcebergPartsFilter, LotSizeFilter, + * MarketLotSizeFilter, MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter, + * MaxNumOrderAmendsFilter, MaxNumOrderListsFilter, MaxNumOrdersFilter, MaxPositionFilter, + * MinNotionalFilter, NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, + * TPlusSellFilter, TrailingDeltaFilter + * + * @return The actual instance (IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter, + * MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter, MaxNumOrderAmendsFilter, + * MaxNumOrderListsFilter, MaxNumOrdersFilter, MaxPositionFilter, MinNotionalFilter, + * NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, + * TPlusSellFilter, TrailingDeltaFilter) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `PriceFilter`. If the actual instance is not `PriceFilter`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `PriceFilter` + * @throws ClassCastException if the instance is not `PriceFilter` + */ + public PriceFilter getPriceFilter() throws ClassCastException { + return (PriceFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `PercentPriceFilter`. If the actual instance is not + * `PercentPriceFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `PercentPriceFilter` + * @throws ClassCastException if the instance is not `PercentPriceFilter` + */ + public PercentPriceFilter getPercentPriceFilter() throws ClassCastException { + return (PercentPriceFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `PercentPriceBySideFilter`. If the actual instance is not + * `PercentPriceBySideFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `PercentPriceBySideFilter` + * @throws ClassCastException if the instance is not `PercentPriceBySideFilter` + */ + public PercentPriceBySideFilter getPercentPriceBySideFilter() throws ClassCastException { + return (PercentPriceBySideFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `LotSizeFilter`. If the actual instance is not `LotSizeFilter`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LotSizeFilter` + * @throws ClassCastException if the instance is not `LotSizeFilter` + */ + public LotSizeFilter getLotSizeFilter() throws ClassCastException { + return (LotSizeFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MinNotionalFilter`. If the actual instance is not + * `MinNotionalFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MinNotionalFilter` + * @throws ClassCastException if the instance is not `MinNotionalFilter` + */ + public MinNotionalFilter getMinNotionalFilter() throws ClassCastException { + return (MinNotionalFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `NotionalFilter`. If the actual instance is not `NotionalFilter`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `NotionalFilter` + * @throws ClassCastException if the instance is not `NotionalFilter` + */ + public NotionalFilter getNotionalFilter() throws ClassCastException { + return (NotionalFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `IcebergPartsFilter`. If the actual instance is not + * `IcebergPartsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `IcebergPartsFilter` + * @throws ClassCastException if the instance is not `IcebergPartsFilter` + */ + public IcebergPartsFilter getIcebergPartsFilter() throws ClassCastException { + return (IcebergPartsFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MarketLotSizeFilter`. If the actual instance is not + * `MarketLotSizeFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MarketLotSizeFilter` + * @throws ClassCastException if the instance is not `MarketLotSizeFilter` + */ + public MarketLotSizeFilter getMarketLotSizeFilter() throws ClassCastException { + return (MarketLotSizeFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumOrdersFilter`. If the actual instance is not + * `MaxNumOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumOrdersFilter` + * @throws ClassCastException if the instance is not `MaxNumOrdersFilter` + */ + public MaxNumOrdersFilter getMaxNumOrdersFilter() throws ClassCastException { + return (MaxNumOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumAlgoOrdersFilter`. If the actual instance is not + * `MaxNumAlgoOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumAlgoOrdersFilter` + * @throws ClassCastException if the instance is not `MaxNumAlgoOrdersFilter` + */ + public MaxNumAlgoOrdersFilter getMaxNumAlgoOrdersFilter() throws ClassCastException { + return (MaxNumAlgoOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumIcebergOrdersFilter`. If the actual instance is not + * `MaxNumIcebergOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumIcebergOrdersFilter` + * @throws ClassCastException if the instance is not `MaxNumIcebergOrdersFilter` + */ + public MaxNumIcebergOrdersFilter getMaxNumIcebergOrdersFilter() throws ClassCastException { + return (MaxNumIcebergOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxPositionFilter`. If the actual instance is not + * `MaxPositionFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxPositionFilter` + * @throws ClassCastException if the instance is not `MaxPositionFilter` + */ + public MaxPositionFilter getMaxPositionFilter() throws ClassCastException { + return (MaxPositionFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `TrailingDeltaFilter`. If the actual instance is not + * `TrailingDeltaFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `TrailingDeltaFilter` + * @throws ClassCastException if the instance is not `TrailingDeltaFilter` + */ + public TrailingDeltaFilter getTrailingDeltaFilter() throws ClassCastException { + return (TrailingDeltaFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `TPlusSellFilter`. If the actual instance is not + * `TPlusSellFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `TPlusSellFilter` + * @throws ClassCastException if the instance is not `TPlusSellFilter` + */ + public TPlusSellFilter getTPlusSellFilter() throws ClassCastException { + return (TPlusSellFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumOrderListsFilter`. If the actual instance is not + * `MaxNumOrderListsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumOrderListsFilter` + * @throws ClassCastException if the instance is not `MaxNumOrderListsFilter` + */ + public MaxNumOrderListsFilter getMaxNumOrderListsFilter() throws ClassCastException { + return (MaxNumOrderListsFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumOrderAmendsFilter`. If the actual instance is not + * `MaxNumOrderAmendsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumOrderAmendsFilter` + * @throws ClassCastException if the instance is not `MaxNumOrderAmendsFilter` + */ + public MaxNumOrderAmendsFilter getMaxNumOrderAmendsFilter() throws ClassCastException { + return (MaxNumOrderAmendsFilter) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SymbolFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with PriceFilter + try { + PriceFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PriceFilter failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with PercentPriceFilter + try { + PercentPriceFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PercentPriceFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with PercentPriceBySideFilter + try { + PercentPriceBySideFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PercentPriceBySideFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with LotSizeFilter + try { + LotSizeFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for LotSizeFilter failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with MinNotionalFilter + try { + MinNotionalFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MinNotionalFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with NotionalFilter + try { + NotionalFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for NotionalFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with IcebergPartsFilter + try { + IcebergPartsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for IcebergPartsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MarketLotSizeFilter + try { + MarketLotSizeFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MarketLotSizeFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumOrdersFilter + try { + MaxNumOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumAlgoOrdersFilter + try { + MaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumAlgoOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumIcebergOrdersFilter + try { + MaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumIcebergOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxPositionFilter + try { + MaxPositionFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxPositionFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with TrailingDeltaFilter + try { + TrailingDeltaFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for TrailingDeltaFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with TPlusSellFilter + try { + TPlusSellFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for TPlusSellFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumOrderListsFilter + try { + MaxNumOrderListsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderListsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumOrderAmendsFilter + try { + MaxNumOrderAmendsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderAmendsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for SymbolFilters with oneOf schemas:" + + " IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter," + + " MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter," + + " MaxNumOrderAmendsFilter, MaxNumOrderListsFilter," + + " MaxNumOrdersFilter, MaxPositionFilter, MinNotionalFilter," + + " NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter," + + " PriceFilter, TPlusSellFilter, TrailingDeltaFilter. %d class(es)" + + " match the result, expected 1. Detailed failure message for" + + " oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of SymbolFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SymbolFilters + * @throws IOException if the JSON string is invalid with respect to SymbolFilters + */ + public static SymbolFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SymbolFilters.class); + } + + /** + * Convert an instance of SymbolFilters 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/TPlusSellFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TPlusSellFilter.java new file mode 100644 index 000000000..216a410c9 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TPlusSellFilter.java @@ -0,0 +1,277 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** TPlusSellFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TPlusSellFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + + @SerializedName(SERIALIZED_NAME_END_TIME) + @jakarta.annotation.Nullable + private Long endTime; + + public TPlusSellFilter() {} + + public TPlusSellFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public TPlusSellFilter endTime(@jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * + * @return endTime + */ + @jakarta.annotation.Nullable + public Long getEndTime() { + return endTime; + } + + public void setEndTime(@jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TPlusSellFilter tplusSellFilter = (TPlusSellFilter) o; + return Objects.equals(this.filterType, tplusSellFilter.filterType) + && Objects.equals(this.endTime, tplusSellFilter.endTime); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, endTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TPlusSellFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long endTimeValue = getEndTime(); + if (endTimeValue != null) { + String endTimeValueAsString = endTimeValue.toString(); + valMap.put("endTime", endTimeValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object endTimeValue = getEndTime(); + if (endTimeValue != null) { + valMap.put("endTime", endTimeValue); + } + + 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("filterType"); + openapiFields.add("endTime"); + + // 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 TPlusSellFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TPlusSellFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TPlusSellFilter is not found in the" + + " empty JSON string", + TPlusSellFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TPlusSellFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TPlusSellFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TPlusSellFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TPlusSellFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TPlusSellFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TPlusSellFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TPlusSellFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TPlusSellFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of TPlusSellFilter + * @throws IOException if the JSON string is invalid with respect to TPlusSellFilter + */ + public static TPlusSellFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TPlusSellFilter.class); + } + + /** + * Convert an instance of TPlusSellFilter 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/Ticker24hrResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse1.java index 539b31528..5af68f45e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse1.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class Ticker24hrResponse1 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public Ticker24hrResponse1() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable Ticker24hrResponse1Result res this.result = result; } - public Ticker24hrResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public Ticker24hrResponse1 rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public Ticker24hrResponse1 addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public Ticker24hrResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits ra */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { Ticker24hrResponse1Result.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse2.java index 346794d5c..250b7e67d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse2.java @@ -65,7 +65,7 @@ public class Ticker24hrResponse2 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public Ticker24hrResponse2() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public Ticker24hrResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public Ticker24hrResponse2 rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public Ticker24hrResponse2 addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public Ticker24hrResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits ra */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse1.java index 0b4be8a61..242517746 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse1.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class TickerBookResponse1 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TickerBookResponse1() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable TickerBookResponse1Result res this.result = result; } - public TickerBookResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TickerBookResponse1 rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TickerBookResponse1 addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public TickerBookResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits ra */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { TickerBookResponse1Result.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse2.java index f8f2a1fa7..70d000ef6 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse2.java @@ -65,7 +65,7 @@ public class TickerBookResponse2 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TickerBookResponse2() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public TickerBookResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TickerBookResponse2 rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TickerBookResponse2 addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public TickerBookResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits ra */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse1.java index 369dae16c..2f94b3f19 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse1.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class TickerPriceResponse1 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TickerPriceResponse1() {} @@ -125,11 +128,20 @@ public void setResult(@jakarta.annotation.Nullable TickerPriceResponse1Result re this.result = result; } - public TickerPriceResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TickerPriceResponse1 rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TickerPriceResponse1 addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -137,11 +149,11 @@ public TickerPriceResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits r */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -196,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -305,6 +317,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { TickerPriceResponse1Result.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse2.java index 04d3235d1..96adc69a7 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse2.java @@ -65,7 +65,7 @@ public class TickerPriceResponse2 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TickerPriceResponse2() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public TickerPriceResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TickerPriceResponse2 rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TickerPriceResponse2 addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public TickerPriceResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits r */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1.java index 19a62c365..256deb129 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class TickerResponse1 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TickerResponse1() {} @@ -124,11 +127,20 @@ public void setResult(@jakarta.annotation.Nullable TickerResponse1Result result) this.result = result; } - public TickerResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TickerResponse1 rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TickerResponse1 addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -136,11 +148,11 @@ public TickerResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits rateLi */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -195,7 +207,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -304,6 +316,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { TickerResponse1Result.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2.java index 1482937bc..779ee723a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2.java @@ -65,7 +65,7 @@ public class TickerResponse2 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TickerResponse2() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public TickerResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TickerResponse2 rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TickerResponse2 addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public TickerResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits rateLi */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayResponse.java index a8ebc83ef..63554ab3a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayResponse.java @@ -65,7 +65,7 @@ public class TickerTradingDayResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TickerTradingDayResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public TickerTradingDayResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TickerTradingDayResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TickerTradingDayResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public TickerTradingDayResponse rateLimits(@jakarta.annotation.Nullable RateLimi */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponse.java index a88229f4f..3cfaa64fb 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class TimeResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TimeResponse() {} @@ -124,11 +127,20 @@ public void setResult(@jakarta.annotation.Nullable TimeResponseResult result) { this.result = result; } - public TimeResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TimeResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TimeResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -136,11 +148,11 @@ public TimeResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimit */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -195,7 +207,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -304,6 +316,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { TimeResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateResponse.java index 9ffda8f08..4e9086b10 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateResponse.java @@ -65,7 +65,7 @@ public class TradesAggregateResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TradesAggregateResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public TradesAggregateResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TradesAggregateResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TradesAggregateResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public TradesAggregateResponse rateLimits(@jakarta.annotation.Nullable RateLimit */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponse.java index 983900b83..18c88af21 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponse.java @@ -65,7 +65,7 @@ public class TradesHistoricalResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TradesHistoricalResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public TradesHistoricalResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TradesHistoricalResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TradesHistoricalResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public TradesHistoricalResponse rateLimits(@jakarta.annotation.Nullable RateLimi */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesRecentResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesRecentResponse.java index e2ffc1fa5..4ddbe64c5 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesRecentResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesRecentResponse.java @@ -65,7 +65,7 @@ public class TradesRecentResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public TradesRecentResponse() {} @@ -137,11 +137,20 @@ public void setResult( this.result = result; } - public TradesRecentResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public TradesRecentResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public TradesRecentResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -149,11 +158,11 @@ public TradesRecentResponse rateLimits(@jakarta.annotation.Nullable RateLimits r */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +217,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -332,6 +341,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TrailingDeltaFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TrailingDeltaFilter.java new file mode 100644 index 000000000..694f3933e --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TrailingDeltaFilter.java @@ -0,0 +1,409 @@ +/* + * 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.*; + +/** TrailingDeltaFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TrailingDeltaFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; + + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) + @jakarta.annotation.Nullable + private Long minTrailingAboveDelta; + + public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; + + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) + @jakarta.annotation.Nullable + private Long maxTrailingAboveDelta; + + public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; + + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) + @jakarta.annotation.Nullable + private Long minTrailingBelowDelta; + + public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; + + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) + @jakarta.annotation.Nullable + private Long maxTrailingBelowDelta; + + public TrailingDeltaFilter() {} + + public TrailingDeltaFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public TrailingDeltaFilter minTrailingAboveDelta( + @jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; + return this; + } + + /** + * Get minTrailingAboveDelta + * + * @return minTrailingAboveDelta + */ + @jakarta.annotation.Nullable + public Long getMinTrailingAboveDelta() { + return minTrailingAboveDelta; + } + + public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; + } + + public TrailingDeltaFilter maxTrailingAboveDelta( + @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; + return this; + } + + /** + * Get maxTrailingAboveDelta + * + * @return maxTrailingAboveDelta + */ + @jakarta.annotation.Nullable + public Long getMaxTrailingAboveDelta() { + return maxTrailingAboveDelta; + } + + public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; + } + + public TrailingDeltaFilter minTrailingBelowDelta( + @jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; + return this; + } + + /** + * Get minTrailingBelowDelta + * + * @return minTrailingBelowDelta + */ + @jakarta.annotation.Nullable + public Long getMinTrailingBelowDelta() { + return minTrailingBelowDelta; + } + + public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; + } + + public TrailingDeltaFilter maxTrailingBelowDelta( + @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; + return this; + } + + /** + * Get maxTrailingBelowDelta + * + * @return maxTrailingBelowDelta + */ + @jakarta.annotation.Nullable + public Long getMaxTrailingBelowDelta() { + return maxTrailingBelowDelta; + } + + public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrailingDeltaFilter trailingDeltaFilter = (TrailingDeltaFilter) o; + return Objects.equals(this.filterType, trailingDeltaFilter.filterType) + && Objects.equals( + this.minTrailingAboveDelta, trailingDeltaFilter.minTrailingAboveDelta) + && Objects.equals( + this.maxTrailingAboveDelta, trailingDeltaFilter.maxTrailingAboveDelta) + && Objects.equals( + this.minTrailingBelowDelta, trailingDeltaFilter.minTrailingBelowDelta) + && Objects.equals( + this.maxTrailingBelowDelta, trailingDeltaFilter.maxTrailingBelowDelta); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + minTrailingAboveDelta, + maxTrailingAboveDelta, + minTrailingBelowDelta, + maxTrailingBelowDelta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrailingDeltaFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" minTrailingAboveDelta: ") + .append(toIndentedString(minTrailingAboveDelta)) + .append("\n"); + sb.append(" maxTrailingAboveDelta: ") + .append(toIndentedString(maxTrailingAboveDelta)) + .append("\n"); + sb.append(" minTrailingBelowDelta: ") + .append(toIndentedString(minTrailingBelowDelta)) + .append("\n"); + sb.append(" maxTrailingBelowDelta: ") + .append(toIndentedString(maxTrailingBelowDelta)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + if (minTrailingAboveDeltaValue != null) { + String minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); + valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValueAsString); + } + Long maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + if (maxTrailingAboveDeltaValue != null) { + String maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); + valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValueAsString); + } + Long minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + if (minTrailingBelowDeltaValue != null) { + String minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); + valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValueAsString); + } + Long maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + if (maxTrailingBelowDeltaValue != null) { + String maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); + valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + if (minTrailingAboveDeltaValue != null) { + valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValue); + } + Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + if (maxTrailingAboveDeltaValue != null) { + valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValue); + } + Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + if (minTrailingBelowDeltaValue != null) { + valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValue); + } + Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + if (maxTrailingBelowDeltaValue != null) { + valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValue); + } + + 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("filterType"); + openapiFields.add("minTrailingAboveDelta"); + openapiFields.add("maxTrailingAboveDelta"); + openapiFields.add("minTrailingBelowDelta"); + openapiFields.add("maxTrailingBelowDelta"); + + // 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 TrailingDeltaFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrailingDeltaFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TrailingDeltaFilter is not found in" + + " the empty JSON string", + TrailingDeltaFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrailingDeltaFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TrailingDeltaFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrailingDeltaFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrailingDeltaFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TrailingDeltaFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TrailingDeltaFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrailingDeltaFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TrailingDeltaFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrailingDeltaFilter + * @throws IOException if the JSON string is invalid with respect to TrailingDeltaFilter + */ + public static TrailingDeltaFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrailingDeltaFilter.class); + } + + /** + * Convert an instance of TrailingDeltaFilter 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/UiKlinesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UiKlinesResponse.java index 4d32735ea..0ef303466 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UiKlinesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UiKlinesResponse.java @@ -15,6 +15,7 @@ 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; @@ -64,7 +65,7 @@ public class UiKlinesResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public UiKlinesResponse() {} @@ -134,11 +135,20 @@ public void setResult(@jakarta.annotation.Nullable List result) { this.result = result; } - public UiKlinesResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public UiKlinesResponse rateLimits( + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public UiKlinesResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -146,11 +156,11 @@ public UiKlinesResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateL */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -205,7 +215,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -320,6 +330,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " `%s`", jsonObj.get("result").toString())); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java index a9c80f91a..f15e7af14 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class UserDataStreamPingResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public UserDataStreamPingResponse() {} @@ -124,11 +127,19 @@ public void setResponse(@jakarta.annotation.Nullable Object response) { } public UserDataStreamPingResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public UserDataStreamPingResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -136,11 +147,11 @@ public UserDataStreamPingResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -195,7 +206,7 @@ public String toUrlQueryString() { String responseValueAsString = responseValue.toString(); valMap.put("response", responseValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -300,6 +311,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("id").toString())); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java index e77182df8..f1e2cea4c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class UserDataStreamStartResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public UserDataStreamStartResponse() {} @@ -126,11 +129,19 @@ public void setResult(@jakarta.annotation.Nullable UserDataStreamStartResponseRe } public UserDataStreamStartResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public UserDataStreamStartResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -138,11 +149,11 @@ public UserDataStreamStartResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -197,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -307,6 +318,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { UserDataStreamStartResponseResult.validateJsonElement(jsonObj.get("result")); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java index f0ffcb1f8..54097d599 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java @@ -15,6 +15,7 @@ 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; @@ -27,7 +28,9 @@ 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; @@ -62,7 +65,7 @@ public class UserDataStreamStopResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private RateLimits rateLimits; + private List<@Valid RateLimits> rateLimits; public UserDataStreamStopResponse() {} @@ -124,11 +127,19 @@ public void setResponse(@jakarta.annotation.Nullable Object response) { } public UserDataStreamStopResponse rateLimits( - @jakarta.annotation.Nullable RateLimits rateLimits) { + @jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; return this; } + public UserDataStreamStopResponse addRateLimitsItem(RateLimits rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + /** * Get rateLimits * @@ -136,11 +147,11 @@ public UserDataStreamStopResponse rateLimits( */ @jakarta.annotation.Nullable @Valid - public RateLimits getRateLimits() { + public List<@Valid RateLimits> getRateLimits() { return rateLimits; } - public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable List<@Valid RateLimits> rateLimits) { this.rateLimits = rateLimits; } @@ -195,7 +206,7 @@ public String toUrlQueryString() { String responseValueAsString = responseValue.toString(); valMap.put("response", responseValueAsString); } - RateLimits rateLimitsValue = getRateLimits(); + List<@Valid RateLimits> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -300,6 +311,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("id").toString())); } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + RateLimits.validateJsonElement(jsonArrayrateLimits.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java index 97ab6ed1f..9e6f053e6 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java @@ -26,6 +26,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -37,6 +38,7 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.HashMap; import java.util.Map; import okio.ByteString; @@ -58,7 +60,254 @@ public class JSON { @SuppressWarnings("unchecked") public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + com.binance.connector.client.spot.websocket.stream.model + .AssetFilters.class, + new TypeSelector< + com.binance.connector.client.spot.websocket.stream.model + .AssetFilters>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot + .websocket.stream.model + .AssetFilters> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "MAX_ASSET", + com.binance.connector.client.spot.websocket.stream + .model.MaxAssetFilter.class); + classByDiscriminatorValue.put( + "MaxAssetFilter", + com.binance.connector.client.spot.websocket.stream + .model.MaxAssetFilter.class); + classByDiscriminatorValue.put( + "assetFilters", + com.binance.connector.client.spot.websocket.stream + .model.AssetFilters.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "filterType")); + } + }) + .registerTypeSelector( + com.binance.connector.client.spot.websocket.stream.model + .ExchangeFilters.class, + new TypeSelector< + com.binance.connector.client.spot.websocket.stream.model + .ExchangeFilters>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot + .websocket.stream.model + .ExchangeFilters> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ALGO_ORDERS", + com.binance.connector.client.spot.websocket.stream + .model.ExchangeMaxNumAlgoOrdersFilter + .class); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ICEBERG_ORDERS", + com.binance.connector.client.spot.websocket.stream + .model.ExchangeMaxNumIcebergOrdersFilter + .class); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ORDERS", + com.binance.connector.client.spot.websocket.stream + .model.ExchangeMaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "EXCHANGE_MAX_NUM_ORDER_LISTS", + com.binance.connector.client.spot.websocket.stream + .model.ExchangeMaxNumOrderListsFilter + .class); + classByDiscriminatorValue.put( + "ExchangeMaxNumAlgoOrdersFilter", + com.binance.connector.client.spot.websocket.stream + .model.ExchangeMaxNumAlgoOrdersFilter + .class); + classByDiscriminatorValue.put( + "ExchangeMaxNumIcebergOrdersFilter", + com.binance.connector.client.spot.websocket.stream + .model.ExchangeMaxNumIcebergOrdersFilter + .class); + classByDiscriminatorValue.put( + "ExchangeMaxNumOrderListsFilter", + com.binance.connector.client.spot.websocket.stream + .model.ExchangeMaxNumOrderListsFilter + .class); + classByDiscriminatorValue.put( + "ExchangeMaxNumOrdersFilter", + com.binance.connector.client.spot.websocket.stream + .model.ExchangeMaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "exchangeFilters", + com.binance.connector.client.spot.websocket.stream + .model.ExchangeFilters.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "filterType")); + } + }) + .registerTypeSelector( + com.binance.connector.client.spot.websocket.stream.model + .SymbolFilters.class, + new TypeSelector< + com.binance.connector.client.spot.websocket.stream.model + .SymbolFilters>() { + @Override + public Class< + ? extends + com.binance.connector.client.spot + .websocket.stream.model + .SymbolFilters> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "ICEBERG_PARTS", + com.binance.connector.client.spot.websocket.stream + .model.IcebergPartsFilter.class); + classByDiscriminatorValue.put( + "LOT_SIZE", + com.binance.connector.client.spot.websocket.stream + .model.LotSizeFilter.class); + classByDiscriminatorValue.put( + "MARKET_LOT_SIZE", + com.binance.connector.client.spot.websocket.stream + .model.MarketLotSizeFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ALGO_ORDERS", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumAlgoOrdersFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ICEBERG_ORDERS", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumIcebergOrdersFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ORDERS", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ORDER_AMENDS", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumOrderAmendsFilter.class); + classByDiscriminatorValue.put( + "MAX_NUM_ORDER_LISTS", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumOrderListsFilter.class); + classByDiscriminatorValue.put( + "MAX_POSITION", + com.binance.connector.client.spot.websocket.stream + .model.MaxPositionFilter.class); + classByDiscriminatorValue.put( + "MIN_NOTIONAL", + com.binance.connector.client.spot.websocket.stream + .model.MinNotionalFilter.class); + classByDiscriminatorValue.put( + "NOTIONAL", + com.binance.connector.client.spot.websocket.stream + .model.NotionalFilter.class); + classByDiscriminatorValue.put( + "PERCENT_PRICE", + com.binance.connector.client.spot.websocket.stream + .model.PercentPriceFilter.class); + classByDiscriminatorValue.put( + "PERCENT_PRICE_BY_SIDE", + com.binance.connector.client.spot.websocket.stream + .model.PercentPriceBySideFilter.class); + classByDiscriminatorValue.put( + "PRICE_FILTER", + com.binance.connector.client.spot.websocket.stream + .model.PriceFilter.class); + classByDiscriminatorValue.put( + "TRAILING_DELTA", + com.binance.connector.client.spot.websocket.stream + .model.TrailingDeltaFilter.class); + classByDiscriminatorValue.put( + "T_PLUS_SELL", + com.binance.connector.client.spot.websocket.stream + .model.TPlusSellFilter.class); + classByDiscriminatorValue.put( + "IcebergPartsFilter", + com.binance.connector.client.spot.websocket.stream + .model.IcebergPartsFilter.class); + classByDiscriminatorValue.put( + "LotSizeFilter", + com.binance.connector.client.spot.websocket.stream + .model.LotSizeFilter.class); + classByDiscriminatorValue.put( + "MarketLotSizeFilter", + com.binance.connector.client.spot.websocket.stream + .model.MarketLotSizeFilter.class); + classByDiscriminatorValue.put( + "MaxNumAlgoOrdersFilter", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumAlgoOrdersFilter.class); + classByDiscriminatorValue.put( + "MaxNumIcebergOrdersFilter", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumIcebergOrdersFilter.class); + classByDiscriminatorValue.put( + "MaxNumOrderAmendsFilter", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumOrderAmendsFilter.class); + classByDiscriminatorValue.put( + "MaxNumOrderListsFilter", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumOrderListsFilter.class); + classByDiscriminatorValue.put( + "MaxNumOrdersFilter", + com.binance.connector.client.spot.websocket.stream + .model.MaxNumOrdersFilter.class); + classByDiscriminatorValue.put( + "MaxPositionFilter", + com.binance.connector.client.spot.websocket.stream + .model.MaxPositionFilter.class); + classByDiscriminatorValue.put( + "MinNotionalFilter", + com.binance.connector.client.spot.websocket.stream + .model.MinNotionalFilter.class); + classByDiscriminatorValue.put( + "NotionalFilter", + com.binance.connector.client.spot.websocket.stream + .model.NotionalFilter.class); + classByDiscriminatorValue.put( + "PercentPriceBySideFilter", + com.binance.connector.client.spot.websocket.stream + .model.PercentPriceBySideFilter.class); + classByDiscriminatorValue.put( + "PercentPriceFilter", + com.binance.connector.client.spot.websocket.stream + .model.PercentPriceFilter.class); + classByDiscriminatorValue.put( + "PriceFilter", + com.binance.connector.client.spot.websocket.stream + .model.PriceFilter.class); + classByDiscriminatorValue.put( + "TPlusSellFilter", + com.binance.connector.client.spot.websocket.stream + .model.TPlusSellFilter.class); + classByDiscriminatorValue.put( + "TrailingDeltaFilter", + com.binance.connector.client.spot.websocket.stream + .model.TrailingDeltaFilter.class); + classByDiscriminatorValue.put( + "symbolFilters", + com.binance.connector.client.spot.websocket.stream + .model.SymbolFilters.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "filterType")); + } + }); GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; } @@ -135,6 +384,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.AllTickerResponseInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.AssetFilters + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.AvgPriceRequest .CustomTypeAdapterFactory()); @@ -157,7 +409,19 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.spot.websocket.stream.model.ExchangeFilters .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.stream.model.ExchangeFiltersInner + new com.binance.connector.client.spot.websocket.stream.model + .ExchangeMaxNumAlgoOrdersFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model + .ExchangeMaxNumIcebergOrdersFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model + .ExchangeMaxNumOrderListsFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model + .ExchangeMaxNumOrdersFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.IcebergPartsFilter .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.KlineOffsetRequest @@ -174,12 +438,45 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.KlineResponseK .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.LotSizeFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.MarketLotSizeFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.MaxAssetFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.MaxNumAlgoOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model + .MaxNumIcebergOrdersFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.MaxNumOrderAmendsFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.MaxNumOrderListsFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.MaxNumOrdersFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.MaxPositionFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.MinNotionalFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.MiniTickerRequest .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.MiniTickerResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.NotionalFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.PartialBookDepthRequest .CustomTypeAdapterFactory()); @@ -187,10 +484,16 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.spot.websocket.stream.model .PartialBookDepthResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.stream.model.RateLimits + new com.binance.connector.client.spot.websocket.stream.model + .PercentPriceBySideFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.PercentPriceFilter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.PriceFilter .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.stream.model.RateLimitsInner + new com.binance.connector.client.spot.websocket.stream.model.RateLimits .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model @@ -198,6 +501,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model .RollingWindowTickerResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.SymbolFilters + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.TPlusSellFilter + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.TickerRequest .CustomTypeAdapterFactory()); @@ -210,6 +519,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.TradeResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.TrailingDeltaFilter + .CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } 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 a51949c7f..61f6bfa4c 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/6.0.0 (Java/%s; %s; %s)", + "binance-spot/7.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/AssetFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AssetFilters.java new file mode 100644 index 000000000..59e7ad22a --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/AssetFilters.java @@ -0,0 +1,266 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.hibernate.validator.constraints.*; + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AssetFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AssetFilters.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterMaxAssetFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxAssetFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetFilters value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `MaxAssetFilter` + if (value.getActualInstance() instanceof MaxAssetFilter) { + JsonElement element = + adapterMaxAssetFilter.toJsonTree( + (MaxAssetFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " MaxAssetFilter"); + } + + @Override + public AssetFilters read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + AssetFilters newAssetFilters = new AssetFilters(); + if (jsonObject.get("filterType") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for AssetFilters as" + + " `filterType` was not found in the payload or the" + + " payload is empty."); + } else { + // look up the discriminator value in the field `filterType` + switch (jsonObject.get("filterType").getAsString()) { + case "MAX_ASSET": + deserialized = + adapterMaxAssetFilter.fromJsonTree(jsonObject); + newAssetFilters.setActualInstance(deserialized); + return newAssetFilters; + case "MaxAssetFilter": + deserialized = + adapterMaxAssetFilter.fromJsonTree(jsonObject); + newAssetFilters.setActualInstance(deserialized); + return newAssetFilters; + default: + newAssetFilters.setActualInstance(jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for AssetFilters. Possible values:" + + " MAX_ASSET MaxAssetFilter. Falling" + + " back to String.", + jsonObject + .get("filterType") + .getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize MaxAssetFilter + try { + // validate the JSON object to see if any exception is thrown + MaxAssetFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxAssetFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'MaxAssetFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxAssetFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxAssetFilter'", + e); + } + + if (match == 1) { + AssetFilters ret = new AssetFilters(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for AssetFilters: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public AssetFilters() { + super("oneOf", Boolean.FALSE); + } + + public AssetFilters(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("MaxAssetFilter", MaxAssetFilter.class); + } + + @Override + public Map> getSchemas() { + return AssetFilters.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: MaxAssetFilter + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof MaxAssetFilter) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be MaxAssetFilter"); + } + + /** + * Get the actual instance, which can be the following: MaxAssetFilter + * + * @return The actual instance (MaxAssetFilter) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxAssetFilter`. If the actual instance is not `MaxAssetFilter`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `MaxAssetFilter` + * @throws ClassCastException if the instance is not `MaxAssetFilter` + */ + public MaxAssetFilter getMaxAssetFilter() throws ClassCastException { + return (MaxAssetFilter) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with MaxAssetFilter + try { + MaxAssetFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxAssetFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for AssetFilters with oneOf schemas:" + + " MaxAssetFilter. %d class(es) match the result, expected 1." + + " Detailed failure message for oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of AssetFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetFilters + * @throws IOException if the JSON string is invalid with respect to AssetFilters + */ + public static AssetFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetFilters.class); + } + + /** + * Convert an instance of AssetFilters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFilters.java index 839db461e..e8a3c9fbe 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFilters.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFilters.java @@ -12,9 +12,11 @@ package com.binance.connector.client.spot.websocket.stream.model; +import com.binance.connector.client.common.AbstractOpenApiSchema; import com.binance.connector.client.spot.websocket.stream.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; @@ -22,88 +24,425 @@ import com.google.gson.stream.JsonWriter; import jakarta.validation.constraints.*; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.HashSet; +import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; +import java.util.logging.Level; +import java.util.logging.Logger; import org.hibernate.validator.constraints.*; -/** ExchangeFilters */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class ExchangeFilters extends ArrayList { - public ExchangeFilters() {} +public class ExchangeFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ExchangeFilters.class.getName()); - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterExchangeMaxNumOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeMaxNumOrdersFilter.class)); + final TypeAdapter + adapterExchangeMaxNumAlgoOrdersFilter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumAlgoOrdersFilter.class)); + final TypeAdapter + adapterExchangeMaxNumIcebergOrdersFilter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumIcebergOrdersFilter.class)); + final TypeAdapter + adapterExchangeMaxNumOrderListsFilter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumOrderListsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeFilters value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ExchangeMaxNumOrdersFilter` + if (value.getActualInstance() instanceof ExchangeMaxNumOrdersFilter) { + JsonElement element = + adapterExchangeMaxNumOrdersFilter.toJsonTree( + (ExchangeMaxNumOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ExchangeMaxNumAlgoOrdersFilter` + if (value.getActualInstance() + instanceof ExchangeMaxNumAlgoOrdersFilter) { + JsonElement element = + adapterExchangeMaxNumAlgoOrdersFilter.toJsonTree( + (ExchangeMaxNumAlgoOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ExchangeMaxNumIcebergOrdersFilter` + if (value.getActualInstance() + instanceof ExchangeMaxNumIcebergOrdersFilter) { + JsonElement element = + adapterExchangeMaxNumIcebergOrdersFilter.toJsonTree( + (ExchangeMaxNumIcebergOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ExchangeMaxNumOrderListsFilter` + if (value.getActualInstance() + instanceof ExchangeMaxNumOrderListsFilter) { + JsonElement element = + adapterExchangeMaxNumOrderListsFilter.toJsonTree( + (ExchangeMaxNumOrderListsFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " ExchangeMaxNumAlgoOrdersFilter," + + " ExchangeMaxNumIcebergOrdersFilter," + + " ExchangeMaxNumOrderListsFilter," + + " ExchangeMaxNumOrdersFilter"); + } + + @Override + public ExchangeFilters read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + ExchangeFilters newExchangeFilters = new ExchangeFilters(); + if (jsonObject.get("filterType") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for ExchangeFilters" + + " as `filterType` was not found in the payload or the" + + " payload is empty."); + } else { + // look up the discriminator value in the field `filterType` + switch (jsonObject.get("filterType").getAsString()) { + case "EXCHANGE_MAX_NUM_ALGO_ORDERS": + deserialized = + adapterExchangeMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "EXCHANGE_MAX_NUM_ICEBERG_ORDERS": + deserialized = + adapterExchangeMaxNumIcebergOrdersFilter + .fromJsonTree(jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "EXCHANGE_MAX_NUM_ORDERS": + deserialized = + adapterExchangeMaxNumOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "EXCHANGE_MAX_NUM_ORDER_LISTS": + deserialized = + adapterExchangeMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumAlgoOrdersFilter": + deserialized = + adapterExchangeMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumIcebergOrdersFilter": + deserialized = + adapterExchangeMaxNumIcebergOrdersFilter + .fromJsonTree(jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumOrderListsFilter": + deserialized = + adapterExchangeMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + case "ExchangeMaxNumOrdersFilter": + deserialized = + adapterExchangeMaxNumOrdersFilter.fromJsonTree( + jsonObject); + newExchangeFilters.setActualInstance(deserialized); + return newExchangeFilters; + default: + newExchangeFilters.setActualInstance( + jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for ExchangeFilters. Possible" + + " values:" + + " EXCHANGE_MAX_NUM_ALGO_ORDERS" + + " EXCHANGE_MAX_NUM_ICEBERG_ORDERS" + + " EXCHANGE_MAX_NUM_ORDERS" + + " EXCHANGE_MAX_NUM_ORDER_LISTS" + + " ExchangeMaxNumAlgoOrdersFilter" + + " ExchangeMaxNumIcebergOrdersFilter" + + " ExchangeMaxNumOrderListsFilter" + + " ExchangeMaxNumOrdersFilter. Falling" + + " back to String.", + jsonObject + .get("filterType") + .getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ExchangeMaxNumOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'ExchangeMaxNumOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrdersFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumOrdersFilter'", + e); + } + // deserialize ExchangeMaxNumAlgoOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumAlgoOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ExchangeMaxNumAlgoOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumAlgoOrdersFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumAlgoOrdersFilter'", + e); + } + // deserialize ExchangeMaxNumIcebergOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumIcebergOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ExchangeMaxNumIcebergOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ExchangeMaxNumIcebergOrdersFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumIcebergOrdersFilter'", + e); + } + // deserialize ExchangeMaxNumOrderListsFilter + try { + // validate the JSON object to see if any exception is thrown + ExchangeMaxNumOrderListsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterExchangeMaxNumOrderListsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema" + + " 'ExchangeMaxNumOrderListsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrderListsFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ExchangeMaxNumOrderListsFilter'", + e); + } + + if (match == 1) { + ExchangeFilters ret = new ExchangeFilters(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for ExchangeFilters: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); } - return super.equals(o); } - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public ExchangeFilters() { + super("oneOf", Boolean.FALSE); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeFilters {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); + public ExchangeFilters(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); } - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); + static { + schemas.put("ExchangeMaxNumOrdersFilter", ExchangeMaxNumOrdersFilter.class); + schemas.put("ExchangeMaxNumAlgoOrdersFilter", ExchangeMaxNumAlgoOrdersFilter.class); + schemas.put("ExchangeMaxNumIcebergOrdersFilter", ExchangeMaxNumIcebergOrdersFilter.class); + schemas.put("ExchangeMaxNumOrderListsFilter", ExchangeMaxNumOrderListsFilter.class); + } - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); + @Override + public Map> getSchemas() { + return ExchangeFilters.schemas; } - public Map toMap() { - Map valMap = new TreeMap(); + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ExchangeMaxNumAlgoOrdersFilter, + * ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter, ExchangeMaxNumOrdersFilter + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ExchangeMaxNumOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExchangeMaxNumAlgoOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExchangeMaxNumIcebergOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExchangeMaxNumOrderListsFilter) { + super.setActualInstance(instance); + return; + } - return valMap; + throw new RuntimeException( + "Invalid instance type. Must be ExchangeMaxNumAlgoOrdersFilter," + + " ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter," + + " ExchangeMaxNumOrdersFilter"); } - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); + /** + * Get the actual instance, which can be the following: ExchangeMaxNumAlgoOrdersFilter, + * ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter, ExchangeMaxNumOrdersFilter + * + * @return The actual instance (ExchangeMaxNumAlgoOrdersFilter, + * ExchangeMaxNumIcebergOrdersFilter, ExchangeMaxNumOrderListsFilter, + * ExchangeMaxNumOrdersFilter) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * Get the actual instance of `ExchangeMaxNumOrdersFilter`. If the actual instance is not + * `ExchangeMaxNumOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumOrdersFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumOrdersFilter` */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + public ExchangeMaxNumOrdersFilter getExchangeMaxNumOrdersFilter() throws ClassCastException { + return (ExchangeMaxNumOrdersFilter) super.getActualInstance(); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + /** + * Get the actual instance of `ExchangeMaxNumAlgoOrdersFilter`. If the actual instance is not + * `ExchangeMaxNumAlgoOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumAlgoOrdersFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumAlgoOrdersFilter` + */ + public ExchangeMaxNumAlgoOrdersFilter getExchangeMaxNumAlgoOrdersFilter() + throws ClassCastException { + return (ExchangeMaxNumAlgoOrdersFilter) super.getActualInstance(); + } - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); + /** + * Get the actual instance of `ExchangeMaxNumIcebergOrdersFilter`. If the actual instance is not + * `ExchangeMaxNumIcebergOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumIcebergOrdersFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumIcebergOrdersFilter` + */ + public ExchangeMaxNumIcebergOrdersFilter getExchangeMaxNumIcebergOrdersFilter() + throws ClassCastException { + return (ExchangeMaxNumIcebergOrdersFilter) super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); + /** + * Get the actual instance of `ExchangeMaxNumOrderListsFilter`. If the actual instance is not + * `ExchangeMaxNumOrderListsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExchangeMaxNumOrderListsFilter` + * @throws ClassCastException if the instance is not `ExchangeMaxNumOrderListsFilter` + */ + public ExchangeMaxNumOrderListsFilter getExchangeMaxNumOrderListsFilter() + throws ClassCastException { + return (ExchangeMaxNumOrderListsFilter) super.getActualInstance(); } /** @@ -113,57 +452,64 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to ExchangeFilters */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExchangeFilters.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExchangeFilters is not found in the" - + " empty JSON string", - ExchangeFilters.openapiRequiredFields.toString())); - } + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ExchangeMaxNumOrdersFilter + try { + ExchangeMaxNumOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeFilters.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeFilters` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } + // validate the json string with ExchangeMaxNumAlgoOrdersFilter + try { + ExchangeMaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumAlgoOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeFilters.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExchangeFilters' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExchangeFilters.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExchangeFilters value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); - elementAdapter.write(out, obj); - } - - @Override - public ExchangeFilters read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); + // validate the json string with ExchangeMaxNumIcebergOrdersFilter + try { + ExchangeMaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumIcebergOrdersFilter failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ExchangeMaxNumOrderListsFilter + try { + ExchangeMaxNumOrderListsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExchangeMaxNumOrderListsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for ExchangeFilters with oneOf schemas:" + + " ExchangeMaxNumAlgoOrdersFilter," + + " ExchangeMaxNumIcebergOrdersFilter," + + " ExchangeMaxNumOrderListsFilter, ExchangeMaxNumOrdersFilter. %d" + + " class(es) match the result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); } } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java deleted file mode 100644 index 714878e33..000000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java +++ /dev/null @@ -1,1494 +0,0 @@ -/* - * Binance Spot WebSocket Streams - * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.spot.websocket.stream.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.websocket.stream.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** ExchangeFiltersInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class ExchangeFiltersInner extends BaseDTO { - public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; - - @SerializedName(SERIALIZED_NAME_FILTER_TYPE) - @jakarta.annotation.Nullable - private String filterType; - - public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; - - @SerializedName(SERIALIZED_NAME_MIN_PRICE) - @jakarta.annotation.Nullable - private String minPrice; - - public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; - - @SerializedName(SERIALIZED_NAME_MAX_PRICE) - @jakarta.annotation.Nullable - private String maxPrice; - - public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; - - @SerializedName(SERIALIZED_NAME_TICK_SIZE) - @jakarta.annotation.Nullable - private String tickSize; - - public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; - - @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) - @jakarta.annotation.Nullable - private String multiplierUp; - - public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; - - @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) - @jakarta.annotation.Nullable - private String multiplierDown; - - public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; - - @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) - @jakarta.annotation.Nullable - private Long avgPriceMins; - - public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; - - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) - @jakarta.annotation.Nullable - private String bidMultiplierUp; - - public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; - - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) - @jakarta.annotation.Nullable - private String bidMultiplierDown; - - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; - - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) - @jakarta.annotation.Nullable - private String askMultiplierUp; - - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; - - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) - @jakarta.annotation.Nullable - private String askMultiplierDown; - - public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; - - @SerializedName(SERIALIZED_NAME_MIN_QTY) - @jakarta.annotation.Nullable - private String minQty; - - public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; - - @SerializedName(SERIALIZED_NAME_MAX_QTY) - @jakarta.annotation.Nullable - private String maxQty; - - public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; - - @SerializedName(SERIALIZED_NAME_STEP_SIZE) - @jakarta.annotation.Nullable - private String stepSize; - - public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; - - @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) - @jakarta.annotation.Nullable - private String minNotional; - - public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyToMarket; - - public static final String SERIALIZED_NAME_APPLY_MIN_TO_MARKET = "applyMinToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_MIN_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyMinToMarket; - - public static final String SERIALIZED_NAME_MAX_NOTIONAL = "maxNotional"; - - @SerializedName(SERIALIZED_NAME_MAX_NOTIONAL) - @jakarta.annotation.Nullable - private String maxNotional; - - public static final String SERIALIZED_NAME_APPLY_MAX_TO_MARKET = "applyMaxToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_MAX_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyMaxToMarket; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; - - @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) - @jakarta.annotation.Nullable - private Long maxNumOrders; - - public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; - - @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) - @jakarta.annotation.Nullable - private Long maxNumAlgoOrders; - - public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; - - @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) - @jakarta.annotation.Nullable - private Long maxNumIcebergOrders; - - public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; - - @SerializedName(SERIALIZED_NAME_MAX_POSITION) - @jakarta.annotation.Nullable - private String maxPosition; - - public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; - - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) - @jakarta.annotation.Nullable - private Long minTrailingAboveDelta; - - public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; - - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) - @jakarta.annotation.Nullable - private Long maxTrailingAboveDelta; - - public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; - - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) - @jakarta.annotation.Nullable - private Long minTrailingBelowDelta; - - public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; - - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) - @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) { - this.filterType = filterType; - return this; - } - - /** - * Get filterType - * - * @return filterType - */ - @jakarta.annotation.Nullable - public String getFilterType() { - return filterType; - } - - public void setFilterType(@jakarta.annotation.Nullable String filterType) { - this.filterType = filterType; - } - - public ExchangeFiltersInner minPrice(@jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; - return this; - } - - /** - * Get minPrice - * - * @return minPrice - */ - @jakarta.annotation.Nullable - public String getMinPrice() { - return minPrice; - } - - public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; - } - - public ExchangeFiltersInner maxPrice(@jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; - return this; - } - - /** - * Get maxPrice - * - * @return maxPrice - */ - @jakarta.annotation.Nullable - public String getMaxPrice() { - return maxPrice; - } - - public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; - } - - public ExchangeFiltersInner tickSize(@jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; - return this; - } - - /** - * Get tickSize - * - * @return tickSize - */ - @jakarta.annotation.Nullable - public String getTickSize() { - return tickSize; - } - - public void setTickSize(@jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; - } - - public ExchangeFiltersInner multiplierUp(@jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; - return this; - } - - /** - * Get multiplierUp - * - * @return multiplierUp - */ - @jakarta.annotation.Nullable - public String getMultiplierUp() { - return multiplierUp; - } - - public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; - } - - public ExchangeFiltersInner multiplierDown(@jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; - return this; - } - - /** - * Get multiplierDown - * - * @return multiplierDown - */ - @jakarta.annotation.Nullable - public String getMultiplierDown() { - return multiplierDown; - } - - public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; - } - - public ExchangeFiltersInner avgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - return this; - } - - /** - * Get avgPriceMins - * - * @return avgPriceMins - */ - @jakarta.annotation.Nullable - public Long getAvgPriceMins() { - return avgPriceMins; - } - - public void setAvgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - } - - public ExchangeFiltersInner bidMultiplierUp( - @jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; - return this; - } - - /** - * Get bidMultiplierUp - * - * @return bidMultiplierUp - */ - @jakarta.annotation.Nullable - public String getBidMultiplierUp() { - return bidMultiplierUp; - } - - public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; - } - - public ExchangeFiltersInner bidMultiplierDown( - @jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; - return this; - } - - /** - * Get bidMultiplierDown - * - * @return bidMultiplierDown - */ - @jakarta.annotation.Nullable - public String getBidMultiplierDown() { - return bidMultiplierDown; - } - - public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; - } - - public ExchangeFiltersInner askMultiplierUp( - @jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; - return this; - } - - /** - * Get askMultiplierUp - * - * @return askMultiplierUp - */ - @jakarta.annotation.Nullable - public String getAskMultiplierUp() { - return askMultiplierUp; - } - - public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; - } - - public ExchangeFiltersInner askMultiplierDown( - @jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; - return this; - } - - /** - * Get askMultiplierDown - * - * @return askMultiplierDown - */ - @jakarta.annotation.Nullable - public String getAskMultiplierDown() { - return askMultiplierDown; - } - - public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; - } - - public ExchangeFiltersInner minQty(@jakarta.annotation.Nullable String minQty) { - this.minQty = minQty; - return this; - } - - /** - * Get minQty - * - * @return minQty - */ - @jakarta.annotation.Nullable - public String getMinQty() { - return minQty; - } - - public void setMinQty(@jakarta.annotation.Nullable String minQty) { - this.minQty = minQty; - } - - public ExchangeFiltersInner maxQty(@jakarta.annotation.Nullable String maxQty) { - this.maxQty = maxQty; - return this; - } - - /** - * Get maxQty - * - * @return maxQty - */ - @jakarta.annotation.Nullable - public String getMaxQty() { - return maxQty; - } - - public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { - this.maxQty = maxQty; - } - - public ExchangeFiltersInner stepSize(@jakarta.annotation.Nullable String stepSize) { - this.stepSize = stepSize; - return this; - } - - /** - * Get stepSize - * - * @return stepSize - */ - @jakarta.annotation.Nullable - public String getStepSize() { - return stepSize; - } - - public void setStepSize(@jakarta.annotation.Nullable String stepSize) { - this.stepSize = stepSize; - } - - public ExchangeFiltersInner minNotional(@jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; - return this; - } - - /** - * Get minNotional - * - * @return minNotional - */ - @jakarta.annotation.Nullable - public String getMinNotional() { - return minNotional; - } - - public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; - } - - public ExchangeFiltersInner applyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - return this; - } - - /** - * Get applyToMarket - * - * @return applyToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyToMarket() { - return applyToMarket; - } - - public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - } - - public ExchangeFiltersInner applyMinToMarket( - @jakarta.annotation.Nullable Boolean applyMinToMarket) { - this.applyMinToMarket = applyMinToMarket; - return this; - } - - /** - * Get applyMinToMarket - * - * @return applyMinToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyMinToMarket() { - return applyMinToMarket; - } - - public void setApplyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { - this.applyMinToMarket = applyMinToMarket; - } - - public ExchangeFiltersInner maxNotional(@jakarta.annotation.Nullable String maxNotional) { - this.maxNotional = maxNotional; - return this; - } - - /** - * Get maxNotional - * - * @return maxNotional - */ - @jakarta.annotation.Nullable - public String getMaxNotional() { - return maxNotional; - } - - public void setMaxNotional(@jakarta.annotation.Nullable String maxNotional) { - this.maxNotional = maxNotional; - } - - public ExchangeFiltersInner applyMaxToMarket( - @jakarta.annotation.Nullable Boolean applyMaxToMarket) { - this.applyMaxToMarket = applyMaxToMarket; - return this; - } - - /** - * Get applyMaxToMarket - * - * @return applyMaxToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyMaxToMarket() { - return applyMaxToMarket; - } - - public void setApplyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { - this.applyMaxToMarket = applyMaxToMarket; - } - - public ExchangeFiltersInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public ExchangeFiltersInner maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; - return this; - } - - /** - * Get maxNumOrders - * - * @return maxNumOrders - */ - @jakarta.annotation.Nullable - public Long getMaxNumOrders() { - return maxNumOrders; - } - - public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; - } - - public ExchangeFiltersInner maxNumAlgoOrders( - @jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; - return this; - } - - /** - * Get maxNumAlgoOrders - * - * @return maxNumAlgoOrders - */ - @jakarta.annotation.Nullable - public Long getMaxNumAlgoOrders() { - return maxNumAlgoOrders; - } - - public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; - } - - public ExchangeFiltersInner maxNumIcebergOrders( - @jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; - return this; - } - - /** - * Get maxNumIcebergOrders - * - * @return maxNumIcebergOrders - */ - @jakarta.annotation.Nullable - public Long getMaxNumIcebergOrders() { - return maxNumIcebergOrders; - } - - public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; - } - - public ExchangeFiltersInner maxPosition(@jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; - return this; - } - - /** - * Get maxPosition - * - * @return maxPosition - */ - @jakarta.annotation.Nullable - public String getMaxPosition() { - return maxPosition; - } - - public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; - } - - public ExchangeFiltersInner minTrailingAboveDelta( - @jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; - return this; - } - - /** - * Get minTrailingAboveDelta - * - * @return minTrailingAboveDelta - */ - @jakarta.annotation.Nullable - public Long getMinTrailingAboveDelta() { - return minTrailingAboveDelta; - } - - public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; - } - - public ExchangeFiltersInner maxTrailingAboveDelta( - @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; - return this; - } - - /** - * Get maxTrailingAboveDelta - * - * @return maxTrailingAboveDelta - */ - @jakarta.annotation.Nullable - public Long getMaxTrailingAboveDelta() { - return maxTrailingAboveDelta; - } - - public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; - } - - public ExchangeFiltersInner minTrailingBelowDelta( - @jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; - return this; - } - - /** - * Get minTrailingBelowDelta - * - * @return minTrailingBelowDelta - */ - @jakarta.annotation.Nullable - public Long getMinTrailingBelowDelta() { - return minTrailingBelowDelta; - } - - public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; - } - - public ExchangeFiltersInner maxTrailingBelowDelta( - @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - this.maxTrailingBelowDelta = maxTrailingBelowDelta; - return this; - } - - /** - * Get maxTrailingBelowDelta - * - * @return maxTrailingBelowDelta - */ - @jakarta.annotation.Nullable - public Long getMaxTrailingBelowDelta() { - return maxTrailingBelowDelta; - } - - public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - 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) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExchangeFiltersInner exchangeFiltersInner = (ExchangeFiltersInner) o; - return Objects.equals(this.filterType, exchangeFiltersInner.filterType) - && Objects.equals(this.minPrice, exchangeFiltersInner.minPrice) - && Objects.equals(this.maxPrice, exchangeFiltersInner.maxPrice) - && Objects.equals(this.tickSize, exchangeFiltersInner.tickSize) - && Objects.equals(this.multiplierUp, exchangeFiltersInner.multiplierUp) - && Objects.equals(this.multiplierDown, exchangeFiltersInner.multiplierDown) - && Objects.equals(this.avgPriceMins, exchangeFiltersInner.avgPriceMins) - && Objects.equals(this.bidMultiplierUp, exchangeFiltersInner.bidMultiplierUp) - && Objects.equals(this.bidMultiplierDown, exchangeFiltersInner.bidMultiplierDown) - && Objects.equals(this.askMultiplierUp, exchangeFiltersInner.askMultiplierUp) - && Objects.equals(this.askMultiplierDown, exchangeFiltersInner.askMultiplierDown) - && Objects.equals(this.minQty, exchangeFiltersInner.minQty) - && Objects.equals(this.maxQty, exchangeFiltersInner.maxQty) - && Objects.equals(this.stepSize, exchangeFiltersInner.stepSize) - && Objects.equals(this.minNotional, exchangeFiltersInner.minNotional) - && Objects.equals(this.applyToMarket, exchangeFiltersInner.applyToMarket) - && Objects.equals(this.applyMinToMarket, exchangeFiltersInner.applyMinToMarket) - && Objects.equals(this.maxNotional, exchangeFiltersInner.maxNotional) - && Objects.equals(this.applyMaxToMarket, exchangeFiltersInner.applyMaxToMarket) - && Objects.equals(this.limit, exchangeFiltersInner.limit) - && Objects.equals(this.maxNumOrders, exchangeFiltersInner.maxNumOrders) - && Objects.equals(this.maxNumAlgoOrders, exchangeFiltersInner.maxNumAlgoOrders) - && Objects.equals( - this.maxNumIcebergOrders, exchangeFiltersInner.maxNumIcebergOrders) - && Objects.equals(this.maxPosition, exchangeFiltersInner.maxPosition) - && Objects.equals( - this.minTrailingAboveDelta, exchangeFiltersInner.minTrailingAboveDelta) - && Objects.equals( - this.maxTrailingAboveDelta, exchangeFiltersInner.maxTrailingAboveDelta) - && Objects.equals( - this.minTrailingBelowDelta, exchangeFiltersInner.minTrailingBelowDelta) - && Objects.equals( - this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta) - && Objects.equals(this.maxNumOrderAmends, exchangeFiltersInner.maxNumOrderAmends) - && Objects.equals(this.maxNumOrderLists, exchangeFiltersInner.maxNumOrderLists); - } - - @Override - public int hashCode() { - return Objects.hash( - filterType, - minPrice, - maxPrice, - tickSize, - multiplierUp, - multiplierDown, - avgPriceMins, - bidMultiplierUp, - bidMultiplierDown, - askMultiplierUp, - askMultiplierDown, - minQty, - maxQty, - stepSize, - minNotional, - applyToMarket, - applyMinToMarket, - maxNotional, - applyMaxToMarket, - limit, - maxNumOrders, - maxNumAlgoOrders, - maxNumIcebergOrders, - maxPosition, - minTrailingAboveDelta, - maxTrailingAboveDelta, - minTrailingBelowDelta, - maxTrailingBelowDelta, - maxNumOrderAmends, - maxNumOrderLists); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeFiltersInner {\n"); - sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); - sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); - sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); - sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); - sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); - sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); - sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); - sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); - sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); - sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); - sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); - sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); - sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); - sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); - sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); - sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); - sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); - sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); - sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); - sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); - sb.append(" maxNumIcebergOrders: ") - .append(toIndentedString(maxNumIcebergOrders)) - .append("\n"); - sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); - sb.append(" minTrailingAboveDelta: ") - .append(toIndentedString(minTrailingAboveDelta)) - .append("\n"); - sb.append(" maxTrailingAboveDelta: ") - .append(toIndentedString(maxTrailingAboveDelta)) - .append("\n"); - sb.append(" minTrailingBelowDelta: ") - .append(toIndentedString(minTrailingBelowDelta)) - .append("\n"); - 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(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String filterTypeValue = getFilterType(); - if (filterTypeValue != null) { - String filterTypeValueAsString = filterTypeValue.toString(); - valMap.put("filterType", filterTypeValueAsString); - } - String minPriceValue = getMinPrice(); - if (minPriceValue != null) { - String minPriceValueAsString = minPriceValue.toString(); - valMap.put("minPrice", minPriceValueAsString); - } - String maxPriceValue = getMaxPrice(); - if (maxPriceValue != null) { - String maxPriceValueAsString = maxPriceValue.toString(); - valMap.put("maxPrice", maxPriceValueAsString); - } - String tickSizeValue = getTickSize(); - if (tickSizeValue != null) { - String tickSizeValueAsString = tickSizeValue.toString(); - valMap.put("tickSize", tickSizeValueAsString); - } - String multiplierUpValue = getMultiplierUp(); - if (multiplierUpValue != null) { - String multiplierUpValueAsString = multiplierUpValue.toString(); - valMap.put("multiplierUp", multiplierUpValueAsString); - } - String multiplierDownValue = getMultiplierDown(); - if (multiplierDownValue != null) { - String multiplierDownValueAsString = multiplierDownValue.toString(); - valMap.put("multiplierDown", multiplierDownValueAsString); - } - Long avgPriceMinsValue = getAvgPriceMins(); - if (avgPriceMinsValue != null) { - String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); - valMap.put("avgPriceMins", avgPriceMinsValueAsString); - } - String bidMultiplierUpValue = getBidMultiplierUp(); - if (bidMultiplierUpValue != null) { - String bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); - valMap.put("bidMultiplierUp", bidMultiplierUpValueAsString); - } - String bidMultiplierDownValue = getBidMultiplierDown(); - if (bidMultiplierDownValue != null) { - String bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); - valMap.put("bidMultiplierDown", bidMultiplierDownValueAsString); - } - String askMultiplierUpValue = getAskMultiplierUp(); - if (askMultiplierUpValue != null) { - String askMultiplierUpValueAsString = askMultiplierUpValue.toString(); - valMap.put("askMultiplierUp", askMultiplierUpValueAsString); - } - String askMultiplierDownValue = getAskMultiplierDown(); - if (askMultiplierDownValue != null) { - String askMultiplierDownValueAsString = askMultiplierDownValue.toString(); - valMap.put("askMultiplierDown", askMultiplierDownValueAsString); - } - String minQtyValue = getMinQty(); - if (minQtyValue != null) { - String minQtyValueAsString = minQtyValue.toString(); - valMap.put("minQty", minQtyValueAsString); - } - String maxQtyValue = getMaxQty(); - if (maxQtyValue != null) { - String maxQtyValueAsString = maxQtyValue.toString(); - valMap.put("maxQty", maxQtyValueAsString); - } - String stepSizeValue = getStepSize(); - if (stepSizeValue != null) { - String stepSizeValueAsString = stepSizeValue.toString(); - valMap.put("stepSize", stepSizeValueAsString); - } - String minNotionalValue = getMinNotional(); - if (minNotionalValue != null) { - String minNotionalValueAsString = minNotionalValue.toString(); - valMap.put("minNotional", minNotionalValueAsString); - } - Boolean applyToMarketValue = getApplyToMarket(); - if (applyToMarketValue != null) { - String applyToMarketValueAsString = applyToMarketValue.toString(); - valMap.put("applyToMarket", applyToMarketValueAsString); - } - Boolean applyMinToMarketValue = getApplyMinToMarket(); - if (applyMinToMarketValue != null) { - String applyMinToMarketValueAsString = applyMinToMarketValue.toString(); - valMap.put("applyMinToMarket", applyMinToMarketValueAsString); - } - String maxNotionalValue = getMaxNotional(); - if (maxNotionalValue != null) { - String maxNotionalValueAsString = maxNotionalValue.toString(); - valMap.put("maxNotional", maxNotionalValueAsString); - } - Boolean applyMaxToMarketValue = getApplyMaxToMarket(); - if (applyMaxToMarketValue != null) { - String applyMaxToMarketValueAsString = applyMaxToMarketValue.toString(); - valMap.put("applyMaxToMarket", applyMaxToMarketValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long maxNumOrdersValue = getMaxNumOrders(); - if (maxNumOrdersValue != null) { - String maxNumOrdersValueAsString = maxNumOrdersValue.toString(); - valMap.put("maxNumOrders", maxNumOrdersValueAsString); - } - Long maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); - if (maxNumAlgoOrdersValue != null) { - String maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); - valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValueAsString); - } - Long maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); - if (maxNumIcebergOrdersValue != null) { - String maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); - valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValueAsString); - } - String maxPositionValue = getMaxPosition(); - if (maxPositionValue != null) { - String maxPositionValueAsString = maxPositionValue.toString(); - valMap.put("maxPosition", maxPositionValueAsString); - } - Long minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); - if (minTrailingAboveDeltaValue != null) { - String minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); - valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValueAsString); - } - Long maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); - if (maxTrailingAboveDeltaValue != null) { - String maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); - valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValueAsString); - } - Long minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); - if (minTrailingBelowDeltaValue != null) { - String minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); - valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValueAsString); - } - Long maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); - if (maxTrailingBelowDeltaValue != null) { - 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( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object filterTypeValue = getFilterType(); - if (filterTypeValue != null) { - valMap.put("filterType", filterTypeValue); - } - Object minPriceValue = getMinPrice(); - if (minPriceValue != null) { - valMap.put("minPrice", minPriceValue); - } - Object maxPriceValue = getMaxPrice(); - if (maxPriceValue != null) { - valMap.put("maxPrice", maxPriceValue); - } - Object tickSizeValue = getTickSize(); - if (tickSizeValue != null) { - valMap.put("tickSize", tickSizeValue); - } - Object multiplierUpValue = getMultiplierUp(); - if (multiplierUpValue != null) { - valMap.put("multiplierUp", multiplierUpValue); - } - Object multiplierDownValue = getMultiplierDown(); - if (multiplierDownValue != null) { - valMap.put("multiplierDown", multiplierDownValue); - } - Object avgPriceMinsValue = getAvgPriceMins(); - if (avgPriceMinsValue != null) { - valMap.put("avgPriceMins", avgPriceMinsValue); - } - Object bidMultiplierUpValue = getBidMultiplierUp(); - if (bidMultiplierUpValue != null) { - valMap.put("bidMultiplierUp", bidMultiplierUpValue); - } - Object bidMultiplierDownValue = getBidMultiplierDown(); - if (bidMultiplierDownValue != null) { - valMap.put("bidMultiplierDown", bidMultiplierDownValue); - } - Object askMultiplierUpValue = getAskMultiplierUp(); - if (askMultiplierUpValue != null) { - valMap.put("askMultiplierUp", askMultiplierUpValue); - } - Object askMultiplierDownValue = getAskMultiplierDown(); - if (askMultiplierDownValue != null) { - valMap.put("askMultiplierDown", askMultiplierDownValue); - } - Object minQtyValue = getMinQty(); - if (minQtyValue != null) { - valMap.put("minQty", minQtyValue); - } - Object maxQtyValue = getMaxQty(); - if (maxQtyValue != null) { - valMap.put("maxQty", maxQtyValue); - } - Object stepSizeValue = getStepSize(); - if (stepSizeValue != null) { - valMap.put("stepSize", stepSizeValue); - } - Object minNotionalValue = getMinNotional(); - if (minNotionalValue != null) { - valMap.put("minNotional", minNotionalValue); - } - Object applyToMarketValue = getApplyToMarket(); - if (applyToMarketValue != null) { - valMap.put("applyToMarket", applyToMarketValue); - } - Object applyMinToMarketValue = getApplyMinToMarket(); - if (applyMinToMarketValue != null) { - valMap.put("applyMinToMarket", applyMinToMarketValue); - } - Object maxNotionalValue = getMaxNotional(); - if (maxNotionalValue != null) { - valMap.put("maxNotional", maxNotionalValue); - } - Object applyMaxToMarketValue = getApplyMaxToMarket(); - if (applyMaxToMarketValue != null) { - valMap.put("applyMaxToMarket", applyMaxToMarketValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object maxNumOrdersValue = getMaxNumOrders(); - if (maxNumOrdersValue != null) { - valMap.put("maxNumOrders", maxNumOrdersValue); - } - Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); - if (maxNumAlgoOrdersValue != null) { - valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValue); - } - Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); - if (maxNumIcebergOrdersValue != null) { - valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValue); - } - Object maxPositionValue = getMaxPosition(); - if (maxPositionValue != null) { - valMap.put("maxPosition", maxPositionValue); - } - Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); - if (minTrailingAboveDeltaValue != null) { - valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValue); - } - Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); - if (maxTrailingAboveDeltaValue != null) { - valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValue); - } - Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); - if (minTrailingBelowDeltaValue != null) { - valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValue); - } - Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); - 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; - } - - 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("filterType"); - openapiFields.add("minPrice"); - openapiFields.add("maxPrice"); - openapiFields.add("tickSize"); - openapiFields.add("multiplierUp"); - openapiFields.add("multiplierDown"); - openapiFields.add("avgPriceMins"); - openapiFields.add("bidMultiplierUp"); - openapiFields.add("bidMultiplierDown"); - openapiFields.add("askMultiplierUp"); - openapiFields.add("askMultiplierDown"); - openapiFields.add("minQty"); - openapiFields.add("maxQty"); - openapiFields.add("stepSize"); - openapiFields.add("minNotional"); - openapiFields.add("applyToMarket"); - openapiFields.add("applyMinToMarket"); - openapiFields.add("maxNotional"); - openapiFields.add("applyMaxToMarket"); - openapiFields.add("limit"); - openapiFields.add("maxNumOrders"); - openapiFields.add("maxNumAlgoOrders"); - openapiFields.add("maxNumIcebergOrders"); - openapiFields.add("maxPosition"); - openapiFields.add("minTrailingAboveDelta"); - 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(); - } - - /** - * 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 ExchangeFiltersInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExchangeFiltersInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExchangeFiltersInner is not found in" - + " the empty JSON string", - ExchangeFiltersInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeFiltersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeFiltersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) - && !jsonObj.get("filterType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("filterType").toString())); - } - if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) - && !jsonObj.get("minPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("minPrice").toString())); - } - if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) - && !jsonObj.get("maxPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("maxPrice").toString())); - } - if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) - && !jsonObj.get("tickSize").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `tickSize` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("tickSize").toString())); - } - if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) - && !jsonObj.get("multiplierUp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `multiplierUp` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("multiplierUp").toString())); - } - if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) - && !jsonObj.get("multiplierDown").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `multiplierDown` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("multiplierDown").toString())); - } - if ((jsonObj.get("bidMultiplierUp") != null && !jsonObj.get("bidMultiplierUp").isJsonNull()) - && !jsonObj.get("bidMultiplierUp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bidMultiplierUp` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("bidMultiplierUp").toString())); - } - if ((jsonObj.get("bidMultiplierDown") != null - && !jsonObj.get("bidMultiplierDown").isJsonNull()) - && !jsonObj.get("bidMultiplierDown").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bidMultiplierDown` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("bidMultiplierDown").toString())); - } - if ((jsonObj.get("askMultiplierUp") != null && !jsonObj.get("askMultiplierUp").isJsonNull()) - && !jsonObj.get("askMultiplierUp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `askMultiplierUp` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("askMultiplierUp").toString())); - } - if ((jsonObj.get("askMultiplierDown") != null - && !jsonObj.get("askMultiplierDown").isJsonNull()) - && !jsonObj.get("askMultiplierDown").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `askMultiplierDown` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("askMultiplierDown").toString())); - } - if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) - && !jsonObj.get("minQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("minQty").toString())); - } - if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) - && !jsonObj.get("maxQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("maxQty").toString())); - } - if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) - && !jsonObj.get("stepSize").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `stepSize` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("stepSize").toString())); - } - if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) - && !jsonObj.get("minNotional").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minNotional` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("minNotional").toString())); - } - if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) - && !jsonObj.get("maxNotional").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxNotional` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("maxNotional").toString())); - } - if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) - && !jsonObj.get("maxPosition").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `maxPosition` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("maxPosition").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeFiltersInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExchangeFiltersInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExchangeFiltersInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExchangeFiltersInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ExchangeFiltersInner read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ExchangeFiltersInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExchangeFiltersInner - * @throws IOException if the JSON string is invalid with respect to ExchangeFiltersInner - */ - public static ExchangeFiltersInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExchangeFiltersInner.class); - } - - /** - * Convert an instance of ExchangeFiltersInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumAlgoOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumAlgoOrdersFilter.java new file mode 100644 index 000000000..586829182 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumAlgoOrdersFilter.java @@ -0,0 +1,286 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ExchangeMaxNumAlgoOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumAlgoOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumAlgoOrders; + + public ExchangeMaxNumAlgoOrdersFilter() {} + + public ExchangeMaxNumAlgoOrdersFilter filterType( + @jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumAlgoOrdersFilter maxNumAlgoOrders( + @jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + return this; + } + + /** + * Get maxNumAlgoOrders + * + * @return maxNumAlgoOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumAlgoOrders() { + return maxNumAlgoOrders; + } + + public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumAlgoOrdersFilter exchangeMaxNumAlgoOrdersFilter = + (ExchangeMaxNumAlgoOrdersFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumAlgoOrdersFilter.filterType) + && Objects.equals( + this.maxNumAlgoOrders, exchangeMaxNumAlgoOrdersFilter.maxNumAlgoOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumAlgoOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumAlgoOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + String maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumAlgoOrders"); + + // 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 + * ExchangeMaxNumAlgoOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumAlgoOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumAlgoOrdersFilter is not" + + " found in the empty JSON string", + ExchangeMaxNumAlgoOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeMaxNumAlgoOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeMaxNumAlgoOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumAlgoOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumAlgoOrdersFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumAlgoOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumAlgoOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumAlgoOrdersFilter read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumAlgoOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumAlgoOrdersFilter + * @throws IOException if the JSON string is invalid with respect to + * ExchangeMaxNumAlgoOrdersFilter + */ + public static ExchangeMaxNumAlgoOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumAlgoOrdersFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumAlgoOrdersFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumIcebergOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumIcebergOrdersFilter.java new file mode 100644 index 000000000..ade38c8f9 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumIcebergOrdersFilter.java @@ -0,0 +1,290 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ExchangeMaxNumIcebergOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumIcebergOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumIcebergOrders; + + public ExchangeMaxNumIcebergOrdersFilter() {} + + public ExchangeMaxNumIcebergOrdersFilter filterType( + @jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumIcebergOrdersFilter maxNumIcebergOrders( + @jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + return this; + } + + /** + * Get maxNumIcebergOrders + * + * @return maxNumIcebergOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumIcebergOrders() { + return maxNumIcebergOrders; + } + + public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumIcebergOrdersFilter exchangeMaxNumIcebergOrdersFilter = + (ExchangeMaxNumIcebergOrdersFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumIcebergOrdersFilter.filterType) + && Objects.equals( + this.maxNumIcebergOrders, + exchangeMaxNumIcebergOrdersFilter.maxNumIcebergOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumIcebergOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumIcebergOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumIcebergOrders: ") + .append(toIndentedString(maxNumIcebergOrders)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + String maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumIcebergOrders"); + + // 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 + * ExchangeMaxNumIcebergOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumIcebergOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumIcebergOrdersFilter is" + + " not found in the empty JSON string", + ExchangeMaxNumIcebergOrdersFilter.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeMaxNumIcebergOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeMaxNumIcebergOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumIcebergOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumIcebergOrdersFilter' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumIcebergOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumIcebergOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumIcebergOrdersFilter read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumIcebergOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumIcebergOrdersFilter + * @throws IOException if the JSON string is invalid with respect to + * ExchangeMaxNumIcebergOrdersFilter + */ + public static ExchangeMaxNumIcebergOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumIcebergOrdersFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumIcebergOrdersFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumOrderListsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumOrderListsFilter.java new file mode 100644 index 000000000..5a71b5cc1 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumOrderListsFilter.java @@ -0,0 +1,286 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ExchangeMaxNumOrderListsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumOrderListsFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + 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 ExchangeMaxNumOrderListsFilter() {} + + public ExchangeMaxNumOrderListsFilter filterType( + @jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumOrderListsFilter 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumOrderListsFilter exchangeMaxNumOrderListsFilter = + (ExchangeMaxNumOrderListsFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumOrderListsFilter.filterType) + && Objects.equals( + this.maxNumOrderLists, exchangeMaxNumOrderListsFilter.maxNumOrderLists); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrderLists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumOrderListsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrderLists: ").append(toIndentedString(maxNumOrderLists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + String maxNumOrderListsValueAsString = maxNumOrderListsValue.toString(); + valMap.put("maxNumOrderLists", maxNumOrderListsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + valMap.put("maxNumOrderLists", maxNumOrderListsValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrderLists"); + + // 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 + * ExchangeMaxNumOrderListsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumOrderListsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumOrderListsFilter is not" + + " found in the empty JSON string", + ExchangeMaxNumOrderListsFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeMaxNumOrderListsFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeMaxNumOrderListsFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumOrderListsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumOrderListsFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ExchangeMaxNumOrderListsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumOrderListsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumOrderListsFilter read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumOrderListsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumOrderListsFilter + * @throws IOException if the JSON string is invalid with respect to + * ExchangeMaxNumOrderListsFilter + */ + public static ExchangeMaxNumOrderListsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumOrderListsFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumOrderListsFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumOrdersFilter.java new file mode 100644 index 000000000..558b7bb9e --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeMaxNumOrdersFilter.java @@ -0,0 +1,278 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** ExchangeMaxNumOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeMaxNumOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumOrders; + + public ExchangeMaxNumOrdersFilter() {} + + public ExchangeMaxNumOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeMaxNumOrdersFilter maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + return this; + } + + /** + * Get maxNumOrders + * + * @return maxNumOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrders() { + return maxNumOrders; + } + + public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeMaxNumOrdersFilter exchangeMaxNumOrdersFilter = (ExchangeMaxNumOrdersFilter) o; + return Objects.equals(this.filterType, exchangeMaxNumOrdersFilter.filterType) + && Objects.equals(this.maxNumOrders, exchangeMaxNumOrdersFilter.maxNumOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeMaxNumOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + String maxNumOrdersValueAsString = maxNumOrdersValue.toString(); + valMap.put("maxNumOrders", maxNumOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + valMap.put("maxNumOrders", maxNumOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrders"); + + // 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 ExchangeMaxNumOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeMaxNumOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeMaxNumOrdersFilter is not" + + " found in the empty JSON string", + ExchangeMaxNumOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeMaxNumOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeMaxNumOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeMaxNumOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeMaxNumOrdersFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeMaxNumOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeMaxNumOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeMaxNumOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeMaxNumOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeMaxNumOrdersFilter + * @throws IOException if the JSON string is invalid with respect to ExchangeMaxNumOrdersFilter + */ + public static ExchangeMaxNumOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeMaxNumOrdersFilter.class); + } + + /** + * Convert an instance of ExchangeMaxNumOrdersFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/IcebergPartsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/IcebergPartsFilter.java new file mode 100644 index 000000000..fd29c9318 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/IcebergPartsFilter.java @@ -0,0 +1,277 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** IcebergPartsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class IcebergPartsFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @jakarta.annotation.Nullable + private Long limit; + + public IcebergPartsFilter() {} + + public IcebergPartsFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public IcebergPartsFilter limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @jakarta.annotation.Nullable + public Long getLimit() { + return limit; + } + + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IcebergPartsFilter icebergPartsFilter = (IcebergPartsFilter) o; + return Objects.equals(this.filterType, icebergPartsFilter.filterType) + && Objects.equals(this.limit, icebergPartsFilter.limit); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IcebergPartsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long limitValue = getLimit(); + if (limitValue != null) { + String limitValueAsString = limitValue.toString(); + valMap.put("limit", limitValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object limitValue = getLimit(); + if (limitValue != null) { + valMap.put("limit", limitValue); + } + + 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("filterType"); + openapiFields.add("limit"); + + // 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 IcebergPartsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IcebergPartsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in IcebergPartsFilter is not found in the" + + " empty JSON string", + IcebergPartsFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IcebergPartsFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IcebergPartsFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IcebergPartsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IcebergPartsFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(IcebergPartsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, IcebergPartsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IcebergPartsFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of IcebergPartsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of IcebergPartsFilter + * @throws IOException if the JSON string is invalid with respect to IcebergPartsFilter + */ + public static IcebergPartsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IcebergPartsFilter.class); + } + + /** + * Convert an instance of IcebergPartsFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/LotSizeFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/LotSizeFilter.java new file mode 100644 index 000000000..44a461237 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/LotSizeFilter.java @@ -0,0 +1,411 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** LotSizeFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class LotSizeFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; + + @SerializedName(SERIALIZED_NAME_MIN_QTY) + @jakarta.annotation.Nullable + private String minQty; + + public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; + + @SerializedName(SERIALIZED_NAME_MAX_QTY) + @jakarta.annotation.Nullable + private String maxQty; + + public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; + + @SerializedName(SERIALIZED_NAME_STEP_SIZE) + @jakarta.annotation.Nullable + private String stepSize; + + public LotSizeFilter() {} + + public LotSizeFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public LotSizeFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public LotSizeFilter minQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + return this; + } + + /** + * Get minQty + * + * @return minQty + */ + @jakarta.annotation.Nullable + public String getMinQty() { + return minQty; + } + + public void setMinQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + } + + public LotSizeFilter maxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + return this; + } + + /** + * Get maxQty + * + * @return maxQty + */ + @jakarta.annotation.Nullable + public String getMaxQty() { + return maxQty; + } + + public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + } + + public LotSizeFilter stepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + return this; + } + + /** + * Get stepSize + * + * @return stepSize + */ + @jakarta.annotation.Nullable + public String getStepSize() { + return stepSize; + } + + public void setStepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LotSizeFilter lotSizeFilter = (LotSizeFilter) o; + return Objects.equals(this.filterType, lotSizeFilter.filterType) + && Objects.equals(this.qtyExponent, lotSizeFilter.qtyExponent) + && Objects.equals(this.minQty, lotSizeFilter.minQty) + && Objects.equals(this.maxQty, lotSizeFilter.maxQty) + && Objects.equals(this.stepSize, lotSizeFilter.stepSize); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, minQty, maxQty, stepSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LotSizeFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); + sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); + sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + String qtyExponentValueAsString = qtyExponentValue.toString(); + valMap.put("qtyExponent", qtyExponentValueAsString); + } + String minQtyValue = getMinQty(); + if (minQtyValue != null) { + String minQtyValueAsString = minQtyValue.toString(); + valMap.put("minQty", minQtyValueAsString); + } + String maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + String maxQtyValueAsString = maxQtyValue.toString(); + valMap.put("maxQty", maxQtyValueAsString); + } + String stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + String stepSizeValueAsString = stepSizeValue.toString(); + valMap.put("stepSize", stepSizeValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + valMap.put("qtyExponent", qtyExponentValue); + } + Object minQtyValue = getMinQty(); + if (minQtyValue != null) { + valMap.put("minQty", minQtyValue); + } + Object maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + valMap.put("maxQty", maxQtyValue); + } + Object stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + valMap.put("stepSize", stepSizeValue); + } + + 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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("minQty"); + openapiFields.add("maxQty"); + openapiFields.add("stepSize"); + + // 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 LotSizeFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LotSizeFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in LotSizeFilter is not found in the" + + " empty JSON string", + LotSizeFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LotSizeFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `LotSizeFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) + && !jsonObj.get("minQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minQty").toString())); + } + if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) + && !jsonObj.get("maxQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxQty").toString())); + } + if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) + && !jsonObj.get("stepSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stepSize").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LotSizeFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LotSizeFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(LotSizeFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, LotSizeFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LotSizeFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of LotSizeFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of LotSizeFilter + * @throws IOException if the JSON string is invalid with respect to LotSizeFilter + */ + public static LotSizeFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LotSizeFilter.class); + } + + /** + * Convert an instance of LotSizeFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MarketLotSizeFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MarketLotSizeFilter.java new file mode 100644 index 000000000..6fa43c81d --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MarketLotSizeFilter.java @@ -0,0 +1,412 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MarketLotSizeFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MarketLotSizeFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; + + @SerializedName(SERIALIZED_NAME_MIN_QTY) + @jakarta.annotation.Nullable + private String minQty; + + public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; + + @SerializedName(SERIALIZED_NAME_MAX_QTY) + @jakarta.annotation.Nullable + private String maxQty; + + public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; + + @SerializedName(SERIALIZED_NAME_STEP_SIZE) + @jakarta.annotation.Nullable + private String stepSize; + + public MarketLotSizeFilter() {} + + public MarketLotSizeFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MarketLotSizeFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public MarketLotSizeFilter minQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + return this; + } + + /** + * Get minQty + * + * @return minQty + */ + @jakarta.annotation.Nullable + public String getMinQty() { + return minQty; + } + + public void setMinQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + } + + public MarketLotSizeFilter maxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + return this; + } + + /** + * Get maxQty + * + * @return maxQty + */ + @jakarta.annotation.Nullable + public String getMaxQty() { + return maxQty; + } + + public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + } + + public MarketLotSizeFilter stepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + return this; + } + + /** + * Get stepSize + * + * @return stepSize + */ + @jakarta.annotation.Nullable + public String getStepSize() { + return stepSize; + } + + public void setStepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarketLotSizeFilter marketLotSizeFilter = (MarketLotSizeFilter) o; + return Objects.equals(this.filterType, marketLotSizeFilter.filterType) + && Objects.equals(this.qtyExponent, marketLotSizeFilter.qtyExponent) + && Objects.equals(this.minQty, marketLotSizeFilter.minQty) + && Objects.equals(this.maxQty, marketLotSizeFilter.maxQty) + && Objects.equals(this.stepSize, marketLotSizeFilter.stepSize); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, minQty, maxQty, stepSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarketLotSizeFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); + sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); + sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + String qtyExponentValueAsString = qtyExponentValue.toString(); + valMap.put("qtyExponent", qtyExponentValueAsString); + } + String minQtyValue = getMinQty(); + if (minQtyValue != null) { + String minQtyValueAsString = minQtyValue.toString(); + valMap.put("minQty", minQtyValueAsString); + } + String maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + String maxQtyValueAsString = maxQtyValue.toString(); + valMap.put("maxQty", maxQtyValueAsString); + } + String stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + String stepSizeValueAsString = stepSizeValue.toString(); + valMap.put("stepSize", stepSizeValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + valMap.put("qtyExponent", qtyExponentValue); + } + Object minQtyValue = getMinQty(); + if (minQtyValue != null) { + valMap.put("minQty", minQtyValue); + } + Object maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + valMap.put("maxQty", maxQtyValue); + } + Object stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + valMap.put("stepSize", stepSizeValue); + } + + 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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("minQty"); + openapiFields.add("maxQty"); + openapiFields.add("stepSize"); + + // 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 MarketLotSizeFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MarketLotSizeFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MarketLotSizeFilter is not found in" + + " the empty JSON string", + MarketLotSizeFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MarketLotSizeFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MarketLotSizeFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) + && !jsonObj.get("minQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minQty").toString())); + } + if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) + && !jsonObj.get("maxQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxQty").toString())); + } + if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) + && !jsonObj.get("stepSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stepSize").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MarketLotSizeFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MarketLotSizeFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MarketLotSizeFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MarketLotSizeFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MarketLotSizeFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MarketLotSizeFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MarketLotSizeFilter + * @throws IOException if the JSON string is invalid with respect to MarketLotSizeFilter + */ + public static MarketLotSizeFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MarketLotSizeFilter.class); + } + + /** + * Convert an instance of MarketLotSizeFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxAssetFilter.java similarity index 51% rename from clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimitsInner.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxAssetFilter.java index 41ecbc5ab..384808679 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimitsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxAssetFilter.java @@ -34,101 +34,76 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** RateLimitsInner */ +/** MaxAssetFilter */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class RateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; +public class MaxAssetFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) @jakarta.annotation.Nullable - private String rateLimitType; + private String filterType; - public static final String SERIALIZED_NAME_INTERVAL = "interval"; + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; - @SerializedName(SERIALIZED_NAME_INTERVAL) + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; + private Integer qtyExponent; public static final String SERIALIZED_NAME_LIMIT = "limit"; @SerializedName(SERIALIZED_NAME_LIMIT) @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; + private String limit; - public RateLimitsInner() {} + public static final String SERIALIZED_NAME_ASSET = "asset"; - public RateLimitsInner rateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ + @SerializedName(SERIALIZED_NAME_ASSET) @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } + private String asset; - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } + public MaxAssetFilter() {} - public RateLimitsInner interval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; + public MaxAssetFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; return this; } /** - * Get interval + * Get filterType * - * @return interval + * @return filterType */ @jakarta.annotation.Nullable - public String getInterval() { - return interval; + public String getFilterType() { + return filterType; } - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; } - public RateLimitsInner intervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; + public MaxAssetFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; return this; } /** - * Get intervalNum + * Get qtyExponent * - * @return intervalNum + * @return qtyExponent */ @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; + public Integer getQtyExponent() { + return qtyExponent; } - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; } - public RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { + public MaxAssetFilter limit(@jakarta.annotation.Nullable String limit) { this.limit = limit; return this; } @@ -139,31 +114,31 @@ public RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { * @return limit */ @jakarta.annotation.Nullable - public Long getLimit() { + public String getLimit() { return limit; } - public void setLimit(@jakarta.annotation.Nullable Long limit) { + public void setLimit(@jakarta.annotation.Nullable String limit) { this.limit = limit; } - public RateLimitsInner count(@jakarta.annotation.Nullable Long count) { - this.count = count; + public MaxAssetFilter asset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; return this; } /** - * Get count + * Get asset * - * @return count + * @return asset */ @jakarta.annotation.Nullable - public Long getCount() { - return count; + public String getAsset() { + return asset; } - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; } @Override @@ -174,28 +149,26 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - RateLimitsInner rateLimitsInner = (RateLimitsInner) o; - return Objects.equals(this.rateLimitType, rateLimitsInner.rateLimitType) - && Objects.equals(this.interval, rateLimitsInner.interval) - && Objects.equals(this.intervalNum, rateLimitsInner.intervalNum) - && Objects.equals(this.limit, rateLimitsInner.limit) - && Objects.equals(this.count, rateLimitsInner.count); + MaxAssetFilter maxAssetFilter = (MaxAssetFilter) o; + return Objects.equals(this.filterType, maxAssetFilter.filterType) + && Objects.equals(this.qtyExponent, maxAssetFilter.qtyExponent) + && Objects.equals(this.limit, maxAssetFilter.limit) + && Objects.equals(this.asset, maxAssetFilter.asset); } @Override public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); + return Objects.hash(filterType, qtyExponent, limit, asset); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class RateLimitsInner {\n"); - sb.append(" rateLimitType: ").append(toIndentedString(rateLimitType)).append("\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append(" intervalNum: ").append(toIndentedString(intervalNum)).append("\n"); + sb.append("class MaxAssetFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); sb.append("}"); return sb.toString(); } @@ -204,30 +177,25 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); + Integer qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + String qtyExponentValueAsString = qtyExponentValue.toString(); + valMap.put("qtyExponent", qtyExponentValueAsString); } - Long limitValue = getLimit(); + String limitValue = getLimit(); if (limitValue != null) { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); + String assetValue = getAsset(); + if (assetValue != null) { + String assetValueAsString = assetValue.toString(); + valMap.put("asset", assetValueAsString); } valMap.put("timestamp", getTimestamp()); @@ -240,25 +208,21 @@ public String toUrlQueryString() { public Map toMap() { Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - Object rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); + Object filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); + Object qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + valMap.put("qtyExponent", qtyExponentValue); } Object limitValue = getLimit(); if (limitValue != null) { valMap.put("limit", limitValue); } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); + Object assetValue = getAsset(); + if (assetValue != null) { + valMap.put("asset", assetValue); } valMap.put("timestamp", getTimestamp()); @@ -286,11 +250,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); + openapiFields.add("filterType"); + openapiFields.add("qtyExponent"); openapiFields.add("limit"); - openapiFields.add("count"); + openapiFields.add("asset"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -300,47 +263,55 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RateLimitsInner + * @throws IOException if the JSON Element is invalid with respect to MaxAssetFilter */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!RateLimitsInner.openapiRequiredFields + if (!MaxAssetFilter.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in RateLimitsInner is not found in the" + "The required field(s) %s in MaxAssetFilter is not found in the" + " empty JSON string", - RateLimitsInner.openapiRequiredFields.toString())); + MaxAssetFilter.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!RateLimitsInner.openapiFields.contains(entry.getKey())) { + if (!MaxAssetFilter.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `RateLimitsInner` properties. JSON: %s", + + " `MaxAssetFilter` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" + "Expected the field `filterType` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); + jsonObj.get("filterType").toString())); } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { + if ((jsonObj.get("limit") != null && !jsonObj.get("limit").isJsonNull()) + && !jsonObj.get("limit").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); + "Expected the field `limit` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("limit").toString())); + } + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); } } @@ -348,24 +319,23 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!RateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RateLimitsInner' and its subtypes + if (!MaxAssetFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxAssetFilter' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RateLimitsInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxAssetFilter.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, RateLimitsInner value) - throws IOException { + public void write(JsonWriter out, MaxAssetFilter value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public RateLimitsInner read(JsonReader in) throws IOException { + public MaxAssetFilter read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -375,18 +345,18 @@ public RateLimitsInner read(JsonReader in) throws IOException { } /** - * Create an instance of RateLimitsInner given an JSON string + * Create an instance of MaxAssetFilter given an JSON string * * @param jsonString JSON string - * @return An instance of RateLimitsInner - * @throws IOException if the JSON string is invalid with respect to RateLimitsInner + * @return An instance of MaxAssetFilter + * @throws IOException if the JSON string is invalid with respect to MaxAssetFilter */ - public static RateLimitsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RateLimitsInner.class); + public static MaxAssetFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxAssetFilter.class); } /** - * Convert an instance of RateLimitsInner to an JSON string + * Convert an instance of MaxAssetFilter to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumAlgoOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumAlgoOrdersFilter.java new file mode 100644 index 000000000..b06c44362 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumAlgoOrdersFilter.java @@ -0,0 +1,278 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MaxNumAlgoOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumAlgoOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumAlgoOrders; + + public MaxNumAlgoOrdersFilter() {} + + public MaxNumAlgoOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumAlgoOrdersFilter maxNumAlgoOrders( + @jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + return this; + } + + /** + * Get maxNumAlgoOrders + * + * @return maxNumAlgoOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumAlgoOrders() { + return maxNumAlgoOrders; + } + + public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumAlgoOrdersFilter maxNumAlgoOrdersFilter = (MaxNumAlgoOrdersFilter) o; + return Objects.equals(this.filterType, maxNumAlgoOrdersFilter.filterType) + && Objects.equals(this.maxNumAlgoOrders, maxNumAlgoOrdersFilter.maxNumAlgoOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumAlgoOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumAlgoOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + String maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumAlgoOrders"); + + // 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 MaxNumAlgoOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumAlgoOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumAlgoOrdersFilter is not found in" + + " the empty JSON string", + MaxNumAlgoOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumAlgoOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumAlgoOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumAlgoOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumAlgoOrdersFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumAlgoOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumAlgoOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumAlgoOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumAlgoOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumAlgoOrdersFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumAlgoOrdersFilter + */ + public static MaxNumAlgoOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumAlgoOrdersFilter.class); + } + + /** + * Convert an instance of MaxNumAlgoOrdersFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumIcebergOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumIcebergOrdersFilter.java new file mode 100644 index 000000000..433fde5e6 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumIcebergOrdersFilter.java @@ -0,0 +1,282 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MaxNumIcebergOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumIcebergOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumIcebergOrders; + + public MaxNumIcebergOrdersFilter() {} + + public MaxNumIcebergOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumIcebergOrdersFilter maxNumIcebergOrders( + @jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + return this; + } + + /** + * Get maxNumIcebergOrders + * + * @return maxNumIcebergOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumIcebergOrders() { + return maxNumIcebergOrders; + } + + public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumIcebergOrdersFilter maxNumIcebergOrdersFilter = (MaxNumIcebergOrdersFilter) o; + return Objects.equals(this.filterType, maxNumIcebergOrdersFilter.filterType) + && Objects.equals( + this.maxNumIcebergOrders, maxNumIcebergOrdersFilter.maxNumIcebergOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumIcebergOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumIcebergOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumIcebergOrders: ") + .append(toIndentedString(maxNumIcebergOrders)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + String maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumIcebergOrders"); + + // 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 MaxNumIcebergOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumIcebergOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumIcebergOrdersFilter is not found" + + " in the empty JSON string", + MaxNumIcebergOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumIcebergOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumIcebergOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumIcebergOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumIcebergOrdersFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumIcebergOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumIcebergOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumIcebergOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumIcebergOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumIcebergOrdersFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumIcebergOrdersFilter + */ + public static MaxNumIcebergOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumIcebergOrdersFilter.class); + } + + /** + * Convert an instance of MaxNumIcebergOrdersFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumOrderAmendsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumOrderAmendsFilter.java new file mode 100644 index 000000000..3eb6f08b1 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumOrderAmendsFilter.java @@ -0,0 +1,280 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MaxNumOrderAmendsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumOrderAmendsFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + 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 MaxNumOrderAmendsFilter() {} + + public MaxNumOrderAmendsFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumOrderAmendsFilter 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumOrderAmendsFilter maxNumOrderAmendsFilter = (MaxNumOrderAmendsFilter) o; + return Objects.equals(this.filterType, maxNumOrderAmendsFilter.filterType) + && Objects.equals( + this.maxNumOrderAmends, maxNumOrderAmendsFilter.maxNumOrderAmends); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrderAmends); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumOrderAmendsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrderAmends: ").append(toIndentedString(maxNumOrderAmends)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrderAmendsValue = getMaxNumOrderAmends(); + if (maxNumOrderAmendsValue != null) { + String maxNumOrderAmendsValueAsString = maxNumOrderAmendsValue.toString(); + valMap.put("maxNumOrderAmends", maxNumOrderAmendsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrderAmendsValue = getMaxNumOrderAmends(); + if (maxNumOrderAmendsValue != null) { + valMap.put("maxNumOrderAmends", maxNumOrderAmendsValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrderAmends"); + + // 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 MaxNumOrderAmendsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumOrderAmendsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumOrderAmendsFilter is not found" + + " in the empty JSON string", + MaxNumOrderAmendsFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumOrderAmendsFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumOrderAmendsFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumOrderAmendsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumOrderAmendsFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderAmendsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumOrderAmendsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumOrderAmendsFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumOrderAmendsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumOrderAmendsFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumOrderAmendsFilter + */ + public static MaxNumOrderAmendsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumOrderAmendsFilter.class); + } + + /** + * Convert an instance of MaxNumOrderAmendsFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumOrderListsFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumOrderListsFilter.java new file mode 100644 index 000000000..1dc19ee28 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumOrderListsFilter.java @@ -0,0 +1,278 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MaxNumOrderListsFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumOrderListsFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + 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 MaxNumOrderListsFilter() {} + + public MaxNumOrderListsFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumOrderListsFilter 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumOrderListsFilter maxNumOrderListsFilter = (MaxNumOrderListsFilter) o; + return Objects.equals(this.filterType, maxNumOrderListsFilter.filterType) + && Objects.equals(this.maxNumOrderLists, maxNumOrderListsFilter.maxNumOrderLists); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrderLists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumOrderListsFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrderLists: ").append(toIndentedString(maxNumOrderLists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + String maxNumOrderListsValueAsString = maxNumOrderListsValue.toString(); + valMap.put("maxNumOrderLists", maxNumOrderListsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrderListsValue = getMaxNumOrderLists(); + if (maxNumOrderListsValue != null) { + valMap.put("maxNumOrderLists", maxNumOrderListsValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrderLists"); + + // 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 MaxNumOrderListsFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumOrderListsFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumOrderListsFilter is not found in" + + " the empty JSON string", + MaxNumOrderListsFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumOrderListsFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumOrderListsFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumOrderListsFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumOrderListsFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderListsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumOrderListsFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumOrderListsFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumOrderListsFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumOrderListsFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumOrderListsFilter + */ + public static MaxNumOrderListsFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumOrderListsFilter.class); + } + + /** + * Convert an instance of MaxNumOrderListsFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumOrdersFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumOrdersFilter.java new file mode 100644 index 000000000..68b182ee4 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxNumOrdersFilter.java @@ -0,0 +1,277 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MaxNumOrdersFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxNumOrdersFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumOrders; + + public MaxNumOrdersFilter() {} + + public MaxNumOrdersFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxNumOrdersFilter maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + return this; + } + + /** + * Get maxNumOrders + * + * @return maxNumOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrders() { + return maxNumOrders; + } + + public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxNumOrdersFilter maxNumOrdersFilter = (MaxNumOrdersFilter) o; + return Objects.equals(this.filterType, maxNumOrdersFilter.filterType) + && Objects.equals(this.maxNumOrders, maxNumOrdersFilter.maxNumOrders); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, maxNumOrders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxNumOrdersFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + String maxNumOrdersValueAsString = maxNumOrdersValue.toString(); + valMap.put("maxNumOrders", maxNumOrdersValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + valMap.put("maxNumOrders", maxNumOrdersValue); + } + + 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("filterType"); + openapiFields.add("maxNumOrders"); + + // 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 MaxNumOrdersFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxNumOrdersFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxNumOrdersFilter is not found in the" + + " empty JSON string", + MaxNumOrdersFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxNumOrdersFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxNumOrdersFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxNumOrdersFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxNumOrdersFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrdersFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxNumOrdersFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxNumOrdersFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxNumOrdersFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxNumOrdersFilter + * @throws IOException if the JSON string is invalid with respect to MaxNumOrdersFilter + */ + public static MaxNumOrdersFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxNumOrdersFilter.class); + } + + /** + * Convert an instance of MaxNumOrdersFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxPositionFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxPositionFilter.java new file mode 100644 index 000000000..49294bffc --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MaxPositionFilter.java @@ -0,0 +1,322 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MaxPositionFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MaxPositionFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_QTY_EXPONENT = "qtyExponent"; + + @SerializedName(SERIALIZED_NAME_QTY_EXPONENT) + @jakarta.annotation.Nullable + private Integer qtyExponent; + + public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; + + @SerializedName(SERIALIZED_NAME_MAX_POSITION) + @jakarta.annotation.Nullable + private String maxPosition; + + public MaxPositionFilter() {} + + public MaxPositionFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MaxPositionFilter qtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + return this; + } + + /** + * Get qtyExponent + * + * @return qtyExponent + */ + @jakarta.annotation.Nullable + public Integer getQtyExponent() { + return qtyExponent; + } + + public void setQtyExponent(@jakarta.annotation.Nullable Integer qtyExponent) { + this.qtyExponent = qtyExponent; + } + + public MaxPositionFilter maxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; + return this; + } + + /** + * Get maxPosition + * + * @return maxPosition + */ + @jakarta.annotation.Nullable + public String getMaxPosition() { + return maxPosition; + } + + public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxPositionFilter maxPositionFilter = (MaxPositionFilter) o; + return Objects.equals(this.filterType, maxPositionFilter.filterType) + && Objects.equals(this.qtyExponent, maxPositionFilter.qtyExponent) + && Objects.equals(this.maxPosition, maxPositionFilter.maxPosition); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, qtyExponent, maxPosition); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxPositionFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" qtyExponent: ").append(toIndentedString(qtyExponent)).append("\n"); + sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + String qtyExponentValueAsString = qtyExponentValue.toString(); + valMap.put("qtyExponent", qtyExponentValueAsString); + } + String maxPositionValue = getMaxPosition(); + if (maxPositionValue != null) { + String maxPositionValueAsString = maxPositionValue.toString(); + valMap.put("maxPosition", maxPositionValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object qtyExponentValue = getQtyExponent(); + if (qtyExponentValue != null) { + valMap.put("qtyExponent", qtyExponentValue); + } + Object maxPositionValue = getMaxPosition(); + if (maxPositionValue != null) { + valMap.put("maxPosition", maxPositionValue); + } + + 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("filterType"); + openapiFields.add("qtyExponent"); + openapiFields.add("maxPosition"); + + // 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 MaxPositionFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxPositionFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MaxPositionFilter is not found in the" + + " empty JSON string", + MaxPositionFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxPositionFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MaxPositionFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) + && !jsonObj.get("maxPosition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxPosition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPosition").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaxPositionFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaxPositionFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MaxPositionFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MaxPositionFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaxPositionFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MaxPositionFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxPositionFilter + * @throws IOException if the JSON string is invalid with respect to MaxPositionFilter + */ + public static MaxPositionFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaxPositionFilter.class); + } + + /** + * Convert an instance of MaxPositionFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MinNotionalFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MinNotionalFilter.java new file mode 100644 index 000000000..8dc69c9b9 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/MinNotionalFilter.java @@ -0,0 +1,396 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** MinNotionalFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MinNotionalFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_PRICE_EXPONENT = "priceExponent"; + + @SerializedName(SERIALIZED_NAME_PRICE_EXPONENT) + @jakarta.annotation.Nullable + private Integer priceExponent; + + public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; + + @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) + @jakarta.annotation.Nullable + private String minNotional; + + public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyToMarket; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public MinNotionalFilter() {} + + public MinNotionalFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public MinNotionalFilter priceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + return this; + } + + /** + * Get priceExponent + * + * @return priceExponent + */ + @jakarta.annotation.Nullable + public Integer getPriceExponent() { + return priceExponent; + } + + public void setPriceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + } + + public MinNotionalFilter minNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + return this; + } + + /** + * Get minNotional + * + * @return minNotional + */ + @jakarta.annotation.Nullable + public String getMinNotional() { + return minNotional; + } + + public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + } + + public MinNotionalFilter applyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; + return this; + } + + /** + * Get applyToMarket + * + * @return applyToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyToMarket() { + return applyToMarket; + } + + public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; + } + + public MinNotionalFilter avgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MinNotionalFilter minNotionalFilter = (MinNotionalFilter) o; + return Objects.equals(this.filterType, minNotionalFilter.filterType) + && Objects.equals(this.priceExponent, minNotionalFilter.priceExponent) + && Objects.equals(this.minNotional, minNotionalFilter.minNotional) + && Objects.equals(this.applyToMarket, minNotionalFilter.applyToMarket) + && Objects.equals(this.avgPriceMins, minNotionalFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, priceExponent, minNotional, applyToMarket, avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MinNotionalFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" priceExponent: ").append(toIndentedString(priceExponent)).append("\n"); + sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); + sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + String priceExponentValueAsString = priceExponentValue.toString(); + valMap.put("priceExponent", priceExponentValueAsString); + } + String minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + String minNotionalValueAsString = minNotionalValue.toString(); + valMap.put("minNotional", minNotionalValueAsString); + } + Boolean applyToMarketValue = getApplyToMarket(); + if (applyToMarketValue != null) { + String applyToMarketValueAsString = applyToMarketValue.toString(); + valMap.put("applyToMarket", applyToMarketValueAsString); + } + Integer avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + valMap.put("priceExponent", priceExponentValue); + } + Object minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + valMap.put("minNotional", minNotionalValue); + } + Object applyToMarketValue = getApplyToMarket(); + if (applyToMarketValue != null) { + valMap.put("applyToMarket", applyToMarketValue); + } + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); + } + + 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("filterType"); + openapiFields.add("priceExponent"); + openapiFields.add("minNotional"); + openapiFields.add("applyToMarket"); + openapiFields.add("avgPriceMins"); + + // 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 MinNotionalFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MinNotionalFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in MinNotionalFilter is not found in the" + + " empty JSON string", + MinNotionalFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MinNotionalFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MinNotionalFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) + && !jsonObj.get("minNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minNotional").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MinNotionalFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MinNotionalFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MinNotionalFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MinNotionalFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MinNotionalFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MinNotionalFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of MinNotionalFilter + * @throws IOException if the JSON string is invalid with respect to MinNotionalFilter + */ + public static MinNotionalFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MinNotionalFilter.class); + } + + /** + * Convert an instance of MinNotionalFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/NotionalFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/NotionalFilter.java new file mode 100644 index 000000000..87b318251 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/NotionalFilter.java @@ -0,0 +1,484 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** NotionalFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NotionalFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_PRICE_EXPONENT = "priceExponent"; + + @SerializedName(SERIALIZED_NAME_PRICE_EXPONENT) + @jakarta.annotation.Nullable + private Integer priceExponent; + + public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; + + @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) + @jakarta.annotation.Nullable + private String minNotional; + + public static final String SERIALIZED_NAME_APPLY_MIN_TO_MARKET = "applyMinToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_MIN_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyMinToMarket; + + public static final String SERIALIZED_NAME_MAX_NOTIONAL = "maxNotional"; + + @SerializedName(SERIALIZED_NAME_MAX_NOTIONAL) + @jakarta.annotation.Nullable + private String maxNotional; + + public static final String SERIALIZED_NAME_APPLY_MAX_TO_MARKET = "applyMaxToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_MAX_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyMaxToMarket; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public NotionalFilter() {} + + public NotionalFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public NotionalFilter priceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + return this; + } + + /** + * Get priceExponent + * + * @return priceExponent + */ + @jakarta.annotation.Nullable + public Integer getPriceExponent() { + return priceExponent; + } + + public void setPriceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + } + + public NotionalFilter minNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + return this; + } + + /** + * Get minNotional + * + * @return minNotional + */ + @jakarta.annotation.Nullable + public String getMinNotional() { + return minNotional; + } + + public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + } + + public NotionalFilter applyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { + this.applyMinToMarket = applyMinToMarket; + return this; + } + + /** + * Get applyMinToMarket + * + * @return applyMinToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyMinToMarket() { + return applyMinToMarket; + } + + public void setApplyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { + this.applyMinToMarket = applyMinToMarket; + } + + public NotionalFilter maxNotional(@jakarta.annotation.Nullable String maxNotional) { + this.maxNotional = maxNotional; + return this; + } + + /** + * Get maxNotional + * + * @return maxNotional + */ + @jakarta.annotation.Nullable + public String getMaxNotional() { + return maxNotional; + } + + public void setMaxNotional(@jakarta.annotation.Nullable String maxNotional) { + this.maxNotional = maxNotional; + } + + public NotionalFilter applyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { + this.applyMaxToMarket = applyMaxToMarket; + return this; + } + + /** + * Get applyMaxToMarket + * + * @return applyMaxToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyMaxToMarket() { + return applyMaxToMarket; + } + + public void setApplyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { + this.applyMaxToMarket = applyMaxToMarket; + } + + public NotionalFilter avgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotionalFilter notionalFilter = (NotionalFilter) o; + return Objects.equals(this.filterType, notionalFilter.filterType) + && Objects.equals(this.priceExponent, notionalFilter.priceExponent) + && Objects.equals(this.minNotional, notionalFilter.minNotional) + && Objects.equals(this.applyMinToMarket, notionalFilter.applyMinToMarket) + && Objects.equals(this.maxNotional, notionalFilter.maxNotional) + && Objects.equals(this.applyMaxToMarket, notionalFilter.applyMaxToMarket) + && Objects.equals(this.avgPriceMins, notionalFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + priceExponent, + minNotional, + applyMinToMarket, + maxNotional, + applyMaxToMarket, + avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotionalFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" priceExponent: ").append(toIndentedString(priceExponent)).append("\n"); + sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); + sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); + sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); + sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + String priceExponentValueAsString = priceExponentValue.toString(); + valMap.put("priceExponent", priceExponentValueAsString); + } + String minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + String minNotionalValueAsString = minNotionalValue.toString(); + valMap.put("minNotional", minNotionalValueAsString); + } + Boolean applyMinToMarketValue = getApplyMinToMarket(); + if (applyMinToMarketValue != null) { + String applyMinToMarketValueAsString = applyMinToMarketValue.toString(); + valMap.put("applyMinToMarket", applyMinToMarketValueAsString); + } + String maxNotionalValue = getMaxNotional(); + if (maxNotionalValue != null) { + String maxNotionalValueAsString = maxNotionalValue.toString(); + valMap.put("maxNotional", maxNotionalValueAsString); + } + Boolean applyMaxToMarketValue = getApplyMaxToMarket(); + if (applyMaxToMarketValue != null) { + String applyMaxToMarketValueAsString = applyMaxToMarketValue.toString(); + valMap.put("applyMaxToMarket", applyMaxToMarketValueAsString); + } + Integer avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + valMap.put("priceExponent", priceExponentValue); + } + Object minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + valMap.put("minNotional", minNotionalValue); + } + Object applyMinToMarketValue = getApplyMinToMarket(); + if (applyMinToMarketValue != null) { + valMap.put("applyMinToMarket", applyMinToMarketValue); + } + Object maxNotionalValue = getMaxNotional(); + if (maxNotionalValue != null) { + valMap.put("maxNotional", maxNotionalValue); + } + Object applyMaxToMarketValue = getApplyMaxToMarket(); + if (applyMaxToMarketValue != null) { + valMap.put("applyMaxToMarket", applyMaxToMarketValue); + } + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); + } + + 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("filterType"); + openapiFields.add("priceExponent"); + openapiFields.add("minNotional"); + openapiFields.add("applyMinToMarket"); + openapiFields.add("maxNotional"); + openapiFields.add("applyMaxToMarket"); + openapiFields.add("avgPriceMins"); + + // 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 NotionalFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NotionalFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NotionalFilter is not found in the" + + " empty JSON string", + NotionalFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NotionalFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `NotionalFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) + && !jsonObj.get("minNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minNotional").toString())); + } + if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) + && !jsonObj.get("maxNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxNotional").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NotionalFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NotionalFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NotionalFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NotionalFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NotionalFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NotionalFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotionalFilter + * @throws IOException if the JSON string is invalid with respect to NotionalFilter + */ + public static NotionalFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NotionalFilter.class); + } + + /** + * Convert an instance of NotionalFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/PercentPriceBySideFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/PercentPriceBySideFilter.java new file mode 100644 index 000000000..9a88054b0 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/PercentPriceBySideFilter.java @@ -0,0 +1,515 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** PercentPriceBySideFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PercentPriceBySideFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MULTIPLIER_EXPONENT = "multiplierExponent"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_EXPONENT) + @jakarta.annotation.Nullable + private Integer multiplierExponent; + + public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String bidMultiplierUp; + + public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String bidMultiplierDown; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String askMultiplierUp; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String askMultiplierDown; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public PercentPriceBySideFilter() {} + + public PercentPriceBySideFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public PercentPriceBySideFilter multiplierExponent( + @jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + return this; + } + + /** + * Get multiplierExponent + * + * @return multiplierExponent + */ + @jakarta.annotation.Nullable + public Integer getMultiplierExponent() { + return multiplierExponent; + } + + public void setMultiplierExponent(@jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + } + + public PercentPriceBySideFilter bidMultiplierUp( + @jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; + return this; + } + + /** + * Get bidMultiplierUp + * + * @return bidMultiplierUp + */ + @jakarta.annotation.Nullable + public String getBidMultiplierUp() { + return bidMultiplierUp; + } + + public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; + } + + public PercentPriceBySideFilter bidMultiplierDown( + @jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + return this; + } + + /** + * Get bidMultiplierDown + * + * @return bidMultiplierDown + */ + @jakarta.annotation.Nullable + public String getBidMultiplierDown() { + return bidMultiplierDown; + } + + public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + } + + public PercentPriceBySideFilter askMultiplierUp( + @jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + return this; + } + + /** + * Get askMultiplierUp + * + * @return askMultiplierUp + */ + @jakarta.annotation.Nullable + public String getAskMultiplierUp() { + return askMultiplierUp; + } + + public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + } + + public PercentPriceBySideFilter askMultiplierDown( + @jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + return this; + } + + /** + * Get askMultiplierDown + * + * @return askMultiplierDown + */ + @jakarta.annotation.Nullable + public String getAskMultiplierDown() { + return askMultiplierDown; + } + + public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + } + + public PercentPriceBySideFilter avgPriceMins( + @jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PercentPriceBySideFilter percentPriceBySideFilter = (PercentPriceBySideFilter) o; + return Objects.equals(this.filterType, percentPriceBySideFilter.filterType) + && Objects.equals( + this.multiplierExponent, percentPriceBySideFilter.multiplierExponent) + && Objects.equals(this.bidMultiplierUp, percentPriceBySideFilter.bidMultiplierUp) + && Objects.equals( + this.bidMultiplierDown, percentPriceBySideFilter.bidMultiplierDown) + && Objects.equals(this.askMultiplierUp, percentPriceBySideFilter.askMultiplierUp) + && Objects.equals( + this.askMultiplierDown, percentPriceBySideFilter.askMultiplierDown) + && Objects.equals(this.avgPriceMins, percentPriceBySideFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + multiplierExponent, + bidMultiplierUp, + bidMultiplierDown, + askMultiplierUp, + askMultiplierDown, + avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PercentPriceBySideFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" multiplierExponent: ") + .append(toIndentedString(multiplierExponent)) + .append("\n"); + sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); + sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); + sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); + sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer multiplierExponentValue = getMultiplierExponent(); + if (multiplierExponentValue != null) { + String multiplierExponentValueAsString = multiplierExponentValue.toString(); + valMap.put("multiplierExponent", multiplierExponentValueAsString); + } + String bidMultiplierUpValue = getBidMultiplierUp(); + if (bidMultiplierUpValue != null) { + String bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); + valMap.put("bidMultiplierUp", bidMultiplierUpValueAsString); + } + String bidMultiplierDownValue = getBidMultiplierDown(); + if (bidMultiplierDownValue != null) { + String bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); + valMap.put("bidMultiplierDown", bidMultiplierDownValueAsString); + } + String askMultiplierUpValue = getAskMultiplierUp(); + if (askMultiplierUpValue != null) { + String askMultiplierUpValueAsString = askMultiplierUpValue.toString(); + valMap.put("askMultiplierUp", askMultiplierUpValueAsString); + } + String askMultiplierDownValue = getAskMultiplierDown(); + if (askMultiplierDownValue != null) { + String askMultiplierDownValueAsString = askMultiplierDownValue.toString(); + valMap.put("askMultiplierDown", askMultiplierDownValueAsString); + } + Integer avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object multiplierExponentValue = getMultiplierExponent(); + if (multiplierExponentValue != null) { + valMap.put("multiplierExponent", multiplierExponentValue); + } + Object bidMultiplierUpValue = getBidMultiplierUp(); + if (bidMultiplierUpValue != null) { + valMap.put("bidMultiplierUp", bidMultiplierUpValue); + } + Object bidMultiplierDownValue = getBidMultiplierDown(); + if (bidMultiplierDownValue != null) { + valMap.put("bidMultiplierDown", bidMultiplierDownValue); + } + Object askMultiplierUpValue = getAskMultiplierUp(); + if (askMultiplierUpValue != null) { + valMap.put("askMultiplierUp", askMultiplierUpValue); + } + Object askMultiplierDownValue = getAskMultiplierDown(); + if (askMultiplierDownValue != null) { + valMap.put("askMultiplierDown", askMultiplierDownValue); + } + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); + } + + 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("filterType"); + openapiFields.add("multiplierExponent"); + openapiFields.add("bidMultiplierUp"); + openapiFields.add("bidMultiplierDown"); + openapiFields.add("askMultiplierUp"); + openapiFields.add("askMultiplierDown"); + openapiFields.add("avgPriceMins"); + + // 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 PercentPriceBySideFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PercentPriceBySideFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PercentPriceBySideFilter is not found" + + " in the empty JSON string", + PercentPriceBySideFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PercentPriceBySideFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PercentPriceBySideFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("bidMultiplierUp") != null && !jsonObj.get("bidMultiplierUp").isJsonNull()) + && !jsonObj.get("bidMultiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidMultiplierUp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("bidMultiplierUp").toString())); + } + if ((jsonObj.get("bidMultiplierDown") != null + && !jsonObj.get("bidMultiplierDown").isJsonNull()) + && !jsonObj.get("bidMultiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidMultiplierDown` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("bidMultiplierDown").toString())); + } + if ((jsonObj.get("askMultiplierUp") != null && !jsonObj.get("askMultiplierUp").isJsonNull()) + && !jsonObj.get("askMultiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askMultiplierUp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("askMultiplierUp").toString())); + } + if ((jsonObj.get("askMultiplierDown") != null + && !jsonObj.get("askMultiplierDown").isJsonNull()) + && !jsonObj.get("askMultiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askMultiplierDown` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("askMultiplierDown").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PercentPriceBySideFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PercentPriceBySideFilter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceBySideFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PercentPriceBySideFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PercentPriceBySideFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PercentPriceBySideFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of PercentPriceBySideFilter + * @throws IOException if the JSON string is invalid with respect to PercentPriceBySideFilter + */ + public static PercentPriceBySideFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PercentPriceBySideFilter.class); + } + + /** + * Convert an instance of PercentPriceBySideFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/PercentPriceFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/PercentPriceFilter.java new file mode 100644 index 000000000..1d1616c30 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/PercentPriceFilter.java @@ -0,0 +1,408 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** PercentPriceFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PercentPriceFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MULTIPLIER_EXPONENT = "multiplierExponent"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_EXPONENT) + @jakarta.annotation.Nullable + private Integer multiplierExponent; + + public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String multiplierUp; + + public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String multiplierDown; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Integer avgPriceMins; + + public PercentPriceFilter() {} + + public PercentPriceFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public PercentPriceFilter multiplierExponent( + @jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + return this; + } + + /** + * Get multiplierExponent + * + * @return multiplierExponent + */ + @jakarta.annotation.Nullable + public Integer getMultiplierExponent() { + return multiplierExponent; + } + + public void setMultiplierExponent(@jakarta.annotation.Nullable Integer multiplierExponent) { + this.multiplierExponent = multiplierExponent; + } + + public PercentPriceFilter multiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; + return this; + } + + /** + * Get multiplierUp + * + * @return multiplierUp + */ + @jakarta.annotation.Nullable + public String getMultiplierUp() { + return multiplierUp; + } + + public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; + } + + public PercentPriceFilter multiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; + return this; + } + + /** + * Get multiplierDown + * + * @return multiplierDown + */ + @jakarta.annotation.Nullable + public String getMultiplierDown() { + return multiplierDown; + } + + public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; + } + + public PercentPriceFilter avgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Integer getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Integer avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PercentPriceFilter percentPriceFilter = (PercentPriceFilter) o; + return Objects.equals(this.filterType, percentPriceFilter.filterType) + && Objects.equals(this.multiplierExponent, percentPriceFilter.multiplierExponent) + && Objects.equals(this.multiplierUp, percentPriceFilter.multiplierUp) + && Objects.equals(this.multiplierDown, percentPriceFilter.multiplierDown) + && Objects.equals(this.avgPriceMins, percentPriceFilter.avgPriceMins); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, multiplierExponent, multiplierUp, multiplierDown, avgPriceMins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PercentPriceFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" multiplierExponent: ") + .append(toIndentedString(multiplierExponent)) + .append("\n"); + sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); + sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer multiplierExponentValue = getMultiplierExponent(); + if (multiplierExponentValue != null) { + String multiplierExponentValueAsString = multiplierExponentValue.toString(); + valMap.put("multiplierExponent", multiplierExponentValueAsString); + } + String multiplierUpValue = getMultiplierUp(); + if (multiplierUpValue != null) { + String multiplierUpValueAsString = multiplierUpValue.toString(); + valMap.put("multiplierUp", multiplierUpValueAsString); + } + String multiplierDownValue = getMultiplierDown(); + if (multiplierDownValue != null) { + String multiplierDownValueAsString = multiplierDownValue.toString(); + valMap.put("multiplierDown", multiplierDownValueAsString); + } + Integer avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object multiplierExponentValue = getMultiplierExponent(); + if (multiplierExponentValue != null) { + valMap.put("multiplierExponent", multiplierExponentValue); + } + Object multiplierUpValue = getMultiplierUp(); + if (multiplierUpValue != null) { + valMap.put("multiplierUp", multiplierUpValue); + } + Object multiplierDownValue = getMultiplierDown(); + if (multiplierDownValue != null) { + valMap.put("multiplierDown", multiplierDownValue); + } + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); + } + + 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("filterType"); + openapiFields.add("multiplierExponent"); + openapiFields.add("multiplierUp"); + openapiFields.add("multiplierDown"); + openapiFields.add("avgPriceMins"); + + // 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 PercentPriceFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PercentPriceFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PercentPriceFilter is not found in the" + + " empty JSON string", + PercentPriceFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PercentPriceFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PercentPriceFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) + && !jsonObj.get("multiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierUp` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("multiplierUp").toString())); + } + if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) + && !jsonObj.get("multiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierDown` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("multiplierDown").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PercentPriceFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PercentPriceFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PercentPriceFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PercentPriceFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PercentPriceFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of PercentPriceFilter + * @throws IOException if the JSON string is invalid with respect to PercentPriceFilter + */ + public static PercentPriceFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PercentPriceFilter.class); + } + + /** + * Convert an instance of PercentPriceFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/PriceFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/PriceFilter.java new file mode 100644 index 000000000..eb0c562e8 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/PriceFilter.java @@ -0,0 +1,411 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** PriceFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PriceFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_PRICE_EXPONENT = "priceExponent"; + + @SerializedName(SERIALIZED_NAME_PRICE_EXPONENT) + @jakarta.annotation.Nullable + private Integer priceExponent; + + public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; + + @SerializedName(SERIALIZED_NAME_MIN_PRICE) + @jakarta.annotation.Nullable + private String minPrice; + + public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; + + @SerializedName(SERIALIZED_NAME_MAX_PRICE) + @jakarta.annotation.Nullable + private String maxPrice; + + public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; + + @SerializedName(SERIALIZED_NAME_TICK_SIZE) + @jakarta.annotation.Nullable + private String tickSize; + + public PriceFilter() {} + + public PriceFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public PriceFilter priceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + return this; + } + + /** + * Get priceExponent + * + * @return priceExponent + */ + @jakarta.annotation.Nullable + public Integer getPriceExponent() { + return priceExponent; + } + + public void setPriceExponent(@jakarta.annotation.Nullable Integer priceExponent) { + this.priceExponent = priceExponent; + } + + public PriceFilter minPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; + return this; + } + + /** + * Get minPrice + * + * @return minPrice + */ + @jakarta.annotation.Nullable + public String getMinPrice() { + return minPrice; + } + + public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; + } + + public PriceFilter maxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; + return this; + } + + /** + * Get maxPrice + * + * @return maxPrice + */ + @jakarta.annotation.Nullable + public String getMaxPrice() { + return maxPrice; + } + + public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; + } + + public PriceFilter tickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; + return this; + } + + /** + * Get tickSize + * + * @return tickSize + */ + @jakarta.annotation.Nullable + public String getTickSize() { + return tickSize; + } + + public void setTickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PriceFilter priceFilter = (PriceFilter) o; + return Objects.equals(this.filterType, priceFilter.filterType) + && Objects.equals(this.priceExponent, priceFilter.priceExponent) + && Objects.equals(this.minPrice, priceFilter.minPrice) + && Objects.equals(this.maxPrice, priceFilter.maxPrice) + && Objects.equals(this.tickSize, priceFilter.tickSize); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, priceExponent, minPrice, maxPrice, tickSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PriceFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" priceExponent: ").append(toIndentedString(priceExponent)).append("\n"); + sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); + sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); + sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Integer priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + String priceExponentValueAsString = priceExponentValue.toString(); + valMap.put("priceExponent", priceExponentValueAsString); + } + String minPriceValue = getMinPrice(); + if (minPriceValue != null) { + String minPriceValueAsString = minPriceValue.toString(); + valMap.put("minPrice", minPriceValueAsString); + } + String maxPriceValue = getMaxPrice(); + if (maxPriceValue != null) { + String maxPriceValueAsString = maxPriceValue.toString(); + valMap.put("maxPrice", maxPriceValueAsString); + } + String tickSizeValue = getTickSize(); + if (tickSizeValue != null) { + String tickSizeValueAsString = tickSizeValue.toString(); + valMap.put("tickSize", tickSizeValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object priceExponentValue = getPriceExponent(); + if (priceExponentValue != null) { + valMap.put("priceExponent", priceExponentValue); + } + Object minPriceValue = getMinPrice(); + if (minPriceValue != null) { + valMap.put("minPrice", minPriceValue); + } + Object maxPriceValue = getMaxPrice(); + if (maxPriceValue != null) { + valMap.put("maxPrice", maxPriceValue); + } + Object tickSizeValue = getTickSize(); + if (tickSizeValue != null) { + valMap.put("tickSize", tickSizeValue); + } + + 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("filterType"); + openapiFields.add("priceExponent"); + openapiFields.add("minPrice"); + openapiFields.add("maxPrice"); + openapiFields.add("tickSize"); + + // 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 PriceFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PriceFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PriceFilter is not found in the empty" + + " JSON string", + PriceFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PriceFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PriceFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) + && !jsonObj.get("minPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minPrice").toString())); + } + if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) + && !jsonObj.get("maxPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPrice").toString())); + } + if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) + && !jsonObj.get("tickSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tickSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tickSize").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PriceFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PriceFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PriceFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PriceFilter value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PriceFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PriceFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of PriceFilter + * @throws IOException if the JSON string is invalid with respect to PriceFilter + */ + public static PriceFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PriceFilter.class); + } + + /** + * Convert an instance of PriceFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimits.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimits.java index 8f409c506..716856363 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimits.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimits.java @@ -12,18 +12,20 @@ package com.binance.connector.client.spot.websocket.stream.model; +import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.websocket.stream.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import jakarta.validation.constraints.*; import java.io.IOException; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; import java.util.HashSet; import java.util.Map; import java.util.Objects; @@ -36,9 +38,134 @@ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class RateLimits extends ArrayList { +public class RateLimits extends BaseDTO { + public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; + + @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) + @jakarta.annotation.Nullable + private String rateLimitType; + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + @jakarta.annotation.Nullable + private String interval; + + public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; + + @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) + @jakarta.annotation.Nullable + private Long intervalNum; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @jakarta.annotation.Nullable + private Long limit; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + @jakarta.annotation.Nullable + private Long count; + public RateLimits() {} + public RateLimits rateLimitType(@jakarta.annotation.Nullable String rateLimitType) { + this.rateLimitType = rateLimitType; + return this; + } + + /** + * Get rateLimitType + * + * @return rateLimitType + */ + @jakarta.annotation.Nullable + public String getRateLimitType() { + return rateLimitType; + } + + public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { + this.rateLimitType = rateLimitType; + } + + public RateLimits interval(@jakarta.annotation.Nullable String interval) { + this.interval = interval; + return this; + } + + /** + * Get interval + * + * @return interval + */ + @jakarta.annotation.Nullable + public String getInterval() { + return interval; + } + + public void setInterval(@jakarta.annotation.Nullable String interval) { + this.interval = interval; + } + + public RateLimits intervalNum(@jakarta.annotation.Nullable Long intervalNum) { + this.intervalNum = intervalNum; + return this; + } + + /** + * Get intervalNum + * + * @return intervalNum + */ + @jakarta.annotation.Nullable + public Long getIntervalNum() { + return intervalNum; + } + + public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { + this.intervalNum = intervalNum; + } + + public RateLimits limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @jakarta.annotation.Nullable + public Long getLimit() { + return limit; + } + + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + } + + public RateLimits count(@jakarta.annotation.Nullable Long count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count + */ + @jakarta.annotation.Nullable + public Long getCount() { + return count; + } + + public void setCount(@jakarta.annotation.Nullable Long count) { + this.count = count; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -47,19 +174,28 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - return super.equals(o); + RateLimits rateLimits = (RateLimits) o; + return Objects.equals(this.rateLimitType, rateLimits.rateLimitType) + && Objects.equals(this.interval, rateLimits.interval) + && Objects.equals(this.intervalNum, rateLimits.intervalNum) + && Objects.equals(this.limit, rateLimits.limit) + && Objects.equals(this.count, rateLimits.count); } @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return Objects.hash(rateLimitType, interval, intervalNum, limit, count); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RateLimits {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" rateLimitType: ").append(toIndentedString(rateLimitType)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" intervalNum: ").append(toIndentedString(intervalNum)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); sb.append("}"); return sb.toString(); } @@ -67,7 +203,34 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String rateLimitTypeValue = getRateLimitType(); + if (rateLimitTypeValue != null) { + String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); + valMap.put("rateLimitType", rateLimitTypeValueAsString); + } + String intervalValue = getInterval(); + if (intervalValue != null) { + String intervalValueAsString = intervalValue.toString(); + valMap.put("interval", intervalValueAsString); + } + Long intervalNumValue = getIntervalNum(); + if (intervalNumValue != null) { + String intervalNumValueAsString = intervalNumValue.toString(); + valMap.put("intervalNum", intervalNumValueAsString); + } + Long limitValue = getLimit(); + if (limitValue != null) { + String limitValueAsString = limitValue.toString(); + valMap.put("limit", limitValueAsString); + } + Long countValue = getCount(); + if (countValue != null) { + String countValueAsString = countValue.toString(); + valMap.put("count", countValueAsString); + } + valMap.put("timestamp", getTimestamp()); return asciiEncode( valMap.keySet().stream() .map(key -> key + "=" + valMap.get(key)) @@ -76,7 +239,29 @@ public String toUrlQueryString() { public Map toMap() { Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object rateLimitTypeValue = getRateLimitType(); + if (rateLimitTypeValue != null) { + valMap.put("rateLimitType", rateLimitTypeValue); + } + Object intervalValue = getInterval(); + if (intervalValue != null) { + valMap.put("interval", intervalValue); + } + Object intervalNumValue = getIntervalNum(); + if (intervalNumValue != null) { + valMap.put("intervalNum", intervalNumValue); + } + Object limitValue = getLimit(); + if (limitValue != null) { + valMap.put("limit", limitValue); + } + Object countValue = getCount(); + if (countValue != null) { + valMap.put("count", countValue); + } + valMap.put("timestamp", getTimestamp()); return valMap; } @@ -101,6 +286,11 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("rateLimitType"); + openapiFields.add("interval"); + openapiFields.add("intervalNum"); + openapiFields.add("limit"); + openapiFields.add("count"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -135,6 +325,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) + && !jsonObj.get("rateLimitType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimitType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimitType").toString())); + } + if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) + && !jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -152,7 +359,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { new TypeAdapter() { @Override public void write(JsonWriter out, RateLimits value) throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/SymbolFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/SymbolFilters.java new file mode 100644 index 000000000..64230768a --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/SymbolFilters.java @@ -0,0 +1,1358 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.hibernate.validator.constraints.*; + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SymbolFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SymbolFilters.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SymbolFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SymbolFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterPriceFilter = + gson.getDelegateAdapter(this, TypeToken.get(PriceFilter.class)); + final TypeAdapter adapterPercentPriceFilter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceFilter.class)); + final TypeAdapter adapterPercentPriceBySideFilter = + gson.getDelegateAdapter(this, TypeToken.get(PercentPriceBySideFilter.class)); + final TypeAdapter adapterLotSizeFilter = + gson.getDelegateAdapter(this, TypeToken.get(LotSizeFilter.class)); + final TypeAdapter adapterMinNotionalFilter = + gson.getDelegateAdapter(this, TypeToken.get(MinNotionalFilter.class)); + final TypeAdapter adapterNotionalFilter = + gson.getDelegateAdapter(this, TypeToken.get(NotionalFilter.class)); + final TypeAdapter adapterIcebergPartsFilter = + gson.getDelegateAdapter(this, TypeToken.get(IcebergPartsFilter.class)); + final TypeAdapter adapterMarketLotSizeFilter = + gson.getDelegateAdapter(this, TypeToken.get(MarketLotSizeFilter.class)); + final TypeAdapter adapterMaxNumOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrdersFilter.class)); + final TypeAdapter adapterMaxNumAlgoOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumAlgoOrdersFilter.class)); + final TypeAdapter adapterMaxNumIcebergOrdersFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumIcebergOrdersFilter.class)); + final TypeAdapter adapterMaxPositionFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxPositionFilter.class)); + final TypeAdapter adapterTrailingDeltaFilter = + gson.getDelegateAdapter(this, TypeToken.get(TrailingDeltaFilter.class)); + final TypeAdapter adapterTPlusSellFilter = + gson.getDelegateAdapter(this, TypeToken.get(TPlusSellFilter.class)); + final TypeAdapter adapterMaxNumOrderListsFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderListsFilter.class)); + final TypeAdapter adapterMaxNumOrderAmendsFilter = + gson.getDelegateAdapter(this, TypeToken.get(MaxNumOrderAmendsFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SymbolFilters value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `PriceFilter` + if (value.getActualInstance() instanceof PriceFilter) { + JsonElement element = + adapterPriceFilter.toJsonTree( + (PriceFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `PercentPriceFilter` + if (value.getActualInstance() instanceof PercentPriceFilter) { + JsonElement element = + adapterPercentPriceFilter.toJsonTree( + (PercentPriceFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `PercentPriceBySideFilter` + if (value.getActualInstance() instanceof PercentPriceBySideFilter) { + JsonElement element = + adapterPercentPriceBySideFilter.toJsonTree( + (PercentPriceBySideFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `LotSizeFilter` + if (value.getActualInstance() instanceof LotSizeFilter) { + JsonElement element = + adapterLotSizeFilter.toJsonTree( + (LotSizeFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MinNotionalFilter` + if (value.getActualInstance() instanceof MinNotionalFilter) { + JsonElement element = + adapterMinNotionalFilter.toJsonTree( + (MinNotionalFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `NotionalFilter` + if (value.getActualInstance() instanceof NotionalFilter) { + JsonElement element = + adapterNotionalFilter.toJsonTree( + (NotionalFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `IcebergPartsFilter` + if (value.getActualInstance() instanceof IcebergPartsFilter) { + JsonElement element = + adapterIcebergPartsFilter.toJsonTree( + (IcebergPartsFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MarketLotSizeFilter` + if (value.getActualInstance() instanceof MarketLotSizeFilter) { + JsonElement element = + adapterMarketLotSizeFilter.toJsonTree( + (MarketLotSizeFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumOrdersFilter` + if (value.getActualInstance() instanceof MaxNumOrdersFilter) { + JsonElement element = + adapterMaxNumOrdersFilter.toJsonTree( + (MaxNumOrdersFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumAlgoOrdersFilter` + if (value.getActualInstance() instanceof MaxNumAlgoOrdersFilter) { + JsonElement element = + adapterMaxNumAlgoOrdersFilter.toJsonTree( + (MaxNumAlgoOrdersFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `MaxNumIcebergOrdersFilter` + if (value.getActualInstance() instanceof MaxNumIcebergOrdersFilter) { + JsonElement element = + adapterMaxNumIcebergOrdersFilter.toJsonTree( + (MaxNumIcebergOrdersFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxPositionFilter` + if (value.getActualInstance() instanceof MaxPositionFilter) { + JsonElement element = + adapterMaxPositionFilter.toJsonTree( + (MaxPositionFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TrailingDeltaFilter` + if (value.getActualInstance() instanceof TrailingDeltaFilter) { + JsonElement element = + adapterTrailingDeltaFilter.toJsonTree( + (TrailingDeltaFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TPlusSellFilter` + if (value.getActualInstance() instanceof TPlusSellFilter) { + JsonElement element = + adapterTPlusSellFilter.toJsonTree( + (TPlusSellFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumOrderListsFilter` + if (value.getActualInstance() instanceof MaxNumOrderListsFilter) { + JsonElement element = + adapterMaxNumOrderListsFilter.toJsonTree( + (MaxNumOrderListsFilter) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `MaxNumOrderAmendsFilter` + if (value.getActualInstance() instanceof MaxNumOrderAmendsFilter) { + JsonElement element = + adapterMaxNumOrderAmendsFilter.toJsonTree( + (MaxNumOrderAmendsFilter) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter," + + " MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter," + + " MaxNumOrderAmendsFilter, MaxNumOrderListsFilter," + + " MaxNumOrdersFilter, MaxPositionFilter," + + " MinNotionalFilter, NotionalFilter," + + " PercentPriceBySideFilter, PercentPriceFilter," + + " PriceFilter, TPlusSellFilter, TrailingDeltaFilter"); + } + + @Override + public SymbolFilters read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + SymbolFilters newSymbolFilters = new SymbolFilters(); + if (jsonObject.get("filterType") == null) { + log.log( + Level.WARNING, + "Failed to lookup discriminator value for SymbolFilters as" + + " `filterType` was not found in the payload or the" + + " payload is empty."); + } else { + // look up the discriminator value in the field `filterType` + switch (jsonObject.get("filterType").getAsString()) { + case "ICEBERG_PARTS": + deserialized = + adapterIcebergPartsFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "LOT_SIZE": + deserialized = + adapterLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MARKET_LOT_SIZE": + deserialized = + adapterMarketLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ALGO_ORDERS": + deserialized = + adapterMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ICEBERG_ORDERS": + deserialized = + adapterMaxNumIcebergOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ORDERS": + deserialized = + adapterMaxNumOrdersFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ORDER_AMENDS": + deserialized = + adapterMaxNumOrderAmendsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_NUM_ORDER_LISTS": + deserialized = + adapterMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MAX_POSITION": + deserialized = + adapterMaxPositionFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MIN_NOTIONAL": + deserialized = + adapterMinNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "NOTIONAL": + deserialized = + adapterNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PERCENT_PRICE": + deserialized = + adapterPercentPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PERCENT_PRICE_BY_SIDE": + deserialized = + adapterPercentPriceBySideFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PRICE_FILTER": + deserialized = adapterPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "TRAILING_DELTA": + deserialized = + adapterTrailingDeltaFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "T_PLUS_SELL": + deserialized = + adapterTPlusSellFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "IcebergPartsFilter": + deserialized = + adapterIcebergPartsFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "LotSizeFilter": + deserialized = + adapterLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MarketLotSizeFilter": + deserialized = + adapterMarketLotSizeFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumAlgoOrdersFilter": + deserialized = + adapterMaxNumAlgoOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumIcebergOrdersFilter": + deserialized = + adapterMaxNumIcebergOrdersFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumOrderAmendsFilter": + deserialized = + adapterMaxNumOrderAmendsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumOrderListsFilter": + deserialized = + adapterMaxNumOrderListsFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxNumOrdersFilter": + deserialized = + adapterMaxNumOrdersFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MaxPositionFilter": + deserialized = + adapterMaxPositionFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "MinNotionalFilter": + deserialized = + adapterMinNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "NotionalFilter": + deserialized = + adapterNotionalFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PercentPriceBySideFilter": + deserialized = + adapterPercentPriceBySideFilter.fromJsonTree( + jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PercentPriceFilter": + deserialized = + adapterPercentPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "PriceFilter": + deserialized = adapterPriceFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "TPlusSellFilter": + deserialized = + adapterTPlusSellFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + case "TrailingDeltaFilter": + deserialized = + adapterTrailingDeltaFilter.fromJsonTree(jsonObject); + newSymbolFilters.setActualInstance(deserialized); + return newSymbolFilters; + default: + newSymbolFilters.setActualInstance(jsonElement.toString()); + log.log( + Level.WARNING, + String.format( + "Failed to lookup discriminator value `%s`" + + " for SymbolFilters. Possible values:" + + " ICEBERG_PARTS LOT_SIZE" + + " MARKET_LOT_SIZE MAX_NUM_ALGO_ORDERS" + + " MAX_NUM_ICEBERG_ORDERS" + + " MAX_NUM_ORDERS MAX_NUM_ORDER_AMENDS" + + " MAX_NUM_ORDER_LISTS MAX_POSITION" + + " MIN_NOTIONAL NOTIONAL PERCENT_PRICE" + + " PERCENT_PRICE_BY_SIDE PRICE_FILTER" + + " TRAILING_DELTA T_PLUS_SELL" + + " IcebergPartsFilter LotSizeFilter" + + " MarketLotSizeFilter" + + " MaxNumAlgoOrdersFilter" + + " MaxNumIcebergOrdersFilter" + + " MaxNumOrderAmendsFilter" + + " MaxNumOrderListsFilter" + + " MaxNumOrdersFilter" + + " MaxPositionFilter MinNotionalFilter" + + " NotionalFilter" + + " PercentPriceBySideFilter" + + " PercentPriceFilter PriceFilter" + + " TPlusSellFilter" + + " TrailingDeltaFilter. Falling back" + + " to String.", + jsonObject + .get("filterType") + .getAsString())); + } + } + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize PriceFilter + try { + // validate the JSON object to see if any exception is thrown + PriceFilter.validateJsonElement(jsonElement); + actualAdapter = adapterPriceFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'PriceFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PriceFilter failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'PriceFilter'", + e); + } + // deserialize PercentPriceFilter + try { + // validate the JSON object to see if any exception is thrown + PercentPriceFilter.validateJsonElement(jsonElement); + actualAdapter = adapterPercentPriceFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'PercentPriceFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PercentPriceFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'PercentPriceFilter'", + e); + } + // deserialize PercentPriceBySideFilter + try { + // validate the JSON object to see if any exception is thrown + PercentPriceBySideFilter.validateJsonElement(jsonElement); + actualAdapter = adapterPercentPriceBySideFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'PercentPriceBySideFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for PercentPriceBySideFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'PercentPriceBySideFilter'", + e); + } + // deserialize LotSizeFilter + try { + // validate the JSON object to see if any exception is thrown + LotSizeFilter.validateJsonElement(jsonElement); + actualAdapter = adapterLotSizeFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'LotSizeFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for LotSizeFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'LotSizeFilter'", + e); + } + // deserialize MinNotionalFilter + try { + // validate the JSON object to see if any exception is thrown + MinNotionalFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMinNotionalFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MinNotionalFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MinNotionalFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MinNotionalFilter'", + e); + } + // deserialize NotionalFilter + try { + // validate the JSON object to see if any exception is thrown + NotionalFilter.validateJsonElement(jsonElement); + actualAdapter = adapterNotionalFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'NotionalFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for NotionalFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'NotionalFilter'", + e); + } + // deserialize IcebergPartsFilter + try { + // validate the JSON object to see if any exception is thrown + IcebergPartsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterIcebergPartsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'IcebergPartsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for IcebergPartsFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'IcebergPartsFilter'", + e); + } + // deserialize MarketLotSizeFilter + try { + // validate the JSON object to see if any exception is thrown + MarketLotSizeFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMarketLotSizeFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MarketLotSizeFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MarketLotSizeFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MarketLotSizeFilter'", + e); + } + // deserialize MaxNumOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumOrdersFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxNumOrdersFilter'", + e); + } + // deserialize MaxNumAlgoOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumAlgoOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumAlgoOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumAlgoOrdersFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxNumAlgoOrdersFilter'", + e); + } + // deserialize MaxNumIcebergOrdersFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumIcebergOrdersFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumIcebergOrdersFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumIcebergOrdersFilter" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'MaxNumIcebergOrdersFilter'", + e); + } + // deserialize MaxPositionFilter + try { + // validate the JSON object to see if any exception is thrown + MaxPositionFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxPositionFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxPositionFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxPositionFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxPositionFilter'", + e); + } + // deserialize TrailingDeltaFilter + try { + // validate the JSON object to see if any exception is thrown + TrailingDeltaFilter.validateJsonElement(jsonElement); + actualAdapter = adapterTrailingDeltaFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'TrailingDeltaFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for TrailingDeltaFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'TrailingDeltaFilter'", + e); + } + // deserialize TPlusSellFilter + try { + // validate the JSON object to see if any exception is thrown + TPlusSellFilter.validateJsonElement(jsonElement); + actualAdapter = adapterTPlusSellFilter; + match++; + log.log(Level.FINER, "Input data matches schema 'TPlusSellFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for TPlusSellFilter failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'TPlusSellFilter'", + e); + } + // deserialize MaxNumOrderListsFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumOrderListsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumOrderListsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumOrderListsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderListsFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'MaxNumOrderListsFilter'", + e); + } + // deserialize MaxNumOrderAmendsFilter + try { + // validate the JSON object to see if any exception is thrown + MaxNumOrderAmendsFilter.validateJsonElement(jsonElement); + actualAdapter = adapterMaxNumOrderAmendsFilter; + match++; + log.log( + Level.FINER, + "Input data matches schema 'MaxNumOrderAmendsFilter'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderAmendsFilter failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'MaxNumOrderAmendsFilter'", + e); + } + + if (match == 1) { + SymbolFilters ret = new SymbolFilters(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for SymbolFilters: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public SymbolFilters() { + super("oneOf", Boolean.FALSE); + } + + public SymbolFilters(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("PriceFilter", PriceFilter.class); + schemas.put("PercentPriceFilter", PercentPriceFilter.class); + schemas.put("PercentPriceBySideFilter", PercentPriceBySideFilter.class); + schemas.put("LotSizeFilter", LotSizeFilter.class); + schemas.put("MinNotionalFilter", MinNotionalFilter.class); + schemas.put("NotionalFilter", NotionalFilter.class); + schemas.put("IcebergPartsFilter", IcebergPartsFilter.class); + schemas.put("MarketLotSizeFilter", MarketLotSizeFilter.class); + schemas.put("MaxNumOrdersFilter", MaxNumOrdersFilter.class); + schemas.put("MaxNumAlgoOrdersFilter", MaxNumAlgoOrdersFilter.class); + schemas.put("MaxNumIcebergOrdersFilter", MaxNumIcebergOrdersFilter.class); + schemas.put("MaxPositionFilter", MaxPositionFilter.class); + schemas.put("TrailingDeltaFilter", TrailingDeltaFilter.class); + schemas.put("TPlusSellFilter", TPlusSellFilter.class); + schemas.put("MaxNumOrderListsFilter", MaxNumOrderListsFilter.class); + schemas.put("MaxNumOrderAmendsFilter", MaxNumOrderAmendsFilter.class); + } + + @Override + public Map> getSchemas() { + return SymbolFilters.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter, + * MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter, MaxNumOrderAmendsFilter, + * MaxNumOrderListsFilter, MaxNumOrdersFilter, MaxPositionFilter, MinNotionalFilter, + * NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, TPlusSellFilter, + * TrailingDeltaFilter + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof PriceFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof PercentPriceFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof PercentPriceBySideFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LotSizeFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MinNotionalFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NotionalFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IcebergPartsFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MarketLotSizeFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumAlgoOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumIcebergOrdersFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxPositionFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TrailingDeltaFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TPlusSellFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumOrderListsFilter) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof MaxNumOrderAmendsFilter) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be IcebergPartsFilter, LotSizeFilter," + + " MarketLotSizeFilter, MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter," + + " MaxNumOrderAmendsFilter, MaxNumOrderListsFilter, MaxNumOrdersFilter," + + " MaxPositionFilter, MinNotionalFilter, NotionalFilter," + + " PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, TPlusSellFilter," + + " TrailingDeltaFilter"); + } + + /** + * Get the actual instance, which can be the following: IcebergPartsFilter, LotSizeFilter, + * MarketLotSizeFilter, MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter, + * MaxNumOrderAmendsFilter, MaxNumOrderListsFilter, MaxNumOrdersFilter, MaxPositionFilter, + * MinNotionalFilter, NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, + * TPlusSellFilter, TrailingDeltaFilter + * + * @return The actual instance (IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter, + * MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter, MaxNumOrderAmendsFilter, + * MaxNumOrderListsFilter, MaxNumOrdersFilter, MaxPositionFilter, MinNotionalFilter, + * NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter, PriceFilter, + * TPlusSellFilter, TrailingDeltaFilter) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `PriceFilter`. If the actual instance is not `PriceFilter`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `PriceFilter` + * @throws ClassCastException if the instance is not `PriceFilter` + */ + public PriceFilter getPriceFilter() throws ClassCastException { + return (PriceFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `PercentPriceFilter`. If the actual instance is not + * `PercentPriceFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `PercentPriceFilter` + * @throws ClassCastException if the instance is not `PercentPriceFilter` + */ + public PercentPriceFilter getPercentPriceFilter() throws ClassCastException { + return (PercentPriceFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `PercentPriceBySideFilter`. If the actual instance is not + * `PercentPriceBySideFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `PercentPriceBySideFilter` + * @throws ClassCastException if the instance is not `PercentPriceBySideFilter` + */ + public PercentPriceBySideFilter getPercentPriceBySideFilter() throws ClassCastException { + return (PercentPriceBySideFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `LotSizeFilter`. If the actual instance is not `LotSizeFilter`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LotSizeFilter` + * @throws ClassCastException if the instance is not `LotSizeFilter` + */ + public LotSizeFilter getLotSizeFilter() throws ClassCastException { + return (LotSizeFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MinNotionalFilter`. If the actual instance is not + * `MinNotionalFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MinNotionalFilter` + * @throws ClassCastException if the instance is not `MinNotionalFilter` + */ + public MinNotionalFilter getMinNotionalFilter() throws ClassCastException { + return (MinNotionalFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `NotionalFilter`. If the actual instance is not `NotionalFilter`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `NotionalFilter` + * @throws ClassCastException if the instance is not `NotionalFilter` + */ + public NotionalFilter getNotionalFilter() throws ClassCastException { + return (NotionalFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `IcebergPartsFilter`. If the actual instance is not + * `IcebergPartsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `IcebergPartsFilter` + * @throws ClassCastException if the instance is not `IcebergPartsFilter` + */ + public IcebergPartsFilter getIcebergPartsFilter() throws ClassCastException { + return (IcebergPartsFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MarketLotSizeFilter`. If the actual instance is not + * `MarketLotSizeFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MarketLotSizeFilter` + * @throws ClassCastException if the instance is not `MarketLotSizeFilter` + */ + public MarketLotSizeFilter getMarketLotSizeFilter() throws ClassCastException { + return (MarketLotSizeFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumOrdersFilter`. If the actual instance is not + * `MaxNumOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumOrdersFilter` + * @throws ClassCastException if the instance is not `MaxNumOrdersFilter` + */ + public MaxNumOrdersFilter getMaxNumOrdersFilter() throws ClassCastException { + return (MaxNumOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumAlgoOrdersFilter`. If the actual instance is not + * `MaxNumAlgoOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumAlgoOrdersFilter` + * @throws ClassCastException if the instance is not `MaxNumAlgoOrdersFilter` + */ + public MaxNumAlgoOrdersFilter getMaxNumAlgoOrdersFilter() throws ClassCastException { + return (MaxNumAlgoOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumIcebergOrdersFilter`. If the actual instance is not + * `MaxNumIcebergOrdersFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumIcebergOrdersFilter` + * @throws ClassCastException if the instance is not `MaxNumIcebergOrdersFilter` + */ + public MaxNumIcebergOrdersFilter getMaxNumIcebergOrdersFilter() throws ClassCastException { + return (MaxNumIcebergOrdersFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxPositionFilter`. If the actual instance is not + * `MaxPositionFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxPositionFilter` + * @throws ClassCastException if the instance is not `MaxPositionFilter` + */ + public MaxPositionFilter getMaxPositionFilter() throws ClassCastException { + return (MaxPositionFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `TrailingDeltaFilter`. If the actual instance is not + * `TrailingDeltaFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `TrailingDeltaFilter` + * @throws ClassCastException if the instance is not `TrailingDeltaFilter` + */ + public TrailingDeltaFilter getTrailingDeltaFilter() throws ClassCastException { + return (TrailingDeltaFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `TPlusSellFilter`. If the actual instance is not + * `TPlusSellFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `TPlusSellFilter` + * @throws ClassCastException if the instance is not `TPlusSellFilter` + */ + public TPlusSellFilter getTPlusSellFilter() throws ClassCastException { + return (TPlusSellFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumOrderListsFilter`. If the actual instance is not + * `MaxNumOrderListsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumOrderListsFilter` + * @throws ClassCastException if the instance is not `MaxNumOrderListsFilter` + */ + public MaxNumOrderListsFilter getMaxNumOrderListsFilter() throws ClassCastException { + return (MaxNumOrderListsFilter) super.getActualInstance(); + } + + /** + * Get the actual instance of `MaxNumOrderAmendsFilter`. If the actual instance is not + * `MaxNumOrderAmendsFilter`, the ClassCastException will be thrown. + * + * @return The actual instance of `MaxNumOrderAmendsFilter` + * @throws ClassCastException if the instance is not `MaxNumOrderAmendsFilter` + */ + public MaxNumOrderAmendsFilter getMaxNumOrderAmendsFilter() throws ClassCastException { + return (MaxNumOrderAmendsFilter) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SymbolFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with PriceFilter + try { + PriceFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PriceFilter failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with PercentPriceFilter + try { + PercentPriceFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PercentPriceFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with PercentPriceBySideFilter + try { + PercentPriceBySideFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for PercentPriceBySideFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with LotSizeFilter + try { + LotSizeFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for LotSizeFilter failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with MinNotionalFilter + try { + MinNotionalFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MinNotionalFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with NotionalFilter + try { + NotionalFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for NotionalFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with IcebergPartsFilter + try { + IcebergPartsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for IcebergPartsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MarketLotSizeFilter + try { + MarketLotSizeFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MarketLotSizeFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumOrdersFilter + try { + MaxNumOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumAlgoOrdersFilter + try { + MaxNumAlgoOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumAlgoOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumIcebergOrdersFilter + try { + MaxNumIcebergOrdersFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumIcebergOrdersFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxPositionFilter + try { + MaxPositionFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxPositionFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with TrailingDeltaFilter + try { + TrailingDeltaFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for TrailingDeltaFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with TPlusSellFilter + try { + TPlusSellFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for TPlusSellFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumOrderListsFilter + try { + MaxNumOrderListsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderListsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with MaxNumOrderAmendsFilter + try { + MaxNumOrderAmendsFilter.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for MaxNumOrderAmendsFilter failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for SymbolFilters with oneOf schemas:" + + " IcebergPartsFilter, LotSizeFilter, MarketLotSizeFilter," + + " MaxNumAlgoOrdersFilter, MaxNumIcebergOrdersFilter," + + " MaxNumOrderAmendsFilter, MaxNumOrderListsFilter," + + " MaxNumOrdersFilter, MaxPositionFilter, MinNotionalFilter," + + " NotionalFilter, PercentPriceBySideFilter, PercentPriceFilter," + + " PriceFilter, TPlusSellFilter, TrailingDeltaFilter. %d class(es)" + + " match the result, expected 1. Detailed failure message for" + + " oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of SymbolFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SymbolFilters + * @throws IOException if the JSON string is invalid with respect to SymbolFilters + */ + public static SymbolFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SymbolFilters.class); + } + + /** + * Convert an instance of SymbolFilters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/TPlusSellFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/TPlusSellFilter.java new file mode 100644 index 000000000..c3135581e --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/TPlusSellFilter.java @@ -0,0 +1,277 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** TPlusSellFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TPlusSellFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + + @SerializedName(SERIALIZED_NAME_END_TIME) + @jakarta.annotation.Nullable + private Long endTime; + + public TPlusSellFilter() {} + + public TPlusSellFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public TPlusSellFilter endTime(@jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * + * @return endTime + */ + @jakarta.annotation.Nullable + public Long getEndTime() { + return endTime; + } + + public void setEndTime(@jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TPlusSellFilter tplusSellFilter = (TPlusSellFilter) o; + return Objects.equals(this.filterType, tplusSellFilter.filterType) + && Objects.equals(this.endTime, tplusSellFilter.endTime); + } + + @Override + public int hashCode() { + return Objects.hash(filterType, endTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TPlusSellFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long endTimeValue = getEndTime(); + if (endTimeValue != null) { + String endTimeValueAsString = endTimeValue.toString(); + valMap.put("endTime", endTimeValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object endTimeValue = getEndTime(); + if (endTimeValue != null) { + valMap.put("endTime", endTimeValue); + } + + 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("filterType"); + openapiFields.add("endTime"); + + // 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 TPlusSellFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TPlusSellFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TPlusSellFilter is not found in the" + + " empty JSON string", + TPlusSellFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TPlusSellFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TPlusSellFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TPlusSellFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TPlusSellFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TPlusSellFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TPlusSellFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TPlusSellFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TPlusSellFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of TPlusSellFilter + * @throws IOException if the JSON string is invalid with respect to TPlusSellFilter + */ + public static TPlusSellFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TPlusSellFilter.class); + } + + /** + * Convert an instance of TPlusSellFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/TrailingDeltaFilter.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/TrailingDeltaFilter.java new file mode 100644 index 000000000..4df9f7953 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/TrailingDeltaFilter.java @@ -0,0 +1,409 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** TrailingDeltaFilter */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TrailingDeltaFilter extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; + + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) + @jakarta.annotation.Nullable + private Long minTrailingAboveDelta; + + public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; + + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) + @jakarta.annotation.Nullable + private Long maxTrailingAboveDelta; + + public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; + + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) + @jakarta.annotation.Nullable + private Long minTrailingBelowDelta; + + public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; + + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) + @jakarta.annotation.Nullable + private Long maxTrailingBelowDelta; + + public TrailingDeltaFilter() {} + + public TrailingDeltaFilter filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public TrailingDeltaFilter minTrailingAboveDelta( + @jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; + return this; + } + + /** + * Get minTrailingAboveDelta + * + * @return minTrailingAboveDelta + */ + @jakarta.annotation.Nullable + public Long getMinTrailingAboveDelta() { + return minTrailingAboveDelta; + } + + public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; + } + + public TrailingDeltaFilter maxTrailingAboveDelta( + @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; + return this; + } + + /** + * Get maxTrailingAboveDelta + * + * @return maxTrailingAboveDelta + */ + @jakarta.annotation.Nullable + public Long getMaxTrailingAboveDelta() { + return maxTrailingAboveDelta; + } + + public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; + } + + public TrailingDeltaFilter minTrailingBelowDelta( + @jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; + return this; + } + + /** + * Get minTrailingBelowDelta + * + * @return minTrailingBelowDelta + */ + @jakarta.annotation.Nullable + public Long getMinTrailingBelowDelta() { + return minTrailingBelowDelta; + } + + public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; + } + + public TrailingDeltaFilter maxTrailingBelowDelta( + @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; + return this; + } + + /** + * Get maxTrailingBelowDelta + * + * @return maxTrailingBelowDelta + */ + @jakarta.annotation.Nullable + public Long getMaxTrailingBelowDelta() { + return maxTrailingBelowDelta; + } + + public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrailingDeltaFilter trailingDeltaFilter = (TrailingDeltaFilter) o; + return Objects.equals(this.filterType, trailingDeltaFilter.filterType) + && Objects.equals( + this.minTrailingAboveDelta, trailingDeltaFilter.minTrailingAboveDelta) + && Objects.equals( + this.maxTrailingAboveDelta, trailingDeltaFilter.maxTrailingAboveDelta) + && Objects.equals( + this.minTrailingBelowDelta, trailingDeltaFilter.minTrailingBelowDelta) + && Objects.equals( + this.maxTrailingBelowDelta, trailingDeltaFilter.maxTrailingBelowDelta); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + minTrailingAboveDelta, + maxTrailingAboveDelta, + minTrailingBelowDelta, + maxTrailingBelowDelta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrailingDeltaFilter {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" minTrailingAboveDelta: ") + .append(toIndentedString(minTrailingAboveDelta)) + .append("\n"); + sb.append(" maxTrailingAboveDelta: ") + .append(toIndentedString(maxTrailingAboveDelta)) + .append("\n"); + sb.append(" minTrailingBelowDelta: ") + .append(toIndentedString(minTrailingBelowDelta)) + .append("\n"); + sb.append(" maxTrailingBelowDelta: ") + .append(toIndentedString(maxTrailingBelowDelta)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + Long minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + if (minTrailingAboveDeltaValue != null) { + String minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); + valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValueAsString); + } + Long maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + if (maxTrailingAboveDeltaValue != null) { + String maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); + valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValueAsString); + } + Long minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + if (minTrailingBelowDeltaValue != null) { + String minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); + valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValueAsString); + } + Long maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + if (maxTrailingBelowDeltaValue != null) { + String maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); + valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + if (minTrailingAboveDeltaValue != null) { + valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValue); + } + Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + if (maxTrailingAboveDeltaValue != null) { + valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValue); + } + Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + if (minTrailingBelowDeltaValue != null) { + valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValue); + } + Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + if (maxTrailingBelowDeltaValue != null) { + valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValue); + } + + 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("filterType"); + openapiFields.add("minTrailingAboveDelta"); + openapiFields.add("maxTrailingAboveDelta"); + openapiFields.add("minTrailingBelowDelta"); + openapiFields.add("maxTrailingBelowDelta"); + + // 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 TrailingDeltaFilter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrailingDeltaFilter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TrailingDeltaFilter is not found in" + + " the empty JSON string", + TrailingDeltaFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrailingDeltaFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TrailingDeltaFilter` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrailingDeltaFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrailingDeltaFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TrailingDeltaFilter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TrailingDeltaFilter value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrailingDeltaFilter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TrailingDeltaFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrailingDeltaFilter + * @throws IOException if the JSON string is invalid with respect to TrailingDeltaFilter + */ + public static TrailingDeltaFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrailingDeltaFilter.class); + } + + /** + * Convert an instance of TrailingDeltaFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/AccountApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/AccountApiTest.java index a309ab61f..8aaf9cd28 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/AccountApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/AccountApiTest.java @@ -125,7 +125,7 @@ public void accountCommissionTest() throws ApiException, CryptoException { @Test public void getAccountTest() throws ApiException, CryptoException { Boolean omitZeroBalances = false; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.getAccount(omitZeroBalances, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -162,7 +162,7 @@ public void myAllocationsTest() throws ApiException, CryptoException { Integer fromAllocationId = 1; Integer limit = 500; Long orderId = 1L; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.myAllocations( symbol, startTime, endTime, fromAllocationId, limit, orderId, recvWindow); @@ -206,7 +206,7 @@ public void myPreventedMatchesTest() throws ApiException, CryptoException { Long orderId = 1L; Long fromPreventedMatchId = 1L; Integer limit = 500; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.myPreventedMatches( symbol, preventedMatchId, orderId, fromPreventedMatchId, limit, recvWindow); @@ -245,7 +245,7 @@ public void myTradesTest() throws ApiException, CryptoException { Long endTime = 1735693200000L; Long fromId = 1L; Integer limit = 500; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.myTrades(symbol, orderId, startTime, endTime, fromId, limit, recvWindow); @@ -277,7 +277,7 @@ public void myTradesTest() throws ApiException, CryptoException { */ @Test public void rateLimitOrderTest() throws ApiException, CryptoException { - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.rateLimitOrder(recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -312,7 +312,7 @@ public void allOrderListTest() throws ApiException, CryptoException { Long startTime = 1735693200000L; Long endTime = 1735693200000L; Integer limit = 500; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.allOrderList(fromId, startTime, endTime, limit, recvWindow); @@ -349,7 +349,7 @@ public void allOrdersTest() throws ApiException, CryptoException { Long startTime = 1735693200000L; Long endTime = 1735693200000L; Integer limit = 500; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.allOrders(symbol, orderId, startTime, endTime, limit, recvWindow); @@ -383,7 +383,7 @@ public void allOrdersTest() throws ApiException, CryptoException { @Test public void getOpenOrdersTest() throws ApiException, CryptoException { String symbol = "BNBUSDT"; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.getOpenOrders(symbol, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -417,7 +417,7 @@ public void getOrderTest() throws ApiException, CryptoException { String symbol = "BNBUSDT"; Long orderId = 1L; String origClientOrderId = ""; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.getOrder(symbol, orderId, origClientOrderId, recvWindow); @@ -451,7 +451,7 @@ public void getOrderTest() throws ApiException, CryptoException { public void getOrderListTest() throws ApiException, CryptoException { Long orderListId = 1L; String origClientOrderId = ""; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.getOrderList(orderListId, origClientOrderId, recvWindow); @@ -483,7 +483,7 @@ public void getOrderListTest() throws ApiException, CryptoException { */ @Test public void openOrderListTest() throws ApiException, CryptoException { - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.openOrderList(recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/Ed25519ApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/Ed25519ApiTest.java index 5d92277a7..53c45f0c8 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/Ed25519ApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/Ed25519ApiTest.java @@ -62,7 +62,7 @@ public void ed25519WithoutPass() throws ApiException, URISyntaxException { AccountApi api = new AccountApi(apiClientSpy); Boolean omitZeroBalances = null; - Long recvWindow = null; + Double recvWindow = null; ApiResponse response = api.getAccount(omitZeroBalances, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture(), Mockito.any(Type.class)); @@ -112,7 +112,7 @@ public void ed25519WithPass() throws ApiException, URISyntaxException { AccountApi api = new AccountApi(apiClientSpy); Boolean omitZeroBalances = null; - Long recvWindow = null; + Double recvWindow = null; ApiResponse response = api.getAccount(omitZeroBalances, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture(), Mockito.any(Type.class)); diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/RSAApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/RSAApiTest.java index cd525e7a2..ecca201bf 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/RSAApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/RSAApiTest.java @@ -62,7 +62,7 @@ public void rsaWithoutPass() throws ApiException, URISyntaxException { AccountApi api = new AccountApi(apiClientSpy); Boolean omitZeroBalances = null; - Long recvWindow = null; + Double recvWindow = null; ApiResponse response = api.getAccount(omitZeroBalances, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture(), Mockito.any(Type.class)); @@ -112,7 +112,7 @@ public void rsaWithPass() throws ApiException, URISyntaxException { AccountApi api = new AccountApi(apiClientSpy); Boolean omitZeroBalances = null; - Long recvWindow = null; + Double recvWindow = null; ApiResponse response = api.getAccount(omitZeroBalances, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture(), Mockito.any(Type.class)); diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/TradeApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/TradeApiTest.java index ea3361c2a..f23875081 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/TradeApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/TradeApiTest.java @@ -123,7 +123,7 @@ public void initApiClient() throws ApiException { @Test public void deleteOpenOrdersTest() throws ApiException, CryptoException { String symbol = "BNBUSDT"; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.deleteOpenOrders(symbol, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -159,7 +159,7 @@ public void deleteOrderTest() throws ApiException, CryptoException { String origClientOrderId = ""; String newClientOrderId = ""; CancelRestrictions cancelRestrictions = CancelRestrictions.ONLY_NEW; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.deleteOrder( symbol, @@ -201,7 +201,7 @@ public void deleteOrderListTest() throws ApiException, CryptoException { Long orderListId = 1L; String listClientOrderId = ""; String newClientOrderId = ""; - Long recvWindow = 5000L; + Double recvWindow = 5000d; ApiResponse response = api.deleteOrderList( symbol, orderListId, listClientOrderId, newClientOrderId, recvWindow); diff --git a/clients/sub-account/CHANGELOG.md b/clients/sub-account/CHANGELOG.md index 279a1b974..3b175d2c4 100644 --- a/clients/sub-account/CHANGELOG.md +++ b/clients/sub-account/CHANGELOG.md @@ -1,6 +1,22 @@ # Changelog +## 4.0.0 - 2025-10-21 + +### Changed (2) + +- Modified parameter `email`: + - required: `true` → `false` + - affected methods: + - `querySubAccountTransactionStatistics()` (`GET /sapi/v1/sub-account/transaction-statistics`) +- Modified parameter `orderArgs`: + - item property `quantity` added + - item property `symbol` added + - item property `positionSide` added + - affected methods: + - `movePositionForSubAccount()` (`POST /sapi/v1/sub-account/futures/move-position`) + ## 3.0.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/sub-account/docs/AccountManagementApi.md b/clients/sub-account/docs/AccountManagementApi.md index 0bd18f285..55a4c6b38 100644 --- a/clients/sub-account/docs/AccountManagementApi.md +++ b/clients/sub-account/docs/AccountManagementApi.md @@ -487,7 +487,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); AccountManagementApi apiInstance = new AccountManagementApi(defaultClient); - String email = "email_example"; // String | [Sub-account email](#email-address) + String email = "email_example"; // String | Managed sub-account email Long recvWindow = 56L; // Long | try { QuerySubAccountTransactionStatisticsResponse result = apiInstance.querySubAccountTransactionStatistics(email, recvWindow); @@ -507,7 +507,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **email** | **String**| [Sub-account email](#email-address) | | +| **email** | **String**| Managed sub-account email | [optional] | | **recvWindow** | **Long**| | [optional] | ### Return type diff --git a/clients/sub-account/docs/OrderArgsInner.md b/clients/sub-account/docs/OrderArgsInner.md new file mode 100644 index 000000000..b348e0f04 --- /dev/null +++ b/clients/sub-account/docs/OrderArgsInner.md @@ -0,0 +1,15 @@ + + +# OrderArgsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**quantity** | **Double** | | [optional] | +|**positionSide** | **String** | | [optional] | + + + diff --git a/clients/sub-account/docs/rest-api/migration-guide.md b/clients/sub-account/docs/rest-api/migration-guide.md index 6bf784f4f..8ac03ed14 100644 --- a/clients/sub-account/docs/rest-api/migration-guide.md +++ b/clients/sub-account/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-sub-account - 3.0.1 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-sub-account - 3.0.1 + 4.0.0 ``` diff --git a/clients/sub-account/pom.xml b/clients/sub-account/pom.xml index 45612dfc9..b06796926 100644 --- a/clients/sub-account/pom.xml +++ b/clients/sub-account/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-sub-account sub-account - 3.0.1 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.1.1 \ No newline at end of file diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/JSON.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/JSON.java index dfb634f87..95789a3fe 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/JSON.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/JSON.java @@ -272,6 +272,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.sub_account.rest.model.OrderArgs .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.sub_account.rest.model.OrderArgsInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.sub_account.rest.model .QueryManagedSubAccountAssetDetailsResponse.CustomTypeAdapterFactory()); diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AccountManagementApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AccountManagementApi.java index bccca1d2c..c1f4c568d 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AccountManagementApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AccountManagementApi.java @@ -53,7 +53,7 @@ public class AccountManagementApi { private static final String USER_AGENT = String.format( - "binance-sub-account/3.0.1 (Java/%s; %s; %s)", + "binance-sub-account/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1161,7 +1161,7 @@ public ApiResponse querySubAccountList( /** * Build call for querySubAccountTransactionStatistics * - * @param email [Sub-account email](#email-address) (required) + * @param email Managed sub-account email (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1280,7 +1280,7 @@ private okhttp3.Call querySubAccountTransactionStatisticsValidateBeforeCall( * Query Sub-account Transaction Statistics (For Master Account) (USER_DATA) Query Sub-account * Transaction statistics (For Master Account). Weight: 60 * - * @param email [Sub-account email](#email-address) (required) + * @param email Managed sub-account email (optional) * @param recvWindow (optional) * @return ApiResponse<QuerySubAccountTransactionStatisticsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1297,7 +1297,7 @@ private okhttp3.Call querySubAccountTransactionStatisticsValidateBeforeCall( * Sub-account Transaction Statistics (For Master Account) (USER_DATA) Documentation */ public ApiResponse - querySubAccountTransactionStatistics(@NotNull String email, Long recvWindow) + querySubAccountTransactionStatistics(String email, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = querySubAccountTransactionStatisticsValidateBeforeCall(email, recvWindow); diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ApiManagementApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ApiManagementApi.java index a67090058..922c8ac8a 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ApiManagementApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ApiManagementApi.java @@ -46,7 +46,7 @@ public class ApiManagementApi { private static final String USER_AGENT = String.format( - "binance-sub-account/3.0.1 (Java/%s; %s; %s)", + "binance-sub-account/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApi.java index 7e038beeb..b8ca3f3ed 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApi.java @@ -74,7 +74,7 @@ public class AssetManagementApi { private static final String USER_AGENT = String.format( - "binance-sub-account/3.0.1 (Java/%s; %s; %s)", + "binance-sub-account/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ManagedSubAccountApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ManagedSubAccountApi.java index 5f434d3b1..08d318f6c 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ManagedSubAccountApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ManagedSubAccountApi.java @@ -56,7 +56,7 @@ public class ManagedSubAccountApi { private static final String USER_AGENT = String.format( - "binance-sub-account/3.0.1 (Java/%s; %s; %s)", + "binance-sub-account/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/SubAccountRestApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/SubAccountRestApi.java index af634f758..5b2e79735 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/SubAccountRestApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/SubAccountRestApi.java @@ -271,7 +271,7 @@ public ApiResponse querySubAccountList( * Query Sub-account Transaction Statistics (For Master Account) (USER_DATA) Query Sub-account * Transaction statistics (For Master Account). Weight: 60 * - * @param email [Sub-account email](#email-address) (required) + * @param email Managed sub-account email (optional) * @param recvWindow (optional) * @return ApiResponse<QuerySubAccountTransactionStatisticsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/model/OrderArgs.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/model/OrderArgs.java index 1b8c20630..a2bd7fa68 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/model/OrderArgs.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/model/OrderArgs.java @@ -35,7 +35,7 @@ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class OrderArgs extends ArrayList { +public class OrderArgs extends ArrayList { public OrderArgs() {} @Override @@ -116,13 +116,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray array = jsonElement.getAsJsonArray(); // validate array items for (JsonElement element : array) { - if (!element.getAsJsonPrimitive().isNumber()) { - throw new IllegalArgumentException( - String.format( - "Expected array items to be of type Number in the JSON string but" - + " got `%s`", - jsonElement.toString())); - } + OrderArgsInner.validateJsonElement(element); } if (jsonElement == null) { if (!OrderArgs.openapiRequiredFields diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/model/OrderArgsInner.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/model/OrderArgsInner.java new file mode 100644 index 000000000..3f5b18abc --- /dev/null +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/model/OrderArgsInner.java @@ -0,0 +1,283 @@ +/* + * Binance Sub Account REST API + * OpenAPI Specification for the Binance Sub Account REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.sub_account.rest.model; + +import com.binance.connector.client.sub_account.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** OrderArgsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderArgsInner { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private Double quantity; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public OrderArgsInner() {} + + public OrderArgsInner symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public OrderArgsInner quantity(@jakarta.annotation.Nullable Double quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + @Valid + public Double getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable Double quantity) { + this.quantity = quantity; + } + + public OrderArgsInner positionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderArgsInner orderArgsInner = (OrderArgsInner) o; + return Objects.equals(this.symbol, orderArgsInner.symbol) + && Objects.equals(this.quantity, orderArgsInner.quantity) + && Objects.equals(this.positionSide, orderArgsInner.positionSide); + } + + @Override + public int hashCode() { + return Objects.hash(symbol, quantity, positionSide); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderArgsInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("quantity"); + openapiFields.add("positionSide"); + + // 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 OrderArgsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderArgsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderArgsInner is not found in the" + + " empty JSON string", + OrderArgsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderArgsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderArgsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderArgsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderArgsInner value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderArgsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderArgsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderArgsInner + * @throws IOException if the JSON string is invalid with respect to OrderArgsInner + */ + public static OrderArgsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderArgsInner.class); + } + + /** + * Convert an instance of OrderArgsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/examples/auto-invest/pom.xml b/examples/auto-invest/pom.xml deleted file mode 100644 index 9de375a5b..000000000 --- a/examples/auto-invest/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - 4.0.0 - binance-auto-invest-examples - auto-invest - 1.0.0 - jar - - - io.github.binance - binance-connector-java-examples - 1.0.0 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - -parameters - - - - - - - - io.github.binance - binance-auto-invest - 1.1.0 - - - \ No newline at end of file diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetListOfPlansExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetListOfPlansExample.java deleted file mode 100644 index 8b9cb3f9a..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetListOfPlansExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.marketdata; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.GetListOfPlansResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for MarketDataApi */ -public class GetListOfPlansExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Get list of plans (USER_DATA) - * - *

Query plan lists * max one request every 3s per account Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void getListOfPlansExample() throws ApiException { - String planType = ""; - Long recvWindow = 5000L; - ApiResponse response = - getApi().getListOfPlans(planType, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetTargetAssetListExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetTargetAssetListExample.java deleted file mode 100644 index 4b0d63cec..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetTargetAssetListExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.marketdata; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.GetTargetAssetListResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for MarketDataApi */ -public class GetTargetAssetListExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Get target asset list(USER_DATA) - * - *

Get target asset list Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void getTargetAssetListExample() throws ApiException { - Long targetAsset = 0L; - Long size = 8L; - Long current = 1L; - Long recvWindow = 5000L; - ApiResponse response = - getApi().getTargetAssetList(targetAsset, size, current, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetTargetAssetRoiDataExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetTargetAssetRoiDataExample.java deleted file mode 100644 index 652491b72..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/GetTargetAssetRoiDataExample.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.marketdata; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.GetTargetAssetRoiDataResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for MarketDataApi */ -public class GetTargetAssetRoiDataExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Get target asset ROI data - * - *

ROI return list for target asset Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void getTargetAssetRoiDataExample() throws ApiException { - String targetAsset = ""; - String hisRoiType = ""; - Long recvWindow = 5000L; - ApiResponse response = - getApi().getTargetAssetRoiData(targetAsset, hisRoiType, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QueryAllSourceAssetAndTargetAssetExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QueryAllSourceAssetAndTargetAssetExample.java deleted file mode 100644 index f8d709c2a..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QueryAllSourceAssetAndTargetAssetExample.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.marketdata; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.QueryAllSourceAssetAndTargetAssetResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for MarketDataApi */ -public class QueryAllSourceAssetAndTargetAssetExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Query all source asset and target asset(USER_DATA) - * - *

Query all source assets and target assets Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void queryAllSourceAssetAndTargetAssetExample() throws ApiException { - Long recvWindow = 5000L; - ApiResponse response = - getApi().queryAllSourceAssetAndTargetAsset(recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QuerySourceAssetListExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QuerySourceAssetListExample.java deleted file mode 100644 index c09ff15a6..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QuerySourceAssetListExample.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.marketdata; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.QuerySourceAssetListResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for MarketDataApi */ -public class QuerySourceAssetListExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Query source asset list(USER_DATA) - * - *

Query Source Asset to be used for investment Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void querySourceAssetListExample() throws ApiException { - String usageType = ""; - Long targetAsset = 0L; - Long indexId = 1L; - Boolean flexibleAllowedToUse = true; - String sourceType = ""; - Long recvWindow = 5000L; - ApiResponse response = - getApi().querySourceAssetList( - usageType, - targetAsset, - indexId, - flexibleAllowedToUse, - sourceType, - recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/ChangePlanStatusExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/ChangePlanStatusExample.java deleted file mode 100644 index 6094bdc3e..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/ChangePlanStatusExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusRequest; -import com.binance.connector.client.auto_invest.rest.model.ChangePlanStatusResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class ChangePlanStatusExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Change Plan Status(TRADE) - * - *

Change Plan Status * max one request every 3s per account Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void changePlanStatusExample() throws ApiException { - ChangePlanStatusRequest changePlanStatusRequest = new ChangePlanStatusRequest(); - changePlanStatusRequest.planId(1L); - changePlanStatusRequest.status(""); - ApiResponse response = - getApi().changePlanStatus(changePlanStatusRequest); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRebalanceDetailsExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRebalanceDetailsExample.java deleted file mode 100644 index 82915202f..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRebalanceDetailsExample.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRebalanceDetailsResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class IndexLinkedPlanRebalanceDetailsExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Index Linked Plan Rebalance Details(USER_DATA) - * - *

Get the history of Index Linked Plan Redemption transactions * Max 30 day difference - * between `startTime` and `endTime` * If no `startTime` and - * `endTime`, default to show past 30 day records Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void indexLinkedPlanRebalanceDetailsExample() throws ApiException { - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - Long size = 8L; - Long recvWindow = 5000L; - ApiResponse response = - getApi().indexLinkedPlanRebalanceDetails( - startTime, endTime, current, size, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRedemptionExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRedemptionExample.java deleted file mode 100644 index 13a7e2973..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRedemptionExample.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionRequest; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class IndexLinkedPlanRedemptionExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Index Linked Plan Redemption(TRADE) - * - *

To redeem index-Linked plan holdings Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void indexLinkedPlanRedemptionExample() throws ApiException { - IndexLinkedPlanRedemptionRequest indexLinkedPlanRedemptionRequest = - new IndexLinkedPlanRedemptionRequest(); - indexLinkedPlanRedemptionRequest.indexId(1L); - indexLinkedPlanRedemptionRequest.redemptionPercentage(0L); - ApiResponse response = - getApi().indexLinkedPlanRedemption(indexLinkedPlanRedemptionRequest); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRedemptionTradeExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRedemptionTradeExample.java deleted file mode 100644 index 10bb6bba5..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/IndexLinkedPlanRedemptionTradeExample.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.IndexLinkedPlanRedemptionTradeResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class IndexLinkedPlanRedemptionTradeExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Index Linked Plan Redemption(USER_DATA) - * - *

Get the history of Index Linked Plan Redemption transactions * Max 30 day difference - * between `startTime` and `endTime` * If no `startTime` and - * `endTime`, default to show past 30 day records Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void indexLinkedPlanRedemptionTradeExample() throws ApiException { - Long requestId = 1L; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - String asset = ""; - Long size = 8L; - Long recvWindow = 5000L; - ApiResponse response = - getApi().indexLinkedPlanRedemptionTrade( - requestId, startTime, endTime, current, asset, size, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/InvestmentPlanAdjustmentExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/InvestmentPlanAdjustmentExample.java deleted file mode 100644 index 30c5697bd..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/InvestmentPlanAdjustmentExample.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.Details; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanAdjustmentRequest; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanAdjustmentResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class InvestmentPlanAdjustmentExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Investment plan adjustment(TRADE) - * - *

Query Source Asset to be used for investment * max one request every 3s per account - * Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void investmentPlanAdjustmentExample() throws ApiException { - InvestmentPlanAdjustmentRequest investmentPlanAdjustmentRequest = - new InvestmentPlanAdjustmentRequest(); - investmentPlanAdjustmentRequest.planId(1L); - investmentPlanAdjustmentRequest.subscriptionAmount(1d); - investmentPlanAdjustmentRequest.subscriptionCycle(""); - investmentPlanAdjustmentRequest.subscriptionStartTime(0L); - investmentPlanAdjustmentRequest.sourceAsset(""); - investmentPlanAdjustmentRequest.details(new Details()); - ApiResponse response = - getApi().investmentPlanAdjustment(investmentPlanAdjustmentRequest); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/InvestmentPlanCreationExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/InvestmentPlanCreationExample.java deleted file mode 100644 index 9c6811547..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/InvestmentPlanCreationExample.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.Details; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanCreationRequest; -import com.binance.connector.client.auto_invest.rest.model.InvestmentPlanCreationResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class InvestmentPlanCreationExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Investment plan creation(USER_DATA) - * - *

Post an investment plan creation * max one request every 3s per account Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void investmentPlanCreationExample() throws ApiException { - InvestmentPlanCreationRequest investmentPlanCreationRequest = - new InvestmentPlanCreationRequest(); - investmentPlanCreationRequest.sourceType(""); - investmentPlanCreationRequest.planType(""); - investmentPlanCreationRequest.subscriptionAmount(1d); - investmentPlanCreationRequest.subscriptionCycle(""); - investmentPlanCreationRequest.subscriptionStartTime(0L); - investmentPlanCreationRequest.sourceAsset(""); - investmentPlanCreationRequest.details(new Details()); - ApiResponse response = - getApi().investmentPlanCreation(investmentPlanCreationRequest); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/OneTimeTransactionExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/OneTimeTransactionExample.java deleted file mode 100644 index 4909b5d7b..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/OneTimeTransactionExample.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.Details; -import com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionRequest; -import com.binance.connector.client.auto_invest.rest.model.OneTimeTransactionResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class OneTimeTransactionExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * One Time Transaction(TRADE) - * - *

One time transaction * `planId`/`planId`/`details` must not - * all be null Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void oneTimeTransactionExample() throws ApiException { - OneTimeTransactionRequest oneTimeTransactionRequest = new OneTimeTransactionRequest(); - oneTimeTransactionRequest.sourceType(""); - oneTimeTransactionRequest.subscriptionAmount(1d); - oneTimeTransactionRequest.sourceAsset(""); - oneTimeTransactionRequest.details(new Details()); - ApiResponse response = - getApi().oneTimeTransaction(oneTimeTransactionRequest); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryHoldingDetailsOfThePlanExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryHoldingDetailsOfThePlanExample.java deleted file mode 100644 index 9fbb2d8a2..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryHoldingDetailsOfThePlanExample.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.QueryHoldingDetailsOfThePlanResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class QueryHoldingDetailsOfThePlanExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Query holding details of the plan(USER_DATA) - * - *

Query holding details of the plan Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void queryHoldingDetailsOfThePlanExample() throws ApiException { - Long planId = 1L; - String requestId = "1"; - Long recvWindow = 5000L; - ApiResponse response = - getApi().queryHoldingDetailsOfThePlan(planId, requestId, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryIndexLinkedPlanPositionDetailsExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryIndexLinkedPlanPositionDetailsExample.java deleted file mode 100644 index 25e044f14..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryIndexLinkedPlanPositionDetailsExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.QueryIndexLinkedPlanPositionDetailsResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class QueryIndexLinkedPlanPositionDetailsExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Query Index Linked Plan Position Details(USER_DATA) - * - *

Details on users Index-Linked plan position details Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void queryIndexLinkedPlanPositionDetailsExample() throws ApiException { - Long indexId = 1L; - Long recvWindow = 5000L; - ApiResponse response = - getApi().queryIndexLinkedPlanPositionDetails(indexId, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryOneTimeTransactionStatusExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryOneTimeTransactionStatusExample.java deleted file mode 100644 index fb7104ee4..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QueryOneTimeTransactionStatusExample.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.QueryOneTimeTransactionStatusResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class QueryOneTimeTransactionStatusExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Query One-Time Transaction Status(USER_DATA) - * - *

Transaction status for one-time transaction Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void queryOneTimeTransactionStatusExample() throws ApiException { - Long transactionId = 1L; - String requestId = "1"; - Long recvWindow = 5000L; - ApiResponse response = - getApi().queryOneTimeTransactionStatus(transactionId, requestId, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QuerySubscriptionTransactionHistoryExample.java b/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QuerySubscriptionTransactionHistoryExample.java deleted file mode 100644 index aeabaa1c7..000000000 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/trade/QuerySubscriptionTransactionHistoryExample.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.auto_invest.rest.trade; - -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.QuerySubscriptionTransactionHistoryResponse; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; - -/** API examples for TradeApi */ -public class QuerySubscriptionTransactionHistoryExample { - private AutoInvestRestApi api; - - public AutoInvestRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); - } - return api; - } - - /** - * Query subscription transaction history(USER_DATA) - * - *

Query subscription transaction history of a plan * Max span between startTime and endTime - * is 30days * If both startTime and endTime are null,then default is 30days Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void querySubscriptionTransactionHistoryExample() throws ApiException { - Long planId = 1L; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long targetAsset = 0L; - Long planType = 0L; - Long size = 8L; - Long current = 1L; - Long recvWindow = 5000L; - ApiResponse response = - getApi().querySubscriptionTransactionHistory( - planId, - startTime, - endTime, - targetAsset, - planType, - size, - current, - recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/derivatives-trading-coin-futures/pom.xml b/examples/derivatives-trading-coin-futures/pom.xml index 507077c5f..57203022b 100644 --- a/examples/derivatives-trading-coin-futures/pom.xml +++ b/examples/derivatives-trading-coin-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-coin-futures - 3.0.0 + 4.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-options/pom.xml b/examples/derivatives-trading-options/pom.xml index fde7cafbc..698ef3de1 100644 --- a/examples/derivatives-trading-options/pom.xml +++ b/examples/derivatives-trading-options/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-options - 3.0.0 + 4.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/NewBlockTradeOrderExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/NewBlockTradeOrderExample.java index de60feabd..f72f1a375 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/NewBlockTradeOrderExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/NewBlockTradeOrderExample.java @@ -21,7 +21,6 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.Legs; import com.binance.connector.client.derivatives_trading_options.rest.model.NewBlockTradeOrderRequest; import com.binance.connector.client.derivatives_trading_options.rest.model.NewBlockTradeOrderResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.Side; /** API examples for MarketMakerBlockTradeApi */ public class NewBlockTradeOrderExample { @@ -51,10 +50,6 @@ public void newBlockTradeOrderExample() throws ApiException { NewBlockTradeOrderRequest newBlockTradeOrderRequest = new NewBlockTradeOrderRequest(); newBlockTradeOrderRequest.liquidity(""); newBlockTradeOrderRequest.legs(new Legs()); - newBlockTradeOrderRequest.symbol(""); - newBlockTradeOrderRequest.side(Side.BUY); - newBlockTradeOrderRequest.price(1.0d); - newBlockTradeOrderRequest.quantity(1.0d); ApiResponse response = getApi().newBlockTradeOrder(newBlockTradeOrderRequest); System.out.println(response.getData()); diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersOnSpecificSymbolExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersOnSpecificSymbolExample.java index d236aedc2..02f27cc16 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersOnSpecificSymbolExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersOnSpecificSymbolExample.java @@ -40,7 +40,7 @@ public DerivativesTradingOptionsRestApi getApi() { /** * Cancel all Option orders on specific symbol (TRADE) * - *

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

Cancel all active order on a symbol. Weight: 5 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QueryCurrentOpenOptionOrdersExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QueryCurrentOpenOptionOrdersExample.java index 1bc772206..ca1d09596 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QueryCurrentOpenOptionOrdersExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QueryCurrentOpenOptionOrdersExample.java @@ -50,11 +50,10 @@ public void queryCurrentOpenOptionOrdersExample() throws ApiException { Long orderId = 1L; Long startTime = 1623319461670L; Long endTime = 1641782889000L; - Long limit = 100L; Long recvWindow = 5000L; ApiResponse response = getApi().queryCurrentOpenOptionOrders( - symbol, orderId, startTime, endTime, limit, recvWindow); + symbol, orderId, startTime, endTime, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-portfolio-margin-pro/pom.xml b/examples/derivatives-trading-portfolio-margin-pro/pom.xml index 34e91d259..b332210b7 100644 --- a/examples/derivatives-trading-portfolio-margin-pro/pom.xml +++ b/examples/derivatives-trading-portfolio-margin-pro/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-portfolio-margin-pro - 3.0.1 + 4.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/ChangeAutoRepayFuturesStatusExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/ChangeAutoRepayFuturesStatusExample.java index c12753799..fc40198c1 100644 --- a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/ChangeAutoRepayFuturesStatusExample.java +++ b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/ChangeAutoRepayFuturesStatusExample.java @@ -48,7 +48,7 @@ public DerivativesTradingPortfolioMarginProRestApi getApi() { public void changeAutoRepayFuturesStatusExample() throws ApiException { ChangeAutoRepayFuturesStatusRequest changeAutoRepayFuturesStatusRequest = new ChangeAutoRepayFuturesStatusRequest(); - changeAutoRepayFuturesStatusRequest.autoRepay(""); + changeAutoRepayFuturesStatusRequest.autoRepay("true"); ApiResponse response = getApi().changeAutoRepayFuturesStatus(changeAutoRepayFuturesStatusRequest); System.out.println(response.getData()); diff --git a/examples/derivatives-trading-usds-futures/pom.xml b/examples/derivatives-trading-usds-futures/pom.xml index 1fea47aed..278ed07de 100644 --- a/examples/derivatives-trading-usds-futures/pom.xml +++ b/examples/derivatives-trading-usds-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-usds-futures - 5.0.0 + 6.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java index 594b838ea..cd180a87e 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java @@ -53,7 +53,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { * `quantity` <= `executedQty` * When the order is `GTX` * and the new price will cause it to be executed immediately * One order can only be modfied * for less than 10000 times Weight: 1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min - * order rate limit(X-MBX-ORDER-COUNT-1M); 1 on IP rate limit(x-mbx-used-weight-1m) + * order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate limit(x-mbx-used-weight-1m) * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java index acda6f72b..18327a4f2 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java @@ -55,7 +55,7 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { * `quantity` <= `executedQty` * When the order is `GTX` * and the new price will cause it to be executed immediately * One order can only be modfied * for less than 10000 times Weight: 1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min - * order rate limit(X-MBX-ORDER-COUNT-1M); 1 on IP rate limit(x-mbx-used-weight-1m) + * order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate limit(x-mbx-used-weight-1m) */ public void modifyOrderExampleAsync() { ModifyOrderRequest modifyOrderRequest = new ModifyOrderRequest(); @@ -88,7 +88,7 @@ public void modifyOrderExampleAsync() { * `quantity` <= `executedQty` * When the order is `GTX` * and the new price will cause it to be executed immediately * One order can only be modfied * for less than 10000 times Weight: 1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min - * order rate limit(X-MBX-ORDER-COUNT-1M); 1 on IP rate limit(x-mbx-used-weight-1m) + * order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate limit(x-mbx-used-weight-1m) */ public void modifyOrderExampleSync() { ModifyOrderRequest modifyOrderRequest = new ModifyOrderRequest(); diff --git a/examples/pom.xml b/examples/pom.xml index 897272234..9c5ada716 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -16,7 +16,6 @@ algo - auto-invest c2c convert copy-trading diff --git a/examples/spot/pom.xml b/examples/spot/pom.xml index e65e4efeb..4a045c3b9 100644 --- a/examples/spot/pom.xml +++ b/examples/spot/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-spot - 6.0.0 + 7.0.0 \ No newline at end of file diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrderListExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrderListExample.java index 0bd979bc6..e02ed0bc7 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrderListExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrderListExample.java @@ -50,7 +50,7 @@ public void allOrderListExample() throws ApiException { Long startTime = 1735693200000L; Long endTime = 1735693200000L; Integer limit = 500; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().allOrderList(fromId, startTime, endTime, limit, recvWindow); System.out.println(response.getData()); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrdersExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrdersExample.java index bbdb57d76..8661939b6 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrdersExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrdersExample.java @@ -49,7 +49,7 @@ public void allOrdersExample() throws ApiException { Long startTime = 1735693200000L; Long endTime = 1735693200000L; Integer limit = 500; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().allOrders(symbol, orderId, startTime, endTime, limit, recvWindow); System.out.println(response.getData()); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetAccountExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetAccountExample.java index e78b57d34..faa60079e 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetAccountExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetAccountExample.java @@ -45,7 +45,7 @@ public SpotRestApi getApi() { */ public void getAccountExample() throws ApiException { Boolean omitZeroBalances = false; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().getAccount(omitZeroBalances, recvWindow); System.out.println(response.getData()); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOpenOrdersExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOpenOrdersExample.java index 96997e115..84270ea71 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOpenOrdersExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOpenOrdersExample.java @@ -46,7 +46,7 @@ public SpotRestApi getApi() { */ public void getOpenOrdersExample() throws ApiException { String symbol = "BNBUSDT"; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().getOpenOrders(symbol, recvWindow); System.out.println(response.getData()); } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderExample.java index 1357a836c..312384ad5 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderExample.java @@ -47,7 +47,7 @@ public void getOrderExample() throws ApiException { String symbol = "BNBUSDT"; Long orderId = 1L; String origClientOrderId = ""; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().getOrder(symbol, orderId, origClientOrderId, recvWindow); System.out.println(response.getData()); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderListExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderListExample.java index f043dacb2..f7af5a553 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderListExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderListExample.java @@ -46,7 +46,7 @@ public SpotRestApi getApi() { public void getOrderListExample() throws ApiException { Long orderListId = 1L; String origClientOrderId = ""; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().getOrderList(orderListId, origClientOrderId, recvWindow); System.out.println(response.getData()); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyAllocationsExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyAllocationsExample.java index ff40ff6aa..3ea885bf2 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyAllocationsExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyAllocationsExample.java @@ -50,7 +50,7 @@ public void myAllocationsExample() throws ApiException { Integer fromAllocationId = 1; Integer limit = 500; Long orderId = 1L; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().myAllocations( symbol, diff --git a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QueryIndexDetailsExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyFiltersExample.java similarity index 57% rename from examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QueryIndexDetailsExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyFiltersExample.java index de5dabda1..2f759bfb8 100644 --- a/examples/auto-invest/src/main/java/com/binance/connector/client/auto_invest/rest/marketdata/QueryIndexDetailsExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyFiltersExample.java @@ -10,45 +10,45 @@ * Do not edit the class manually. */ -package com.binance.connector.client.auto_invest.rest.marketdata; +package com.binance.connector.client.spot.rest.account; -import com.binance.connector.client.auto_invest.rest.AutoInvestRestApiUtil; -import com.binance.connector.client.auto_invest.rest.api.AutoInvestRestApi; -import com.binance.connector.client.auto_invest.rest.model.QueryIndexDetailsResponse; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.spot.rest.SpotRestApiUtil; +import com.binance.connector.client.spot.rest.api.SpotRestApi; +import com.binance.connector.client.spot.rest.model.MyFiltersResponse; -/** API examples for MarketDataApi */ -public class QueryIndexDetailsExample { - private AutoInvestRestApi api; +/** API examples for AccountApi */ +public class MyFiltersExample { + private SpotRestApi api; - public AutoInvestRestApi getApi() { + public SpotRestApi getApi() { if (api == null) { - ClientConfiguration clientConfiguration = - AutoInvestRestApiUtil.getClientConfiguration(); + ClientConfiguration clientConfiguration = SpotRestApiUtil.getClientConfiguration(); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("path/to/private.key"); clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new AutoInvestRestApi(clientConfiguration); + api = new SpotRestApi(clientConfiguration); } return api; } /** - * Query Index Details(USER_DATA) + * Query relevant filters * - *

Query index details Weight: 1 + *

Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This + * is the only endpoint that shows if an account has `MAX_ASSET` filters applied to + * it. Weight: 40 * * @throws ApiException if the Api call fails */ - public void queryIndexDetailsExample() throws ApiException { - Long indexId = 1L; - Long recvWindow = 5000L; - ApiResponse response = - getApi().queryIndexDetails(indexId, recvWindow); + public void myFiltersExample() throws ApiException { + String symbol = "BNBUSDT"; + Double recvWindow = 5000.0d; + ApiResponse response = getApi().myFilters(symbol, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyPreventedMatchesExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyPreventedMatchesExample.java index 1d1ec13f5..260386b64 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyPreventedMatchesExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyPreventedMatchesExample.java @@ -55,7 +55,7 @@ public void myPreventedMatchesExample() throws ApiException { Long orderId = 1L; Long fromPreventedMatchId = 1L; Integer limit = 500; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().myPreventedMatches( symbol, diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyTradesExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyTradesExample.java index abc6867c5..c0f291ee4 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyTradesExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyTradesExample.java @@ -51,7 +51,7 @@ public void myTradesExample() throws ApiException { Long endTime = 1735693200000L; Long fromId = 1L; Integer limit = 500; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().myTrades(symbol, orderId, startTime, endTime, fromId, limit, recvWindow); System.out.println(response.getData()); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OpenOrderListExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OpenOrderListExample.java index 0f84bdfa4..c6642cdfd 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OpenOrderListExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OpenOrderListExample.java @@ -44,7 +44,7 @@ public SpotRestApi getApi() { * @throws ApiException if the Api call fails */ public void openOrderListExample() throws ApiException { - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().openOrderList(recvWindow); System.out.println(response.getData()); } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OrderAmendmentsExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OrderAmendmentsExample.java index f95b667fb..f11c86413 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OrderAmendmentsExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OrderAmendmentsExample.java @@ -48,7 +48,7 @@ public void orderAmendmentsExample() throws ApiException { Long orderId = 1L; Long fromExecutionId = 1L; Long limit = 500L; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().orderAmendments(symbol, orderId, fromExecutionId, limit, recvWindow); System.out.println(response.getData()); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/RateLimitOrderExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/RateLimitOrderExample.java index 5cf502b38..3bdc85244 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/RateLimitOrderExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/RateLimitOrderExample.java @@ -44,7 +44,7 @@ public SpotRestApi getApi() { * @throws ApiException if the Api call fails */ public void rateLimitOrderExample() throws ApiException { - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().rateLimitOrder(recvWindow); System.out.println(response.getData()); } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOpenOrdersExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOpenOrdersExample.java index 5bb4c45e2..a7c459e5e 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOpenOrdersExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOpenOrdersExample.java @@ -46,7 +46,7 @@ public SpotRestApi getApi() { */ public void deleteOpenOrdersExample() throws ApiException { String symbol = "BNBUSDT"; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().deleteOpenOrders(symbol, recvWindow); System.out.println(response.getData()); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderExample.java index 2b3839838..00d03fc11 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderExample.java @@ -50,7 +50,7 @@ public void deleteOrderExample() throws ApiException { String origClientOrderId = ""; String newClientOrderId = ""; CancelRestrictions cancelRestrictions = CancelRestrictions.ONLY_NEW; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().deleteOrder( symbol, diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderListExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderListExample.java index bfa51c969..0d0c2a326 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderListExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderListExample.java @@ -48,7 +48,7 @@ public void deleteOrderListExample() throws ApiException { Long orderListId = 1L; String listClientOrderId = ""; String newClientOrderId = ""; - Long recvWindow = 5000L; + Double recvWindow = 5000.0d; ApiResponse response = getApi().deleteOrderList( symbol, diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/NewUserDataStreamExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/NewUserDataStreamExample.java index 9a60d30b3..4eab09e90 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/NewUserDataStreamExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/NewUserDataStreamExample.java @@ -40,7 +40,7 @@ public SpotRestApi getApi() { * Start user data stream * *

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is - * sent. Weight: 2 + * sent. This request does not require `signature`. Weight: 2 * * @throws ApiException if the Api call fails */ diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java index 5b65408e2..3c872340e 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/userdatastream/PutUserDataStreamExample.java @@ -39,7 +39,8 @@ public SpotRestApi getApi() { * Keepalive user data stream * *

Keepalive a user data stream to prevent a time out. User data streams will close after 60 - * minutes. It's recommended to send a ping about every 30 minutes. Weight: 2 + * minutes. It's recommended to send a ping about every 30 minutes. This request does not + * require `signature`. Weight: 2 * * @throws ApiException if the Api call fails */ diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyFiltersExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyFiltersExample.java new file mode 100644 index 000000000..5a219a60b --- /dev/null +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyFiltersExample.java @@ -0,0 +1,78 @@ +/* + * 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.account; + +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.MyFiltersRequest; +import com.binance.connector.client.spot.websocket.api.model.MyFiltersResponse; +import java.util.concurrent.CompletableFuture; + +/** API examples for AccountApi */ +public class MyFiltersExample { + 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 Query Relevant Filters + * + *

Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This + * is the only endpoint that shows if an account has `MAX_ASSET` filters applied to + * it. Weight: 40 + */ + public void myFiltersExampleAsync() { + MyFiltersRequest myFiltersRequest = new MyFiltersRequest(); + myFiltersRequest.symbol("BNBUSDT"); + CompletableFuture future = getApi().myFilters(myFiltersRequest); + future.handle( + (response, error) -> { + if (error != null) { + System.err.println(error); + } + System.out.println(response); + return response; + }); + } + + /** + * WebSocket Query Relevant Filters + * + *

Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This + * is the only endpoint that shows if an account has `MAX_ASSET` filters applied to + * it. Weight: 40 + */ + public void myFiltersExampleSync() { + MyFiltersRequest myFiltersRequest = new MyFiltersRequest(); + myFiltersRequest.symbol("BNBUSDT"); + CompletableFuture future = getApi().myFilters(myFiltersRequest); + MyFiltersResponse response = future.join(); + System.out.println(response); + } +} diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java index e21a32aae..608645fa4 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamPingExample.java @@ -46,7 +46,8 @@ public SpotWebSocketApi getApi() { *

Ping a user data stream to keep it alive. User data streams close automatically after 60 * minutes, even if you're listening to them on WebSocket Streams. In order to keep the * stream open, you have to regularly send pings using the `userDataStream.ping` - * request. It is recommended to send a ping once every 30 minutes. Weight: 2 + * request. It is recommended to send a ping once every 30 minutes. This request does not + * require `signature`. Weight: 2 */ public void userDataStreamPingExampleAsync() { UserDataStreamPingRequest userDataStreamPingRequest = new UserDataStreamPingRequest(); @@ -69,7 +70,8 @@ public void userDataStreamPingExampleAsync() { *

Ping a user data stream to keep it alive. User data streams close automatically after 60 * minutes, even if you're listening to them on WebSocket Streams. In order to keep the * stream open, you have to regularly send pings using the `userDataStream.ping` - * request. It is recommended to send a ping once every 30 minutes. Weight: 2 + * request. It is recommended to send a ping once every 30 minutes. This request does not + * require `signature`. Weight: 2 */ public void userDataStreamPingExampleSync() { UserDataStreamPingRequest userDataStreamPingRequest = new UserDataStreamPingRequest(); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java index 1841b51c1..1345fc92c 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStartExample.java @@ -42,7 +42,9 @@ public SpotWebSocketApi getApi() { /** * WebSocket Start user data stream * - *

Start a new user data stream. Weight: 2 + *

Start a new user data stream. Note the stream will close in 60 minutes unless + * `userDataStream.ping` requests are sent regularly. This request does not require + * `signature`. Weight: 2 */ public void userDataStreamStartExampleAsync() { CompletableFuture future = getApi().userDataStreamStart(); @@ -59,7 +61,9 @@ public void userDataStreamStartExampleAsync() { /** * WebSocket Start user data stream * - *

Start a new user data stream. Weight: 2 + *

Start a new user data stream. Note the stream will close in 60 minutes unless + * `userDataStream.ping` requests are sent regularly. This request does not require + * `signature`. Weight: 2 */ public void userDataStreamStartExampleSync() { CompletableFuture future = getApi().userDataStreamStart(); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java index aa9778142..c056e2ce9 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamStopExample.java @@ -43,7 +43,8 @@ public SpotWebSocketApi getApi() { /** * WebSocket Stop user data stream * - *

Explicitly stop and close the user data stream. Weight: 2 + *

Explicitly stop and close the user data stream. This request does not require + * `signature`. Weight: 2 */ public void userDataStreamStopExampleAsync() { UserDataStreamStopRequest userDataStreamStopRequest = new UserDataStreamStopRequest(); @@ -63,7 +64,8 @@ public void userDataStreamStopExampleAsync() { /** * WebSocket Stop user data stream * - *

Explicitly stop and close the user data stream. Weight: 2 + *

Explicitly stop and close the user data stream. This request does not require + * `signature`. Weight: 2 */ public void userDataStreamStopExampleSync() { UserDataStreamStopRequest userDataStreamStopRequest = new UserDataStreamStopRequest(); diff --git a/examples/sub-account/pom.xml b/examples/sub-account/pom.xml index 1630ab168..1f5859a3e 100644 --- a/examples/sub-account/pom.xml +++ b/examples/sub-account/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-sub-account - 3.0.1 + 4.0.0 \ No newline at end of file diff --git a/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/accountmanagement/QuerySubAccountTransactionStatisticsExample.java b/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/accountmanagement/QuerySubAccountTransactionStatisticsExample.java index 7c2903060..bf3a726ba 100644 --- a/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/accountmanagement/QuerySubAccountTransactionStatisticsExample.java +++ b/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/accountmanagement/QuerySubAccountTransactionStatisticsExample.java @@ -45,7 +45,7 @@ public SubAccountRestApi getApi() { * @throws ApiException if the Api call fails */ public void querySubAccountTransactionStatisticsExample() throws ApiException { - String email = "sub-account-email@email.com"; + String email = ""; Long recvWindow = 5000L; ApiResponse response = getApi().querySubAccountTransactionStatistics(email, recvWindow);