org.openapitools.client.model.Overage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zuora-sdk-java Show documentation
Show all versions of zuora-sdk-java Show documentation
The SDK of JAVA language for Zuora pricing system
/*
* 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;
/**
* An object defining how overage charges are calculated.
*/
@ApiModel(description = "An object defining how overage charges are calculated.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Overage {
public static final String SERIALIZED_NAME_INTERVAL_COUNT = "interval_count";
@SerializedName(SERIALIZED_NAME_INTERVAL_COUNT)
private Integer intervalCount;
/**
* Represents the overage type: one of rolling_window or rollover.
*/
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
ROLLING_WINDOW("rolling_window"),
ROLLOVER("rollover"),
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");
private String value;
TypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private TypeEnum type;
public static final String SERIALIZED_NAME_INCLUDED_UNITS = "included_units";
@SerializedName(SERIALIZED_NAME_INCLUDED_UNITS)
private BigDecimal includedUnits;
public static final String SERIALIZED_NAME_CREDIT_UNUSED_UNITS = "credit_unused_units";
@SerializedName(SERIALIZED_NAME_CREDIT_UNUSED_UNITS)
private Boolean creditUnusedUnits;
public static final String SERIALIZED_NAME_APPLY_AT_END_OF_SMOOTHING_PERIOD = "apply_at_end_of_smoothing_period";
@SerializedName(SERIALIZED_NAME_APPLY_AT_END_OF_SMOOTHING_PERIOD)
private Boolean applyAtEndOfSmoothingPeriod;
public Overage() {
}
public Overage intervalCount(Integer intervalCount) {
this.intervalCount = intervalCount;
return this;
}
/**
* Specifies the number of intervals used to calculate smoothed overage charges.
* @return intervalCount
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Specifies the number of intervals used to calculate smoothed overage charges.")
public Integer getIntervalCount() {
return intervalCount;
}
public void setIntervalCount(Integer intervalCount) {
this.intervalCount = intervalCount;
}
public Overage type(TypeEnum type) {
this.type = type;
return this;
}
/**
* Represents the overage type: one of rolling_window or rollover.
* @return type
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Represents the overage type: one of rolling_window or rollover.")
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
public Overage includedUnits(BigDecimal includedUnits) {
this.includedUnits = includedUnits;
return this;
}
/**
* Specifies the included units to which overage charges do not apply.
* @return includedUnits
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Specifies the included units to which overage charges do not apply.")
public BigDecimal getIncludedUnits() {
return includedUnits;
}
public void setIncludedUnits(BigDecimal includedUnits) {
this.includedUnits = includedUnits;
}
public Overage creditUnusedUnits(Boolean creditUnusedUnits) {
this.creditUnusedUnits = creditUnusedUnits;
return this;
}
/**
* Specifies whether or not to credit unused units.
* @return creditUnusedUnits
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Specifies whether or not to credit unused units.")
public Boolean getCreditUnusedUnits() {
return creditUnusedUnits;
}
public void setCreditUnusedUnits(Boolean creditUnusedUnits) {
this.creditUnusedUnits = creditUnusedUnits;
}
public Overage applyAtEndOfSmoothingPeriod(Boolean applyAtEndOfSmoothingPeriod) {
this.applyAtEndOfSmoothingPeriod = applyAtEndOfSmoothingPeriod;
return this;
}
/**
* Indicates if the overage price is calculated at the end of the smoothing period.
* @return applyAtEndOfSmoothingPeriod
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Indicates if the overage price is calculated at the end of the smoothing period.")
public Boolean getApplyAtEndOfSmoothingPeriod() {
return applyAtEndOfSmoothingPeriod;
}
public void setApplyAtEndOfSmoothingPeriod(Boolean applyAtEndOfSmoothingPeriod) {
this.applyAtEndOfSmoothingPeriod = applyAtEndOfSmoothingPeriod;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Overage overage = (Overage) o;
return Objects.equals(this.intervalCount, overage.intervalCount) &&
Objects.equals(this.type, overage.type) &&
Objects.equals(this.includedUnits, overage.includedUnits) &&
Objects.equals(this.creditUnusedUnits, overage.creditUnusedUnits) &&
Objects.equals(this.applyAtEndOfSmoothingPeriod, overage.applyAtEndOfSmoothingPeriod);
}
@Override
public int hashCode() {
return Objects.hash(intervalCount, type, includedUnits, creditUnusedUnits, applyAtEndOfSmoothingPeriod);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Overage {\n");
sb.append(" intervalCount: ").append(toIndentedString(intervalCount)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" includedUnits: ").append(toIndentedString(includedUnits)).append("\n");
sb.append(" creditUnusedUnits: ").append(toIndentedString(creditUnusedUnits)).append("\n");
sb.append(" applyAtEndOfSmoothingPeriod: ").append(toIndentedString(applyAtEndOfSmoothingPeriod)).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