Package com.stripe.param
Class UsageRecordCreateOnSubscriptionItemParams.Builder
- java.lang.Object
-
- com.stripe.param.UsageRecordCreateOnSubscriptionItemParams.Builder
-
- Enclosing class:
- UsageRecordCreateOnSubscriptionItemParams
public static class UsageRecordCreateOnSubscriptionItemParams.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UsageRecordCreateOnSubscriptionItemParams.Builder
addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list.UsageRecordCreateOnSubscriptionItemParams.Builder
addExpand(java.lang.String element)
Add an element to `expand` list.UsageRecordCreateOnSubscriptionItemParams
build()
Finalize and obtain parameter instance from this builder.UsageRecordCreateOnSubscriptionItemParams.Builder
putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map.UsageRecordCreateOnSubscriptionItemParams.Builder
putExtraParam(java.lang.String key, java.lang.Object value)
Add a key/value pair to `extraParams` map.UsageRecordCreateOnSubscriptionItemParams.Builder
setAction(UsageRecordCreateOnSubscriptionItemParams.Action action)
Valid values areincrement
(default) orset
.UsageRecordCreateOnSubscriptionItemParams.Builder
setQuantity(java.lang.Long quantity)
The usage quantity for the specified timestamp.UsageRecordCreateOnSubscriptionItemParams.Builder
setTimestamp(UsageRecordCreateOnSubscriptionItemParams.Timestamp timestamp)
The timestamp for the usage event.UsageRecordCreateOnSubscriptionItemParams.Builder
setTimestamp(java.lang.Long timestamp)
The timestamp for the usage event.
-
-
-
Method Detail
-
build
public UsageRecordCreateOnSubscriptionItemParams build()
Finalize and obtain parameter instance from this builder.
-
setAction
public UsageRecordCreateOnSubscriptionItemParams.Builder setAction(UsageRecordCreateOnSubscriptionItemParams.Action action)
Valid values areincrement
(default) orset
. When usingincrement
the specifiedquantity
will be added to the usage at the specified timestamp. Theset
action will overwrite the usage quantity at that timestamp. If the subscription has billing thresholds,increment
is the only allowed value.
-
addExpand
public UsageRecordCreateOnSubscriptionItemParams.Builder addExpand(java.lang.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. SeeUsageRecordCreateOnSubscriptionItemParams.expand
for the field documentation.
-
addAllExpand
public UsageRecordCreateOnSubscriptionItemParams.Builder addAllExpand(java.util.List<java.lang.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. SeeUsageRecordCreateOnSubscriptionItemParams.expand
for the field documentation.
-
putExtraParam
public UsageRecordCreateOnSubscriptionItemParams.Builder putExtraParam(java.lang.String key, java.lang.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. SeeUsageRecordCreateOnSubscriptionItemParams.extraParams
for the field documentation.
-
putAllExtraParam
public UsageRecordCreateOnSubscriptionItemParams.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.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. SeeUsageRecordCreateOnSubscriptionItemParams.extraParams
for the field documentation.
-
setQuantity
public UsageRecordCreateOnSubscriptionItemParams.Builder setQuantity(java.lang.Long quantity)
The usage quantity for the specified timestamp.
-
setTimestamp
public UsageRecordCreateOnSubscriptionItemParams.Builder setTimestamp(UsageRecordCreateOnSubscriptionItemParams.Timestamp timestamp)
The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the providedsubscription_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 UsageRecordCreateOnSubscriptionItemParams.Builder setTimestamp(java.lang.Long timestamp)
The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the providedsubscription_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.
-
-