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

com.zuora.model.OrderStatus Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
 * 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 status of the order. If the order contains any `Pending Activation` or `Pending Acceptance` subscription, the order status will be `Pending`; If the order is in draft status, the order status will be `Draft`; otherwise the order status is `Completed`.  **Note**: You cannot retrieve the detailed information about draft orders or scheduled orders through the \"List orders of a subscription owner\" and  \"List orders of an invoice owner\" operations.  Draft: The order is in draft status. - `Draft`: The order is in draft status. - `Pending`: The order is in pending status. - `Completed`: The order is in completed status. - `Scheduled`: The order is in scheduled status and it is only valid if the Scheduled Orders feature is enabled. - `Executing`: The scheduled order is executed by a scheduler and it is only valid if the Scheduled Orders feature is enabled. - `Failed`: The scheduled order has failed.  **Note**: The Scheduled Orders feature is in the Early Adopter phase. We are actively soliciting feedback from a small set of early adopters before releasing it as generally available. If you want to join this early adopter program, submit a request at <a href=\"https://support.zuora.com/hc/en-us\" target=\"_blank\">Zuora Global Support</a>. 
 */
@JsonAdapter(OrderStatus.Adapter.class)
public enum OrderStatus {
  
  DRAFT("Draft"),
  
  PENDING("Pending"),
  
  COMPLETED("Completed"),
  
  CANCELLED("Cancelled"),
  
  SCHEDULED("Scheduled"),
  
  EXECUTING("Executing"),
  
  FAILED("Failed");

  private String value;

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

  public String getValue() {
    return value;
  }

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

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

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

  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
    String value = jsonElement.getAsString();
    OrderStatus.fromValue(value);
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy