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
A billing meter is a resource that allows you to track usage of a particular event. For example,
you might create a billing meter to track the number of API calls made by a particular user. You
can then attach the billing meter to a price and attach the price to a subscription to charge the
user for the number of API calls they make.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classNested 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.Deactivates a billing meter.deactivate(RequestOptions options) Deactivates a billing meter.deactivate(MeterDeactivateParams params) Deactivates a billing meter.deactivate(MeterDeactivateParams params, RequestOptions options) Deactivates a billing meter.deactivate(Map<String, Object> params) Deactivates a billing meter.deactivate(Map<String, Object> params, RequestOptions options) Deactivates a billing meter.booleanTime at which the object was created.The meter's name.The name of the meter event to record usage for.The time window to pre-aggregate meter events 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.Reactivates a billing meter.reactivate(RequestOptions options) Reactivates a billing meter.reactivate(MeterReactivateParams params) Reactivates a billing meter.reactivate(MeterReactivateParams params, RequestOptions options) Reactivates a billing meter.reactivate(Map<String, Object> params) Reactivates a billing meter.reactivate(Map<String, Object> params, RequestOptions options) Reactivates a billing meter.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) 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 to pre-aggregate meter events 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, setStripeResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
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
Deactivates a billing meter.- Throws:
StripeException
-
deactivate
Deactivates a billing meter.- Throws:
StripeException
-
deactivate
Deactivates a billing meter.- Throws:
StripeException
-
deactivate
Deactivates a billing meter.- Throws:
StripeException
-
deactivate
Deactivates a billing meter.- Throws:
StripeException
-
deactivate
public Meter deactivate(MeterDeactivateParams params, RequestOptions options) throws StripeException Deactivates a billing meter.- 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
Reactivates a billing meter.- Throws:
StripeException
-
reactivate
Reactivates a billing meter.- Throws:
StripeException
-
reactivate
Reactivates a billing meter.- Throws:
StripeException
-
reactivate
Reactivates a billing meter.- Throws:
StripeException
-
reactivate
Reactivates a billing meter.- Throws:
StripeException
-
reactivate
public Meter reactivate(MeterReactivateParams params, RequestOptions options) throws StripeException Reactivates a billing meter.- 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
-
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 to pre-aggregate meter events 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
-
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 to pre-aggregate meter events 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.
-