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

org.openapitools.client.model.Tier 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 java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;

import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
 * Tier information for tiered prices.
 */
@ApiModel(description = "Tier information for tiered prices.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Tier {
  public static final String SERIALIZED_NAME_UP_TO = "up_to";
  @SerializedName(SERIALIZED_NAME_UP_TO)
  private BigDecimal upTo;

  public static final String SERIALIZED_NAME_AMOUNTS = "amounts";
  @SerializedName(SERIALIZED_NAME_AMOUNTS)
  private Map amounts;

  public static final String SERIALIZED_NAME_UNIT_AMOUNTS = "unit_amounts";
  @SerializedName(SERIALIZED_NAME_UNIT_AMOUNTS)
  private Map unitAmounts;

  public Tier() { 
  }

  public Tier upTo(BigDecimal upTo) {
    
    this.upTo = upTo;
    return this;
  }

   /**
   * The upper bound of a tier. The lower bound of a tier is the upper bound of the previous tier plus one or some fraction of one, depending on the precision of the unit of measure.
   * @return upTo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The upper bound of a tier. The lower bound of a tier is the upper bound of the previous tier plus one or some fraction of one, depending on the precision of the unit of measure.")

  public BigDecimal getUpTo() {
    return upTo;
  }


  public void setUpTo(BigDecimal upTo) {
    this.upTo = upTo;
  }


  public Tier amounts(Map amounts) {
    
    this.amounts = amounts;
    return this;
  }

   /**
   * Prices for the tier. Only set if `charge_model` is `tiered`, `tiered_overage`, or `highwatermark_tiered`.
   * @return amounts
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Prices for the tier. Only set if `charge_model` is `tiered`, `tiered_overage`, or `highwatermark_tiered`.")

  public Map getAmounts() {
    return amounts;
  }


  public void setAmounts(Map amounts) {
    this.amounts = amounts;
  }


  public Tier unitAmounts(Map unitAmounts) {
    
    this.unitAmounts = unitAmounts;
    return this;
  }

   /**
   * Per unit prices for units in the tier. Only set if `charge_model` is `tiered`, `tiered_overage`, or `highwatermark_tiered`.
   * @return unitAmounts
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Per unit prices for units in the tier. Only set if `charge_model` is `tiered`, `tiered_overage`, or `highwatermark_tiered`.")

  public Map getUnitAmounts() {
    return unitAmounts;
  }


  public void setUnitAmounts(Map unitAmounts) {
    this.unitAmounts = unitAmounts;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Tier tier = (Tier) o;
    return Objects.equals(this.upTo, tier.upTo) &&
        Objects.equals(this.amounts, tier.amounts) &&
        Objects.equals(this.unitAmounts, tier.unitAmounts);
  }

  private static  boolean equalsNullable(JsonNullable a, JsonNullable b) {
    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
  }

  @Override
  public int hashCode() {
    return Objects.hash(upTo, amounts, unitAmounts);
  }

  private static  int hashCodeNullable(JsonNullable a) {
    if (a == null) {
      return 1;
    }
    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
  }

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