
com.merge.api.resources.accounting.balancesheets.requests.BalanceSheetsRetrieveRequest Maven / Gradle / Ivy
package com.merge.api.resources.accounting.balancesheets.requests;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.Objects;
import java.util.Optional;
@JsonDeserialize(builder = BalanceSheetsRetrieveRequest.Builder.class)
public final class BalanceSheetsRetrieveRequest {
private final Optional expand;
private final Optional includeRemoteData;
private BalanceSheetsRetrieveRequest(Optional expand, Optional includeRemoteData) {
this.expand = expand;
this.includeRemoteData = includeRemoteData;
}
/**
* @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
*/
@JsonProperty("expand")
public Optional getExpand() {
return expand;
}
/**
* @return Whether to include the original data Merge fetched from the third-party to produce these models.
*/
@JsonProperty("include_remote_data")
public Optional getIncludeRemoteData() {
return includeRemoteData;
}
@Override
public boolean equals(Object other) {
if (this == other) return true;
return other instanceof BalanceSheetsRetrieveRequest && equalTo((BalanceSheetsRetrieveRequest) other);
}
private boolean equalTo(BalanceSheetsRetrieveRequest other) {
return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData);
}
@Override
public int hashCode() {
return Objects.hash(this.expand, this.includeRemoteData);
}
@Override
public String toString() {
return "BalanceSheetsRetrieveRequest{" + "expand: " + expand + ", includeRemoteData: " + includeRemoteData
+ "}";
}
public static Builder builder() {
return new Builder();
}
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder {
private Optional expand = Optional.empty();
private Optional includeRemoteData = Optional.empty();
private Builder() {}
public Builder from(BalanceSheetsRetrieveRequest other) {
expand(other.getExpand());
includeRemoteData(other.getIncludeRemoteData());
return this;
}
@JsonSetter(value = "expand", nulls = Nulls.SKIP)
public Builder expand(Optional expand) {
this.expand = expand;
return this;
}
public Builder expand(String expand) {
this.expand = Optional.of(expand);
return this;
}
@JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP)
public Builder includeRemoteData(Optional includeRemoteData) {
this.includeRemoteData = includeRemoteData;
return this;
}
public Builder includeRemoteData(Boolean includeRemoteData) {
this.includeRemoteData = Optional.of(includeRemoteData);
return this;
}
public BalanceSheetsRetrieveRequest build() {
return new BalanceSheetsRetrieveRequest(expand, includeRemoteData);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy