/*
 * The Plaid API
 * The Plaid REST API. Please see https://plaid.com/docs/api for more details.
 *
 * The version of the OpenAPI document: 2020-09-14_1.680.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.plaid.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.plaid.client.model.CraVoaReportAccountHistoricalBalance;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * VOA Report information about an account&#39;s balances.
 */
@ApiModel(description = "VOA Report information about an account's balances.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-12-11T18:58:39.328614Z[Etc/UTC]")
public class CraVoaReportAccountBalances {
  public static final String SERIALIZED_NAME_AVAILABLE = "available";
  @SerializedName(SERIALIZED_NAME_AVAILABLE)
  private Double available;

  public static final String SERIALIZED_NAME_CURRENT = "current";
  @SerializedName(SERIALIZED_NAME_CURRENT)
  private Double current;

  public static final String SERIALIZED_NAME_ISO_CURRENCY_CODE = "iso_currency_code";
  @SerializedName(SERIALIZED_NAME_ISO_CURRENCY_CODE)
  private String isoCurrencyCode;

  public static final String SERIALIZED_NAME_UNOFFICIAL_CURRENCY_CODE = "unofficial_currency_code";
  @SerializedName(SERIALIZED_NAME_UNOFFICIAL_CURRENCY_CODE)
  private String unofficialCurrencyCode;

  public static final String SERIALIZED_NAME_HISTORICAL_BALANCES = "historical_balances";
  @SerializedName(SERIALIZED_NAME_HISTORICAL_BALANCES)
  private List<CraVoaReportAccountHistoricalBalance> historicalBalances = new ArrayList<>();

  public static final String SERIALIZED_NAME_AVERAGE_BALANCE30_DAYS = "average_balance_30_days";
  @SerializedName(SERIALIZED_NAME_AVERAGE_BALANCE30_DAYS)
  private Double averageBalance30Days;

  public static final String SERIALIZED_NAME_AVERAGE_BALANCE60_DAYS = "average_balance_60_days";
  @SerializedName(SERIALIZED_NAME_AVERAGE_BALANCE60_DAYS)
  private Double averageBalance60Days;

  public static final String SERIALIZED_NAME_NSF_OVERDRAFT_TRANSACTIONS_COUNT = "nsf_overdraft_transactions_count";
  @SerializedName(SERIALIZED_NAME_NSF_OVERDRAFT_TRANSACTIONS_COUNT)
  private Double nsfOverdraftTransactionsCount;


  public CraVoaReportAccountBalances available(Double available) {
    
    this.available = available;
    return this;
  }

   /**
   * The amount of funds available to be withdrawn from the account, as determined by the financial institution.  For &#x60;credit&#x60;-type accounts, the &#x60;available&#x60; balance typically equals the &#x60;limit&#x60; less the &#x60;current&#x60; balance, less any pending outflows plus any pending inflows.  For &#x60;depository&#x60;-type accounts, the &#x60;available&#x60; balance typically equals the &#x60;current&#x60; balance less any pending outflows plus any pending inflows. For &#x60;depository&#x60;-type accounts, the &#x60;available&#x60; balance does not include the overdraft limit.  For &#x60;investment&#x60;-type accounts (or &#x60;brokerage&#x60;-type accounts for API versions 2018-05-22 and earlier), the &#x60;available&#x60; balance is the total cash available to withdraw as presented by the institution.  Note that not all institutions calculate the &#x60;available&#x60;  balance. In the event that &#x60;available&#x60; balance is unavailable, Plaid will return an &#x60;available&#x60; balance value of &#x60;null&#x60;.  Available balance may be cached and is not guaranteed to be up-to-date in realtime unless the value was returned by &#x60;/accounts/balance/get&#x60;.  If &#x60;current&#x60; is &#x60;null&#x60; this field is guaranteed not to be &#x60;null&#x60;.
   * @return available
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(required = true, value = "The amount of funds available to be withdrawn from the account, as determined by the financial institution.  For `credit`-type accounts, the `available` balance typically equals the `limit` less the `current` balance, less any pending outflows plus any pending inflows.  For `depository`-type accounts, the `available` balance typically equals the `current` balance less any pending outflows plus any pending inflows. For `depository`-type accounts, the `available` balance does not include the overdraft limit.  For `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the `available` balance is the total cash available to withdraw as presented by the institution.  Note that not all institutions calculate the `available`  balance. In the event that `available` balance is unavailable, Plaid will return an `available` balance value of `null`.  Available balance may be cached and is not guaranteed to be up-to-date in realtime unless the value was returned by `/accounts/balance/get`.  If `current` is `null` this field is guaranteed not to be `null`.")

  public Double getAvailable() {
    return available;
  }


  public void setAvailable(Double available) {
    this.available = available;
  }


  public CraVoaReportAccountBalances current(Double current) {
    
    this.current = current;
    return this;
  }

   /**
   * The total amount of funds in or owed by the account.  For &#x60;credit&#x60;-type accounts, a positive balance indicates the amount owed; a negative amount indicates the lender owing the account holder.  For &#x60;loan&#x60;-type accounts, the current balance is the principal remaining on the loan, except in the case of student loan accounts at Sallie Mae (&#x60;ins_116944&#x60;). For Sallie Mae student loans, the account&#39;s balance includes both principal and any outstanding interest.  For &#x60;investment&#x60;-type accounts (or &#x60;brokerage&#x60;-type accounts for API versions 2018-05-22 and earlier), the current balance is the total value of assets as presented by the institution.  Note that balance information may be cached unless the value was returned by &#x60;/accounts/balance/get&#x60;; if the Item is enabled for Transactions, the balance will be at least as recent as the most recent Transaction update. If you require realtime balance information, use the &#x60;available&#x60; balance as provided by &#x60;/accounts/balance/get&#x60;.  When returned by &#x60;/accounts/balance/get&#x60;, this field may be &#x60;null&#x60;. When this happens, &#x60;available&#x60; is guaranteed not to be &#x60;null&#x60;.
   * @return current
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(required = true, value = "The total amount of funds in or owed by the account.  For `credit`-type accounts, a positive balance indicates the amount owed; a negative amount indicates the lender owing the account holder.  For `loan`-type accounts, the current balance is the principal remaining on the loan, except in the case of student loan accounts at Sallie Mae (`ins_116944`). For Sallie Mae student loans, the account's balance includes both principal and any outstanding interest.  For `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the current balance is the total value of assets as presented by the institution.  Note that balance information may be cached unless the value was returned by `/accounts/balance/get`; if the Item is enabled for Transactions, the balance will be at least as recent as the most recent Transaction update. If you require realtime balance information, use the `available` balance as provided by `/accounts/balance/get`.  When returned by `/accounts/balance/get`, this field may be `null`. When this happens, `available` is guaranteed not to be `null`.")

  public Double getCurrent() {
    return current;
  }


  public void setCurrent(Double current) {
    this.current = current;
  }


  public CraVoaReportAccountBalances isoCurrencyCode(String isoCurrencyCode) {
    
    this.isoCurrencyCode = isoCurrencyCode;
    return this;
  }

   /**
   * The ISO-4217 currency code of the balance. Always null if &#x60;unofficial_currency_code&#x60; is non-null.
   * @return isoCurrencyCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(required = true, value = "The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null.")

  public String getIsoCurrencyCode() {
    return isoCurrencyCode;
  }


  public void setIsoCurrencyCode(String isoCurrencyCode) {
    this.isoCurrencyCode = isoCurrencyCode;
  }


  public CraVoaReportAccountBalances unofficialCurrencyCode(String unofficialCurrencyCode) {
    
    this.unofficialCurrencyCode = unofficialCurrencyCode;
    return this;
  }

   /**
   * The unofficial currency code associated with the balance. Always null if &#x60;iso_currency_code&#x60; is non-null. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.  See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported &#x60;unofficial_currency_code&#x60;s.
   * @return unofficialCurrencyCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(required = true, value = "The unofficial currency code associated with the balance. Always null if `iso_currency_code` is non-null. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.  See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.")

  public String getUnofficialCurrencyCode() {
    return unofficialCurrencyCode;
  }


  public void setUnofficialCurrencyCode(String unofficialCurrencyCode) {
    this.unofficialCurrencyCode = unofficialCurrencyCode;
  }


  public CraVoaReportAccountBalances historicalBalances(List<CraVoaReportAccountHistoricalBalance> historicalBalances) {
    
    this.historicalBalances = historicalBalances;
    return this;
  }

  public CraVoaReportAccountBalances addHistoricalBalancesItem(CraVoaReportAccountHistoricalBalance historicalBalancesItem) {
    this.historicalBalances.add(historicalBalancesItem);
    return this;
  }

   /**
   * Calculated data about the historical balances on the account.  Available for &#x60;credit&#x60; and &#x60;depository&#x60; type accounts.
   * @return historicalBalances
  **/
  @ApiModelProperty(required = true, value = "Calculated data about the historical balances on the account.  Available for `credit` and `depository` type accounts.")

  public List<CraVoaReportAccountHistoricalBalance> getHistoricalBalances() {
    return historicalBalances;
  }


  public void setHistoricalBalances(List<CraVoaReportAccountHistoricalBalance> historicalBalances) {
    this.historicalBalances = historicalBalances;
  }


  public CraVoaReportAccountBalances averageBalance30Days(Double averageBalance30Days) {
    
    this.averageBalance30Days = averageBalance30Days;
    return this;
  }

   /**
   * The average balance in the account over the last 30 days. Calculated using the derived historical balances.
   * @return averageBalance30Days
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(required = true, value = "The average balance in the account over the last 30 days. Calculated using the derived historical balances.")

  public Double getAverageBalance30Days() {
    return averageBalance30Days;
  }


  public void setAverageBalance30Days(Double averageBalance30Days) {
    this.averageBalance30Days = averageBalance30Days;
  }


  public CraVoaReportAccountBalances averageBalance60Days(Double averageBalance60Days) {
    
    this.averageBalance60Days = averageBalance60Days;
    return this;
  }

   /**
   * The average balance in the account over the last 60 days. Calculated using the derived historical balances.
   * @return averageBalance60Days
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(required = true, value = "The average balance in the account over the last 60 days. Calculated using the derived historical balances.")

  public Double getAverageBalance60Days() {
    return averageBalance60Days;
  }


  public void setAverageBalance60Days(Double averageBalance60Days) {
    this.averageBalance60Days = averageBalance60Days;
  }


  public CraVoaReportAccountBalances nsfOverdraftTransactionsCount(Double nsfOverdraftTransactionsCount) {
    
    this.nsfOverdraftTransactionsCount = nsfOverdraftTransactionsCount;
    return this;
  }

   /**
   * The number of net NSF fee transactions in the time range for the report in the given account (not counting any fees that were reversed within the time range).
   * @return nsfOverdraftTransactionsCount
  **/
  @ApiModelProperty(required = true, value = "The number of net NSF fee transactions in the time range for the report in the given account (not counting any fees that were reversed within the time range).")

  public Double getNsfOverdraftTransactionsCount() {
    return nsfOverdraftTransactionsCount;
  }


  public void setNsfOverdraftTransactionsCount(Double nsfOverdraftTransactionsCount) {
    this.nsfOverdraftTransactionsCount = nsfOverdraftTransactionsCount;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CraVoaReportAccountBalances craVoaReportAccountBalances = (CraVoaReportAccountBalances) o;
    return Objects.equals(this.available, craVoaReportAccountBalances.available) &&
        Objects.equals(this.current, craVoaReportAccountBalances.current) &&
        Objects.equals(this.isoCurrencyCode, craVoaReportAccountBalances.isoCurrencyCode) &&
        Objects.equals(this.unofficialCurrencyCode, craVoaReportAccountBalances.unofficialCurrencyCode) &&
        Objects.equals(this.historicalBalances, craVoaReportAccountBalances.historicalBalances) &&
        Objects.equals(this.averageBalance30Days, craVoaReportAccountBalances.averageBalance30Days) &&
        Objects.equals(this.averageBalance60Days, craVoaReportAccountBalances.averageBalance60Days) &&
        Objects.equals(this.nsfOverdraftTransactionsCount, craVoaReportAccountBalances.nsfOverdraftTransactionsCount);
  }

  @Override
  public int hashCode() {
    return Objects.hash(available, current, isoCurrencyCode, unofficialCurrencyCode, historicalBalances, averageBalance30Days, averageBalance60Days, nsfOverdraftTransactionsCount);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CraVoaReportAccountBalances {\n");
    sb.append("    available: ").append(toIndentedString(available)).append("\n");
    sb.append("    current: ").append(toIndentedString(current)).append("\n");
    sb.append("    isoCurrencyCode: ").append(toIndentedString(isoCurrencyCode)).append("\n");
    sb.append("    unofficialCurrencyCode: ").append(toIndentedString(unofficialCurrencyCode)).append("\n");
    sb.append("    historicalBalances: ").append(toIndentedString(historicalBalances)).append("\n");
    sb.append("    averageBalance30Days: ").append(toIndentedString(averageBalance30Days)).append("\n");
    sb.append("    averageBalance60Days: ").append(toIndentedString(averageBalance60Days)).append("\n");
    sb.append("    nsfOverdraftTransactionsCount: ").append(toIndentedString(nsfOverdraftTransactionsCount)).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    ");
  }

}

