/*
 * 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 org.openapitools.client.model.CustomFieldsDto;

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

  public static final String SERIALIZED_NAME_BILLING_TEMPLATE_NAME_E_L = "billingTemplateNameEL";
  @SerializedName(SERIALIZED_NAME_BILLING_TEMPLATE_NAME_E_L)
  private String billingTemplateNameEL;

  public static final String SERIALIZED_NAME_INVOICE_DATE_DELAY = "invoiceDateDelay";
  @SerializedName(SERIALIZED_NAME_INVOICE_DATE_DELAY)
  private Integer invoiceDateDelay;

  public static final String SERIALIZED_NAME_DUE_DATE_DELAY = "dueDateDelay";
  @SerializedName(SERIALIZED_NAME_DUE_DATE_DELAY)
  private Integer dueDateDelay;

  public static final String SERIALIZED_NAME_DUE_DATE_DELAY_E_L = "dueDateDelayEL";
  @SerializedName(SERIALIZED_NAME_DUE_DATE_DELAY_E_L)
  private String dueDateDelayEL;

  public static final String SERIALIZED_NAME_DUE_DATE_DELAY_E_L_SPARK = "dueDateDelayELSpark";
  @SerializedName(SERIALIZED_NAME_DUE_DATE_DELAY_E_L_SPARK)
  private String dueDateDelayELSpark;

  public static final String SERIALIZED_NAME_INVOICE_DATE_PRODUCTION_DELAY = "invoiceDateProductionDelay";
  @SerializedName(SERIALIZED_NAME_INVOICE_DATE_PRODUCTION_DELAY)
  private Integer invoiceDateProductionDelay;

  public static final String SERIALIZED_NAME_TRANSACTION_DATE_DELAY = "transactionDateDelay";
  @SerializedName(SERIALIZED_NAME_TRANSACTION_DATE_DELAY)
  private Integer transactionDateDelay;

  public static final String SERIALIZED_NAME_CALENDAR = "calendar";
  @SerializedName(SERIALIZED_NAME_CALENDAR)
  private String calendar;

  public static final String SERIALIZED_NAME_INVOICING_THRESHOLD = "invoicingThreshold";
  @SerializedName(SERIALIZED_NAME_INVOICING_THRESHOLD)
  private BigDecimal invoicingThreshold;

  public static final String SERIALIZED_NAME_INVOICE_TYPE_CODE = "invoiceTypeCode";
  @SerializedName(SERIALIZED_NAME_INVOICE_TYPE_CODE)
  private String invoiceTypeCode;

  public static final String SERIALIZED_NAME_INVOICE_TYPE_EL = "invoiceTypeEl";
  @SerializedName(SERIALIZED_NAME_INVOICE_TYPE_EL)
  private String invoiceTypeEl;

  public static final String SERIALIZED_NAME_INVOICE_TYPE_EL_SPARK = "invoiceTypeElSpark";
  @SerializedName(SERIALIZED_NAME_INVOICE_TYPE_EL_SPARK)
  private String invoiceTypeElSpark;

  public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "customFields";
  @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS)
  private CustomFieldsDto customFields;

  /**
   * Gets or Sets type
   */
  @JsonAdapter(TypeEnum.Adapter.class)
  public enum TypeEnum {
    BILLINGACCOUNT("BILLINGACCOUNT"),
    
    SUBSCRIPTION("SUBSCRIPTION"),
    
    ORDER("ORDER");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_TYPE = "type";
  @SerializedName(SERIALIZED_NAME_TYPE)
  private TypeEnum type;

  /**
   * Gets or Sets referenceDate
   */
  @JsonAdapter(ReferenceDateEnum.Adapter.class)
  public enum ReferenceDateEnum {
    TODAY("TODAY"),
    
    NEXT_INVOICE_DATE("NEXT_INVOICE_DATE"),
    
    LAST_TRANSACTION_DATE("LAST_TRANSACTION_DATE"),
    
    END_DATE("END_DATE");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_REFERENCE_DATE = "referenceDate";
  @SerializedName(SERIALIZED_NAME_REFERENCE_DATE)
  private ReferenceDateEnum referenceDate;

  public static final String SERIALIZED_NAME_SCRIPT_INSTANCE_CODE = "scriptInstanceCode";
  @SerializedName(SERIALIZED_NAME_SCRIPT_INSTANCE_CODE)
  private String scriptInstanceCode;

  public static final String SERIALIZED_NAME_DUE_DATE_DELAY_SPARK = "dueDateDelaySpark";
  @SerializedName(SERIALIZED_NAME_DUE_DATE_DELAY_SPARK)
  private String dueDateDelaySpark;


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

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

  public String getBillingTemplateName() {
    return billingTemplateName;
  }



  public void setBillingTemplateName(String billingTemplateName) {
    this.billingTemplateName = billingTemplateName;
  }


  public BillingCycleDto billingTemplateNameEL(String billingTemplateNameEL) {
    
    this.billingTemplateNameEL = billingTemplateNameEL;
    return this;
  }

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

  public String getBillingTemplateNameEL() {
    return billingTemplateNameEL;
  }



  public void setBillingTemplateNameEL(String billingTemplateNameEL) {
    this.billingTemplateNameEL = billingTemplateNameEL;
  }


  public BillingCycleDto invoiceDateDelay(Integer invoiceDateDelay) {
    
    this.invoiceDateDelay = invoiceDateDelay;
    return this;
  }

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

  public Integer getInvoiceDateDelay() {
    return invoiceDateDelay;
  }



  public void setInvoiceDateDelay(Integer invoiceDateDelay) {
    this.invoiceDateDelay = invoiceDateDelay;
  }


  public BillingCycleDto dueDateDelay(Integer dueDateDelay) {
    
    this.dueDateDelay = dueDateDelay;
    return this;
  }

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

  public Integer getDueDateDelay() {
    return dueDateDelay;
  }



  public void setDueDateDelay(Integer dueDateDelay) {
    this.dueDateDelay = dueDateDelay;
  }


  public BillingCycleDto dueDateDelayEL(String dueDateDelayEL) {
    
    this.dueDateDelayEL = dueDateDelayEL;
    return this;
  }

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

  public String getDueDateDelayEL() {
    return dueDateDelayEL;
  }



  public void setDueDateDelayEL(String dueDateDelayEL) {
    this.dueDateDelayEL = dueDateDelayEL;
  }


  public BillingCycleDto dueDateDelayELSpark(String dueDateDelayELSpark) {
    
    this.dueDateDelayELSpark = dueDateDelayELSpark;
    return this;
  }

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

  public String getDueDateDelayELSpark() {
    return dueDateDelayELSpark;
  }



  public void setDueDateDelayELSpark(String dueDateDelayELSpark) {
    this.dueDateDelayELSpark = dueDateDelayELSpark;
  }


  public BillingCycleDto invoiceDateProductionDelay(Integer invoiceDateProductionDelay) {
    
    this.invoiceDateProductionDelay = invoiceDateProductionDelay;
    return this;
  }

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

  public Integer getInvoiceDateProductionDelay() {
    return invoiceDateProductionDelay;
  }



  public void setInvoiceDateProductionDelay(Integer invoiceDateProductionDelay) {
    this.invoiceDateProductionDelay = invoiceDateProductionDelay;
  }


  public BillingCycleDto transactionDateDelay(Integer transactionDateDelay) {
    
    this.transactionDateDelay = transactionDateDelay;
    return this;
  }

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

  public Integer getTransactionDateDelay() {
    return transactionDateDelay;
  }



  public void setTransactionDateDelay(Integer transactionDateDelay) {
    this.transactionDateDelay = transactionDateDelay;
  }


  public BillingCycleDto calendar(String calendar) {
    
    this.calendar = calendar;
    return this;
  }

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

  public String getCalendar() {
    return calendar;
  }



  public void setCalendar(String calendar) {
    this.calendar = calendar;
  }


  public BillingCycleDto invoicingThreshold(BigDecimal invoicingThreshold) {
    
    this.invoicingThreshold = invoicingThreshold;
    return this;
  }

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

  public BigDecimal getInvoicingThreshold() {
    return invoicingThreshold;
  }



  public void setInvoicingThreshold(BigDecimal invoicingThreshold) {
    this.invoicingThreshold = invoicingThreshold;
  }


  public BillingCycleDto invoiceTypeCode(String invoiceTypeCode) {
    
    this.invoiceTypeCode = invoiceTypeCode;
    return this;
  }

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

  public String getInvoiceTypeCode() {
    return invoiceTypeCode;
  }



  public void setInvoiceTypeCode(String invoiceTypeCode) {
    this.invoiceTypeCode = invoiceTypeCode;
  }


  public BillingCycleDto invoiceTypeEl(String invoiceTypeEl) {
    
    this.invoiceTypeEl = invoiceTypeEl;
    return this;
  }

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

  public String getInvoiceTypeEl() {
    return invoiceTypeEl;
  }



  public void setInvoiceTypeEl(String invoiceTypeEl) {
    this.invoiceTypeEl = invoiceTypeEl;
  }


  public BillingCycleDto invoiceTypeElSpark(String invoiceTypeElSpark) {
    
    this.invoiceTypeElSpark = invoiceTypeElSpark;
    return this;
  }

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

  public String getInvoiceTypeElSpark() {
    return invoiceTypeElSpark;
  }



  public void setInvoiceTypeElSpark(String invoiceTypeElSpark) {
    this.invoiceTypeElSpark = invoiceTypeElSpark;
  }


  public BillingCycleDto customFields(CustomFieldsDto customFields) {
    
    this.customFields = customFields;
    return this;
  }

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

  public CustomFieldsDto getCustomFields() {
    return customFields;
  }



  public void setCustomFields(CustomFieldsDto customFields) {
    this.customFields = customFields;
  }


  public BillingCycleDto type(TypeEnum type) {
    
    this.type = type;
    return this;
  }

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

  public TypeEnum getType() {
    return type;
  }



  public void setType(TypeEnum type) {
    this.type = type;
  }


  public BillingCycleDto referenceDate(ReferenceDateEnum referenceDate) {
    
    this.referenceDate = referenceDate;
    return this;
  }

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

  public ReferenceDateEnum getReferenceDate() {
    return referenceDate;
  }



  public void setReferenceDate(ReferenceDateEnum referenceDate) {
    this.referenceDate = referenceDate;
  }


  public BillingCycleDto scriptInstanceCode(String scriptInstanceCode) {
    
    this.scriptInstanceCode = scriptInstanceCode;
    return this;
  }

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

  public String getScriptInstanceCode() {
    return scriptInstanceCode;
  }



  public void setScriptInstanceCode(String scriptInstanceCode) {
    this.scriptInstanceCode = scriptInstanceCode;
  }


  public BillingCycleDto dueDateDelaySpark(String dueDateDelaySpark) {
    
    this.dueDateDelaySpark = dueDateDelaySpark;
    return this;
  }

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

  public String getDueDateDelaySpark() {
    return dueDateDelaySpark;
  }



  public void setDueDateDelaySpark(String dueDateDelaySpark) {
    this.dueDateDelaySpark = dueDateDelaySpark;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    BillingCycleDto billingCycleDto = (BillingCycleDto) o;
    return Objects.equals(this.id, billingCycleDto.id) &&
        Objects.equals(this.code, billingCycleDto.code) &&
        Objects.equals(this.description, billingCycleDto.description) &&
        Objects.equals(this.updatedCode, billingCycleDto.updatedCode) &&
        Objects.equals(this.billingTemplateName, billingCycleDto.billingTemplateName) &&
        Objects.equals(this.billingTemplateNameEL, billingCycleDto.billingTemplateNameEL) &&
        Objects.equals(this.invoiceDateDelay, billingCycleDto.invoiceDateDelay) &&
        Objects.equals(this.dueDateDelay, billingCycleDto.dueDateDelay) &&
        Objects.equals(this.dueDateDelayEL, billingCycleDto.dueDateDelayEL) &&
        Objects.equals(this.dueDateDelayELSpark, billingCycleDto.dueDateDelayELSpark) &&
        Objects.equals(this.invoiceDateProductionDelay, billingCycleDto.invoiceDateProductionDelay) &&
        Objects.equals(this.transactionDateDelay, billingCycleDto.transactionDateDelay) &&
        Objects.equals(this.calendar, billingCycleDto.calendar) &&
        Objects.equals(this.invoicingThreshold, billingCycleDto.invoicingThreshold) &&
        Objects.equals(this.invoiceTypeCode, billingCycleDto.invoiceTypeCode) &&
        Objects.equals(this.invoiceTypeEl, billingCycleDto.invoiceTypeEl) &&
        Objects.equals(this.invoiceTypeElSpark, billingCycleDto.invoiceTypeElSpark) &&
        Objects.equals(this.customFields, billingCycleDto.customFields) &&
        Objects.equals(this.type, billingCycleDto.type) &&
        Objects.equals(this.referenceDate, billingCycleDto.referenceDate) &&
        Objects.equals(this.scriptInstanceCode, billingCycleDto.scriptInstanceCode) &&
        Objects.equals(this.dueDateDelaySpark, billingCycleDto.dueDateDelaySpark);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, code, description, updatedCode, billingTemplateName, billingTemplateNameEL, invoiceDateDelay, dueDateDelay, dueDateDelayEL, dueDateDelayELSpark, invoiceDateProductionDelay, transactionDateDelay, calendar, invoicingThreshold, invoiceTypeCode, invoiceTypeEl, invoiceTypeElSpark, customFields, type, referenceDate, scriptInstanceCode, dueDateDelaySpark);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class BillingCycleDto {\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("    billingTemplateName: ").append(toIndentedString(billingTemplateName)).append("\n");
    sb.append("    billingTemplateNameEL: ").append(toIndentedString(billingTemplateNameEL)).append("\n");
    sb.append("    invoiceDateDelay: ").append(toIndentedString(invoiceDateDelay)).append("\n");
    sb.append("    dueDateDelay: ").append(toIndentedString(dueDateDelay)).append("\n");
    sb.append("    dueDateDelayEL: ").append(toIndentedString(dueDateDelayEL)).append("\n");
    sb.append("    dueDateDelayELSpark: ").append(toIndentedString(dueDateDelayELSpark)).append("\n");
    sb.append("    invoiceDateProductionDelay: ").append(toIndentedString(invoiceDateProductionDelay)).append("\n");
    sb.append("    transactionDateDelay: ").append(toIndentedString(transactionDateDelay)).append("\n");
    sb.append("    calendar: ").append(toIndentedString(calendar)).append("\n");
    sb.append("    invoicingThreshold: ").append(toIndentedString(invoicingThreshold)).append("\n");
    sb.append("    invoiceTypeCode: ").append(toIndentedString(invoiceTypeCode)).append("\n");
    sb.append("    invoiceTypeEl: ").append(toIndentedString(invoiceTypeEl)).append("\n");
    sb.append("    invoiceTypeElSpark: ").append(toIndentedString(invoiceTypeElSpark)).append("\n");
    sb.append("    customFields: ").append(toIndentedString(customFields)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    referenceDate: ").append(toIndentedString(referenceDate)).append("\n");
    sb.append("    scriptInstanceCode: ").append(toIndentedString(scriptInstanceCode)).append("\n");
    sb.append("    dueDateDelaySpark: ").append(toIndentedString(dueDateDelaySpark)).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    ");
  }

}

