From fd84c0fd4a251ad4d725040d948250d2424534b8 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Tue, 17 Feb 2026 21:46:59 +0000 Subject: [PATCH] [balanceplatform] Automated update from Adyen/adyen-openapi@d667e61 --- .../adyen/model/balanceplatform/Summary.java | 232 ++++++++++++++++++ .../TaxFormSummaryResponse.java | 192 +++++++++++++++ .../balanceplatform/AccountHoldersApi.java | 64 ++++- 3 files changed, 481 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/adyen/model/balanceplatform/Summary.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/TaxFormSummaryResponse.java diff --git a/src/main/java/com/adyen/model/balanceplatform/Summary.java b/src/main/java/com/adyen/model/balanceplatform/Summary.java new file mode 100644 index 000000000..49159ddd7 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/Summary.java @@ -0,0 +1,232 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * 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.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** Summary */ +@JsonPropertyOrder({Summary.JSON_PROPERTY_LEGAL_ENTITY_ID, Summary.JSON_PROPERTY_TAX_YEARS}) +public class Summary { + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; + private String legalEntityId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + + public static final String JSON_PROPERTY_TAX_YEARS = "taxYears"; + private List taxYears; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxYears = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Summary() {} + + /** + * The unique identifier of the legal entity. + * + * @param legalEntityId The unique identifier of the legal entity. + * @return the current {@code Summary} instance, allowing for method chaining + */ + public Summary legalEntityId(String legalEntityId) { + this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set + return this; + } + + /** + * The unique identifier of the legal entity. + * + * @return legalEntityId The unique identifier of the legal entity. + */ + @JsonProperty(JSON_PROPERTY_LEGAL_ENTITY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLegalEntityId() { + return legalEntityId; + } + + /** + * The unique identifier of the legal entity. + * + * @param legalEntityId The unique identifier of the legal entity. + */ + @JsonProperty(JSON_PROPERTY_LEGAL_ENTITY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLegalEntityId(String legalEntityId) { + this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set + } + + /** + * The tax years for which the legal entity has a tax form. + * + * @param taxYears The tax years for which the legal entity has a tax form. + * @return the current {@code Summary} instance, allowing for method chaining + */ + public Summary taxYears(List taxYears) { + this.taxYears = taxYears; + isSetTaxYears = true; // mark as set + return this; + } + + public Summary addTaxYearsItem(Integer taxYearsItem) { + if (this.taxYears == null) { + this.taxYears = new ArrayList<>(); + } + this.taxYears.add(taxYearsItem); + return this; + } + + /** + * The tax years for which the legal entity has a tax form. + * + * @return taxYears The tax years for which the legal entity has a tax form. + */ + @JsonProperty(JSON_PROPERTY_TAX_YEARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTaxYears() { + return taxYears; + } + + /** + * The tax years for which the legal entity has a tax form. + * + * @param taxYears The tax years for which the legal entity has a tax form. + */ + @JsonProperty(JSON_PROPERTY_TAX_YEARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTaxYears(List taxYears) { + this.taxYears = taxYears; + isSetTaxYears = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Summary includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Summary object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Summary summary = (Summary) o; + return Objects.equals(this.legalEntityId, summary.legalEntityId) + && Objects.equals(this.isSetLegalEntityId, summary.isSetLegalEntityId) + && Objects.equals(this.taxYears, summary.taxYears) + && Objects.equals(this.isSetTaxYears, summary.isSetTaxYears); + } + + @Override + public int hashCode() { + return Objects.hash(legalEntityId, isSetLegalEntityId, taxYears, isSetTaxYears); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Summary {\n"); + sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); + sb.append(" taxYears: ").append(toIndentedString(taxYears)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetTaxYears) { + addIfNull(nulls, JSON_PROPERTY_TAX_YEARS, this.taxYears); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Summary given an JSON string + * + * @param jsonString JSON string + * @return An instance of Summary + * @throws JsonProcessingException if the JSON string is invalid with respect to Summary + */ + public static Summary fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Summary.class); + } + + /** + * Convert an instance of Summary to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/TaxFormSummaryResponse.java b/src/main/java/com/adyen/model/balanceplatform/TaxFormSummaryResponse.java new file mode 100644 index 000000000..f21782532 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/TaxFormSummaryResponse.java @@ -0,0 +1,192 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * 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.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** TaxFormSummaryResponse */ +@JsonPropertyOrder({TaxFormSummaryResponse.JSON_PROPERTY_DATA}) +public class TaxFormSummaryResponse { + public static final String JSON_PROPERTY_DATA = "data"; + private List data; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TaxFormSummaryResponse() {} + + /** + * A list of tax form summaries, where each summary consists of the legal entity and the tax years + * in which the legal entity has a tax form. + * + * @param data A list of tax form summaries, where each summary consists of the legal entity and + * the tax years in which the legal entity has a tax form. + * @return the current {@code TaxFormSummaryResponse} instance, allowing for method chaining + */ + public TaxFormSummaryResponse data(List data) { + this.data = data; + isSetData = true; // mark as set + return this; + } + + public TaxFormSummaryResponse addDataItem(Summary dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * A list of tax form summaries, where each summary consists of the legal entity and the tax years + * in which the legal entity has a tax form. + * + * @return data A list of tax form summaries, where each summary consists of the legal entity and + * the tax years in which the legal entity has a tax form. + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + /** + * A list of tax form summaries, where each summary consists of the legal entity and the tax years + * in which the legal entity has a tax form. + * + * @param data A list of tax form summaries, where each summary consists of the legal entity and + * the tax years in which the legal entity has a tax form. + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(List data) { + this.data = data; + isSetData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TaxFormSummaryResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TaxFormSummaryResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaxFormSummaryResponse taxFormSummaryResponse = (TaxFormSummaryResponse) o; + return Objects.equals(this.data, taxFormSummaryResponse.data) + && Objects.equals(this.isSetData, taxFormSummaryResponse.isSetData); + } + + @Override + public int hashCode() { + return Objects.hash(data, isSetData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaxFormSummaryResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TaxFormSummaryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaxFormSummaryResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TaxFormSummaryResponse + */ + public static TaxFormSummaryResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TaxFormSummaryResponse.class); + } + + /** + * Convert an instance of TaxFormSummaryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java b/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java index b95660475..6fe006cec 100644 --- a/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java @@ -20,6 +20,7 @@ import com.adyen.model.balanceplatform.AccountHolderUpdateRequest; import com.adyen.model.balanceplatform.GetTaxFormResponse; import com.adyen.model.balanceplatform.PaginatedBalanceAccountsResponse; +import com.adyen.model.balanceplatform.TaxFormSummaryResponse; import com.adyen.model.balanceplatform.TransactionRulesResponse; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.Resource; @@ -218,9 +219,9 @@ public TransactionRulesResponse getAllTransactionRulesForAccountHolder( * * @param id {@link String } The unique identifier of the account holder. (required) * @param formType {@link String } Query: The type of tax form you want to retrieve. Accepted - * values are **US1099k** and **US1099nec** (required) - * @param year {@link Integer } Query: The tax year in YYYY format for the tax form you want to - * retrieve (required) + * values are **US1099k** and **US1099nec**. (required) + * @param year {@link Integer } Query: The tax year in **YYYY** format for the tax form you want + * to retrieve. (required) * @return {@link GetTaxFormResponse } * @throws ApiException if fails to make API call */ @@ -234,11 +235,11 @@ public GetTaxFormResponse getTaxForm(String id, String formType, Integer year) * * @param id {@link String } The unique identifier of the account holder. (required) * @param formType {@link String } Query: The type of tax form you want to retrieve. Accepted - * values are **US1099k** and **US1099nec** (required) - * @param year {@link Integer } Query: The tax year in YYYY format for the tax form you want to - * retrieve (required) + * values are **US1099k** and **US1099nec**. (required) + * @param year {@link Integer } Query: The tax year in **YYYY** format for the tax form you want + * to retrieve. (required) * @param legalEntityId {@link String } Query: The legal entity reference whose tax form you want - * to retrieve (optional) + * to retrieve. (optional) * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as * idempotency-keys (optional) * @return {@link GetTaxFormResponse } @@ -274,6 +275,55 @@ public GetTaxFormResponse getTaxForm( return GetTaxFormResponse.fromJson(jsonResult); } + /** + * Get summary of tax forms for an account holder + * + * @param id {@link String } The unique identifier of the account holder. (required) + * @param formType {@link String } Query: The type of tax form you want a summary for. Accepted + * values are **US1099k** and **US1099nec**. (required) + * @return {@link TaxFormSummaryResponse } + * @throws ApiException if fails to make API call + */ + public TaxFormSummaryResponse getTaxFormSummary(String id, String formType) + throws ApiException, IOException { + return getTaxFormSummary(id, formType, null); + } + + /** + * Get summary of tax forms for an account holder + * + * @param id {@link String } The unique identifier of the account holder. (required) + * @param formType {@link String } Query: The type of tax form you want a summary for. Accepted + * values are **US1099k** and **US1099nec**. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link TaxFormSummaryResponse } + * @throws ApiException if fails to make API call + */ + public TaxFormSummaryResponse getTaxFormSummary( + String id, String formType, RequestOptions requestOptions) throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + // Add query params + Map queryParams = new HashMap<>(); + if (formType != null) { + queryParams.put("formType", formType); + } + + String requestBody = null; + Resource resource = + new Resource(this, this.baseURL + "/accountHolders/{id}/taxFormSummary", null); + String jsonResult = + resource.request( + requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return TaxFormSummaryResponse.fromJson(jsonResult); + } + /** * Update an account holder *