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

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

  /**
   * Gets or Sets initialyActiveForUnit
   */
  @JsonAdapter(InitialyActiveForUnitEnum.Adapter.class)
  public enum InitialyActiveForUnitEnum {
    MONTH("MONTH"),
    
    DAY("DAY");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_INITIALY_ACTIVE_FOR_UNIT = "initialyActiveForUnit";
  @SerializedName(SERIALIZED_NAME_INITIALY_ACTIVE_FOR_UNIT)
  private InitialyActiveForUnitEnum initialyActiveForUnit;

  public static final String SERIALIZED_NAME_AUTO_RENEW = "autoRenew";
  @SerializedName(SERIALIZED_NAME_AUTO_RENEW)
  private Boolean autoRenew;

  public static final String SERIALIZED_NAME_DAYS_NOTIFY_RENEWAL = "daysNotifyRenewal";
  @SerializedName(SERIALIZED_NAME_DAYS_NOTIFY_RENEWAL)
  private Integer daysNotifyRenewal;

  /**
   * Gets or Sets endOfTermAction
   */
  @JsonAdapter(EndOfTermActionEnum.Adapter.class)
  public enum EndOfTermActionEnum {
    SUSPEND("SUSPEND"),
    
    TERMINATE("TERMINATE");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_END_OF_TERM_ACTION = "endOfTermAction";
  @SerializedName(SERIALIZED_NAME_END_OF_TERM_ACTION)
  private EndOfTermActionEnum endOfTermAction;

  public static final String SERIALIZED_NAME_TERMINATION_REASON_CODE = "terminationReasonCode";
  @SerializedName(SERIALIZED_NAME_TERMINATION_REASON_CODE)
  private String terminationReasonCode;

  public static final String SERIALIZED_NAME_RENEW_FOR = "renewFor";
  @SerializedName(SERIALIZED_NAME_RENEW_FOR)
  private Integer renewFor;

  /**
   * Gets or Sets renewForUnit
   */
  @JsonAdapter(RenewForUnitEnum.Adapter.class)
  public enum RenewForUnitEnum {
    MONTH("MONTH"),
    
    DAY("DAY");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_RENEW_FOR_UNIT = "renewForUnit";
  @SerializedName(SERIALIZED_NAME_RENEW_FOR_UNIT)
  private RenewForUnitEnum renewForUnit;

  public static final String SERIALIZED_NAME_EXTEND_AGREEMENT_PERIOD_TO_SUBSCRIBED_TILL_DATE = "extendAgreementPeriodToSubscribedTillDate";
  @SerializedName(SERIALIZED_NAME_EXTEND_AGREEMENT_PERIOD_TO_SUBSCRIBED_TILL_DATE)
  private Boolean extendAgreementPeriodToSubscribedTillDate;


  public SubscriptionRenewalDto initialyActiveFor(Integer initialyActiveFor) {
    
    this.initialyActiveFor = initialyActiveFor;
    return this;
  }

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

  public Integer getInitialyActiveFor() {
    return initialyActiveFor;
  }



  public void setInitialyActiveFor(Integer initialyActiveFor) {
    this.initialyActiveFor = initialyActiveFor;
  }


  public SubscriptionRenewalDto initialyActiveForUnit(InitialyActiveForUnitEnum initialyActiveForUnit) {
    
    this.initialyActiveForUnit = initialyActiveForUnit;
    return this;
  }

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

  public InitialyActiveForUnitEnum getInitialyActiveForUnit() {
    return initialyActiveForUnit;
  }



  public void setInitialyActiveForUnit(InitialyActiveForUnitEnum initialyActiveForUnit) {
    this.initialyActiveForUnit = initialyActiveForUnit;
  }


  public SubscriptionRenewalDto autoRenew(Boolean autoRenew) {
    
    this.autoRenew = autoRenew;
    return this;
  }

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

  public Boolean getAutoRenew() {
    return autoRenew;
  }



  public void setAutoRenew(Boolean autoRenew) {
    this.autoRenew = autoRenew;
  }


  public SubscriptionRenewalDto daysNotifyRenewal(Integer daysNotifyRenewal) {
    
    this.daysNotifyRenewal = daysNotifyRenewal;
    return this;
  }

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

  public Integer getDaysNotifyRenewal() {
    return daysNotifyRenewal;
  }



  public void setDaysNotifyRenewal(Integer daysNotifyRenewal) {
    this.daysNotifyRenewal = daysNotifyRenewal;
  }


  public SubscriptionRenewalDto endOfTermAction(EndOfTermActionEnum endOfTermAction) {
    
    this.endOfTermAction = endOfTermAction;
    return this;
  }

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

  public EndOfTermActionEnum getEndOfTermAction() {
    return endOfTermAction;
  }



  public void setEndOfTermAction(EndOfTermActionEnum endOfTermAction) {
    this.endOfTermAction = endOfTermAction;
  }


  public SubscriptionRenewalDto terminationReasonCode(String terminationReasonCode) {
    
    this.terminationReasonCode = terminationReasonCode;
    return this;
  }

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

  public String getTerminationReasonCode() {
    return terminationReasonCode;
  }



  public void setTerminationReasonCode(String terminationReasonCode) {
    this.terminationReasonCode = terminationReasonCode;
  }


  public SubscriptionRenewalDto renewFor(Integer renewFor) {
    
    this.renewFor = renewFor;
    return this;
  }

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

  public Integer getRenewFor() {
    return renewFor;
  }



  public void setRenewFor(Integer renewFor) {
    this.renewFor = renewFor;
  }


  public SubscriptionRenewalDto renewForUnit(RenewForUnitEnum renewForUnit) {
    
    this.renewForUnit = renewForUnit;
    return this;
  }

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

  public RenewForUnitEnum getRenewForUnit() {
    return renewForUnit;
  }



  public void setRenewForUnit(RenewForUnitEnum renewForUnit) {
    this.renewForUnit = renewForUnit;
  }


  public SubscriptionRenewalDto extendAgreementPeriodToSubscribedTillDate(Boolean extendAgreementPeriodToSubscribedTillDate) {
    
    this.extendAgreementPeriodToSubscribedTillDate = extendAgreementPeriodToSubscribedTillDate;
    return this;
  }

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

  public Boolean getExtendAgreementPeriodToSubscribedTillDate() {
    return extendAgreementPeriodToSubscribedTillDate;
  }



  public void setExtendAgreementPeriodToSubscribedTillDate(Boolean extendAgreementPeriodToSubscribedTillDate) {
    this.extendAgreementPeriodToSubscribedTillDate = extendAgreementPeriodToSubscribedTillDate;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SubscriptionRenewalDto subscriptionRenewalDto = (SubscriptionRenewalDto) o;
    return Objects.equals(this.initialyActiveFor, subscriptionRenewalDto.initialyActiveFor) &&
        Objects.equals(this.initialyActiveForUnit, subscriptionRenewalDto.initialyActiveForUnit) &&
        Objects.equals(this.autoRenew, subscriptionRenewalDto.autoRenew) &&
        Objects.equals(this.daysNotifyRenewal, subscriptionRenewalDto.daysNotifyRenewal) &&
        Objects.equals(this.endOfTermAction, subscriptionRenewalDto.endOfTermAction) &&
        Objects.equals(this.terminationReasonCode, subscriptionRenewalDto.terminationReasonCode) &&
        Objects.equals(this.renewFor, subscriptionRenewalDto.renewFor) &&
        Objects.equals(this.renewForUnit, subscriptionRenewalDto.renewForUnit) &&
        Objects.equals(this.extendAgreementPeriodToSubscribedTillDate, subscriptionRenewalDto.extendAgreementPeriodToSubscribedTillDate);
  }

  @Override
  public int hashCode() {
    return Objects.hash(initialyActiveFor, initialyActiveForUnit, autoRenew, daysNotifyRenewal, endOfTermAction, terminationReasonCode, renewFor, renewForUnit, extendAgreementPeriodToSubscribedTillDate);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SubscriptionRenewalDto {\n");
    sb.append("    initialyActiveFor: ").append(toIndentedString(initialyActiveFor)).append("\n");
    sb.append("    initialyActiveForUnit: ").append(toIndentedString(initialyActiveForUnit)).append("\n");
    sb.append("    autoRenew: ").append(toIndentedString(autoRenew)).append("\n");
    sb.append("    daysNotifyRenewal: ").append(toIndentedString(daysNotifyRenewal)).append("\n");
    sb.append("    endOfTermAction: ").append(toIndentedString(endOfTermAction)).append("\n");
    sb.append("    terminationReasonCode: ").append(toIndentedString(terminationReasonCode)).append("\n");
    sb.append("    renewFor: ").append(toIndentedString(renewFor)).append("\n");
    sb.append("    renewForUnit: ").append(toIndentedString(renewForUnit)).append("\n");
    sb.append("    extendAgreementPeriodToSubscribedTillDate: ").append(toIndentedString(extendAgreementPeriodToSubscribedTillDate)).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    ");
  }

}

