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

com.zuora.model.BillingPeriodAlignment 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;

/**
 * Specifies how Zuora determines when to start new billing periods. You can use this field to align the billing periods of different charges.  * `AlignToCharge` - Zuora starts a new billing period on the first billing day that falls on or after the date when the charge becomes active. * `AlignToSubscriptionStart` - Zuora starts a new billing period on the first billing day that falls on or after the start date of the subscription. * `AlignToTermStart` - For each term of the subscription, Zuora starts a new billing period on the first billing day that falls on or after the start date of the term.  See the `billCycleType` field for information about how Zuora determines the billing day. **Note:** `AlignToTermEnd` is only available for prepayment charges by default. To enable this value for non-prepaid recurring charges, contact <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a>. 
 */
@JsonAdapter(BillingPeriodAlignment.Adapter.class)
public enum BillingPeriodAlignment {
  
  ALIGNTOCHARGE("AlignToCharge"),
  
  ALIGNTOSUBSCRIPTIONSTART("AlignToSubscriptionStart"),
  
  ALIGNTOTERMSTART("AlignToTermStart"),
  
  ALIGNTOTERMEND("AlignToTermEnd");

  private String value;

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

  public String getValue() {
    return value;
  }

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

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

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

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





© 2015 - 2025 Weber Informatics LLC | Privacy Policy