com.zuora.model.OrderLineItemState 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;
/**
* The state of the Order Line Item (OLI). See [State transitions for an order, order line item, and fulfillment](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AB_Order_Line_Item_States_and_Order_States) for more information. To generate invoice for an OLI, you must set this field to `SentToBilling` and set the `billTargetDate` field . You can update this field for a sales or return OLI only when the OLI is in the `Executing` or 'Booked' or `SentToBilling`state (when the `itemState` field is set as `Executing` or `SentToBilling`).
*/
@JsonAdapter(OrderLineItemState.Adapter.class)
public enum OrderLineItemState {
EXECUTING("Executing"),
BOOKED("Booked"),
SENTTOBILLING("SentToBilling"),
COMPLETE("Complete"),
CANCELED("Canceled");
private String value;
OrderLineItemState(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static OrderLineItemState fromValue(String value) {
for (OrderLineItemState b : OrderLineItemState.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 OrderLineItemState enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public OrderLineItemState read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return OrderLineItemState.fromValue(value);
}
}
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
OrderLineItemState.fromValue(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy