Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static final class EventData {
public static final class Reason {
/** The total error count within this window. */
@SerializedName("error_count")
Integer errorCount;
Long errorCount;
/** The error details. */
@SerializedName("error_types")
List<V1BillingMeterErrorReportTriggeredEvent.EventData.Reason.ErrorType> errorTypes;
Expand All @@ -53,7 +53,7 @@ public static final class ErrorType {
String code;
/** The number of errors of this type. */
@SerializedName("error_count")
Integer errorCount;
Long errorCount;
/** A list of sample errors of this type. */
@SerializedName("sample_errors")
List<V1BillingMeterErrorReportTriggeredEvent.EventData.Reason.ErrorType.SampleError>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static final class EventData {
public static final class Reason {
/** The total error count within this window. */
@SerializedName("error_count")
Integer errorCount;
Long errorCount;
/** The error details. */
@SerializedName("error_types")
List<V1BillingMeterNoMeterFoundEvent.EventData.Reason.ErrorType> errorTypes;
Expand All @@ -51,7 +51,7 @@ public static final class ErrorType {
String code;
/** The number of errors of this type. */
@SerializedName("error_count")
Integer errorCount;
Long errorCount;
/** A list of sample errors of this type. */
@SerializedName("sample_errors")
List<V1BillingMeterNoMeterFoundEvent.EventData.Reason.ErrorType.SampleError> sampleErrors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.stripe.model.StripeObject;
import com.stripe.net.StripeResponseGetter;

/** The temporary session token has expired. */
/** Information about the error that occurred. */
public final class TemporarySessionExpiredException extends ApiException {
private static final long serialVersionUID = 2L;

Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/stripe/model/v2/DeletedObject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// File generated from our OpenAPI spec
package com.stripe.model.v2;

import com.google.gson.annotations.SerializedName;
import com.stripe.model.HasId;
import com.stripe.model.StripeObject;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class DeletedObject extends StripeObject implements HasId {
/** The ID of the object that's being deleted. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;

/**
* String representing the type of the object that has been deleted. Objects of the same type
* share the same value of the object field.
*/
@SerializedName("object")
String object;
}
22 changes: 14 additions & 8 deletions src/main/java/com/stripe/model/v2/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
import lombok.Getter;
import lombok.Setter;

/**
* Events are generated to keep you informed of activity in your business account. APIs in the /v2
* namespace generate <a
* href="https://docs.stripe.com/event-destinations#benefits-of-thin-events">thin events</a> which
* have small, unversioned payloads that include a reference to the ID of the object that has
* changed. The Events v2 API returns these new thin events. <a
* href="https://docs.stripe.com/event-destinations#fetch-data">Retrieve the event object</a> for
* additional data about the event. Use the related object ID in the event payload to <a
* href="https://docs.stripe.com/event-destinations#retrieve-the-object-associated-with-thin-events">fetch
* the API resource</a> of the object associated with the event. Comparatively, events generated by
* most API v1 include a versioned snapshot of an API object in their payload.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -121,10 +133,7 @@ public static class RelatedObject extends StripeObject implements HasId {
String url;
}

/**
* For more details about Reason, please refer to the <a href="https://docs.stripe.com/api">API
* Reference.</a>
*/
/** Reason for the event. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand All @@ -141,10 +150,7 @@ public static class Reason extends StripeObject {
@SerializedName("type")
String type;

/**
* For more details about Request, please refer to the <a href="https://docs.stripe.com/api">API
* Reference.</a>
*/
/** Information on the API request that instigated the event. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
27 changes: 11 additions & 16 deletions src/main/java/com/stripe/model/v2/EventDestination.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
import lombok.Getter;
import lombok.Setter;

/**
* Set up an event destination to receive events from Stripe across multiple destination types,
* including <a href="https://docs.stripe.com/webhooks">webhook endpoints</a> and <a
* href="https://docs.stripe.com/event-destinations/eventbridge">Amazon EventBridge</a>. Event
* destinations support receiving <a href="https://docs.stripe.com/api/v2/events">thin events</a>
* and <a href="https://docs.stripe.com/api/events">snapshot events</a>.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -104,10 +111,7 @@ public class EventDestination extends StripeObject implements HasId {
@SerializedName("webhook_endpoint")
WebhookEndpoint webhookEndpoint;

/**
* For more details about AmazonEventbridge, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
/** Amazon EventBridge configuration. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand All @@ -129,10 +133,7 @@ public static class AmazonEventbridge extends StripeObject {
String awsEventSourceStatus;
}

/**
* For more details about StatusDetails, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
/** Additional information about event destination status. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand All @@ -141,10 +142,7 @@ public static class StatusDetails extends StripeObject {
@SerializedName("disabled")
Disabled disabled;

/**
* For more details about Disabled, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
/** Details about why the event destination has been disabled. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand All @@ -159,10 +157,7 @@ public static class Disabled extends StripeObject {
}
}

/**
* For more details about WebhookEndpoint, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
/** Webhook endpoint configuration. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import lombok.Getter;
import lombok.Setter;

/** Fix me empty_doc_string. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ public class MeterEventAdjustment extends StripeObject implements HasId {
@SerializedName("type")
String type;

/**
* For more details about Cancel, please refer to the <a href="https://docs.stripe.com/api">API
* Reference.</a>
*/
/** Specifies which event to cancel. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class EventDestinationListParams extends ApiRequestParams {

/** The page size. */
@SerializedName("limit")
Integer limit;
Long limit;

private EventDestinationListParams(
Map<String, Object> extraParams,
List<EventDestinationListParams.Include> include,
Integer limit) {
Long limit) {
this.extraParams = extraParams;
this.include = include;
this.limit = limit;
Expand All @@ -50,7 +50,7 @@ public static class Builder {

private List<EventDestinationListParams.Include> include;

private Integer limit;
private Long limit;

/** Finalize and obtain parameter instance from this builder. */
public EventDestinationListParams build() {
Expand Down Expand Up @@ -110,7 +110,7 @@ public Builder addAllInclude(List<EventDestinationListParams.Include> elements)
}

/** The page size. */
public Builder setLimit(Integer limit) {
public Builder setLimit(Long limit) {
this.limit = limit;
return this;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/stripe/param/v2/core/EventListParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public class EventListParams extends ApiRequestParams {

/** The page size. */
@SerializedName("limit")
Integer limit;
Long limit;

/** <strong>Required.</strong> Primary object ID used to retrieve related events. */
@SerializedName("object_id")
String objectId;

private EventListParams(Map<String, Object> extraParams, Integer limit, String objectId) {
private EventListParams(Map<String, Object> extraParams, Long limit, String objectId) {
this.extraParams = extraParams;
this.limit = limit;
this.objectId = objectId;
Expand All @@ -41,7 +41,7 @@ public static Builder builder() {
public static class Builder {
private Map<String, Object> extraParams;

private Integer limit;
private Long limit;

private String objectId;

Expand Down Expand Up @@ -77,7 +77,7 @@ public Builder putAllExtraParam(Map<String, Object> map) {
}

/** The page size. */
public Builder setLimit(Integer limit) {
public Builder setLimit(Long limit) {
this.limit = limit;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.google.gson.reflect.TypeToken;
import com.stripe.exception.StripeException;
import com.stripe.model.v2.DeletedObject;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.EventDestination;
import com.stripe.model.v2.StripeCollection;
Expand Down Expand Up @@ -67,15 +68,15 @@ public EventDestination create(EventDestinationCreateParams params, RequestOptio
return this.request(request, EventDestination.class);
}
/** Delete an event destination. */
public EventDestination delete(String id) throws StripeException {
public DeletedObject delete(String id) throws StripeException {
return delete(id, (RequestOptions) null);
}
/** Delete an event destination. */
public EventDestination delete(String id, RequestOptions options) throws StripeException {
public DeletedObject delete(String id, RequestOptions options) throws StripeException {
String path = String.format("/v2/core/event_destinations/%s", ApiResource.urlEncodeId(id));
ApiRequest request =
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, null, options);
return this.request(request, EventDestination.class);
return this.request(request, DeletedObject.class);
}
/** Retrieves the details of an event destination. */
public EventDestination retrieve(String id, EventDestinationRetrieveParams params)
Expand Down
Loading