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

com.stripe.param.SubscriptionCancelParams Maven / Gradle / Ivy

There is a newer version: 28.2.0
Show newest version
// Generated by delombok at Fri Dec 20 23:44:58 CET 2019
package com.stripe.param;

import com.google.gson.annotations.SerializedName;
import com.stripe.net.ApiRequestParams;
import java.util.HashMap;
import java.util.Map;

public class SubscriptionCancelParams extends ApiRequestParams {
  /**
   * Map of extra parameters for custom features not available in this client library. The content
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
   * param object. Effectively, this map is flattened to its parent instance.
   */
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
  Map extraParams;
  /**
   * Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending
   * proration invoice items.
   */
  @SerializedName("invoice_now")
  Boolean invoiceNow;
  /**
   * Will generate a proration invoice item that credits remaining unused time until the
   * subscription period end.
   */
  @SerializedName("prorate")
  Boolean prorate;

  private SubscriptionCancelParams(Map extraParams, Boolean invoiceNow, Boolean prorate) {
    this.extraParams = extraParams;
    this.invoiceNow = invoiceNow;
    this.prorate = prorate;
  }

  public static Builder builder() {
    return new Builder();
  }


  public static class Builder {
    private Map extraParams;
    private Boolean invoiceNow;
    private Boolean prorate;

    /** Finalize and obtain parameter instance from this builder. */
    public SubscriptionCancelParams build() {
      return new SubscriptionCancelParams(this.extraParams, this.invoiceNow, this.prorate);
    }

    /**
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
     * SubscriptionCancelParams#extraParams} for the field documentation.
     */
    public Builder putExtraParam(String key, Object value) {
      if (this.extraParams == null) {
        this.extraParams = new HashMap<>();
      }
      this.extraParams.put(key, value);
      return this;
    }

    /**
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
     * See {@link SubscriptionCancelParams#extraParams} for the field documentation.
     */
    public Builder putAllExtraParam(Map map) {
      if (this.extraParams == null) {
        this.extraParams = new HashMap<>();
      }
      this.extraParams.putAll(map);
      return this;
    }

    /**
     * Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending
     * proration invoice items.
     */
    public Builder setInvoiceNow(Boolean invoiceNow) {
      this.invoiceNow = invoiceNow;
      return this;
    }

    /**
     * Will generate a proration invoice item that credits remaining unused time until the
     * subscription period end.
     */
    public Builder setProrate(Boolean prorate) {
      this.prorate = prorate;
      return this;
    }
  }

  /**
   * Map of extra parameters for custom features not available in this client library. The content
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
   * param object. Effectively, this map is flattened to its parent instance.
   */
  @java.lang.SuppressWarnings("all")
  @lombok.Generated
  public Map getExtraParams() {
    return this.extraParams;
  }

  /**
   * Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending
   * proration invoice items.
   */
  @java.lang.SuppressWarnings("all")
  @lombok.Generated
  public Boolean getInvoiceNow() {
    return this.invoiceNow;
  }

  /**
   * Will generate a proration invoice item that credits remaining unused time until the
   * subscription period end.
   */
  @java.lang.SuppressWarnings("all")
  @lombok.Generated
  public Boolean getProrate() {
    return this.prorate;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy