/*
 * 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.BillingAccount;
import org.openapitools.client.model.BusinessEntity;
import org.openapitools.client.model.Calendar;
import org.openapitools.client.model.CustomFieldValues;
import org.openapitools.client.model.ICustomFieldEntity;
import org.openapitools.client.model.InvoiceType;
import org.openapitools.client.model.ScriptInstance;

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

  public static final String SERIALIZED_NAME_CF_VALUES = "cfValues";
  @SerializedName(SERIALIZED_NAME_CF_VALUES)
  private CustomFieldValues cfValues;

  public static final String SERIALIZED_NAME_CF_ACCUMULATED_VALUES = "cfAccumulatedValues";
  @SerializedName(SERIALIZED_NAME_CF_ACCUMULATED_VALUES)
  private CustomFieldValues cfAccumulatedValues;

  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_CALENDAR = "calendar";
  @SerializedName(SERIALIZED_NAME_CALENDAR)
  private Calendar calendar;

  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_INVOICE_DATE_PRODUCTION_DELAY = "invoiceDateProductionDelay";
  @SerializedName(SERIALIZED_NAME_INVOICE_DATE_PRODUCTION_DELAY)
  private Integer invoiceDateProductionDelay;

  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_BILLING_ACCOUNTS = "billingAccounts";
  @SerializedName(SERIALIZED_NAME_BILLING_ACCOUNTS)
  private List<BillingAccount> billingAccounts = null;

  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 = "invoiceType";
  @SerializedName(SERIALIZED_NAME_INVOICE_TYPE)
  private InvoiceType invoiceType;

  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_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;

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

  public static final String SERIALIZED_NAME_SCRIPT_INSTANCE = "scriptInstance";
  @SerializedName(SERIALIZED_NAME_SCRIPT_INSTANCE)
  private ScriptInstance scriptInstance;

  /**
   * 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_PARENT_C_F_ENTITIES = "parentCFEntities";
  @SerializedName(SERIALIZED_NAME_PARENT_C_F_ENTITIES)
  private List<ICustomFieldEntity> parentCFEntities = null;

  public static final String SERIALIZED_NAME_CF_VALUES_NULL_SAFE = "cfValuesNullSafe";
  @SerializedName(SERIALIZED_NAME_CF_VALUES_NULL_SAFE)
  private CustomFieldValues cfValuesNullSafe;

  public static final String SERIALIZED_NAME_CF_VALUES_AS_VALUES = "cfValuesAsValues";
  @SerializedName(SERIALIZED_NAME_CF_VALUES_AS_VALUES)
  private Map<String, Object> cfValuesAsValues = null;

  public static final String SERIALIZED_NAME_CF_ACCUMULATED_VALUES_NULL_SAFE = "cfAccumulatedValuesNullSafe";
  @SerializedName(SERIALIZED_NAME_CF_ACCUMULATED_VALUES_NULL_SAFE)
  private CustomFieldValues cfAccumulatedValuesNullSafe;

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

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

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

  public String getUuid() {
    return uuid;
  }



  public void setUuid(String uuid) {
    this.uuid = uuid;
  }


  public BillingCycle cfValues(CustomFieldValues cfValues) {
    
    this.cfValues = cfValues;
    return this;
  }

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

  public CustomFieldValues getCfValues() {
    return cfValues;
  }



  public void setCfValues(CustomFieldValues cfValues) {
    this.cfValues = cfValues;
  }


  public BillingCycle cfAccumulatedValues(CustomFieldValues cfAccumulatedValues) {
    
    this.cfAccumulatedValues = cfAccumulatedValues;
    return this;
  }

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

  public CustomFieldValues getCfAccumulatedValues() {
    return cfAccumulatedValues;
  }



  public void setCfAccumulatedValues(CustomFieldValues cfAccumulatedValues) {
    this.cfAccumulatedValues = cfAccumulatedValues;
  }


  public BillingCycle 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 BillingCycle 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 BillingCycle calendar(Calendar calendar) {
    
    this.calendar = calendar;
    return this;
  }

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

  public Calendar getCalendar() {
    return calendar;
  }



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


  public BillingCycle 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 BillingCycle 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 BillingCycle invoiceDateDelay(Integer invoiceDateDelay) {
    
    this.invoiceDateDelay = invoiceDateDelay;
    return this;
  }

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

  public Integer getInvoiceDateDelay() {
    return invoiceDateDelay;
  }



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


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

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

  public Integer getDueDateDelay() {
    return dueDateDelay;
  }



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


  public BillingCycle billingAccounts(List<BillingAccount> billingAccounts) {
    
    this.billingAccounts = billingAccounts;
    return this;
  }

  public BillingCycle addBillingAccountsItem(BillingAccount billingAccountsItem) {
    if (this.billingAccounts == null) {
      this.billingAccounts = new ArrayList<BillingAccount>();
    }
    this.billingAccounts.add(billingAccountsItem);
    return this;
  }

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

  public List<BillingAccount> getBillingAccounts() {
    return billingAccounts;
  }



  public void setBillingAccounts(List<BillingAccount> billingAccounts) {
    this.billingAccounts = billingAccounts;
  }


  public BillingCycle 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 BillingCycle invoiceType(InvoiceType invoiceType) {
    
    this.invoiceType = invoiceType;
    return this;
  }

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

  public InvoiceType getInvoiceType() {
    return invoiceType;
  }



  public void setInvoiceType(InvoiceType invoiceType) {
    this.invoiceType = invoiceType;
  }


  public BillingCycle 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 BillingCycle 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 BillingCycle 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 BillingCycle 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 BillingCycle 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 BillingCycle scriptInstance(ScriptInstance scriptInstance) {
    
    this.scriptInstance = scriptInstance;
    return this;
  }

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

  public ScriptInstance getScriptInstance() {
    return scriptInstance;
  }



  public void setScriptInstance(ScriptInstance scriptInstance) {
    this.scriptInstance = scriptInstance;
  }


  public BillingCycle 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 BillingCycle parentCFEntities(List<ICustomFieldEntity> parentCFEntities) {
    
    this.parentCFEntities = parentCFEntities;
    return this;
  }

  public BillingCycle addParentCFEntitiesItem(ICustomFieldEntity parentCFEntitiesItem) {
    if (this.parentCFEntities == null) {
      this.parentCFEntities = new ArrayList<ICustomFieldEntity>();
    }
    this.parentCFEntities.add(parentCFEntitiesItem);
    return this;
  }

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

  public List<ICustomFieldEntity> getParentCFEntities() {
    return parentCFEntities;
  }



  public void setParentCFEntities(List<ICustomFieldEntity> parentCFEntities) {
    this.parentCFEntities = parentCFEntities;
  }


  public BillingCycle cfValuesNullSafe(CustomFieldValues cfValuesNullSafe) {
    
    this.cfValuesNullSafe = cfValuesNullSafe;
    return this;
  }

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

  public CustomFieldValues getCfValuesNullSafe() {
    return cfValuesNullSafe;
  }



  public void setCfValuesNullSafe(CustomFieldValues cfValuesNullSafe) {
    this.cfValuesNullSafe = cfValuesNullSafe;
  }


  public BillingCycle cfValuesAsValues(Map<String, Object> cfValuesAsValues) {
    
    this.cfValuesAsValues = cfValuesAsValues;
    return this;
  }

  public BillingCycle putCfValuesAsValuesItem(String key, Object cfValuesAsValuesItem) {
    if (this.cfValuesAsValues == null) {
      this.cfValuesAsValues = new HashMap<String, Object>();
    }
    this.cfValuesAsValues.put(key, cfValuesAsValuesItem);
    return this;
  }

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

  public Map<String, Object> getCfValuesAsValues() {
    return cfValuesAsValues;
  }



  public void setCfValuesAsValues(Map<String, Object> cfValuesAsValues) {
    this.cfValuesAsValues = cfValuesAsValues;
  }


  public BillingCycle cfAccumulatedValuesNullSafe(CustomFieldValues cfAccumulatedValuesNullSafe) {
    
    this.cfAccumulatedValuesNullSafe = cfAccumulatedValuesNullSafe;
    return this;
  }

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

  public CustomFieldValues getCfAccumulatedValuesNullSafe() {
    return cfAccumulatedValuesNullSafe;
  }



  public void setCfAccumulatedValuesNullSafe(CustomFieldValues cfAccumulatedValuesNullSafe) {
    this.cfAccumulatedValuesNullSafe = cfAccumulatedValuesNullSafe;
  }


  public BillingCycle 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 BillingCycle 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 BillingCycle 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 BillingCycle 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 BillingCycle 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 BillingCycle 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 BillingCycle _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;
    }
    BillingCycle billingCycle = (BillingCycle) o;
    return Objects.equals(this.id, billingCycle.id) &&
        Objects.equals(this.version, billingCycle.version) &&
        Objects.equals(this.auditable, billingCycle.auditable) &&
        Objects.equals(this.historized, billingCycle.historized) &&
        Objects.equals(this.notified, billingCycle.notified) &&
        Objects.equals(this.auditableFields, billingCycle.auditableFields) &&
        Objects.equals(this.code, billingCycle.code) &&
        Objects.equals(this.description, billingCycle.description) &&
        Objects.equals(this.appendGeneratedCode, billingCycle.appendGeneratedCode) &&
        Objects.equals(this.uuid, billingCycle.uuid) &&
        Objects.equals(this.cfValues, billingCycle.cfValues) &&
        Objects.equals(this.cfAccumulatedValues, billingCycle.cfAccumulatedValues) &&
        Objects.equals(this.billingTemplateName, billingCycle.billingTemplateName) &&
        Objects.equals(this.billingTemplateNameEL, billingCycle.billingTemplateNameEL) &&
        Objects.equals(this.calendar, billingCycle.calendar) &&
        Objects.equals(this.transactionDateDelay, billingCycle.transactionDateDelay) &&
        Objects.equals(this.invoiceDateProductionDelay, billingCycle.invoiceDateProductionDelay) &&
        Objects.equals(this.invoiceDateDelay, billingCycle.invoiceDateDelay) &&
        Objects.equals(this.dueDateDelay, billingCycle.dueDateDelay) &&
        Objects.equals(this.billingAccounts, billingCycle.billingAccounts) &&
        Objects.equals(this.invoicingThreshold, billingCycle.invoicingThreshold) &&
        Objects.equals(this.invoiceType, billingCycle.invoiceType) &&
        Objects.equals(this.dueDateDelayEL, billingCycle.dueDateDelayEL) &&
        Objects.equals(this.dueDateDelayELSpark, billingCycle.dueDateDelayELSpark) &&
        Objects.equals(this.invoiceTypeEl, billingCycle.invoiceTypeEl) &&
        Objects.equals(this.invoiceTypeElSpark, billingCycle.invoiceTypeElSpark) &&
        Objects.equals(this.type, billingCycle.type) &&
        Objects.equals(this.scriptInstance, billingCycle.scriptInstance) &&
        Objects.equals(this.referenceDate, billingCycle.referenceDate) &&
        Objects.equals(this.parentCFEntities, billingCycle.parentCFEntities) &&
        Objects.equals(this.cfValuesNullSafe, billingCycle.cfValuesNullSafe) &&
        Objects.equals(this.cfValuesAsValues, billingCycle.cfValuesAsValues) &&
        Objects.equals(this.cfAccumulatedValuesNullSafe, billingCycle.cfAccumulatedValuesNullSafe) &&
        Objects.equals(this.descriptionOrCode, billingCycle.descriptionOrCode) &&
        Objects.equals(this.descriptionAndCode, billingCycle.descriptionAndCode) &&
        Objects.equals(this.referenceCode, billingCycle.referenceCode) &&
        Objects.equals(this.referenceDescription, billingCycle.referenceDescription) &&
        Objects.equals(this.codeChanged, billingCycle.codeChanged) &&
        Objects.equals(this.parentEntity, billingCycle.parentEntity) &&
        Objects.equals(this._transient, billingCycle._transient);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, version, auditable, historized, notified, auditableFields, code, description, appendGeneratedCode, uuid, cfValues, cfAccumulatedValues, billingTemplateName, billingTemplateNameEL, calendar, transactionDateDelay, invoiceDateProductionDelay, invoiceDateDelay, dueDateDelay, billingAccounts, invoicingThreshold, invoiceType, dueDateDelayEL, dueDateDelayELSpark, invoiceTypeEl, invoiceTypeElSpark, type, scriptInstance, referenceDate, parentCFEntities, cfValuesNullSafe, cfValuesAsValues, cfAccumulatedValuesNullSafe, descriptionOrCode, descriptionAndCode, referenceCode, referenceDescription, codeChanged, parentEntity, _transient);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class BillingCycle {\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("    uuid: ").append(toIndentedString(uuid)).append("\n");
    sb.append("    cfValues: ").append(toIndentedString(cfValues)).append("\n");
    sb.append("    cfAccumulatedValues: ").append(toIndentedString(cfAccumulatedValues)).append("\n");
    sb.append("    billingTemplateName: ").append(toIndentedString(billingTemplateName)).append("\n");
    sb.append("    billingTemplateNameEL: ").append(toIndentedString(billingTemplateNameEL)).append("\n");
    sb.append("    calendar: ").append(toIndentedString(calendar)).append("\n");
    sb.append("    transactionDateDelay: ").append(toIndentedString(transactionDateDelay)).append("\n");
    sb.append("    invoiceDateProductionDelay: ").append(toIndentedString(invoiceDateProductionDelay)).append("\n");
    sb.append("    invoiceDateDelay: ").append(toIndentedString(invoiceDateDelay)).append("\n");
    sb.append("    dueDateDelay: ").append(toIndentedString(dueDateDelay)).append("\n");
    sb.append("    billingAccounts: ").append(toIndentedString(billingAccounts)).append("\n");
    sb.append("    invoicingThreshold: ").append(toIndentedString(invoicingThreshold)).append("\n");
    sb.append("    invoiceType: ").append(toIndentedString(invoiceType)).append("\n");
    sb.append("    dueDateDelayEL: ").append(toIndentedString(dueDateDelayEL)).append("\n");
    sb.append("    dueDateDelayELSpark: ").append(toIndentedString(dueDateDelayELSpark)).append("\n");
    sb.append("    invoiceTypeEl: ").append(toIndentedString(invoiceTypeEl)).append("\n");
    sb.append("    invoiceTypeElSpark: ").append(toIndentedString(invoiceTypeElSpark)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    scriptInstance: ").append(toIndentedString(scriptInstance)).append("\n");
    sb.append("    referenceDate: ").append(toIndentedString(referenceDate)).append("\n");
    sb.append("    parentCFEntities: ").append(toIndentedString(parentCFEntities)).append("\n");
    sb.append("    cfValuesNullSafe: ").append(toIndentedString(cfValuesNullSafe)).append("\n");
    sb.append("    cfValuesAsValues: ").append(toIndentedString(cfValuesAsValues)).append("\n");
    sb.append("    cfAccumulatedValuesNullSafe: ").append(toIndentedString(cfAccumulatedValuesNullSafe)).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    ");
  }

}

