Skip to content

Commit

Permalink
Update generated code for v1520
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Feb 28, 2025
1 parent 1cf6c5b commit 59878c2
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 5 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1505
v1520
99 changes: 95 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 @@ -3,12 +3,37 @@

import com.google.gson.annotations.SerializedName;
import com.stripe.net.ApiRequestParams;
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
import lombok.Getter;

@Getter
public class EventListParams extends ApiRequestParams {
/** Filter for events created after the specified timestamp. */
@SerializedName("created_gt")
Instant createdGt;

/** Filter for events created at or after the specified timestamp. */
@SerializedName("created_gte")
Instant createdGte;

/** Filter for events created before the specified timestamp. */
@SerializedName("created_lt")
Instant createdLt;

/** Filter for events created at or before the specified timestamp. */
@SerializedName("created_lte")
Instant createdLte;

/**
* Filter events based on whether they were successfully delivered to all subscribed event
* destinations. If false, events which are still pending or have failed all delivery attempts to
* a event destination will be returned.
*/
@SerializedName("delivery_success")
Boolean deliverySuccess;

/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
Expand All @@ -22,7 +47,7 @@ public class EventListParams extends ApiRequestParams {
@SerializedName("limit")
Integer limit;

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

Expand All @@ -31,7 +56,20 @@ public class EventListParams extends ApiRequestParams {
String page;

private EventListParams(
Map<String, Object> extraParams, Integer limit, String objectId, String page) {
Instant createdGt,
Instant createdGte,
Instant createdLt,
Instant createdLte,
Boolean deliverySuccess,
Map<String, Object> extraParams,
Integer limit,
String objectId,
String page) {
this.createdGt = createdGt;
this.createdGte = createdGte;
this.createdLt = createdLt;
this.createdLte = createdLte;
this.deliverySuccess = deliverySuccess;
this.extraParams = extraParams;
this.limit = limit;
this.objectId = objectId;
Expand All @@ -43,6 +81,16 @@ public static Builder builder() {
}

public static class Builder {
private Instant createdGt;

private Instant createdGte;

private Instant createdLt;

private Instant createdLte;

private Boolean deliverySuccess;

private Map<String, Object> extraParams;

private Integer limit;
Expand All @@ -53,7 +101,50 @@ public static class Builder {

/** Finalize and obtain parameter instance from this builder. */
public EventListParams build() {
return new EventListParams(this.extraParams, this.limit, this.objectId, this.page);
return new EventListParams(
this.createdGt,
this.createdGte,
this.createdLt,
this.createdLte,
this.deliverySuccess,
this.extraParams,
this.limit,
this.objectId,
this.page);
}

/** Filter for events created after the specified timestamp. */
public Builder setCreatedGt(Instant createdGt) {
this.createdGt = createdGt;
return this;
}

/** Filter for events created at or after the specified timestamp. */
public Builder setCreatedGte(Instant createdGte) {
this.createdGte = createdGte;
return this;
}

/** Filter for events created before the specified timestamp. */
public Builder setCreatedLt(Instant createdLt) {
this.createdLt = createdLt;
return this;
}

/** Filter for events created at or before the specified timestamp. */
public Builder setCreatedLte(Instant createdLte) {
this.createdLte = createdLte;
return this;
}

/**
* Filter events based on whether they were successfully delivered to all subscribed event
* destinations. If false, events which are still pending or have failed all delivery attempts
* to a event destination will be returned.
*/
public Builder setDeliverySuccess(Boolean deliverySuccess) {
this.deliverySuccess = deliverySuccess;
return this;
}

/**
Expand Down Expand Up @@ -88,7 +179,7 @@ public Builder setLimit(Integer limit) {
return this;
}

/** <strong>Required.</strong> Primary object ID used to retrieve related events. */
/** Primary object ID used to retrieve related events. */
public Builder setObjectId(String objectId) {
this.objectId = objectId;
return this;
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/stripe/service/v2/core/EventService.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ public StripeCollection<Event> list(EventListParams params) throws StripeExcepti
return list(params, (RequestOptions) null);
}
/** List events, going back up to 30 days. */
public StripeCollection<Event> list(RequestOptions options) throws StripeException {
return list((EventListParams) null, options);
}
/** List events, going back up to 30 days. */
public StripeCollection<Event> list() throws StripeException {
return list((EventListParams) null, (RequestOptions) null);
}
/** List events, going back up to 30 days. */
public StripeCollection<Event> list(EventListParams params, RequestOptions options)
throws StripeException {
String path = "/v2/core/events";
Expand Down

0 comments on commit 59878c2

Please sign in to comment.