com.zuora.model.BillingPeriod 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
/*
* Zuora API Reference
* REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).
*
* The version of the OpenAPI document: 2024-05-20
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.zuora.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.JsonElement;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
/**
* Billing frequency of the charge. The value of this field controls the duration of each billing period. Allows billing period to be overridden on the rate plan charge. If the value of this field is `Specific_Months` or `Specific_Weeks`, use the `specificBillingPeriod` field to specify the duration of each billing period.
*/
@JsonAdapter(BillingPeriod.Adapter.class)
public enum BillingPeriod {
MONTH("Month"),
QUARTER("Quarter"),
SEMI_ANNUAL("Semi_Annual"),
ANNUAL("Annual"),
EIGHTEEN_MONTHS("Eighteen_Months"),
TWO_YEARS("Two_Years"),
THREE_YEARS("Three_Years"),
FIVE_YEARS("Five_Years"),
SPECIFIC_MONTHS("Specific_Months"),
SUBSCRIPTION_TERM("Subscription_Term"),
WEEK("Week"),
SPECIFIC_WEEKS("Specific_Weeks");
private String value;
BillingPeriod(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static BillingPeriod fromValue(String value) {
for (BillingPeriod b : BillingPeriod.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 BillingPeriod enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public BillingPeriod read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return BillingPeriod.fromValue(value);
}
}
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
BillingPeriod.fromValue(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy