public class Event extends ApiResource implements HasId
ApiResource.RequestMethod
CHARSET, GSON
PRETTY_PRINT_GSON
Constructor and Description |
---|
Event() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(java.lang.Object other) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAccount()
The connected account that originated the event.
|
java.lang.String |
getApiVersion()
The Stripe API version used to render
data . |
java.lang.Long |
getCreated()
Time at which the object was created.
|
EventData |
getData() |
EventDataObjectDeserializer |
getDataObjectDeserializer()
Get deserialization helper to handle failure due to schema incompatibility.
|
java.lang.String |
getId()
Unique identifier for the object.
|
java.lang.Boolean |
getLivemode()
Has the value
true if the object exists in live mode or the value false if the
object exists in test mode. |
java.lang.String |
getObject()
String representing the object's type.
|
java.lang.Long |
getPendingWebhooks()
Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response)
to the URLs you've specified.
|
EventRequest |
getRequest()
Information on the API request that instigated the event.
|
java.lang.String |
getType()
Description of the event (e.g.,
invoice.created or charge.refunded ). |
int |
hashCode() |
static EventCollection |
list(EventListParams params)
List events, going back up to 30 days.
|
static EventCollection |
list(EventListParams params,
RequestOptions options)
List events, going back up to 30 days.
|
static EventCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params)
List events, going back up to 30 days.
|
static EventCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
List events, going back up to 30 days.
|
static Event |
retrieve(java.lang.String id)
Retrieves the details of an event.
|
static Event |
retrieve(java.lang.String id,
EventRetrieveParams params,
RequestOptions options)
Retrieves the details of an event.
|
static Event |
retrieve(java.lang.String id,
java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Retrieves the details of an event.
|
static Event |
retrieve(java.lang.String id,
RequestOptions options)
Retrieves the details of an event.
|
void |
setAccount(java.lang.String account)
The connected account that originated the event.
|
void |
setApiVersion(java.lang.String apiVersion)
The Stripe API version used to render
data . |
void |
setCreated(java.lang.Long created)
Time at which the object was created.
|
void |
setData(EventData data) |
void |
setId(java.lang.String id)
Unique identifier for the object.
|
void |
setLivemode(java.lang.Boolean livemode)
Has the value
true if the object exists in live mode or the value false if the
object exists in test mode. |
void |
setObject(java.lang.String object)
String representing the object's type.
|
void |
setPendingWebhooks(java.lang.Long pendingWebhooks)
Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response)
to the URLs you've specified.
|
void |
setRequest(EventRequest request)
Information on the API request that instigated the event.
|
void |
setType(java.lang.String type)
Description of the event (e.g.,
invoice.created or charge.refunded ). |
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
public static EventCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
api_version
attribute (not according to your current Stripe API version or Stripe-Version
header).StripeException
public static EventCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
api_version
attribute (not according to your current Stripe API version or Stripe-Version
header).StripeException
public static EventCollection list(EventListParams params) throws StripeException
api_version
attribute (not according to your current Stripe API version or Stripe-Version
header).StripeException
public static EventCollection list(EventListParams params, RequestOptions options) throws StripeException
api_version
attribute (not according to your current Stripe API version or Stripe-Version
header).StripeException
public static Event retrieve(java.lang.String id) throws StripeException
StripeException
public static Event retrieve(java.lang.String id, RequestOptions options) throws StripeException
StripeException
public static Event retrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public static Event retrieve(java.lang.String id, EventRetrieveParams params, RequestOptions options) throws StripeException
StripeException
public EventDataObjectDeserializer getDataObjectDeserializer()
Event event = getEvent(); // either from webhook or event endpoint EventDataObjectDeserializer deserializer = event.getDataObjectDeserializer(); Optional<StripeObject> stripeObject = deserializer.getObject();You can ensure that webhook events has the same API version by creating webhook endpoint specifying api version](https://stripe.com/docs/api/webhook_endpoints/create) as
Stripe.API_VERSION
. For reading from old webhook endpoints or old events with
potential schema incompatibility, see EventDataObjectDeserializer.deserialize()
and
EventDataObjectDeserializer.deserializeUnsafe()
.public java.lang.String getAccount()
public java.lang.String getApiVersion()
data
. Note: This property is populated only
for events on or after October 31, 2014.public java.lang.Long getCreated()
public EventData getData()
public java.lang.Boolean getLivemode()
true
if the object exists in live mode or the value false
if the
object exists in test mode.public java.lang.String getObject()
Equal to event
.
public java.lang.Long getPendingWebhooks()
public EventRequest getRequest()
public java.lang.String getType()
invoice.created
or charge.refunded
).public void setAccount(java.lang.String account)
public void setApiVersion(java.lang.String apiVersion)
data
. Note: This property is populated only
for events on or after October 31, 2014.public void setCreated(java.lang.Long created)
public void setData(EventData data)
public void setId(java.lang.String id)
public void setLivemode(java.lang.Boolean livemode)
true
if the object exists in live mode or the value false
if the
object exists in test mode.public void setObject(java.lang.String object)
Equal to event
.
public void setPendingWebhooks(java.lang.Long pendingWebhooks)
public void setRequest(EventRequest request)
public void setType(java.lang.String type)
invoice.created
or charge.refunded
).public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode
in class java.lang.Object