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

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

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

  public static final String SERIALIZED_NAME_AMOUNT = "amount";
  @SerializedName(SERIALIZED_NAME_AMOUNT)
  private BigDecimal amount;

  public static final String SERIALIZED_NAME_CALENDAR_CODE = "calendarCode";
  @SerializedName(SERIALIZED_NAME_CALENDAR_CODE)
  private String calendarCode;

  /**
   * Gets or Sets status
   */
  @JsonAdapter(StatusEnum.Adapter.class)
  public enum StatusEnum {
    IN_PROGRESS("IN_PROGRESS"),
    
    OBSOLETE("OBSOLETE"),
    
    DONE("DONE"),
    
    CANCELLED("CANCELLED"),
    
    TERMINATED("TERMINATED");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_STATUS = "status";
  @SerializedName(SERIALIZED_NAME_STATUS)
  private StatusEnum status;

  public static final String SERIALIZED_NAME_STATUS_DATE = "statusDate";
  @SerializedName(SERIALIZED_NAME_STATUS_DATE)
  private OffsetDateTime statusDate;

  public static final String SERIALIZED_NAME_PAYMENT_SCHEDULE_TEMPLATE_CODE = "paymentScheduleTemplateCode";
  @SerializedName(SERIALIZED_NAME_PAYMENT_SCHEDULE_TEMPLATE_CODE)
  private String paymentScheduleTemplateCode;

  public static final String SERIALIZED_NAME_PAYMENT_DAY_IN_MONTH = "paymentDayInMonth";
  @SerializedName(SERIALIZED_NAME_PAYMENT_DAY_IN_MONTH)
  private Integer paymentDayInMonth;

  public static final String SERIALIZED_NAME_SERVICE_INSTANCE_TEMPLATE_CODE = "serviceInstanceTemplateCode";
  @SerializedName(SERIALIZED_NAME_SERVICE_INSTANCE_TEMPLATE_CODE)
  private String serviceInstanceTemplateCode;

  public static final String SERIALIZED_NAME_SERVICE_INSTANCE_ID = "serviceInstanceId";
  @SerializedName(SERIALIZED_NAME_SERVICE_INSTANCE_ID)
  private Long serviceInstanceId;

  public static final String SERIALIZED_NAME_SUBSCRIPTION_CODE = "subscriptionCode";
  @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_CODE)
  private String subscriptionCode;

  public static final String SERIALIZED_NAME_PAYMENT_SCHEDULE_INSTANCE_BALANCE_DTO = "paymentScheduleInstanceBalanceDto";
  @SerializedName(SERIALIZED_NAME_PAYMENT_SCHEDULE_INSTANCE_BALANCE_DTO)
  private PaymentScheduleInstanceBalanceDto paymentScheduleInstanceBalanceDto;

  public static final String SERIALIZED_NAME_ITEMS = "items";
  @SerializedName(SERIALIZED_NAME_ITEMS)
  private List<PaymentScheduleInstanceItemDto> items = null;

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


  public PaymentScheduleInstanceDto 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 PaymentScheduleInstanceDto 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 PaymentScheduleInstanceDto 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 PaymentScheduleInstanceDto 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 PaymentScheduleInstanceDto 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 PaymentScheduleInstanceDto 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 PaymentScheduleInstanceDto amount(BigDecimal amount) {
    
    this.amount = amount;
    return this;
  }

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

  public BigDecimal getAmount() {
    return amount;
  }



  public void setAmount(BigDecimal amount) {
    this.amount = amount;
  }


  public PaymentScheduleInstanceDto calendarCode(String calendarCode) {
    
    this.calendarCode = calendarCode;
    return this;
  }

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

  public String getCalendarCode() {
    return calendarCode;
  }



  public void setCalendarCode(String calendarCode) {
    this.calendarCode = calendarCode;
  }


  public PaymentScheduleInstanceDto status(StatusEnum status) {
    
    this.status = status;
    return this;
  }

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

  public StatusEnum getStatus() {
    return status;
  }



  public void setStatus(StatusEnum status) {
    this.status = status;
  }


  public PaymentScheduleInstanceDto statusDate(OffsetDateTime statusDate) {
    
    this.statusDate = statusDate;
    return this;
  }

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

  public OffsetDateTime getStatusDate() {
    return statusDate;
  }



  public void setStatusDate(OffsetDateTime statusDate) {
    this.statusDate = statusDate;
  }


  public PaymentScheduleInstanceDto paymentScheduleTemplateCode(String paymentScheduleTemplateCode) {
    
    this.paymentScheduleTemplateCode = paymentScheduleTemplateCode;
    return this;
  }

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

  public String getPaymentScheduleTemplateCode() {
    return paymentScheduleTemplateCode;
  }



  public void setPaymentScheduleTemplateCode(String paymentScheduleTemplateCode) {
    this.paymentScheduleTemplateCode = paymentScheduleTemplateCode;
  }


  public PaymentScheduleInstanceDto paymentDayInMonth(Integer paymentDayInMonth) {
    
    this.paymentDayInMonth = paymentDayInMonth;
    return this;
  }

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

  public Integer getPaymentDayInMonth() {
    return paymentDayInMonth;
  }



  public void setPaymentDayInMonth(Integer paymentDayInMonth) {
    this.paymentDayInMonth = paymentDayInMonth;
  }


  public PaymentScheduleInstanceDto serviceInstanceTemplateCode(String serviceInstanceTemplateCode) {
    
    this.serviceInstanceTemplateCode = serviceInstanceTemplateCode;
    return this;
  }

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

  public String getServiceInstanceTemplateCode() {
    return serviceInstanceTemplateCode;
  }



  public void setServiceInstanceTemplateCode(String serviceInstanceTemplateCode) {
    this.serviceInstanceTemplateCode = serviceInstanceTemplateCode;
  }


  public PaymentScheduleInstanceDto serviceInstanceId(Long serviceInstanceId) {
    
    this.serviceInstanceId = serviceInstanceId;
    return this;
  }

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

  public Long getServiceInstanceId() {
    return serviceInstanceId;
  }



  public void setServiceInstanceId(Long serviceInstanceId) {
    this.serviceInstanceId = serviceInstanceId;
  }


  public PaymentScheduleInstanceDto subscriptionCode(String subscriptionCode) {
    
    this.subscriptionCode = subscriptionCode;
    return this;
  }

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

  public String getSubscriptionCode() {
    return subscriptionCode;
  }



  public void setSubscriptionCode(String subscriptionCode) {
    this.subscriptionCode = subscriptionCode;
  }


  public PaymentScheduleInstanceDto paymentScheduleInstanceBalanceDto(PaymentScheduleInstanceBalanceDto paymentScheduleInstanceBalanceDto) {
    
    this.paymentScheduleInstanceBalanceDto = paymentScheduleInstanceBalanceDto;
    return this;
  }

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

  public PaymentScheduleInstanceBalanceDto getPaymentScheduleInstanceBalanceDto() {
    return paymentScheduleInstanceBalanceDto;
  }



  public void setPaymentScheduleInstanceBalanceDto(PaymentScheduleInstanceBalanceDto paymentScheduleInstanceBalanceDto) {
    this.paymentScheduleInstanceBalanceDto = paymentScheduleInstanceBalanceDto;
  }


  public PaymentScheduleInstanceDto items(List<PaymentScheduleInstanceItemDto> items) {
    
    this.items = items;
    return this;
  }

  public PaymentScheduleInstanceDto addItemsItem(PaymentScheduleInstanceItemDto itemsItem) {
    if (this.items == null) {
      this.items = new ArrayList<PaymentScheduleInstanceItemDto>();
    }
    this.items.add(itemsItem);
    return this;
  }

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

  public List<PaymentScheduleInstanceItemDto> getItems() {
    return items;
  }



  public void setItems(List<PaymentScheduleInstanceItemDto> items) {
    this.items = items;
  }


  public PaymentScheduleInstanceDto 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;
    }
    PaymentScheduleInstanceDto paymentScheduleInstanceDto = (PaymentScheduleInstanceDto) o;
    return Objects.equals(this.id, paymentScheduleInstanceDto.id) &&
        Objects.equals(this.code, paymentScheduleInstanceDto.code) &&
        Objects.equals(this.description, paymentScheduleInstanceDto.description) &&
        Objects.equals(this.updatedCode, paymentScheduleInstanceDto.updatedCode) &&
        Objects.equals(this.endDate, paymentScheduleInstanceDto.endDate) &&
        Objects.equals(this.startDate, paymentScheduleInstanceDto.startDate) &&
        Objects.equals(this.amount, paymentScheduleInstanceDto.amount) &&
        Objects.equals(this.calendarCode, paymentScheduleInstanceDto.calendarCode) &&
        Objects.equals(this.status, paymentScheduleInstanceDto.status) &&
        Objects.equals(this.statusDate, paymentScheduleInstanceDto.statusDate) &&
        Objects.equals(this.paymentScheduleTemplateCode, paymentScheduleInstanceDto.paymentScheduleTemplateCode) &&
        Objects.equals(this.paymentDayInMonth, paymentScheduleInstanceDto.paymentDayInMonth) &&
        Objects.equals(this.serviceInstanceTemplateCode, paymentScheduleInstanceDto.serviceInstanceTemplateCode) &&
        Objects.equals(this.serviceInstanceId, paymentScheduleInstanceDto.serviceInstanceId) &&
        Objects.equals(this.subscriptionCode, paymentScheduleInstanceDto.subscriptionCode) &&
        Objects.equals(this.paymentScheduleInstanceBalanceDto, paymentScheduleInstanceDto.paymentScheduleInstanceBalanceDto) &&
        Objects.equals(this.items, paymentScheduleInstanceDto.items) &&
        Objects.equals(this.customFields, paymentScheduleInstanceDto.customFields);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, code, description, updatedCode, endDate, startDate, amount, calendarCode, status, statusDate, paymentScheduleTemplateCode, paymentDayInMonth, serviceInstanceTemplateCode, serviceInstanceId, subscriptionCode, paymentScheduleInstanceBalanceDto, items, customFields);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PaymentScheduleInstanceDto {\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("    endDate: ").append(toIndentedString(endDate)).append("\n");
    sb.append("    startDate: ").append(toIndentedString(startDate)).append("\n");
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
    sb.append("    calendarCode: ").append(toIndentedString(calendarCode)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    statusDate: ").append(toIndentedString(statusDate)).append("\n");
    sb.append("    paymentScheduleTemplateCode: ").append(toIndentedString(paymentScheduleTemplateCode)).append("\n");
    sb.append("    paymentDayInMonth: ").append(toIndentedString(paymentDayInMonth)).append("\n");
    sb.append("    serviceInstanceTemplateCode: ").append(toIndentedString(serviceInstanceTemplateCode)).append("\n");
    sb.append("    serviceInstanceId: ").append(toIndentedString(serviceInstanceId)).append("\n");
    sb.append("    subscriptionCode: ").append(toIndentedString(subscriptionCode)).append("\n");
    sb.append("    paymentScheduleInstanceBalanceDto: ").append(toIndentedString(paymentScheduleInstanceBalanceDto)).append("\n");
    sb.append("    items: ").append(toIndentedString(items)).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    ");
  }

}

