Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 232 additions & 0 deletions src/main/java/com/adyen/model/balanceplatform/Summary.java
Original file line number Diff line number Diff line change
@@ -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<Integer> 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<Integer> 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<Integer> 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<Integer> 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<String, Object> getExplicitNulls() {
if (!this.includeNullValues) {
return Collections.emptyMap();
}

Map<String, Object> 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<String, Object> 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);
}
}
Loading