/*
 * 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.MatchingAmount;
import org.threeten.bp.OffsetDateTime;

/**
 * MatchingCode
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-13T10:03:17.753Z[GMT]")
public class MatchingCode {
  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_CODE = "code";
  @SerializedName(SERIALIZED_NAME_CODE)
  private String code;

  /**
   * Gets or Sets matchingType
   */
  @JsonAdapter(MatchingTypeEnum.Adapter.class)
  public enum MatchingTypeEnum {
    A("A"),
    
    M("M"),
    
    A_TIP("A_TIP"),
    
    A_DERICT_DEBIT("A_DERICT_DEBIT");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_MATCHING_TYPE = "matchingType";
  @SerializedName(SERIALIZED_NAME_MATCHING_TYPE)
  private MatchingTypeEnum matchingType;

  public static final String SERIALIZED_NAME_MATCHING_DATE = "matchingDate";
  @SerializedName(SERIALIZED_NAME_MATCHING_DATE)
  private OffsetDateTime matchingDate;

  public static final String SERIALIZED_NAME_MATCHING_AMOUNTS = "matchingAmounts";
  @SerializedName(SERIALIZED_NAME_MATCHING_AMOUNTS)
  private List<MatchingAmount> matchingAmounts = null;

  public static final String SERIALIZED_NAME_MATCHING_AMOUNT_CREDIT = "matchingAmountCredit";
  @SerializedName(SERIALIZED_NAME_MATCHING_AMOUNT_CREDIT)
  private BigDecimal matchingAmountCredit;

  public static final String SERIALIZED_NAME_MATCHING_AMOUNT_DEBIT = "matchingAmountDebit";
  @SerializedName(SERIALIZED_NAME_MATCHING_AMOUNT_DEBIT)
  private BigDecimal matchingAmountDebit;

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


  public MatchingCode 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 MatchingCode 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 MatchingCode 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 MatchingCode 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 MatchingCode 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 MatchingCode auditableFields(List<AuditableFieldHistory> auditableFields) {
    
    this.auditableFields = auditableFields;
    return this;
  }

  public MatchingCode 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 MatchingCode code(String code) {
    
    this.code = code;
    return this;
  }

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

  public String getCode() {
    return code;
  }



  public void setCode(String code) {
    this.code = code;
  }


  public MatchingCode matchingType(MatchingTypeEnum matchingType) {
    
    this.matchingType = matchingType;
    return this;
  }

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

  public MatchingTypeEnum getMatchingType() {
    return matchingType;
  }



  public void setMatchingType(MatchingTypeEnum matchingType) {
    this.matchingType = matchingType;
  }


  public MatchingCode matchingDate(OffsetDateTime matchingDate) {
    
    this.matchingDate = matchingDate;
    return this;
  }

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

  public OffsetDateTime getMatchingDate() {
    return matchingDate;
  }



  public void setMatchingDate(OffsetDateTime matchingDate) {
    this.matchingDate = matchingDate;
  }


  public MatchingCode matchingAmounts(List<MatchingAmount> matchingAmounts) {
    
    this.matchingAmounts = matchingAmounts;
    return this;
  }

  public MatchingCode addMatchingAmountsItem(MatchingAmount matchingAmountsItem) {
    if (this.matchingAmounts == null) {
      this.matchingAmounts = new ArrayList<MatchingAmount>();
    }
    this.matchingAmounts.add(matchingAmountsItem);
    return this;
  }

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

  public List<MatchingAmount> getMatchingAmounts() {
    return matchingAmounts;
  }



  public void setMatchingAmounts(List<MatchingAmount> matchingAmounts) {
    this.matchingAmounts = matchingAmounts;
  }


  public MatchingCode matchingAmountCredit(BigDecimal matchingAmountCredit) {
    
    this.matchingAmountCredit = matchingAmountCredit;
    return this;
  }

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

  public BigDecimal getMatchingAmountCredit() {
    return matchingAmountCredit;
  }



  public void setMatchingAmountCredit(BigDecimal matchingAmountCredit) {
    this.matchingAmountCredit = matchingAmountCredit;
  }


  public MatchingCode matchingAmountDebit(BigDecimal matchingAmountDebit) {
    
    this.matchingAmountDebit = matchingAmountDebit;
    return this;
  }

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

  public BigDecimal getMatchingAmountDebit() {
    return matchingAmountDebit;
  }



  public void setMatchingAmountDebit(BigDecimal matchingAmountDebit) {
    this.matchingAmountDebit = matchingAmountDebit;
  }


  public MatchingCode _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;
    }
    MatchingCode matchingCode = (MatchingCode) o;
    return Objects.equals(this.id, matchingCode.id) &&
        Objects.equals(this.version, matchingCode.version) &&
        Objects.equals(this.auditable, matchingCode.auditable) &&
        Objects.equals(this.historized, matchingCode.historized) &&
        Objects.equals(this.notified, matchingCode.notified) &&
        Objects.equals(this.auditableFields, matchingCode.auditableFields) &&
        Objects.equals(this.code, matchingCode.code) &&
        Objects.equals(this.matchingType, matchingCode.matchingType) &&
        Objects.equals(this.matchingDate, matchingCode.matchingDate) &&
        Objects.equals(this.matchingAmounts, matchingCode.matchingAmounts) &&
        Objects.equals(this.matchingAmountCredit, matchingCode.matchingAmountCredit) &&
        Objects.equals(this.matchingAmountDebit, matchingCode.matchingAmountDebit) &&
        Objects.equals(this._transient, matchingCode._transient);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, version, auditable, historized, notified, auditableFields, code, matchingType, matchingDate, matchingAmounts, matchingAmountCredit, matchingAmountDebit, _transient);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class MatchingCode {\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("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    matchingType: ").append(toIndentedString(matchingType)).append("\n");
    sb.append("    matchingDate: ").append(toIndentedString(matchingDate)).append("\n");
    sb.append("    matchingAmounts: ").append(toIndentedString(matchingAmounts)).append("\n");
    sb.append("    matchingAmountCredit: ").append(toIndentedString(matchingAmountCredit)).append("\n");
    sb.append("    matchingAmountDebit: ").append(toIndentedString(matchingAmountDebit)).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    ");
  }

}

