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
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
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_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static Meter
create
(MeterCreateParams params) Creates a billing meter.static Meter
create
(MeterCreateParams params, RequestOptions options) Creates a billing meter.static Meter
Creates a billing meter.static Meter
create
(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.boolean
Retrieve 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.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 valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.String representing the object's type.The meter's status.Time at which the object was last updated.int
hashCode()
static MeterCollection
list
(MeterListParams params) Retrieve a list of billing meters.static MeterCollection
list
(MeterListParams params, RequestOptions options) Retrieve a list of billing meters.static MeterCollection
Retrieve a list of billing meters.static MeterCollection
list
(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 Meter
Retrieves a billing meter given an ID.static Meter
retrieve
(String id, RequestOptions options) Retrieves a billing meter given an ID.static Meter
retrieve
(String id, MeterRetrieveParams params, RequestOptions options) Retrieves a billing meter given an ID.static Meter
Retrieves a billing meter given an ID.void
setCreated
(Long created) Time at which the object was created.void
setCustomerMapping
(Meter.CustomerMapping customerMapping) void
setDefaultAggregation
(Meter.DefaultAggregation defaultAggregation) void
setDisplayName
(String displayName) The meter's name.void
setEventName
(String eventName) The name of the meter event to record usage for.void
setEventTimeWindow
(String eventTimeWindow) The time window to pre-aggregate meter events for, if any.void
Unique identifier for the object.void
setLivemode
(Boolean livemode) Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
String representing the object's type.void
setResponseGetter
(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.void
The meter's status.void
setStatusTransitions
(Meter.StatusTransitions statusTransitions) void
setUpdated
(Long updated) Time at which the object was last updated.void
setValueSettings
(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, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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
-
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
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:StripeActiveObject
Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance 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_name
field on meter events. -
getEventTimeWindow
The time window to pre-aggregate meter events for, if any.One of
day
, orhour
. -
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if 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_name
field 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 valuetrue
if the object exists in live mode or the valuefalse
if 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.
-