Package com.stripe.model.billing
Class Meter
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.billing.Meter
- All Implemented Interfaces:
HasId,StripeActiveObject,StripeObjectInterface
Meters specify how to aggregate meter events over a billing period. Meter events represent the
actions that customers take in your system. Meters attach to prices and form the basis of the
bill.
Related guide: Usage based billing
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about CustomerMapping, please refer to the API Reference.static classFor more details about DefaultAggregation, please refer to the API Reference.static classFor more details about StatusTransitions, please refer to the API Reference.static classFor more details about ValueSettings, please refer to the API Reference.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic Metercreate(MeterCreateParams params) Creates a billing meter.static Metercreate(MeterCreateParams params, RequestOptions options) Creates a billing meter.static MeterCreates a billing meter.static Metercreate(Map<String, Object> params, RequestOptions options) Creates a billing meter.When a meter is deactivated, no more meter events will be accepted for this meter.deactivate(RequestOptions options) When a meter is deactivated, no more meter events will be accepted for this meter.deactivate(MeterDeactivateParams params) When a meter is deactivated, no more meter events will be accepted for this meter.deactivate(MeterDeactivateParams params, RequestOptions options) When a meter is deactivated, no more meter events will be accepted for this meter.deactivate(Map<String, Object> params) When a meter is deactivated, no more meter events will be accepted for this meter.deactivate(Map<String, Object> params, RequestOptions options) When a meter is deactivated, no more meter events will be accepted for this meter.booleanRetrieve a list of billing meter event summaries.eventSummaries(MeterEventSummariesParams params, RequestOptions options) Retrieve a list of billing meter event summaries.eventSummaries(Map<String, Object> params) Retrieve a list of billing meter event summaries.eventSummaries(Map<String, Object> params, RequestOptions options) Retrieve a list of billing meter event summaries.Time at which the object was created.Set of keys that will be used to group meter events by.The meter's name.The name of the meter event to record usage for.The time window which meter events have been pre-aggregated for, if any.getId()Unique identifier for the object.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.String representing the object's type.The meter's status.Time at which the object was last updated.inthashCode()static MeterCollectionlist(MeterListParams params) Retrieve a list of billing meters.static MeterCollectionlist(MeterListParams params, RequestOptions options) Retrieve a list of billing meters.static MeterCollectionRetrieve a list of billing meters.static MeterCollectionlist(Map<String, Object> params, RequestOptions options) Retrieve a list of billing meters.When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.reactivate(RequestOptions options) When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.reactivate(MeterReactivateParams params) When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.reactivate(MeterReactivateParams params, RequestOptions options) When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.reactivate(Map<String, Object> params) When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.reactivate(Map<String, Object> params, RequestOptions options) When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.static MeterRetrieves a billing meter given an ID.static Meterretrieve(String id, RequestOptions options) Retrieves a billing meter given an ID.static Meterretrieve(String id, MeterRetrieveParams params, RequestOptions options) Retrieves a billing meter given an ID.static MeterRetrieves a billing meter given an ID.voidsetCreated(Long created) Time at which the object was created.voidsetCustomerMapping(Meter.CustomerMapping customerMapping) voidsetDefaultAggregation(Meter.DefaultAggregation defaultAggregation) voidsetDimensionPayloadKeys(List<String> dimensionPayloadKeys) Set of keys that will be used to group meter events by.voidsetDisplayName(String displayName) The meter's name.voidsetEventName(String eventName) The name of the meter event to record usage for.voidsetEventTimeWindow(String eventTimeWindow) The time window which meter events have been pre-aggregated for, if any.voidUnique identifier for the object.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidString representing the object's type.voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidThe meter's status.voidsetStatusTransitions(Meter.StatusTransitions statusTransitions) voidsetUpdated(Long updated) Time at which the object was last updated.voidsetValueSettings(Meter.ValueSettings valueSettings) update(MeterUpdateParams params) Updates a billing meter.update(MeterUpdateParams params, RequestOptions options) Updates a billing meter.Updates a billing meter.update(Map<String, Object> params, RequestOptions options) Updates a billing meter.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Meter
public Meter()
-
-
Method Details
-
create
Creates a billing meter.- Throws:
StripeException
-
create
public static Meter create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a billing meter.- Throws:
StripeException
-
create
Creates a billing meter.- Throws:
StripeException
-
create
Creates a billing meter.- Throws:
StripeException
-
deactivate
When a meter is deactivated, no more meter events will be accepted for this meter. You can’t attach a deactivated meter to a price.- Throws:
StripeException
-
deactivate
When a meter is deactivated, no more meter events will be accepted for this meter. You can’t attach a deactivated meter to a price.- Throws:
StripeException
-
deactivate
When a meter is deactivated, no more meter events will be accepted for this meter. You can’t attach a deactivated meter to a price.- Throws:
StripeException
-
deactivate
When a meter is deactivated, no more meter events will be accepted for this meter. You can’t attach a deactivated meter to a price.- Throws:
StripeException
-
deactivate
When a meter is deactivated, no more meter events will be accepted for this meter. You can’t attach a deactivated meter to a price.- Throws:
StripeException
-
deactivate
public Meter deactivate(MeterDeactivateParams params, RequestOptions options) throws StripeException When a meter is deactivated, no more meter events will be accepted for this meter. You can’t attach a deactivated meter to a price.- Throws:
StripeException
-
eventSummaries
Retrieve a list of billing meter event summaries.- Throws:
StripeException
-
eventSummaries
public MeterEventSummaryCollection eventSummaries(Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieve a list of billing meter event summaries.- Throws:
StripeException
-
eventSummaries
public MeterEventSummaryCollection eventSummaries(MeterEventSummariesParams params) throws StripeException Retrieve a list of billing meter event summaries.- Throws:
StripeException
-
eventSummaries
public MeterEventSummaryCollection eventSummaries(MeterEventSummariesParams params, RequestOptions options) throws StripeException Retrieve a list of billing meter event summaries.- Throws:
StripeException
-
list
Retrieve a list of billing meters.- Throws:
StripeException
-
list
public static MeterCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieve a list of billing meters.- Throws:
StripeException
-
list
Retrieve a list of billing meters.- Throws:
StripeException
-
list
public static MeterCollection list(MeterListParams params, RequestOptions options) throws StripeException Retrieve a list of billing meters.- Throws:
StripeException
-
reactivate
When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.- Throws:
StripeException
-
reactivate
When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.- Throws:
StripeException
-
reactivate
When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.- Throws:
StripeException
-
reactivate
When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.- Throws:
StripeException
-
reactivate
When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.- Throws:
StripeException
-
reactivate
public Meter reactivate(MeterReactivateParams params, RequestOptions options) throws StripeException When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.- Throws:
StripeException
-
retrieve
Retrieves a billing meter given an ID.- Throws:
StripeException
-
retrieve
Retrieves a billing meter given an ID.- Throws:
StripeException
-
retrieve
public static Meter retrieve(String id, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves a billing meter given an ID.- Throws:
StripeException
-
retrieve
public static Meter retrieve(String id, MeterRetrieveParams params, RequestOptions options) throws StripeException Retrieves a billing meter given an ID.- Throws:
StripeException
-
update
Updates a billing meter.- Throws:
StripeException
-
update
Updates a billing meter.- Throws:
StripeException
-
update
Updates a billing meter.- Throws:
StripeException
-
update
Updates a billing meter.- Throws:
StripeException
-
setResponseGetter
Description copied from interface:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCustomerMapping
-
getDefaultAggregation
-
getDimensionPayloadKeys
Set of keys that will be used to group meter events by. -
getDisplayName
The meter's name. -
getEventName
The name of the meter event to record usage for. Corresponds with theevent_namefield on meter events. -
getEventTimeWindow
The time window which meter events have been pre-aggregated for, if any.One of
day, orhour. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
billing.meter. -
getStatus
The meter's status.One of
active, orinactive. -
getStatusTransitions
-
getUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
getValueSettings
-
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCustomerMapping
-
setDefaultAggregation
-
setDimensionPayloadKeys
Set of keys that will be used to group meter events by. -
setDisplayName
The meter's name. -
setEventName
The name of the meter event to record usage for. Corresponds with theevent_namefield on meter events. -
setEventTimeWindow
The time window which meter events have been pre-aggregated for, if any.One of
day, orhour. -
setId
Unique identifier for the object. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
billing.meter. -
setStatus
The meter's status.One of
active, orinactive. -
setStatusTransitions
-
setUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
setValueSettings
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object.
-