/*
 * 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.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.Auditable;
import org.openapitools.client.model.AuditableFieldHistory;
import org.openapitools.client.model.BusinessEntity;
import org.openapitools.client.model.CounterInstance;
import org.threeten.bp.OffsetDateTime;

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

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

  public static final String SERIALIZED_NAME_APPEND_GENERATED_CODE = "appendGeneratedCode";
  @SerializedName(SERIALIZED_NAME_APPEND_GENERATED_CODE)
  private Boolean appendGeneratedCode;

  public static final String SERIALIZED_NAME_COUNTER_INSTANCE = "counterInstance";
  @SerializedName(SERIALIZED_NAME_COUNTER_INSTANCE)
  private CounterInstance counterInstance;

  /**
   * Gets or Sets counterType
   */
  @JsonAdapter(CounterTypeEnum.Adapter.class)
  public enum CounterTypeEnum {
    USAGE("USAGE"),
    
    NOTIFICATION("NOTIFICATION");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_COUNTER_TYPE = "counterType";
  @SerializedName(SERIALIZED_NAME_COUNTER_TYPE)
  private CounterTypeEnum counterType;

  public static final String SERIALIZED_NAME_PERIOD_START_DATE = "periodStartDate";
  @SerializedName(SERIALIZED_NAME_PERIOD_START_DATE)
  private OffsetDateTime periodStartDate;

  public static final String SERIALIZED_NAME_PERIOD_END_DATE = "periodEndDate";
  @SerializedName(SERIALIZED_NAME_PERIOD_END_DATE)
  private OffsetDateTime periodEndDate;

  public static final String SERIALIZED_NAME_LEVEL = "level";
  @SerializedName(SERIALIZED_NAME_LEVEL)
  private BigDecimal level;

  public static final String SERIALIZED_NAME_VALUE = "value";
  @SerializedName(SERIALIZED_NAME_VALUE)
  private BigDecimal value;

  public static final String SERIALIZED_NAME_NOTIFICATION_LEVELS = "notificationLevels";
  @SerializedName(SERIALIZED_NAME_NOTIFICATION_LEVELS)
  private String notificationLevels;

  public static final String SERIALIZED_NAME_NOTIFICATION_LEVELS_AS_MAP = "notificationLevelsAsMap";
  @SerializedName(SERIALIZED_NAME_NOTIFICATION_LEVELS_AS_MAP)
  private Map<String, BigDecimal> notificationLevelsAsMap = null;

  public static final String SERIALIZED_NAME_DESCRIPTION_OR_CODE = "descriptionOrCode";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION_OR_CODE)
  private String descriptionOrCode;

  public static final String SERIALIZED_NAME_DESCRIPTION_AND_CODE = "descriptionAndCode";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION_AND_CODE)
  private String descriptionAndCode;

  public static final String SERIALIZED_NAME_REFERENCE_CODE = "referenceCode";
  @SerializedName(SERIALIZED_NAME_REFERENCE_CODE)
  private String referenceCode;

  public static final String SERIALIZED_NAME_REFERENCE_DESCRIPTION = "referenceDescription";
  @SerializedName(SERIALIZED_NAME_REFERENCE_DESCRIPTION)
  private String referenceDescription;

  public static final String SERIALIZED_NAME_CODE_CHANGED = "codeChanged";
  @SerializedName(SERIALIZED_NAME_CODE_CHANGED)
  private Boolean codeChanged;

  public static final String SERIALIZED_NAME_PARENT_ENTITY = "parentEntity";
  @SerializedName(SERIALIZED_NAME_PARENT_ENTITY)
  private BusinessEntity parentEntity;

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


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

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

   /**
   * Get code
   * @return code
  **/
  @ApiModelProperty(required = true, value = "")

  public String getCode() {
    return code;
  }



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


  public CounterPeriod 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 CounterPeriod appendGeneratedCode(Boolean appendGeneratedCode) {
    
    this.appendGeneratedCode = appendGeneratedCode;
    return this;
  }

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

  public Boolean getAppendGeneratedCode() {
    return appendGeneratedCode;
  }



  public void setAppendGeneratedCode(Boolean appendGeneratedCode) {
    this.appendGeneratedCode = appendGeneratedCode;
  }


  public CounterPeriod counterInstance(CounterInstance counterInstance) {
    
    this.counterInstance = counterInstance;
    return this;
  }

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

  public CounterInstance getCounterInstance() {
    return counterInstance;
  }



  public void setCounterInstance(CounterInstance counterInstance) {
    this.counterInstance = counterInstance;
  }


  public CounterPeriod counterType(CounterTypeEnum counterType) {
    
    this.counterType = counterType;
    return this;
  }

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

  public CounterTypeEnum getCounterType() {
    return counterType;
  }



  public void setCounterType(CounterTypeEnum counterType) {
    this.counterType = counterType;
  }


  public CounterPeriod periodStartDate(OffsetDateTime periodStartDate) {
    
    this.periodStartDate = periodStartDate;
    return this;
  }

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

  public OffsetDateTime getPeriodStartDate() {
    return periodStartDate;
  }



  public void setPeriodStartDate(OffsetDateTime periodStartDate) {
    this.periodStartDate = periodStartDate;
  }


  public CounterPeriod periodEndDate(OffsetDateTime periodEndDate) {
    
    this.periodEndDate = periodEndDate;
    return this;
  }

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

  public OffsetDateTime getPeriodEndDate() {
    return periodEndDate;
  }



  public void setPeriodEndDate(OffsetDateTime periodEndDate) {
    this.periodEndDate = periodEndDate;
  }


  public CounterPeriod level(BigDecimal level) {
    
    this.level = level;
    return this;
  }

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

  public BigDecimal getLevel() {
    return level;
  }



  public void setLevel(BigDecimal level) {
    this.level = level;
  }


  public CounterPeriod value(BigDecimal value) {
    
    this.value = value;
    return this;
  }

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

  public BigDecimal getValue() {
    return value;
  }



  public void setValue(BigDecimal value) {
    this.value = value;
  }


  public CounterPeriod notificationLevels(String notificationLevels) {
    
    this.notificationLevels = notificationLevels;
    return this;
  }

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

  public String getNotificationLevels() {
    return notificationLevels;
  }



  public void setNotificationLevels(String notificationLevels) {
    this.notificationLevels = notificationLevels;
  }


  public CounterPeriod notificationLevelsAsMap(Map<String, BigDecimal> notificationLevelsAsMap) {
    
    this.notificationLevelsAsMap = notificationLevelsAsMap;
    return this;
  }

  public CounterPeriod putNotificationLevelsAsMapItem(String key, BigDecimal notificationLevelsAsMapItem) {
    if (this.notificationLevelsAsMap == null) {
      this.notificationLevelsAsMap = new HashMap<String, BigDecimal>();
    }
    this.notificationLevelsAsMap.put(key, notificationLevelsAsMapItem);
    return this;
  }

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

  public Map<String, BigDecimal> getNotificationLevelsAsMap() {
    return notificationLevelsAsMap;
  }



  public void setNotificationLevelsAsMap(Map<String, BigDecimal> notificationLevelsAsMap) {
    this.notificationLevelsAsMap = notificationLevelsAsMap;
  }


  public CounterPeriod descriptionOrCode(String descriptionOrCode) {
    
    this.descriptionOrCode = descriptionOrCode;
    return this;
  }

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

  public String getDescriptionOrCode() {
    return descriptionOrCode;
  }



  public void setDescriptionOrCode(String descriptionOrCode) {
    this.descriptionOrCode = descriptionOrCode;
  }


  public CounterPeriod descriptionAndCode(String descriptionAndCode) {
    
    this.descriptionAndCode = descriptionAndCode;
    return this;
  }

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

  public String getDescriptionAndCode() {
    return descriptionAndCode;
  }



  public void setDescriptionAndCode(String descriptionAndCode) {
    this.descriptionAndCode = descriptionAndCode;
  }


  public CounterPeriod referenceCode(String referenceCode) {
    
    this.referenceCode = referenceCode;
    return this;
  }

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

  public String getReferenceCode() {
    return referenceCode;
  }



  public void setReferenceCode(String referenceCode) {
    this.referenceCode = referenceCode;
  }


  public CounterPeriod referenceDescription(String referenceDescription) {
    
    this.referenceDescription = referenceDescription;
    return this;
  }

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

  public String getReferenceDescription() {
    return referenceDescription;
  }



  public void setReferenceDescription(String referenceDescription) {
    this.referenceDescription = referenceDescription;
  }


  public CounterPeriod codeChanged(Boolean codeChanged) {
    
    this.codeChanged = codeChanged;
    return this;
  }

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

  public Boolean getCodeChanged() {
    return codeChanged;
  }



  public void setCodeChanged(Boolean codeChanged) {
    this.codeChanged = codeChanged;
  }


  public CounterPeriod parentEntity(BusinessEntity parentEntity) {
    
    this.parentEntity = parentEntity;
    return this;
  }

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

  public BusinessEntity getParentEntity() {
    return parentEntity;
  }



  public void setParentEntity(BusinessEntity parentEntity) {
    this.parentEntity = parentEntity;
  }


  public CounterPeriod _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;
    }
    CounterPeriod counterPeriod = (CounterPeriod) o;
    return Objects.equals(this.id, counterPeriod.id) &&
        Objects.equals(this.version, counterPeriod.version) &&
        Objects.equals(this.auditable, counterPeriod.auditable) &&
        Objects.equals(this.historized, counterPeriod.historized) &&
        Objects.equals(this.notified, counterPeriod.notified) &&
        Objects.equals(this.auditableFields, counterPeriod.auditableFields) &&
        Objects.equals(this.code, counterPeriod.code) &&
        Objects.equals(this.description, counterPeriod.description) &&
        Objects.equals(this.appendGeneratedCode, counterPeriod.appendGeneratedCode) &&
        Objects.equals(this.counterInstance, counterPeriod.counterInstance) &&
        Objects.equals(this.counterType, counterPeriod.counterType) &&
        Objects.equals(this.periodStartDate, counterPeriod.periodStartDate) &&
        Objects.equals(this.periodEndDate, counterPeriod.periodEndDate) &&
        Objects.equals(this.level, counterPeriod.level) &&
        Objects.equals(this.value, counterPeriod.value) &&
        Objects.equals(this.notificationLevels, counterPeriod.notificationLevels) &&
        Objects.equals(this.notificationLevelsAsMap, counterPeriod.notificationLevelsAsMap) &&
        Objects.equals(this.descriptionOrCode, counterPeriod.descriptionOrCode) &&
        Objects.equals(this.descriptionAndCode, counterPeriod.descriptionAndCode) &&
        Objects.equals(this.referenceCode, counterPeriod.referenceCode) &&
        Objects.equals(this.referenceDescription, counterPeriod.referenceDescription) &&
        Objects.equals(this.codeChanged, counterPeriod.codeChanged) &&
        Objects.equals(this.parentEntity, counterPeriod.parentEntity) &&
        Objects.equals(this._transient, counterPeriod._transient);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, version, auditable, historized, notified, auditableFields, code, description, appendGeneratedCode, counterInstance, counterType, periodStartDate, periodEndDate, level, value, notificationLevels, notificationLevelsAsMap, descriptionOrCode, descriptionAndCode, referenceCode, referenceDescription, codeChanged, parentEntity, _transient);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CounterPeriod {\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("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    appendGeneratedCode: ").append(toIndentedString(appendGeneratedCode)).append("\n");
    sb.append("    counterInstance: ").append(toIndentedString(counterInstance)).append("\n");
    sb.append("    counterType: ").append(toIndentedString(counterType)).append("\n");
    sb.append("    periodStartDate: ").append(toIndentedString(periodStartDate)).append("\n");
    sb.append("    periodEndDate: ").append(toIndentedString(periodEndDate)).append("\n");
    sb.append("    level: ").append(toIndentedString(level)).append("\n");
    sb.append("    value: ").append(toIndentedString(value)).append("\n");
    sb.append("    notificationLevels: ").append(toIndentedString(notificationLevels)).append("\n");
    sb.append("    notificationLevelsAsMap: ").append(toIndentedString(notificationLevelsAsMap)).append("\n");
    sb.append("    descriptionOrCode: ").append(toIndentedString(descriptionOrCode)).append("\n");
    sb.append("    descriptionAndCode: ").append(toIndentedString(descriptionAndCode)).append("\n");
    sb.append("    referenceCode: ").append(toIndentedString(referenceCode)).append("\n");
    sb.append("    referenceDescription: ").append(toIndentedString(referenceDescription)).append("\n");
    sb.append("    codeChanged: ").append(toIndentedString(codeChanged)).append("\n");
    sb.append("    parentEntity: ").append(toIndentedString(parentEntity)).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    ");
  }

}

