diff --git a/clients/wallet/CHANGELOG.md b/clients/wallet/CHANGELOG.md index 1e7ccf76..ca37bd3b 100644 --- a/clients/wallet/CHANGELOG.md +++ b/clients/wallet/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.0.0 - 2025-06-11 + +### Added (1) + +- `fetchAddressVerificationList()` (`GET /sapi/v1/addressVerify/list`) + ## 1.1.0 - 2025-05-02 - Update `binance/common` module to version `1.1.0`. @@ -8,4 +14,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/wallet/docs/rest-api/migration-guide.md b/clients/wallet/docs/rest-api/migration-guide.md index 7beb941c..3f27954a 100644 --- a/clients/wallet/docs/rest-api/migration-guide.md +++ b/clients/wallet/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-wallet - 1.1.0 + 2.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-wallet - 1.1.0 + 2.0.0 ``` diff --git a/clients/wallet/example_rest.md b/clients/wallet/example_rest.md index ec439562..f3878cf6 100644 --- a/clients/wallet/example_rest.md +++ b/clients/wallet/example_rest.md @@ -78,6 +78,8 @@ [GET /sapi/v1/localentity/deposit/history](https://developers.binance.com/docs/wallet/travel-rule/Deposit-History) - depositHistoryTravelRule - [DepositHistoryTravelRuleExample.java:51](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryTravelRuleExample.java#L51) +[GET /sapi/v1/addressVerify/list](https://developers.binance.com/docs/wallet/travel-rule/address-verification-list) - fetchAddressVerificationList - [FetchAddressVerificationListExample.java:46](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java#L46) + [GET /sapi/v1/localentity/vasp](https://developers.binance.com/docs/wallet/travel-rule/Onboarded-VASP-list) - onboardedVaspList - [OnboardedVaspListExample.java:52](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/OnboardedVaspListExample.java#L52) [PUT /sapi/v1/localentity/broker/deposit/provide-info](https://developers.binance.com/docs/wallet/travel-rule/deposit-provide-info) - submitDepositQuestionnaire - [SubmitDepositQuestionnaireExample.java:52](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireExample.java#L52) diff --git a/clients/wallet/pom.xml b/clients/wallet/pom.xml index 6a4e5f2c..6b57a2d9 100644 --- a/clients/wallet/pom.xml +++ b/clients/wallet/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-wallet wallet - 1.1.0 + 2.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.1.0 + 1.2.1 \ No newline at end of file diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java index bd017bb0..056c79b5 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java @@ -225,6 +225,16 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.EnableFastWithdrawSwitchRequest .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model + .FetchAddressVerificationListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model + .FetchAddressVerificationListResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model + .FetchAddressVerificationListResponseInnerAddressQuestionnaire + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model .FetchDepositAddressListWithNetworkResponse.CustomTypeAdapterFactory()); diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java index d14c359a..565a7463 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java @@ -49,7 +49,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-wallet/1.1.0 (Java/%s; %s; %s)", + "binance-wallet/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java index 499f0279..30817114 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java @@ -64,7 +64,7 @@ public class AssetApi { private static final String USER_AGENT = String.format( - "binance-wallet/1.1.0 (Java/%s; %s; %s)", + "binance-wallet/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java index 4e71158c..26ece09d 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java @@ -54,7 +54,7 @@ public class CapitalApi { private static final String USER_AGENT = String.format( - "binance-wallet/1.1.0 (Java/%s; %s; %s)", + "binance-wallet/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1404,7 +1404,8 @@ public ApiResponse withdraw(@Valid @NotNull WithdrawRequest wi * Build call for withdrawHistory * * @param coin (optional) - * @param withdrawOrderId (optional) + * @param withdrawOrderId client side id for withdrawal, if provided in POST + * `/sapi/v1/capital/withdraw/apply`, can be used here for query. (optional) * @param status 0(0:Email Sent, 2:Awaiting Approval 3:Rejected 4:Processing 6:Completed) * (optional) * @param offset Default: 0 (optional) @@ -1608,7 +1609,8 @@ private okhttp3.Call withdrawHistoryValidateBeforeCall( * 10 requests per second * * @param coin (optional) - * @param withdrawOrderId (optional) + * @param withdrawOrderId client side id for withdrawal, if provided in POST + * `/sapi/v1/capital/withdraw/apply`, can be used here for query. (optional) * @param status 0(0:Email Sent, 2:Awaiting Approval 3:Rejected 4:Processing 6:Completed) * (optional) * @param offset Default: 0 (optional) diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java index c0307beb..d0a647d3 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java @@ -43,7 +43,7 @@ public class OthersApi { private static final String USER_AGENT = String.format( - "binance-wallet/1.1.0 (Java/%s; %s; %s)", + "binance-wallet/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java index 3dfa6859..52baf7c1 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java @@ -23,6 +23,7 @@ import com.binance.connector.client.wallet.rest.model.BrokerWithdrawRequest; import com.binance.connector.client.wallet.rest.model.BrokerWithdrawResponse; import com.binance.connector.client.wallet.rest.model.DepositHistoryTravelRuleResponse; +import com.binance.connector.client.wallet.rest.model.FetchAddressVerificationListResponse; import com.binance.connector.client.wallet.rest.model.OnboardedVaspListResponse; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireRequest; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireResponse; @@ -55,7 +56,7 @@ public class TravelRuleApi { private static final String USER_AGENT = String.format( - "binance-wallet/1.1.0 (Java/%s; %s; %s)", + "binance-wallet/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -574,6 +575,136 @@ public ApiResponse depositHistoryTravelRule( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for fetchAddressVerificationList + * + * @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 Fetch address verification list -
+ * + * @see Fetch + * address verification list (USER_DATA) Documentation + */ + private okhttp3.Call fetchAddressVerificationListCall() 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/addressVerify/list"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (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 fetchAddressVerificationListValidateBeforeCall() throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {}; + Method method = this.getClass().getMethod("fetchAddressVerificationList"); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return fetchAddressVerificationListCall(); + } 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()); + } + } + + /** + * Fetch address verification list (USER_DATA) Fetch address verification list Weight: 10 + * + * @return ApiResponse<FetchAddressVerificationListResponse> + * @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 Fetch address verification list -
+ * + * @see Fetch + * address verification list (USER_DATA) Documentation + */ + public ApiResponse fetchAddressVerificationList() + throws ApiException { + okhttp3.Call localVarCall = fetchAddressVerificationListValidateBeforeCall(); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for onboardedVaspList * @@ -1076,7 +1207,8 @@ private okhttp3.Call submitDepositQuestionnaireTravelRuleValidateBeforeCall( * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) - * @param withdrawOrderId (optional) + * @param withdrawOrderId client side id for withdrawal, if provided in POST + * `/sapi/v1/capital/withdraw/apply`, can be used here for query. (optional) * @param network (optional) * @param coin (optional) * @param travelRuleStatus 0:Completed,1:Pending,2:Failed (optional) @@ -1309,7 +1441,8 @@ private okhttp3.Call withdrawHistoryV1ValidateBeforeCall( * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) - * @param withdrawOrderId (optional) + * @param withdrawOrderId client side id for withdrawal, if provided in POST + * `/sapi/v1/capital/withdraw/apply`, can be used here for query. (optional) * @param network (optional) * @param coin (optional) * @param travelRuleStatus 0:Completed,1:Pending,2:Failed (optional) @@ -1369,7 +1502,8 @@ public ApiResponse withdrawHistoryV1( * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) - * @param withdrawOrderId (optional) + * @param withdrawOrderId client side id for withdrawal, if provided in POST + * `/sapi/v1/capital/withdraw/apply`, can be used here for query. (optional) * @param network (optional) * @param coin (optional) * @param travelRuleStatus 0:Completed,1:Pending,2:Failed (optional) @@ -1608,7 +1742,8 @@ private okhttp3.Call withdrawHistoryV2ValidateBeforeCall( * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) - * @param withdrawOrderId (optional) + * @param withdrawOrderId client side id for withdrawal, if provided in POST + * `/sapi/v1/capital/withdraw/apply`, can be used here for query. (optional) * @param network (optional) * @param coin (optional) * @param travelRuleStatus 0:Completed,1:Pending,2:Failed (optional) diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java index 5b2d139b..a4ce500a 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java @@ -22,6 +22,7 @@ import com.binance.connector.client.wallet.rest.model.DustTransferResponse; import com.binance.connector.client.wallet.rest.model.DustlogResponse; import com.binance.connector.client.wallet.rest.model.EnableFastWithdrawSwitchRequest; +import com.binance.connector.client.wallet.rest.model.FetchAddressVerificationListResponse; import com.binance.connector.client.wallet.rest.model.FetchDepositAddressListWithNetworkResponse; import com.binance.connector.client.wallet.rest.model.FetchWithdrawAddressListResponse; import com.binance.connector.client.wallet.rest.model.FetchWithdrawQuotaResponse; @@ -924,7 +925,8 @@ public ApiResponse withdraw(WithdrawRequest withdrawRequest) * 10 requests per second * * @param coin (optional) - * @param withdrawOrderId (optional) + * @param withdrawOrderId client side id for withdrawal, if provided in POST + * `/sapi/v1/capital/withdraw/apply`, can be used here for query. (optional) * @param status 0(0:Email Sent, 2:Awaiting Approval 3:Rejected 4:Processing 6:Completed) * (optional) * @param offset Default: 0 (optional) @@ -1103,6 +1105,28 @@ public ApiResponse depositHistoryTravelRule( limit); } + /** + * Fetch address verification list (USER_DATA) Fetch address verification list Weight: 10 + * + * @return ApiResponse<FetchAddressVerificationListResponse> + * @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 Fetch address verification list -
+ * + * @see Fetch + * address verification list (USER_DATA) Documentation + */ + public ApiResponse fetchAddressVerificationList() + throws ApiException { + return travelRuleApi.fetchAddressVerificationList(); + } + /** * Onboarded VASP list (for local entities that require travel rule) (supporting network) * (USER_DATA) Fetch the onboarded VASP list for local entities that required travel rule. * @@ -1208,7 +1232,8 @@ public ApiResponse submitDepositQuestionnair * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) - * @param withdrawOrderId (optional) + * @param withdrawOrderId client side id for withdrawal, if provided in POST + * `/sapi/v1/capital/withdraw/apply`, can be used here for query. (optional) * @param network (optional) * @param coin (optional) * @param travelRuleStatus 0:Completed,1:Pending,2:Failed (optional) @@ -1279,7 +1304,8 @@ public ApiResponse withdrawHistoryV1( * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) - * @param withdrawOrderId (optional) + * @param withdrawOrderId client side id for withdrawal, if provided in POST + * `/sapi/v1/capital/withdraw/apply`, can be used here for query. (optional) * @param network (optional) * @param coin (optional) * @param travelRuleStatus 0:Completed,1:Pending,2:Failed (optional) diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/FetchAddressVerificationListResponse.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/FetchAddressVerificationListResponse.java new file mode 100644 index 00000000..14163adf --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/FetchAddressVerificationListResponse.java @@ -0,0 +1,194 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet 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.wallet.rest.model; + +import com.binance.connector.client.wallet.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.*; + +/** FetchAddressVerificationListResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FetchAddressVerificationListResponse + extends ArrayList { + public FetchAddressVerificationListResponse() {} + + @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 FetchAddressVerificationListResponse {\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 + * FetchAddressVerificationListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FetchAddressVerificationListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FetchAddressVerificationListResponse" + + " is not found in the empty JSON string", + FetchAddressVerificationListResponse.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FetchAddressVerificationListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FetchAddressVerificationListResponse` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FetchAddressVerificationListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FetchAddressVerificationListResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(FetchAddressVerificationListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, FetchAddressVerificationListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FetchAddressVerificationListResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FetchAddressVerificationListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FetchAddressVerificationListResponse + * @throws IOException if the JSON string is invalid with respect to + * FetchAddressVerificationListResponse + */ + public static FetchAddressVerificationListResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, FetchAddressVerificationListResponse.class); + } + + /** + * Convert an instance of FetchAddressVerificationListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/FetchAddressVerificationListResponseInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/FetchAddressVerificationListResponseInner.java new file mode 100644 index 00000000..351eb0c7 --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/FetchAddressVerificationListResponseInner.java @@ -0,0 +1,413 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet 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.wallet.rest.model; + +import com.binance.connector.client.wallet.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.*; + +/** FetchAddressVerificationListResponseInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FetchAddressVerificationListResponseInner { + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + + @SerializedName(SERIALIZED_NAME_TOKEN) + @jakarta.annotation.Nullable + private String token; + + public static final String SERIALIZED_NAME_NETWORK = "network"; + + @SerializedName(SERIALIZED_NAME_NETWORK) + @jakarta.annotation.Nullable + private String network; + + public static final String SERIALIZED_NAME_WALLET_ADDRESS = "walletAddress"; + + @SerializedName(SERIALIZED_NAME_WALLET_ADDRESS) + @jakarta.annotation.Nullable + private String walletAddress; + + public static final String SERIALIZED_NAME_ADDRESS_QUESTIONNAIRE = "addressQuestionnaire"; + + @SerializedName(SERIALIZED_NAME_ADDRESS_QUESTIONNAIRE) + @jakarta.annotation.Nullable + private FetchAddressVerificationListResponseInnerAddressQuestionnaire addressQuestionnaire; + + public FetchAddressVerificationListResponseInner() {} + + public FetchAddressVerificationListResponseInner 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 FetchAddressVerificationListResponseInner token( + @jakarta.annotation.Nullable String token) { + this.token = token; + return this; + } + + /** + * Get token + * + * @return token + */ + @jakarta.annotation.Nullable + public String getToken() { + return token; + } + + public void setToken(@jakarta.annotation.Nullable String token) { + this.token = token; + } + + public FetchAddressVerificationListResponseInner network( + @jakarta.annotation.Nullable String network) { + this.network = network; + return this; + } + + /** + * Get network + * + * @return network + */ + @jakarta.annotation.Nullable + public String getNetwork() { + return network; + } + + public void setNetwork(@jakarta.annotation.Nullable String network) { + this.network = network; + } + + public FetchAddressVerificationListResponseInner walletAddress( + @jakarta.annotation.Nullable String walletAddress) { + this.walletAddress = walletAddress; + return this; + } + + /** + * Get walletAddress + * + * @return walletAddress + */ + @jakarta.annotation.Nullable + public String getWalletAddress() { + return walletAddress; + } + + public void setWalletAddress(@jakarta.annotation.Nullable String walletAddress) { + this.walletAddress = walletAddress; + } + + public FetchAddressVerificationListResponseInner addressQuestionnaire( + @jakarta.annotation.Nullable + FetchAddressVerificationListResponseInnerAddressQuestionnaire + addressQuestionnaire) { + this.addressQuestionnaire = addressQuestionnaire; + return this; + } + + /** + * Get addressQuestionnaire + * + * @return addressQuestionnaire + */ + @jakarta.annotation.Nullable + @Valid + public FetchAddressVerificationListResponseInnerAddressQuestionnaire getAddressQuestionnaire() { + return addressQuestionnaire; + } + + public void setAddressQuestionnaire( + @jakarta.annotation.Nullable + FetchAddressVerificationListResponseInnerAddressQuestionnaire + addressQuestionnaire) { + this.addressQuestionnaire = addressQuestionnaire; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FetchAddressVerificationListResponseInner fetchAddressVerificationListResponseInner = + (FetchAddressVerificationListResponseInner) o; + return Objects.equals(this.status, fetchAddressVerificationListResponseInner.status) + && Objects.equals(this.token, fetchAddressVerificationListResponseInner.token) + && Objects.equals(this.network, fetchAddressVerificationListResponseInner.network) + && Objects.equals( + this.walletAddress, fetchAddressVerificationListResponseInner.walletAddress) + && Objects.equals( + this.addressQuestionnaire, + fetchAddressVerificationListResponseInner.addressQuestionnaire); + } + + @Override + public int hashCode() { + return Objects.hash(status, token, network, walletAddress, addressQuestionnaire); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FetchAddressVerificationListResponseInner {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" walletAddress: ").append(toIndentedString(walletAddress)).append("\n"); + sb.append(" addressQuestionnaire: ") + .append(toIndentedString(addressQuestionnaire)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object tokenValue = getToken(); + String tokenValueAsString = ""; + tokenValueAsString = tokenValue.toString(); + sb.append("token=").append(urlEncode(tokenValueAsString)).append(""); + Object networkValue = getNetwork(); + String networkValueAsString = ""; + networkValueAsString = networkValue.toString(); + sb.append("network=").append(urlEncode(networkValueAsString)).append(""); + Object walletAddressValue = getWalletAddress(); + String walletAddressValueAsString = ""; + walletAddressValueAsString = walletAddressValue.toString(); + sb.append("walletAddress=").append(urlEncode(walletAddressValueAsString)).append(""); + Object addressQuestionnaireValue = getAddressQuestionnaire(); + String addressQuestionnaireValueAsString = ""; + addressQuestionnaireValueAsString = addressQuestionnaireValue.toString(); + sb.append("addressQuestionnaire=") + .append(urlEncode(addressQuestionnaireValueAsString)) + .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("status"); + openapiFields.add("token"); + openapiFields.add("network"); + openapiFields.add("walletAddress"); + openapiFields.add("addressQuestionnaire"); + + // 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 + * FetchAddressVerificationListResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FetchAddressVerificationListResponseInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " FetchAddressVerificationListResponseInner is not found in" + + " the empty JSON string", + FetchAddressVerificationListResponseInner.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FetchAddressVerificationListResponseInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FetchAddressVerificationListResponseInner` 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())); + } + if ((jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) + && !jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `token` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("token").toString())); + } + if ((jsonObj.get("network") != null && !jsonObj.get("network").isJsonNull()) + && !jsonObj.get("network").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `network` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("network").toString())); + } + if ((jsonObj.get("walletAddress") != null && !jsonObj.get("walletAddress").isJsonNull()) + && !jsonObj.get("walletAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `walletAddress` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("walletAddress").toString())); + } + // validate the optional field `addressQuestionnaire` + if (jsonObj.get("addressQuestionnaire") != null + && !jsonObj.get("addressQuestionnaire").isJsonNull()) { + FetchAddressVerificationListResponseInnerAddressQuestionnaire.validateJsonElement( + jsonObj.get("addressQuestionnaire")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FetchAddressVerificationListResponseInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'FetchAddressVerificationListResponseInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(FetchAddressVerificationListResponseInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, FetchAddressVerificationListResponseInner value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FetchAddressVerificationListResponseInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FetchAddressVerificationListResponseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of FetchAddressVerificationListResponseInner + * @throws IOException if the JSON string is invalid with respect to + * FetchAddressVerificationListResponseInner + */ + public static FetchAddressVerificationListResponseInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, FetchAddressVerificationListResponseInner.class); + } + + /** + * Convert an instance of FetchAddressVerificationListResponseInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/FetchAddressVerificationListResponseInnerAddressQuestionnaire.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/FetchAddressVerificationListResponseInnerAddressQuestionnaire.java new file mode 100644 index 00000000..54561180 --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/FetchAddressVerificationListResponseInnerAddressQuestionnaire.java @@ -0,0 +1,360 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet 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.wallet.rest.model; + +import com.binance.connector.client.wallet.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.*; + +/** FetchAddressVerificationListResponseInnerAddressQuestionnaire */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FetchAddressVerificationListResponseInnerAddressQuestionnaire { + public static final String SERIALIZED_NAME_SEND_TO = "sendTo"; + + @SerializedName(SERIALIZED_NAME_SEND_TO) + @jakarta.annotation.Nullable + private Long sendTo; + + public static final String SERIALIZED_NAME_SATOSHI_TOKEN = "satoshiToken"; + + @SerializedName(SERIALIZED_NAME_SATOSHI_TOKEN) + @jakarta.annotation.Nullable + private String satoshiToken; + + public static final String SERIALIZED_NAME_IS_ADDRESS_OWNER = "isAddressOwner"; + + @SerializedName(SERIALIZED_NAME_IS_ADDRESS_OWNER) + @jakarta.annotation.Nullable + private Long isAddressOwner; + + public static final String SERIALIZED_NAME_VERIFY_METHOD = "verifyMethod"; + + @SerializedName(SERIALIZED_NAME_VERIFY_METHOD) + @jakarta.annotation.Nullable + private Long verifyMethod; + + public FetchAddressVerificationListResponseInnerAddressQuestionnaire() {} + + public FetchAddressVerificationListResponseInnerAddressQuestionnaire sendTo( + @jakarta.annotation.Nullable Long sendTo) { + this.sendTo = sendTo; + return this; + } + + /** + * Get sendTo + * + * @return sendTo + */ + @jakarta.annotation.Nullable + public Long getSendTo() { + return sendTo; + } + + public void setSendTo(@jakarta.annotation.Nullable Long sendTo) { + this.sendTo = sendTo; + } + + public FetchAddressVerificationListResponseInnerAddressQuestionnaire satoshiToken( + @jakarta.annotation.Nullable String satoshiToken) { + this.satoshiToken = satoshiToken; + return this; + } + + /** + * Get satoshiToken + * + * @return satoshiToken + */ + @jakarta.annotation.Nullable + public String getSatoshiToken() { + return satoshiToken; + } + + public void setSatoshiToken(@jakarta.annotation.Nullable String satoshiToken) { + this.satoshiToken = satoshiToken; + } + + public FetchAddressVerificationListResponseInnerAddressQuestionnaire isAddressOwner( + @jakarta.annotation.Nullable Long isAddressOwner) { + this.isAddressOwner = isAddressOwner; + return this; + } + + /** + * Get isAddressOwner + * + * @return isAddressOwner + */ + @jakarta.annotation.Nullable + public Long getIsAddressOwner() { + return isAddressOwner; + } + + public void setIsAddressOwner(@jakarta.annotation.Nullable Long isAddressOwner) { + this.isAddressOwner = isAddressOwner; + } + + public FetchAddressVerificationListResponseInnerAddressQuestionnaire verifyMethod( + @jakarta.annotation.Nullable Long verifyMethod) { + this.verifyMethod = verifyMethod; + return this; + } + + /** + * Get verifyMethod + * + * @return verifyMethod + */ + @jakarta.annotation.Nullable + public Long getVerifyMethod() { + return verifyMethod; + } + + public void setVerifyMethod(@jakarta.annotation.Nullable Long verifyMethod) { + this.verifyMethod = verifyMethod; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FetchAddressVerificationListResponseInnerAddressQuestionnaire + fetchAddressVerificationListResponseInnerAddressQuestionnaire = + (FetchAddressVerificationListResponseInnerAddressQuestionnaire) o; + return Objects.equals( + this.sendTo, + fetchAddressVerificationListResponseInnerAddressQuestionnaire.sendTo) + && Objects.equals( + this.satoshiToken, + fetchAddressVerificationListResponseInnerAddressQuestionnaire.satoshiToken) + && Objects.equals( + this.isAddressOwner, + fetchAddressVerificationListResponseInnerAddressQuestionnaire + .isAddressOwner) + && Objects.equals( + this.verifyMethod, + fetchAddressVerificationListResponseInnerAddressQuestionnaire.verifyMethod); + } + + @Override + public int hashCode() { + return Objects.hash(sendTo, satoshiToken, isAddressOwner, verifyMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FetchAddressVerificationListResponseInnerAddressQuestionnaire {\n"); + sb.append(" sendTo: ").append(toIndentedString(sendTo)).append("\n"); + sb.append(" satoshiToken: ").append(toIndentedString(satoshiToken)).append("\n"); + sb.append(" isAddressOwner: ").append(toIndentedString(isAddressOwner)).append("\n"); + sb.append(" verifyMethod: ").append(toIndentedString(verifyMethod)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object sendToValue = getSendTo(); + String sendToValueAsString = ""; + sendToValueAsString = sendToValue.toString(); + sb.append("sendTo=").append(urlEncode(sendToValueAsString)).append(""); + Object satoshiTokenValue = getSatoshiToken(); + String satoshiTokenValueAsString = ""; + satoshiTokenValueAsString = satoshiTokenValue.toString(); + sb.append("satoshiToken=").append(urlEncode(satoshiTokenValueAsString)).append(""); + Object isAddressOwnerValue = getIsAddressOwner(); + String isAddressOwnerValueAsString = ""; + isAddressOwnerValueAsString = isAddressOwnerValue.toString(); + sb.append("isAddressOwner=").append(urlEncode(isAddressOwnerValueAsString)).append(""); + Object verifyMethodValue = getVerifyMethod(); + String verifyMethodValueAsString = ""; + verifyMethodValueAsString = verifyMethodValue.toString(); + sb.append("verifyMethod=").append(urlEncode(verifyMethodValueAsString)).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("sendTo"); + openapiFields.add("satoshiToken"); + openapiFields.add("isAddressOwner"); + openapiFields.add("verifyMethod"); + + // 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 + * FetchAddressVerificationListResponseInnerAddressQuestionnaire + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FetchAddressVerificationListResponseInnerAddressQuestionnaire.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " FetchAddressVerificationListResponseInnerAddressQuestionnaire" + + " is not found in the empty JSON string", + FetchAddressVerificationListResponseInnerAddressQuestionnaire + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FetchAddressVerificationListResponseInnerAddressQuestionnaire.openapiFields + .contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FetchAddressVerificationListResponseInnerAddressQuestionnaire`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("satoshiToken") != null && !jsonObj.get("satoshiToken").isJsonNull()) + && !jsonObj.get("satoshiToken").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `satoshiToken` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("satoshiToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FetchAddressVerificationListResponseInnerAddressQuestionnaire.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'FetchAddressVerificationListResponseInnerAddressQuestionnaire' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + FetchAddressVerificationListResponseInnerAddressQuestionnaire + .class)); + + return (TypeAdapter) + new TypeAdapter< + FetchAddressVerificationListResponseInnerAddressQuestionnaire>() { + @Override + public void write( + JsonWriter out, + FetchAddressVerificationListResponseInnerAddressQuestionnaire value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FetchAddressVerificationListResponseInnerAddressQuestionnaire read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FetchAddressVerificationListResponseInnerAddressQuestionnaire given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of FetchAddressVerificationListResponseInnerAddressQuestionnaire + * @throws IOException if the JSON string is invalid with respect to + * FetchAddressVerificationListResponseInnerAddressQuestionnaire + */ + public static FetchAddressVerificationListResponseInnerAddressQuestionnaire fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + FetchAddressVerificationListResponseInnerAddressQuestionnaire.class); + } + + /** + * Convert an instance of FetchAddressVerificationListResponseInnerAddressQuestionnaire to an + * JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/examples/wallet/pom.xml b/examples/wallet/pom.xml index f4442745..e532f84f 100644 --- a/examples/wallet/pom.xml +++ b/examples/wallet/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-wallet - 1.1.0 + 2.0.0 \ No newline at end of file diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java new file mode 100644 index 00000000..817a9ed2 --- /dev/null +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java @@ -0,0 +1,51 @@ +/* + * 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.wallet.rest.travelrule; + +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.wallet.rest.WalletRestApiUtil; +import com.binance.connector.client.wallet.rest.api.WalletRestApi; +import com.binance.connector.client.wallet.rest.model.FetchAddressVerificationListResponse; + +/** API examples for TravelRuleApi */ +public class FetchAddressVerificationListExample { + private WalletRestApi api; + + public WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Fetch address verification list (USER_DATA) + * + *

Fetch address verification list Weight: 10 + * + * @throws ApiException if the Api call fails + */ + public void fetchAddressVerificationListExample() throws ApiException { + ApiResponse response = + getApi().fetchAddressVerificationList(); + System.out.println(response.getData()); + } +}