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

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

  /**
   * Gets or Sets billingRunTypeEnum
   */
  @JsonAdapter(BillingRunTypeEnumEnum.Adapter.class)
  public enum BillingRunTypeEnumEnum {
    AUTOMATIC("AUTOMATIC"),
    
    MANUAL("MANUAL"),
    
    FULL_AUTOMATIC("FULL_AUTOMATIC");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_BILLING_RUN_TYPE_ENUM = "billingRunTypeEnum";
  @SerializedName(SERIALIZED_NAME_BILLING_RUN_TYPE_ENUM)
  private BillingRunTypeEnumEnum billingRunTypeEnum;

  public static final String SERIALIZED_NAME_START_DATE = "startDate";
  @SerializedName(SERIALIZED_NAME_START_DATE)
  private OffsetDateTime startDate;

  public static final String SERIALIZED_NAME_END_DATE = "endDate";
  @SerializedName(SERIALIZED_NAME_END_DATE)
  private OffsetDateTime endDate;

  public static final String SERIALIZED_NAME_INVOICE_DATE = "invoiceDate";
  @SerializedName(SERIALIZED_NAME_INVOICE_DATE)
  private OffsetDateTime invoiceDate;

  public static final String SERIALIZED_NAME_LAST_TRANSACTION_DATE = "lastTransactionDate";
  @SerializedName(SERIALIZED_NAME_LAST_TRANSACTION_DATE)
  private OffsetDateTime lastTransactionDate;

  /**
   * 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_CUSTOM_FIELDS = "customFields";
  @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS)
  private CustomFieldsDto customFields;


  public CreateBillingRunDto billingCycleCode(String billingCycleCode) {
    
    this.billingCycleCode = billingCycleCode;
    return this;
  }

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

  public String getBillingCycleCode() {
    return billingCycleCode;
  }



  public void setBillingCycleCode(String billingCycleCode) {
    this.billingCycleCode = billingCycleCode;
  }


  public CreateBillingRunDto billingRunTypeEnum(BillingRunTypeEnumEnum billingRunTypeEnum) {
    
    this.billingRunTypeEnum = billingRunTypeEnum;
    return this;
  }

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

  public BillingRunTypeEnumEnum getBillingRunTypeEnum() {
    return billingRunTypeEnum;
  }



  public void setBillingRunTypeEnum(BillingRunTypeEnumEnum billingRunTypeEnum) {
    this.billingRunTypeEnum = billingRunTypeEnum;
  }


  public CreateBillingRunDto startDate(OffsetDateTime startDate) {
    
    this.startDate = startDate;
    return this;
  }

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

  public OffsetDateTime getStartDate() {
    return startDate;
  }



  public void setStartDate(OffsetDateTime startDate) {
    this.startDate = startDate;
  }


  public CreateBillingRunDto endDate(OffsetDateTime endDate) {
    
    this.endDate = endDate;
    return this;
  }

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

  public OffsetDateTime getEndDate() {
    return endDate;
  }



  public void setEndDate(OffsetDateTime endDate) {
    this.endDate = endDate;
  }


  public CreateBillingRunDto invoiceDate(OffsetDateTime invoiceDate) {
    
    this.invoiceDate = invoiceDate;
    return this;
  }

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

  public OffsetDateTime getInvoiceDate() {
    return invoiceDate;
  }



  public void setInvoiceDate(OffsetDateTime invoiceDate) {
    this.invoiceDate = invoiceDate;
  }


  public CreateBillingRunDto lastTransactionDate(OffsetDateTime lastTransactionDate) {
    
    this.lastTransactionDate = lastTransactionDate;
    return this;
  }

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

  public OffsetDateTime getLastTransactionDate() {
    return lastTransactionDate;
  }



  public void setLastTransactionDate(OffsetDateTime lastTransactionDate) {
    this.lastTransactionDate = lastTransactionDate;
  }


  public CreateBillingRunDto 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 CreateBillingRunDto 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;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreateBillingRunDto createBillingRunDto = (CreateBillingRunDto) o;
    return Objects.equals(this.billingCycleCode, createBillingRunDto.billingCycleCode) &&
        Objects.equals(this.billingRunTypeEnum, createBillingRunDto.billingRunTypeEnum) &&
        Objects.equals(this.startDate, createBillingRunDto.startDate) &&
        Objects.equals(this.endDate, createBillingRunDto.endDate) &&
        Objects.equals(this.invoiceDate, createBillingRunDto.invoiceDate) &&
        Objects.equals(this.lastTransactionDate, createBillingRunDto.lastTransactionDate) &&
        Objects.equals(this.referenceDate, createBillingRunDto.referenceDate) &&
        Objects.equals(this.customFields, createBillingRunDto.customFields);
  }

  @Override
  public int hashCode() {
    return Objects.hash(billingCycleCode, billingRunTypeEnum, startDate, endDate, invoiceDate, lastTransactionDate, referenceDate, customFields);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateBillingRunDto {\n");
    sb.append("    billingCycleCode: ").append(toIndentedString(billingCycleCode)).append("\n");
    sb.append("    billingRunTypeEnum: ").append(toIndentedString(billingRunTypeEnum)).append("\n");
    sb.append("    startDate: ").append(toIndentedString(startDate)).append("\n");
    sb.append("    endDate: ").append(toIndentedString(endDate)).append("\n");
    sb.append("    invoiceDate: ").append(toIndentedString(invoiceDate)).append("\n");
    sb.append("    lastTransactionDate: ").append(toIndentedString(lastTransactionDate)).append("\n");
    sb.append("    referenceDate: ").append(toIndentedString(referenceDate)).append("\n");
    sb.append("    customFields: ").append(toIndentedString(customFields)).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    ");
  }

}

