/*
 * Swagger of Opencellsoft Api
 * @#Introduction
 *
 * The version of the OpenAPI document: 7.3.1-SNAPSHOT
 * Contact: contact@opencellsoft.fr
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.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 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;
import org.openapitools.client.model.Auditable;
import org.openapitools.client.model.AuditableFieldHistory;
import org.openapitools.client.model.CustomerAccount;
import org.openapitools.client.model.DunningLOT;
import org.openapitools.client.model.RecordedInvoice;
import org.openapitools.client.model.WFAction;
import org.threeten.bp.OffsetDateTime;

/**
 * ActionDunning
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-13T10:03:17.753Z[GMT]")
public class ActionDunning {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private Long id;

  public static final String SERIALIZED_NAME_VERSION = "version";
  @SerializedName(SERIALIZED_NAME_VERSION)
  private Integer version;

  public static final String SERIALIZED_NAME_AUDITABLE = "auditable";
  @SerializedName(SERIALIZED_NAME_AUDITABLE)
  private Auditable auditable;

  public static final String SERIALIZED_NAME_HISTORIZED = "historized";
  @SerializedName(SERIALIZED_NAME_HISTORIZED)
  private Boolean historized;

  public static final String SERIALIZED_NAME_NOTIFIED = "notified";
  @SerializedName(SERIALIZED_NAME_NOTIFIED)
  private Boolean notified;

  public static final String SERIALIZED_NAME_AUDITABLE_FIELDS = "auditableFields";
  @SerializedName(SERIALIZED_NAME_AUDITABLE_FIELDS)
  private List<AuditableFieldHistory> auditableFields = null;

  public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate";
  @SerializedName(SERIALIZED_NAME_CREATION_DATE)
  private OffsetDateTime creationDate;

  /**
   * Gets or Sets typeAction
   */
  @JsonAdapter(TypeActionEnum.Adapter.class)
  public enum TypeActionEnum {
    FILE("FILE"),
    
    LETTER("LETTER"),
    
    EMAIL("EMAIL"),
    
    CHARGE("CHARGE");

    private String value;

    TypeActionEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static TypeActionEnum fromValue(String value) {
      for (TypeActionEnum b : TypeActionEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<TypeActionEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final TypeActionEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public TypeActionEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return TypeActionEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_TYPE_ACTION = "typeAction";
  @SerializedName(SERIALIZED_NAME_TYPE_ACTION)
  private TypeActionEnum typeAction;

  /**
   * Gets or Sets status
   */
  @JsonAdapter(StatusEnum.Adapter.class)
  public enum StatusEnum {
    A("A"),
    
    T("T"),
    
    E("E");

    private String value;

    StatusEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static StatusEnum fromValue(String value) {
      for (StatusEnum b : StatusEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<StatusEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public StatusEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return StatusEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_STATUS = "status";
  @SerializedName(SERIALIZED_NAME_STATUS)
  private StatusEnum status;

  public static final String SERIALIZED_NAME_STATUS_DATE = "statusDate";
  @SerializedName(SERIALIZED_NAME_STATUS_DATE)
  private OffsetDateTime statusDate;

  public static final String SERIALIZED_NAME_CUSTOMER_ACCOUNT = "customerAccount";
  @SerializedName(SERIALIZED_NAME_CUSTOMER_ACCOUNT)
  private CustomerAccount customerAccount;

  public static final String SERIALIZED_NAME_RECORDED_INVOICE = "recordedInvoice";
  @SerializedName(SERIALIZED_NAME_RECORDED_INVOICE)
  private RecordedInvoice recordedInvoice;

  public static final String SERIALIZED_NAME_DUNNING_L_O_T = "dunningLOT";
  @SerializedName(SERIALIZED_NAME_DUNNING_L_O_T)
  private DunningLOT dunningLOT;

  /**
   * Gets or Sets fromLevel
   */
  @JsonAdapter(FromLevelEnum.Adapter.class)
  public enum FromLevelEnum {
    R0("R0"),
    
    R1("R1"),
    
    R2("R2"),
    
    R3("R3"),
    
    R4("R4");

    private String value;

    FromLevelEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static FromLevelEnum fromValue(String value) {
      for (FromLevelEnum b : FromLevelEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<FromLevelEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final FromLevelEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public FromLevelEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return FromLevelEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_FROM_LEVEL = "fromLevel";
  @SerializedName(SERIALIZED_NAME_FROM_LEVEL)
  private FromLevelEnum fromLevel;

  /**
   * Gets or Sets toLevel
   */
  @JsonAdapter(ToLevelEnum.Adapter.class)
  public enum ToLevelEnum {
    R0("R0"),
    
    R1("R1"),
    
    R2("R2"),
    
    R3("R3"),
    
    R4("R4");

    private String value;

    ToLevelEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static ToLevelEnum fromValue(String value) {
      for (ToLevelEnum b : ToLevelEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<ToLevelEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final ToLevelEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public ToLevelEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return ToLevelEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_TO_LEVEL = "toLevel";
  @SerializedName(SERIALIZED_NAME_TO_LEVEL)
  private ToLevelEnum toLevel;

  public static final String SERIALIZED_NAME_ACTION_PLAN_ITEM = "actionPlanItem";
  @SerializedName(SERIALIZED_NAME_ACTION_PLAN_ITEM)
  private WFAction actionPlanItem;

  public static final String SERIALIZED_NAME_AMOUNT_DUE = "amountDue";
  @SerializedName(SERIALIZED_NAME_AMOUNT_DUE)
  private BigDecimal amountDue;

  public static final String SERIALIZED_NAME_TRANSIENT = "transient";
  @SerializedName(SERIALIZED_NAME_TRANSIENT)
  private Boolean _transient;


  public ActionDunning id(Long id) {
    
    this.id = id;
    return this;
  }

   /**
   * Get id
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Long getId() {
    return id;
  }



  public void setId(Long id) {
    this.id = id;
  }


  public ActionDunning version(Integer version) {
    
    this.version = version;
    return this;
  }

   /**
   * Get version
   * @return version
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getVersion() {
    return version;
  }



  public void setVersion(Integer version) {
    this.version = version;
  }


  public ActionDunning auditable(Auditable auditable) {
    
    this.auditable = auditable;
    return this;
  }

   /**
   * Get auditable
   * @return auditable
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Auditable getAuditable() {
    return auditable;
  }



  public void setAuditable(Auditable auditable) {
    this.auditable = auditable;
  }


  public ActionDunning historized(Boolean historized) {
    
    this.historized = historized;
    return this;
  }

   /**
   * Get historized
   * @return historized
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getHistorized() {
    return historized;
  }



  public void setHistorized(Boolean historized) {
    this.historized = historized;
  }


  public ActionDunning notified(Boolean notified) {
    
    this.notified = notified;
    return this;
  }

   /**
   * Get notified
   * @return notified
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getNotified() {
    return notified;
  }



  public void setNotified(Boolean notified) {
    this.notified = notified;
  }


  public ActionDunning auditableFields(List<AuditableFieldHistory> auditableFields) {
    
    this.auditableFields = auditableFields;
    return this;
  }

  public ActionDunning addAuditableFieldsItem(AuditableFieldHistory auditableFieldsItem) {
    if (this.auditableFields == null) {
      this.auditableFields = new ArrayList<AuditableFieldHistory>();
    }
    this.auditableFields.add(auditableFieldsItem);
    return this;
  }

   /**
   * Get auditableFields
   * @return auditableFields
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public List<AuditableFieldHistory> getAuditableFields() {
    return auditableFields;
  }



  public void setAuditableFields(List<AuditableFieldHistory> auditableFields) {
    this.auditableFields = auditableFields;
  }


  public ActionDunning creationDate(OffsetDateTime creationDate) {
    
    this.creationDate = creationDate;
    return this;
  }

   /**
   * Get creationDate
   * @return creationDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public OffsetDateTime getCreationDate() {
    return creationDate;
  }



  public void setCreationDate(OffsetDateTime creationDate) {
    this.creationDate = creationDate;
  }


  public ActionDunning typeAction(TypeActionEnum typeAction) {
    
    this.typeAction = typeAction;
    return this;
  }

   /**
   * Get typeAction
   * @return typeAction
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public TypeActionEnum getTypeAction() {
    return typeAction;
  }



  public void setTypeAction(TypeActionEnum typeAction) {
    this.typeAction = typeAction;
  }


  public ActionDunning status(StatusEnum status) {
    
    this.status = status;
    return this;
  }

   /**
   * Get status
   * @return status
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public StatusEnum getStatus() {
    return status;
  }



  public void setStatus(StatusEnum status) {
    this.status = status;
  }


  public ActionDunning statusDate(OffsetDateTime statusDate) {
    
    this.statusDate = statusDate;
    return this;
  }

   /**
   * Get statusDate
   * @return statusDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public OffsetDateTime getStatusDate() {
    return statusDate;
  }



  public void setStatusDate(OffsetDateTime statusDate) {
    this.statusDate = statusDate;
  }


  public ActionDunning customerAccount(CustomerAccount customerAccount) {
    
    this.customerAccount = customerAccount;
    return this;
  }

   /**
   * Get customerAccount
   * @return customerAccount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public CustomerAccount getCustomerAccount() {
    return customerAccount;
  }



  public void setCustomerAccount(CustomerAccount customerAccount) {
    this.customerAccount = customerAccount;
  }


  public ActionDunning recordedInvoice(RecordedInvoice recordedInvoice) {
    
    this.recordedInvoice = recordedInvoice;
    return this;
  }

   /**
   * Get recordedInvoice
   * @return recordedInvoice
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public RecordedInvoice getRecordedInvoice() {
    return recordedInvoice;
  }



  public void setRecordedInvoice(RecordedInvoice recordedInvoice) {
    this.recordedInvoice = recordedInvoice;
  }


  public ActionDunning dunningLOT(DunningLOT dunningLOT) {
    
    this.dunningLOT = dunningLOT;
    return this;
  }

   /**
   * Get dunningLOT
   * @return dunningLOT
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public DunningLOT getDunningLOT() {
    return dunningLOT;
  }



  public void setDunningLOT(DunningLOT dunningLOT) {
    this.dunningLOT = dunningLOT;
  }


  public ActionDunning fromLevel(FromLevelEnum fromLevel) {
    
    this.fromLevel = fromLevel;
    return this;
  }

   /**
   * Get fromLevel
   * @return fromLevel
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public FromLevelEnum getFromLevel() {
    return fromLevel;
  }



  public void setFromLevel(FromLevelEnum fromLevel) {
    this.fromLevel = fromLevel;
  }


  public ActionDunning toLevel(ToLevelEnum toLevel) {
    
    this.toLevel = toLevel;
    return this;
  }

   /**
   * Get toLevel
   * @return toLevel
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public ToLevelEnum getToLevel() {
    return toLevel;
  }



  public void setToLevel(ToLevelEnum toLevel) {
    this.toLevel = toLevel;
  }


  public ActionDunning actionPlanItem(WFAction actionPlanItem) {
    
    this.actionPlanItem = actionPlanItem;
    return this;
  }

   /**
   * Get actionPlanItem
   * @return actionPlanItem
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public WFAction getActionPlanItem() {
    return actionPlanItem;
  }



  public void setActionPlanItem(WFAction actionPlanItem) {
    this.actionPlanItem = actionPlanItem;
  }


  public ActionDunning amountDue(BigDecimal amountDue) {
    
    this.amountDue = amountDue;
    return this;
  }

   /**
   * Get amountDue
   * @return amountDue
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public BigDecimal getAmountDue() {
    return amountDue;
  }



  public void setAmountDue(BigDecimal amountDue) {
    this.amountDue = amountDue;
  }


  public ActionDunning _transient(Boolean _transient) {
    
    this._transient = _transient;
    return this;
  }

   /**
   * Get _transient
   * @return _transient
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getTransient() {
    return _transient;
  }



  public void setTransient(Boolean _transient) {
    this._transient = _transient;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ActionDunning actionDunning = (ActionDunning) o;
    return Objects.equals(this.id, actionDunning.id) &&
        Objects.equals(this.version, actionDunning.version) &&
        Objects.equals(this.auditable, actionDunning.auditable) &&
        Objects.equals(this.historized, actionDunning.historized) &&
        Objects.equals(this.notified, actionDunning.notified) &&
        Objects.equals(this.auditableFields, actionDunning.auditableFields) &&
        Objects.equals(this.creationDate, actionDunning.creationDate) &&
        Objects.equals(this.typeAction, actionDunning.typeAction) &&
        Objects.equals(this.status, actionDunning.status) &&
        Objects.equals(this.statusDate, actionDunning.statusDate) &&
        Objects.equals(this.customerAccount, actionDunning.customerAccount) &&
        Objects.equals(this.recordedInvoice, actionDunning.recordedInvoice) &&
        Objects.equals(this.dunningLOT, actionDunning.dunningLOT) &&
        Objects.equals(this.fromLevel, actionDunning.fromLevel) &&
        Objects.equals(this.toLevel, actionDunning.toLevel) &&
        Objects.equals(this.actionPlanItem, actionDunning.actionPlanItem) &&
        Objects.equals(this.amountDue, actionDunning.amountDue) &&
        Objects.equals(this._transient, actionDunning._transient);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, version, auditable, historized, notified, auditableFields, creationDate, typeAction, status, statusDate, customerAccount, recordedInvoice, dunningLOT, fromLevel, toLevel, actionPlanItem, amountDue, _transient);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ActionDunning {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    version: ").append(toIndentedString(version)).append("\n");
    sb.append("    auditable: ").append(toIndentedString(auditable)).append("\n");
    sb.append("    historized: ").append(toIndentedString(historized)).append("\n");
    sb.append("    notified: ").append(toIndentedString(notified)).append("\n");
    sb.append("    auditableFields: ").append(toIndentedString(auditableFields)).append("\n");
    sb.append("    creationDate: ").append(toIndentedString(creationDate)).append("\n");
    sb.append("    typeAction: ").append(toIndentedString(typeAction)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    statusDate: ").append(toIndentedString(statusDate)).append("\n");
    sb.append("    customerAccount: ").append(toIndentedString(customerAccount)).append("\n");
    sb.append("    recordedInvoice: ").append(toIndentedString(recordedInvoice)).append("\n");
    sb.append("    dunningLOT: ").append(toIndentedString(dunningLOT)).append("\n");
    sb.append("    fromLevel: ").append(toIndentedString(fromLevel)).append("\n");
    sb.append("    toLevel: ").append(toIndentedString(toLevel)).append("\n");
    sb.append("    actionPlanItem: ").append(toIndentedString(actionPlanItem)).append("\n");
    sb.append("    amountDue: ").append(toIndentedString(amountDue)).append("\n");
    sb.append("    _transient: ").append(toIndentedString(_transient)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

