All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openapitools.client.model.Recurring Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/

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.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
 * The recurring components of a price such as interval and usage.
 */
@ApiModel(description = "The recurring components of a price such as interval and usage.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Recurring {
  /**
   * Specifies on which day or the month or day of the week a customer shall be billed.
   */
  @JsonAdapter(RecurringOnEnum.Adapter.class)
  public enum RecurringOnEnum {
    _1("_1"),
    
    _2("_2"),
    
    _3("_3"),
    
    _4("_4"),
    
    _5("_5"),
    
    _6("_6"),
    
    _7("_7"),
    
    _8("_8"),
    
    _9("_9"),
    
    _10("_10"),
    
    _11("_11"),
    
    _12("_12"),
    
    _13("_13"),
    
    _14("_14"),
    
    _15("_15"),
    
    _16("_16"),
    
    _17("_17"),
    
    _18("_18"),
    
    _19("_19"),
    
    _20("_20"),
    
    _21("_21"),
    
    _22("_22"),
    
    _23("_23"),
    
    _24("_24"),
    
    _25("_25"),
    
    _26("_26"),
    
    _27("_27"),
    
    _28("_28"),
    
    _29("_29"),
    
    _30("_30"),
    
    _31("_31"),
    
    SUBSCRIPTION_ITEM_START_DAY("subscription_item_start_day"),
    
    ACCOUNT_CYCLE_DATE("account_cycle_date"),
    
    SUBSCRIPTION_START_DAY("subscription_start_day"),
    
    TERM_END_DAY("term_end_day"),
    
    MONDAY("monday"),
    
    TUESDAY("tuesday"),
    
    WEDNESDAY("wednesday"),
    
    THURSDAY("thursday"),
    
    FRIDAY("friday"),
    
    SATURDAY("saturday"),
    
    SUNDAY("sunday"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_RECURRING_ON = "recurring_on";
  @SerializedName(SERIALIZED_NAME_RECURRING_ON)
  private RecurringOnEnum recurringOn;

  /**
   * Specifies on which day or the month or day of the week a customer shall be billed.
   */
  @JsonAdapter(OnEnum.Adapter.class)
  public enum OnEnum {
    _1("_1"),
    
    _2("_2"),
    
    _3("_3"),
    
    _4("_4"),
    
    _5("_5"),
    
    _6("_6"),
    
    _7("_7"),
    
    _8("_8"),
    
    _9("_9"),
    
    _10("_10"),
    
    _11("_11"),
    
    _12("_12"),
    
    _13("_13"),
    
    _14("_14"),
    
    _15("_15"),
    
    _16("_16"),
    
    _17("_17"),
    
    _18("_18"),
    
    _19("_19"),
    
    _20("_20"),
    
    _21("_21"),
    
    _22("_22"),
    
    _23("_23"),
    
    _24("_24"),
    
    _25("_25"),
    
    _26("_26"),
    
    _27("_27"),
    
    _28("_28"),
    
    _29("_29"),
    
    _30("_30"),
    
    _31("_31"),
    
    SUBSCRIPTION_ITEM_START_DAY("subscription_item_start_day"),
    
    ACCOUNT_CYCLE_DATE("account_cycle_date"),
    
    SUBSCRIPTION_START_DAY("subscription_start_day"),
    
    TERM_END_DAY("term_end_day"),
    
    MONDAY("monday"),
    
    TUESDAY("tuesday"),
    
    WEDNESDAY("wednesday"),
    
    THURSDAY("thursday"),
    
    FRIDAY("friday"),
    
    SATURDAY("saturday"),
    
    SUNDAY("sunday"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_ON = "on";
  @SerializedName(SERIALIZED_NAME_ON)
  private OnEnum on;

  public static final String SERIALIZED_NAME_USAGE = "usage";
  @SerializedName(SERIALIZED_NAME_USAGE)
  private Boolean usage;

  /**
   * Specifies the billing frequency. One of `week`, `month` or `year`.
   */
  @JsonAdapter(IntervalEnum.Adapter.class)
  public enum IntervalEnum {
    MONTH("month"),
    
    YEAR("year"),
    
    WEEK("week"),
    
    TERM("term"),
    
    DAY("day"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_INTERVAL = "interval";
  @SerializedName(SERIALIZED_NAME_INTERVAL)
  private IntervalEnum interval;

  public static final String SERIALIZED_NAME_INTERVAL_COUNT = "interval_count";
  @SerializedName(SERIALIZED_NAME_INTERVAL_COUNT)
  private Integer intervalCount;

  /**
   * Specifies how to align billing for recurring (subscription) products that start on different days.
   */
  @JsonAdapter(AlignmentBehaviorEnum.Adapter.class)
  public enum AlignmentBehaviorEnum {
    SUBSCRIPTION_START("subscription_start"),
    
    TERM_START("term_start"),
    
    TERM_END("term_end"),
    
    NONE("none"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_ALIGNMENT_BEHAVIOR = "alignment_behavior";
  @SerializedName(SERIALIZED_NAME_ALIGNMENT_BEHAVIOR)
  private AlignmentBehaviorEnum alignmentBehavior;

  /**
   * You can choose to bill in_advance or in_arrears for recurring prices. The field is not used with one-time or usage-based prices.
   */
  @JsonAdapter(TimingEnum.Adapter.class)
  public enum TimingEnum {
    ADVANCE("in_advance"),
    
    ARREARS("in_arrears"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_TIMING = "timing";
  @SerializedName(SERIALIZED_NAME_TIMING)
  private TimingEnum timing;

  public static final String SERIALIZED_NAME_FORMULA = "formula";
  @SerializedName(SERIALIZED_NAME_FORMULA)
  private String formula;

  /**
   * Specifies the duration frequency. One of day, week, month or year.
   */
  @JsonAdapter(DurationIntervalEnum.Adapter.class)
  public enum DurationIntervalEnum {
    DAY("day"),
    
    WEEK("week"),
    
    MONTH("month"),
    
    YEAR("year"),
    
    SUBSCRIPTION_TERM("subscription_term"),
    
    BILLING_PERIOD("billing_period"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_DURATION_INTERVAL = "duration_interval";
  @SerializedName(SERIALIZED_NAME_DURATION_INTERVAL)
  private DurationIntervalEnum durationInterval;

  public static final String SERIALIZED_NAME_DURATION_INTERVAL_COUNT = "duration_interval_count";
  @SerializedName(SERIALIZED_NAME_DURATION_INTERVAL_COUNT)
  private Integer durationIntervalCount;

  /**
   * A rating group based on which usage records are rated. Only applicable to usage prices.
   */
  @JsonAdapter(RatingGroupEnum.Adapter.class)
  public enum RatingGroupEnum {
    BILLING_PERIOD("billing_period"),
    
    USAGE_START_DATE("usage_start_date"),
    
    USAGE_RECORD("usage_record"),
    
    USAGE_UPLOAD("usage_upload"),
    
    CUSTOM_GROUP("custom_group"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_RATING_GROUP = "rating_group";
  @SerializedName(SERIALIZED_NAME_RATING_GROUP)
  private RatingGroupEnum ratingGroup;

  public Recurring() { 
  }

  
  public Recurring(
     String formula
  ) {
    this();
    this.formula = formula;
  }

  public Recurring recurringOn(RecurringOnEnum recurringOn) {
    
    this.recurringOn = recurringOn;
    return this;
  }

   /**
   * Specifies on which day or the month or day of the week a customer shall be billed.
   * @return recurringOn
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Specifies on which day or the month or day of the week a customer shall be billed.")

  public RecurringOnEnum getRecurringOn() {
    return recurringOn;
  }


  public void setRecurringOn(RecurringOnEnum recurringOn) {
    this.recurringOn = recurringOn;
  }


  public Recurring on(OnEnum on) {
    
    this.on = on;
    return this;
  }

   /**
   * Specifies on which day or the month or day of the week a customer shall be billed.
   * @return on
   * @deprecated
  **/
  @Deprecated
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Specifies on which day or the month or day of the week a customer shall be billed.")

  public OnEnum getOn() {
    return on;
  }


  public void setOn(OnEnum on) {
    this.on = on;
  }


  public Recurring usage(Boolean usage) {
    
    this.usage = usage;
    return this;
  }

   /**
   * Indicates that this is a usage price.
   * @return usage
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Indicates that this is a usage price.")

  public Boolean getUsage() {
    return usage;
  }


  public void setUsage(Boolean usage) {
    this.usage = usage;
  }


  public Recurring interval(IntervalEnum interval) {
    
    this.interval = interval;
    return this;
  }

   /**
   * Specifies the billing frequency. One of `week`, `month` or `year`.
   * @return interval
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Specifies the billing frequency. One of `week`, `month` or `year`.")

  public IntervalEnum getInterval() {
    return interval;
  }


  public void setInterval(IntervalEnum interval) {
    this.interval = interval;
  }


  public Recurring intervalCount(Integer intervalCount) {
    
    this.intervalCount = intervalCount;
    return this;
  }

   /**
   * The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and intervalCount=3 bills every 3 months.
   * @return intervalCount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and intervalCount=3 bills every 3 months.")

  public Integer getIntervalCount() {
    return intervalCount;
  }


  public void setIntervalCount(Integer intervalCount) {
    this.intervalCount = intervalCount;
  }


  public Recurring alignmentBehavior(AlignmentBehaviorEnum alignmentBehavior) {
    
    this.alignmentBehavior = alignmentBehavior;
    return this;
  }

   /**
   * Specifies how to align billing for recurring (subscription) products that start on different days.
   * @return alignmentBehavior
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Specifies how to align billing for recurring (subscription) products that start on different days.")

  public AlignmentBehaviorEnum getAlignmentBehavior() {
    return alignmentBehavior;
  }


  public void setAlignmentBehavior(AlignmentBehaviorEnum alignmentBehavior) {
    this.alignmentBehavior = alignmentBehavior;
  }


  public Recurring timing(TimingEnum timing) {
    
    this.timing = timing;
    return this;
  }

   /**
   * You can choose to bill in_advance or in_arrears for recurring prices. The field is not used with one-time or usage-based prices.
   * @return timing
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "You can choose to bill in_advance or in_arrears for recurring prices. The field is not used with one-time or usage-based prices.")

  public TimingEnum getTiming() {
    return timing;
  }


  public void setTiming(TimingEnum timing) {
    this.timing = timing;
  }


   /**
   * You can choose to bill in_advance or in_arrears for recurring prices. The field is not used with one-time or usage-based prices.
   * @return formula
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "You can choose to bill in_advance or in_arrears for recurring prices. The field is not used with one-time or usage-based prices.")

  public String getFormula() {
    return formula;
  }




  public Recurring durationInterval(DurationIntervalEnum durationInterval) {
    
    this.durationInterval = durationInterval;
    return this;
  }

   /**
   * Specifies the duration frequency. One of day, week, month or year.
   * @return durationInterval
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Specifies the duration frequency. One of day, week, month or year.")

  public DurationIntervalEnum getDurationInterval() {
    return durationInterval;
  }


  public void setDurationInterval(DurationIntervalEnum durationInterval) {
    this.durationInterval = durationInterval;
  }


  public Recurring durationIntervalCount(Integer durationIntervalCount) {
    
    this.durationIntervalCount = durationIntervalCount;
    return this;
  }

   /**
   * Specifies how long a customer shall be charged if this is less than the duration of the subscription
   * @return durationIntervalCount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Specifies how long a customer shall be charged if this is less than the duration of the subscription")

  public Integer getDurationIntervalCount() {
    return durationIntervalCount;
  }


  public void setDurationIntervalCount(Integer durationIntervalCount) {
    this.durationIntervalCount = durationIntervalCount;
  }


  public Recurring ratingGroup(RatingGroupEnum ratingGroup) {
    
    this.ratingGroup = ratingGroup;
    return this;
  }

   /**
   * A rating group based on which usage records are rated. Only applicable to usage prices.
   * @return ratingGroup
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A rating group based on which usage records are rated. Only applicable to usage prices.")

  public RatingGroupEnum getRatingGroup() {
    return ratingGroup;
  }


  public void setRatingGroup(RatingGroupEnum ratingGroup) {
    this.ratingGroup = ratingGroup;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Recurring recurring = (Recurring) o;
    return Objects.equals(this.recurringOn, recurring.recurringOn) &&
        Objects.equals(this.on, recurring.on) &&
        Objects.equals(this.usage, recurring.usage) &&
        Objects.equals(this.interval, recurring.interval) &&
        Objects.equals(this.intervalCount, recurring.intervalCount) &&
        Objects.equals(this.alignmentBehavior, recurring.alignmentBehavior) &&
        Objects.equals(this.timing, recurring.timing) &&
        Objects.equals(this.formula, recurring.formula) &&
        Objects.equals(this.durationInterval, recurring.durationInterval) &&
        Objects.equals(this.durationIntervalCount, recurring.durationIntervalCount) &&
        Objects.equals(this.ratingGroup, recurring.ratingGroup);
  }

  @Override
  public int hashCode() {
    return Objects.hash(recurringOn, on, usage, interval, intervalCount, alignmentBehavior, timing, formula, durationInterval, durationIntervalCount, ratingGroup);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Recurring {\n");
    sb.append("    recurringOn: ").append(toIndentedString(recurringOn)).append("\n");
    sb.append("    on: ").append(toIndentedString(on)).append("\n");
    sb.append("    usage: ").append(toIndentedString(usage)).append("\n");
    sb.append("    interval: ").append(toIndentedString(interval)).append("\n");
    sb.append("    intervalCount: ").append(toIndentedString(intervalCount)).append("\n");
    sb.append("    alignmentBehavior: ").append(toIndentedString(alignmentBehavior)).append("\n");
    sb.append("    timing: ").append(toIndentedString(timing)).append("\n");
    sb.append("    formula: ").append(toIndentedString(formula)).append("\n");
    sb.append("    durationInterval: ").append(toIndentedString(durationInterval)).append("\n");
    sb.append("    durationIntervalCount: ").append(toIndentedString(durationIntervalCount)).append("\n");
    sb.append("    ratingGroup: ").append(toIndentedString(ratingGroup)).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(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy