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

org.openapitools.client.model.Prepayment 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;
/**
 * Prepayment
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Prepayment {
  /**
   * The way to calculate credit. See <a href='https://knowledgecenter.zuora.com/Zuora_Billing/Billing_and_Invoicing/JA_Advanced_Consumption_Billing/Prepaid_with_Drawdown/A_Create_prepayment_charge#Credit_Option'  target='_blank'>Credit Option</a> for more information.
   */
  @JsonAdapter(CreditOptionEnum.Adapter.class)
  public enum CreditOptionEnum {
    TIME_BASED("time_based"),
    
    CONSUMPTION_BASED("consumption_based"),
    
    FULL_CREDIT("full_credit"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

  public static final String SERIALIZED_NAME_CREDIT_OPTION = "credit_option";
  @SerializedName(SERIALIZED_NAME_CREDIT_OPTION)
  private CreditOptionEnum creditOption;

  public static final String SERIALIZED_NAME_QUANTITY = "quantity";
  @SerializedName(SERIALIZED_NAME_QUANTITY)
  private BigDecimal quantity;

  public static final String SERIALIZED_NAME_TOTAL_QUANTITY = "total_quantity";
  @SerializedName(SERIALIZED_NAME_TOTAL_QUANTITY)
  private BigDecimal totalQuantity;

  public static final String SERIALIZED_NAME_UNIT_OF_MEASURE = "unit_of_measure";
  @SerializedName(SERIALIZED_NAME_UNIT_OF_MEASURE)
  private String unitOfMeasure;

  /**
   * 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 Prepayment() { 
  }

  public Prepayment creditOption(CreditOptionEnum creditOption) {
    
    this.creditOption = creditOption;
    return this;
  }

   /**
   * The way to calculate credit. See <a href='https://knowledgecenter.zuora.com/Zuora_Billing/Billing_and_Invoicing/JA_Advanced_Consumption_Billing/Prepaid_with_Drawdown/A_Create_prepayment_charge#Credit_Option'  target='_blank'>Credit Option</a> for more information.
   * @return creditOption
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The way to calculate credit. See Credit Option for more information.")

  public CreditOptionEnum getCreditOption() {
    return creditOption;
  }


  public void setCreditOption(CreditOptionEnum creditOption) {
    this.creditOption = creditOption;
  }


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

   /**
   * The total amount of units that end customers can use during a validity period when they subscribe to a prepayment charge.
   * @return totalQuantity
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The total amount of units that end customers can use during a validity period when they subscribe to a prepayment charge.")

  public BigDecimal getTotalQuantity() {
    return totalQuantity;
  }


  public void setTotalQuantity(BigDecimal totalQuantity) {
    this.totalQuantity = totalQuantity;
  }


  public Prepayment unitOfMeasure(String unitOfMeasure) {
    
    this.unitOfMeasure = unitOfMeasure;
    return this;
  }

   /**
   * A configured unit of measure. This field is required for per-unit prices.
   * @return unitOfMeasure
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A configured unit of measure. This field is required for per-unit prices.")

  public String getUnitOfMeasure() {
    return unitOfMeasure;
  }


  public void setUnitOfMeasure(String unitOfMeasure) {
    this.unitOfMeasure = unitOfMeasure;
  }


  public Prepayment 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;
    }
    Prepayment prepayment = (Prepayment) o;
    return Objects.equals(this.creditOption, prepayment.creditOption) &&
        Objects.equals(this.quantity, prepayment.quantity) &&
        Objects.equals(this.totalQuantity, prepayment.totalQuantity) &&
        Objects.equals(this.unitOfMeasure, prepayment.unitOfMeasure) &&
        Objects.equals(this.validityPeriod, prepayment.validityPeriod);
  }

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

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