/*
 * 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.BaseReportAverageFlowInsights;
import com.plaid.client.model.BaseReportLongestGapInsights;
import com.plaid.client.model.BaseReportNumberFlowInsights;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

/**
 * Calculated insights derived from transaction-level data. This field has been deprecated in favor of [Base Report attributes aggregated across accounts](https://plaid.com/docs/api/products/check/#cra-check_report-base_report-get-response-report-attributes) and will be removed in a future release.
 */
@ApiModel(description = "Calculated insights derived from transaction-level data. This field has been deprecated in favor of [Base Report attributes aggregated across accounts](https://plaid.com/docs/api/products/check/#cra-check_report-base_report-get-response-report-attributes) and will be removed in a future release.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-12-11T18:58:39.328614Z[Etc/UTC]")
public class BaseReportAccountInsights {
  public static final String SERIALIZED_NAME_OLDEST_TRANSACTION_DATE = "oldest_transaction_date";
  @SerializedName(SERIALIZED_NAME_OLDEST_TRANSACTION_DATE)
  private LocalDate oldestTransactionDate;

  public static final String SERIALIZED_NAME_MOST_RECENT_TRANSACTION_DATE = "most_recent_transaction_date";
  @SerializedName(SERIALIZED_NAME_MOST_RECENT_TRANSACTION_DATE)
  private LocalDate mostRecentTransactionDate;

  public static final String SERIALIZED_NAME_DAYS_AVAILABLE = "days_available";
  @SerializedName(SERIALIZED_NAME_DAYS_AVAILABLE)
  private Integer daysAvailable;

  public static final String SERIALIZED_NAME_AVERAGE_DAYS_BETWEEN_TRANSACTIONS = "average_days_between_transactions";
  @SerializedName(SERIALIZED_NAME_AVERAGE_DAYS_BETWEEN_TRANSACTIONS)
  private Double averageDaysBetweenTransactions;

  public static final String SERIALIZED_NAME_LONGEST_GAPS_BETWEEN_TRANSACTIONS = "longest_gaps_between_transactions";
  @SerializedName(SERIALIZED_NAME_LONGEST_GAPS_BETWEEN_TRANSACTIONS)
  private List<BaseReportLongestGapInsights> longestGapsBetweenTransactions = null;

  public static final String SERIALIZED_NAME_NUMBER_OF_INFLOWS = "number_of_inflows";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_INFLOWS)
  private List<BaseReportNumberFlowInsights> numberOfInflows = null;

  public static final String SERIALIZED_NAME_AVERAGE_INFLOW_AMOUNTS = "average_inflow_amounts";
  @SerializedName(SERIALIZED_NAME_AVERAGE_INFLOW_AMOUNTS)
  private List<BaseReportAverageFlowInsights> averageInflowAmounts = null;

  public static final String SERIALIZED_NAME_NUMBER_OF_OUTFLOWS = "number_of_outflows";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_OUTFLOWS)
  private List<BaseReportNumberFlowInsights> numberOfOutflows = null;

  public static final String SERIALIZED_NAME_AVERAGE_OUTFLOW_AMOUNTS = "average_outflow_amounts";
  @SerializedName(SERIALIZED_NAME_AVERAGE_OUTFLOW_AMOUNTS)
  private List<BaseReportAverageFlowInsights> averageOutflowAmounts = null;

  public static final String SERIALIZED_NAME_NUMBER_OF_DAYS_NO_TRANSACTIONS = "number_of_days_no_transactions";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_DAYS_NO_TRANSACTIONS)
  private Integer numberOfDaysNoTransactions;


  public BaseReportAccountInsights oldestTransactionDate(LocalDate oldestTransactionDate) {
    
    this.oldestTransactionDate = oldestTransactionDate;
    return this;
  }

   /**
   * Date of the earliest transaction for the account.
   * @return oldestTransactionDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Date of the earliest transaction for the account.")

  public LocalDate getOldestTransactionDate() {
    return oldestTransactionDate;
  }


  public void setOldestTransactionDate(LocalDate oldestTransactionDate) {
    this.oldestTransactionDate = oldestTransactionDate;
  }


  public BaseReportAccountInsights mostRecentTransactionDate(LocalDate mostRecentTransactionDate) {
    
    this.mostRecentTransactionDate = mostRecentTransactionDate;
    return this;
  }

   /**
   * Date of the most recent transaction for the account.
   * @return mostRecentTransactionDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Date of the most recent transaction for the account.")

  public LocalDate getMostRecentTransactionDate() {
    return mostRecentTransactionDate;
  }


  public void setMostRecentTransactionDate(LocalDate mostRecentTransactionDate) {
    this.mostRecentTransactionDate = mostRecentTransactionDate;
  }


  public BaseReportAccountInsights daysAvailable(Integer daysAvailable) {
    
    this.daysAvailable = daysAvailable;
    return this;
  }

   /**
   * Number of days days available for the account.
   * @return daysAvailable
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Number of days days available for the account.")

  public Integer getDaysAvailable() {
    return daysAvailable;
  }


  public void setDaysAvailable(Integer daysAvailable) {
    this.daysAvailable = daysAvailable;
  }


  public BaseReportAccountInsights averageDaysBetweenTransactions(Double averageDaysBetweenTransactions) {
    
    this.averageDaysBetweenTransactions = averageDaysBetweenTransactions;
    return this;
  }

   /**
   * Average number of days between sequential transactions
   * @return averageDaysBetweenTransactions
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Average number of days between sequential transactions")

  public Double getAverageDaysBetweenTransactions() {
    return averageDaysBetweenTransactions;
  }


  public void setAverageDaysBetweenTransactions(Double averageDaysBetweenTransactions) {
    this.averageDaysBetweenTransactions = averageDaysBetweenTransactions;
  }


  public BaseReportAccountInsights longestGapsBetweenTransactions(List<BaseReportLongestGapInsights> longestGapsBetweenTransactions) {
    
    this.longestGapsBetweenTransactions = longestGapsBetweenTransactions;
    return this;
  }

  public BaseReportAccountInsights addLongestGapsBetweenTransactionsItem(BaseReportLongestGapInsights longestGapsBetweenTransactionsItem) {
    if (this.longestGapsBetweenTransactions == null) {
      this.longestGapsBetweenTransactions = new ArrayList<>();
    }
    this.longestGapsBetweenTransactions.add(longestGapsBetweenTransactionsItem);
    return this;
  }

   /**
   * Longest gap between sequential transactions in a time period. This array can include multiple time periods.
   * @return longestGapsBetweenTransactions
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Longest gap between sequential transactions in a time period. This array can include multiple time periods.")

  public List<BaseReportLongestGapInsights> getLongestGapsBetweenTransactions() {
    return longestGapsBetweenTransactions;
  }


  public void setLongestGapsBetweenTransactions(List<BaseReportLongestGapInsights> longestGapsBetweenTransactions) {
    this.longestGapsBetweenTransactions = longestGapsBetweenTransactions;
  }


  public BaseReportAccountInsights numberOfInflows(List<BaseReportNumberFlowInsights> numberOfInflows) {
    
    this.numberOfInflows = numberOfInflows;
    return this;
  }

  public BaseReportAccountInsights addNumberOfInflowsItem(BaseReportNumberFlowInsights numberOfInflowsItem) {
    if (this.numberOfInflows == null) {
      this.numberOfInflows = new ArrayList<>();
    }
    this.numberOfInflows.add(numberOfInflowsItem);
    return this;
  }

   /**
   * The number of debits into the account. This array will be empty for non-depository accounts.
   * @return numberOfInflows
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The number of debits into the account. This array will be empty for non-depository accounts.")

  public List<BaseReportNumberFlowInsights> getNumberOfInflows() {
    return numberOfInflows;
  }


  public void setNumberOfInflows(List<BaseReportNumberFlowInsights> numberOfInflows) {
    this.numberOfInflows = numberOfInflows;
  }


  public BaseReportAccountInsights averageInflowAmounts(List<BaseReportAverageFlowInsights> averageInflowAmounts) {
    
    this.averageInflowAmounts = averageInflowAmounts;
    return this;
  }

  public BaseReportAccountInsights addAverageInflowAmountsItem(BaseReportAverageFlowInsights averageInflowAmountsItem) {
    if (this.averageInflowAmounts == null) {
      this.averageInflowAmounts = new ArrayList<>();
    }
    this.averageInflowAmounts.add(averageInflowAmountsItem);
    return this;
  }

   /**
   * Average amount of debit transactions into the account in a time period. This array will be empty for non-depository accounts. This field only takes into account USD transactions from the account.
   * @return averageInflowAmounts
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Average amount of debit transactions into the account in a time period. This array will be empty for non-depository accounts. This field only takes into account USD transactions from the account.")

  public List<BaseReportAverageFlowInsights> getAverageInflowAmounts() {
    return averageInflowAmounts;
  }


  public void setAverageInflowAmounts(List<BaseReportAverageFlowInsights> averageInflowAmounts) {
    this.averageInflowAmounts = averageInflowAmounts;
  }


  public BaseReportAccountInsights numberOfOutflows(List<BaseReportNumberFlowInsights> numberOfOutflows) {
    
    this.numberOfOutflows = numberOfOutflows;
    return this;
  }

  public BaseReportAccountInsights addNumberOfOutflowsItem(BaseReportNumberFlowInsights numberOfOutflowsItem) {
    if (this.numberOfOutflows == null) {
      this.numberOfOutflows = new ArrayList<>();
    }
    this.numberOfOutflows.add(numberOfOutflowsItem);
    return this;
  }

   /**
   * The number of outflows from the account. This array will be empty for non-depository accounts.
   * @return numberOfOutflows
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The number of outflows from the account. This array will be empty for non-depository accounts.")

  public List<BaseReportNumberFlowInsights> getNumberOfOutflows() {
    return numberOfOutflows;
  }


  public void setNumberOfOutflows(List<BaseReportNumberFlowInsights> numberOfOutflows) {
    this.numberOfOutflows = numberOfOutflows;
  }


  public BaseReportAccountInsights averageOutflowAmounts(List<BaseReportAverageFlowInsights> averageOutflowAmounts) {
    
    this.averageOutflowAmounts = averageOutflowAmounts;
    return this;
  }

  public BaseReportAccountInsights addAverageOutflowAmountsItem(BaseReportAverageFlowInsights averageOutflowAmountsItem) {
    if (this.averageOutflowAmounts == null) {
      this.averageOutflowAmounts = new ArrayList<>();
    }
    this.averageOutflowAmounts.add(averageOutflowAmountsItem);
    return this;
  }

   /**
   * Average amount of transactions out of the account in a time period. This array will be empty for non-depository accounts. This field only takes into account USD transactions from the account.
   * @return averageOutflowAmounts
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Average amount of transactions out of the account in a time period. This array will be empty for non-depository accounts. This field only takes into account USD transactions from the account.")

  public List<BaseReportAverageFlowInsights> getAverageOutflowAmounts() {
    return averageOutflowAmounts;
  }


  public void setAverageOutflowAmounts(List<BaseReportAverageFlowInsights> averageOutflowAmounts) {
    this.averageOutflowAmounts = averageOutflowAmounts;
  }


  public BaseReportAccountInsights numberOfDaysNoTransactions(Integer numberOfDaysNoTransactions) {
    
    this.numberOfDaysNoTransactions = numberOfDaysNoTransactions;
    return this;
  }

   /**
   * Number of days with no transactions
   * @return numberOfDaysNoTransactions
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Number of days with no transactions")

  public Integer getNumberOfDaysNoTransactions() {
    return numberOfDaysNoTransactions;
  }


  public void setNumberOfDaysNoTransactions(Integer numberOfDaysNoTransactions) {
    this.numberOfDaysNoTransactions = numberOfDaysNoTransactions;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    BaseReportAccountInsights baseReportAccountInsights = (BaseReportAccountInsights) o;
    return Objects.equals(this.oldestTransactionDate, baseReportAccountInsights.oldestTransactionDate) &&
        Objects.equals(this.mostRecentTransactionDate, baseReportAccountInsights.mostRecentTransactionDate) &&
        Objects.equals(this.daysAvailable, baseReportAccountInsights.daysAvailable) &&
        Objects.equals(this.averageDaysBetweenTransactions, baseReportAccountInsights.averageDaysBetweenTransactions) &&
        Objects.equals(this.longestGapsBetweenTransactions, baseReportAccountInsights.longestGapsBetweenTransactions) &&
        Objects.equals(this.numberOfInflows, baseReportAccountInsights.numberOfInflows) &&
        Objects.equals(this.averageInflowAmounts, baseReportAccountInsights.averageInflowAmounts) &&
        Objects.equals(this.numberOfOutflows, baseReportAccountInsights.numberOfOutflows) &&
        Objects.equals(this.averageOutflowAmounts, baseReportAccountInsights.averageOutflowAmounts) &&
        Objects.equals(this.numberOfDaysNoTransactions, baseReportAccountInsights.numberOfDaysNoTransactions);
  }

  @Override
  public int hashCode() {
    return Objects.hash(oldestTransactionDate, mostRecentTransactionDate, daysAvailable, averageDaysBetweenTransactions, longestGapsBetweenTransactions, numberOfInflows, averageInflowAmounts, numberOfOutflows, averageOutflowAmounts, numberOfDaysNoTransactions);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class BaseReportAccountInsights {\n");
    sb.append("    oldestTransactionDate: ").append(toIndentedString(oldestTransactionDate)).append("\n");
    sb.append("    mostRecentTransactionDate: ").append(toIndentedString(mostRecentTransactionDate)).append("\n");
    sb.append("    daysAvailable: ").append(toIndentedString(daysAvailable)).append("\n");
    sb.append("    averageDaysBetweenTransactions: ").append(toIndentedString(averageDaysBetweenTransactions)).append("\n");
    sb.append("    longestGapsBetweenTransactions: ").append(toIndentedString(longestGapsBetweenTransactions)).append("\n");
    sb.append("    numberOfInflows: ").append(toIndentedString(numberOfInflows)).append("\n");
    sb.append("    averageInflowAmounts: ").append(toIndentedString(averageInflowAmounts)).append("\n");
    sb.append("    numberOfOutflows: ").append(toIndentedString(numberOfOutflows)).append("\n");
    sb.append("    averageOutflowAmounts: ").append(toIndentedString(averageOutflowAmounts)).append("\n");
    sb.append("    numberOfDaysNoTransactions: ").append(toIndentedString(numberOfDaysNoTransactions)).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    ");
  }

}

