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

org.openapitools.client.model.SubscriptionItemPrepaymentField 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 java.math.BigDecimal;

import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
 * The prepayment information.
 */
@ApiModel(description = "The prepayment information.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class SubscriptionItemPrepaymentField {
  public static final String SERIALIZED_NAME_QUANTITY = "quantity";
  @SerializedName(SERIALIZED_NAME_QUANTITY)
  private BigDecimal quantity;

  /**
   * The period in which the prepayment units are valid to use as defined in a prepayment charge.
   */
  @JsonAdapter(ValidityPeriodEnum.Adapter.class)
  public enum ValidityPeriodEnum {
    SUBSCRIPTION_TERM("subscription_term"),
    
    ANNUAL("annual"),
    
    SEMI_ANNUAL("semi_annual"),
    
    QUARTER("quarter"),
    
    MONTH("month"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

    public static ValidityPeriodEnum fromValue(String value) {
      for (ValidityPeriodEnum b : ValidityPeriodEnum.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 ValidityPeriodEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

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

  public static final String SERIALIZED_NAME_VALIDITY_PERIOD = "validity_period";
  @SerializedName(SERIALIZED_NAME_VALIDITY_PERIOD)
  private ValidityPeriodEnum validityPeriod;

  public SubscriptionItemPrepaymentField() { 
  }

  public SubscriptionItemPrepaymentField quantity(BigDecimal quantity) {
    
    this.quantity = quantity;
    return this;
  }

   /**
   * The number of units included in a prepayment charge.
   * @return quantity
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The number of units included in a prepayment charge.")

  public BigDecimal getQuantity() {
    return quantity;
  }


  public void setQuantity(BigDecimal quantity) {
    this.quantity = quantity;
  }


  public SubscriptionItemPrepaymentField validityPeriod(ValidityPeriodEnum validityPeriod) {
    
    this.validityPeriod = validityPeriod;
    return this;
  }

   /**
   * The period in which the prepayment units are valid to use as defined in a prepayment charge.
   * @return validityPeriod
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The period in which the prepayment units are valid to use as defined in a prepayment charge.")

  public ValidityPeriodEnum getValidityPeriod() {
    return validityPeriod;
  }


  public void setValidityPeriod(ValidityPeriodEnum validityPeriod) {
    this.validityPeriod = validityPeriod;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SubscriptionItemPrepaymentField subscriptionItemPrepaymentField = (SubscriptionItemPrepaymentField) o;
    return Objects.equals(this.quantity, subscriptionItemPrepaymentField.quantity) &&
        Objects.equals(this.validityPeriod, subscriptionItemPrepaymentField.validityPeriod);
  }

  @Override
  public int hashCode() {
    return Objects.hash(quantity, validityPeriod);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SubscriptionItemPrepaymentField {\n");
    sb.append("    quantity: ").append(toIndentedString(quantity)).append("\n");
    sb.append("    validityPeriod: ").append(toIndentedString(validityPeriod)).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