/*
 * 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;

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

  public static final String SERIALIZED_NAME_CODE = "code";
  @SerializedName(SERIALIZED_NAME_CODE)
  private String code;

  public static final String SERIALIZED_NAME_DESCRIPTION = "description";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION)
  private String description;

  public static final String SERIALIZED_NAME_UPDATED_CODE = "updatedCode";
  @SerializedName(SERIALIZED_NAME_UPDATED_CODE)
  private String updatedCode;

  public static final String SERIALIZED_NAME_DISABLED = "disabled";
  @SerializedName(SERIALIZED_NAME_DISABLED)
  private Boolean disabled;

  public static final String SERIALIZED_NAME_PARENT_ACCOUNTING_CODE = "parentAccountingCode";
  @SerializedName(SERIALIZED_NAME_PARENT_ACCOUNTING_CODE)
  private String parentAccountingCode;

  /**
   * Gets or Sets chartOfAccountTypeEnum
   */
  @JsonAdapter(ChartOfAccountTypeEnumEnum.Adapter.class)
  public enum ChartOfAccountTypeEnumEnum {
    ASSETS("ASSETS"),
    
    LIABILITIES("LIABILITIES"),
    
    EQUITY("EQUITY"),
    
    REVENUE("REVENUE"),
    
    EXPENSE("EXPENSE");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_CHART_OF_ACCOUNT_TYPE_ENUM = "chartOfAccountTypeEnum";
  @SerializedName(SERIALIZED_NAME_CHART_OF_ACCOUNT_TYPE_ENUM)
  private ChartOfAccountTypeEnumEnum chartOfAccountTypeEnum;

  /**
   * Gets or Sets chartOfAccountViewTypeEnum
   */
  @JsonAdapter(ChartOfAccountViewTypeEnumEnum.Adapter.class)
  public enum ChartOfAccountViewTypeEnumEnum {
    VIEW("VIEW"),
    
    REGULAR("REGULAR");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_CHART_OF_ACCOUNT_VIEW_TYPE_ENUM = "chartOfAccountViewTypeEnum";
  @SerializedName(SERIALIZED_NAME_CHART_OF_ACCOUNT_VIEW_TYPE_ENUM)
  private ChartOfAccountViewTypeEnumEnum chartOfAccountViewTypeEnum;

  public static final String SERIALIZED_NAME_REPORTING_ACCOUNT = "reportingAccount";
  @SerializedName(SERIALIZED_NAME_REPORTING_ACCOUNT)
  private String reportingAccount;

  public static final String SERIALIZED_NAME_NOTES = "notes";
  @SerializedName(SERIALIZED_NAME_NOTES)
  private String notes;

  public static final String SERIALIZED_NAME_MIGRATED = "migrated";
  @SerializedName(SERIALIZED_NAME_MIGRATED)
  private Boolean migrated;


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

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

  public String getDescription() {
    return description;
  }



  public void setDescription(String description) {
    this.description = description;
  }


  public AccountingCodeDto updatedCode(String updatedCode) {
    
    this.updatedCode = updatedCode;
    return this;
  }

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

  public String getUpdatedCode() {
    return updatedCode;
  }



  public void setUpdatedCode(String updatedCode) {
    this.updatedCode = updatedCode;
  }


  public AccountingCodeDto disabled(Boolean disabled) {
    
    this.disabled = disabled;
    return this;
  }

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

  public Boolean getDisabled() {
    return disabled;
  }



  public void setDisabled(Boolean disabled) {
    this.disabled = disabled;
  }


  public AccountingCodeDto parentAccountingCode(String parentAccountingCode) {
    
    this.parentAccountingCode = parentAccountingCode;
    return this;
  }

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

  public String getParentAccountingCode() {
    return parentAccountingCode;
  }



  public void setParentAccountingCode(String parentAccountingCode) {
    this.parentAccountingCode = parentAccountingCode;
  }


  public AccountingCodeDto chartOfAccountTypeEnum(ChartOfAccountTypeEnumEnum chartOfAccountTypeEnum) {
    
    this.chartOfAccountTypeEnum = chartOfAccountTypeEnum;
    return this;
  }

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

  public ChartOfAccountTypeEnumEnum getChartOfAccountTypeEnum() {
    return chartOfAccountTypeEnum;
  }



  public void setChartOfAccountTypeEnum(ChartOfAccountTypeEnumEnum chartOfAccountTypeEnum) {
    this.chartOfAccountTypeEnum = chartOfAccountTypeEnum;
  }


  public AccountingCodeDto chartOfAccountViewTypeEnum(ChartOfAccountViewTypeEnumEnum chartOfAccountViewTypeEnum) {
    
    this.chartOfAccountViewTypeEnum = chartOfAccountViewTypeEnum;
    return this;
  }

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

  public ChartOfAccountViewTypeEnumEnum getChartOfAccountViewTypeEnum() {
    return chartOfAccountViewTypeEnum;
  }



  public void setChartOfAccountViewTypeEnum(ChartOfAccountViewTypeEnumEnum chartOfAccountViewTypeEnum) {
    this.chartOfAccountViewTypeEnum = chartOfAccountViewTypeEnum;
  }


  public AccountingCodeDto reportingAccount(String reportingAccount) {
    
    this.reportingAccount = reportingAccount;
    return this;
  }

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

  public String getReportingAccount() {
    return reportingAccount;
  }



  public void setReportingAccount(String reportingAccount) {
    this.reportingAccount = reportingAccount;
  }


  public AccountingCodeDto notes(String notes) {
    
    this.notes = notes;
    return this;
  }

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

  public String getNotes() {
    return notes;
  }



  public void setNotes(String notes) {
    this.notes = notes;
  }


  public AccountingCodeDto migrated(Boolean migrated) {
    
    this.migrated = migrated;
    return this;
  }

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

  public Boolean getMigrated() {
    return migrated;
  }



  public void setMigrated(Boolean migrated) {
    this.migrated = migrated;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AccountingCodeDto accountingCodeDto = (AccountingCodeDto) o;
    return Objects.equals(this.id, accountingCodeDto.id) &&
        Objects.equals(this.code, accountingCodeDto.code) &&
        Objects.equals(this.description, accountingCodeDto.description) &&
        Objects.equals(this.updatedCode, accountingCodeDto.updatedCode) &&
        Objects.equals(this.disabled, accountingCodeDto.disabled) &&
        Objects.equals(this.parentAccountingCode, accountingCodeDto.parentAccountingCode) &&
        Objects.equals(this.chartOfAccountTypeEnum, accountingCodeDto.chartOfAccountTypeEnum) &&
        Objects.equals(this.chartOfAccountViewTypeEnum, accountingCodeDto.chartOfAccountViewTypeEnum) &&
        Objects.equals(this.reportingAccount, accountingCodeDto.reportingAccount) &&
        Objects.equals(this.notes, accountingCodeDto.notes) &&
        Objects.equals(this.migrated, accountingCodeDto.migrated);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, code, description, updatedCode, disabled, parentAccountingCode, chartOfAccountTypeEnum, chartOfAccountViewTypeEnum, reportingAccount, notes, migrated);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AccountingCodeDto {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    updatedCode: ").append(toIndentedString(updatedCode)).append("\n");
    sb.append("    disabled: ").append(toIndentedString(disabled)).append("\n");
    sb.append("    parentAccountingCode: ").append(toIndentedString(parentAccountingCode)).append("\n");
    sb.append("    chartOfAccountTypeEnum: ").append(toIndentedString(chartOfAccountTypeEnum)).append("\n");
    sb.append("    chartOfAccountViewTypeEnum: ").append(toIndentedString(chartOfAccountViewTypeEnum)).append("\n");
    sb.append("    reportingAccount: ").append(toIndentedString(reportingAccount)).append("\n");
    sb.append("    notes: ").append(toIndentedString(notes)).append("\n");
    sb.append("    migrated: ").append(toIndentedString(migrated)).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    ");
  }

}

