/*
 * 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.CraLoanPaymentHistory;
import com.plaid.client.model.CraLoanStatusHistoryUpdate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Contains loan data to update.
 */
@ApiModel(description = "Contains loan data to update.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-12-11T18:58:39.328614Z[Etc/UTC]")
public class CraLoanUpdate {
  public static final String SERIALIZED_NAME_LOAN_ID = "loan_id";
  @SerializedName(SERIALIZED_NAME_LOAN_ID)
  private String loanId;

  public static final String SERIALIZED_NAME_STATUS_HISTORY = "status_history";
  @SerializedName(SERIALIZED_NAME_STATUS_HISTORY)
  private List<CraLoanStatusHistoryUpdate> statusHistory = null;

  public static final String SERIALIZED_NAME_PAYMENT_HISTORY = "payment_history";
  @SerializedName(SERIALIZED_NAME_PAYMENT_HISTORY)
  private List<CraLoanPaymentHistory> paymentHistory = null;


  public CraLoanUpdate loanId(String loanId) {
    
    this.loanId = loanId;
    return this;
  }

   /**
   * A unique identifier for the loan. Personally identifiable information, such as an email address or phone number, should not be used in the &#x60;loan_id&#x60;.
   * @return loanId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A unique identifier for the loan. Personally identifiable information, such as an email address or phone number, should not be used in the `loan_id`.")

  public String getLoanId() {
    return loanId;
  }


  public void setLoanId(String loanId) {
    this.loanId = loanId;
  }


  public CraLoanUpdate statusHistory(List<CraLoanStatusHistoryUpdate> statusHistory) {
    
    this.statusHistory = statusHistory;
    return this;
  }

  public CraLoanUpdate addStatusHistoryItem(CraLoanStatusHistoryUpdate statusHistoryItem) {
    if (this.statusHistory == null) {
      this.statusHistory = new ArrayList<>();
    }
    this.statusHistory.add(statusHistoryItem);
    return this;
  }

   /**
   * A list of status update history of the loan.
   * @return statusHistory
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A list of status update history of the loan.")

  public List<CraLoanStatusHistoryUpdate> getStatusHistory() {
    return statusHistory;
  }


  public void setStatusHistory(List<CraLoanStatusHistoryUpdate> statusHistory) {
    this.statusHistory = statusHistory;
  }


  public CraLoanUpdate paymentHistory(List<CraLoanPaymentHistory> paymentHistory) {
    
    this.paymentHistory = paymentHistory;
    return this;
  }

  public CraLoanUpdate addPaymentHistoryItem(CraLoanPaymentHistory paymentHistoryItem) {
    if (this.paymentHistory == null) {
      this.paymentHistory = new ArrayList<>();
    }
    this.paymentHistory.add(paymentHistoryItem);
    return this;
  }

   /**
   * The updates to the payment history for the loan.
   * @return paymentHistory
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The updates to the payment history for the loan.")

  public List<CraLoanPaymentHistory> getPaymentHistory() {
    return paymentHistory;
  }


  public void setPaymentHistory(List<CraLoanPaymentHistory> paymentHistory) {
    this.paymentHistory = paymentHistory;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CraLoanUpdate craLoanUpdate = (CraLoanUpdate) o;
    return Objects.equals(this.loanId, craLoanUpdate.loanId) &&
        Objects.equals(this.statusHistory, craLoanUpdate.statusHistory) &&
        Objects.equals(this.paymentHistory, craLoanUpdate.paymentHistory);
  }

  @Override
  public int hashCode() {
    return Objects.hash(loanId, statusHistory, paymentHistory);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CraLoanUpdate {\n");
    sb.append("    loanId: ").append(toIndentedString(loanId)).append("\n");
    sb.append("    statusHistory: ").append(toIndentedString(statusHistory)).append("\n");
    sb.append("    paymentHistory: ").append(toIndentedString(paymentHistory)).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    ");
  }

}

