Class UsageRecordCreateParams.Builder

java.lang.Object
com.stripe.param.UsageRecordCreateParams.Builder
Enclosing class:
UsageRecordCreateParams

public static class UsageRecordCreateParams.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public UsageRecordCreateParams build()
      Finalize and obtain parameter instance from this builder.
    • setAction

      Valid values are increment (default) or set. When using increment the specified quantity will be added to the usage at the specified timestamp. The set action will overwrite the usage quantity at that timestamp. If the subscription has billing thresholds, increment is the only allowed value.
    • addExpand

      public UsageRecordCreateParams.Builder addExpand(String element)
      Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See UsageRecordCreateParams.expand for the field documentation.
    • addAllExpand

      public UsageRecordCreateParams.Builder addAllExpand(List<String> elements)
      Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See UsageRecordCreateParams.expand for the field documentation.
    • putExtraParam

      public UsageRecordCreateParams.Builder putExtraParam(String key, Object value)
      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 UsageRecordCreateParams.extraParams for the field documentation.
    • putAllExtraParam

      public UsageRecordCreateParams.Builder putAllExtraParam(Map<String,Object> map)
      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 UsageRecordCreateParams.extraParams for the field documentation.
    • setQuantity

      public UsageRecordCreateParams.Builder setQuantity(Long quantity)
      Required. The usage quantity for the specified timestamp.
    • setTimestamp

      The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided subscription_item, and must not be in the future. When passing "now", Stripe records usage for the current time. Default is "now" if a value is not provided.
    • setTimestamp

      public UsageRecordCreateParams.Builder setTimestamp(Long timestamp)
      The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided subscription_item, and must not be in the future. When passing "now", Stripe records usage for the current time. Default is "now" if a value is not provided.