From c4794cbb7e817680b5c2e245b61b6698703caf7b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Sat, 15 Nov 2025 22:40:04 +0000 Subject: [PATCH 1/2] Update generated code for v2123 and --- API_VERSION | 2 +- src/main/java/com/stripe/model/v2/core/Event.java | 5 ----- src/test/java/com/stripe/functional/GeneratedExamples.java | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/API_VERSION b/API_VERSION index 2f15c36285b..4abc1b1af37 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -a4d4c803dcbf205368dc65179c7eca4748aadaf7 \ No newline at end of file +4e44e29e54f43547d4bff8d37c18e4f8453fb18f \ No newline at end of file diff --git a/src/main/java/com/stripe/model/v2/core/Event.java b/src/main/java/com/stripe/model/v2/core/Event.java index 1c9b0fed797..0d0963ecdfc 100644 --- a/src/main/java/com/stripe/model/v2/core/Event.java +++ b/src/main/java/com/stripe/model/v2/core/Event.java @@ -14,7 +14,6 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import java.time.Instant; -import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -35,10 +34,6 @@ @Setter @EqualsAndHashCode(callSuper = false) public class Event extends StripeObject implements HasId, StripeActiveObject { - /** Before and after changes for the primary related object. */ - @SerializedName("changes") - Map changes; - /** Authentication context needed to fetch the event or related object. */ @SerializedName("context") String context; diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index 8b1d3202870..6eeab497786 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -3208,7 +3208,7 @@ public void testCoreEventsGetServices() throws StripeException { null, null, com.stripe.model.v2.core.Event.class, - "{\"changes\":{\"int_key\":123,\"string_key\":\"value\",\"boolean_key\":true,\"object_key\":{\"object_int_key\":123,\"object_string_key\":\"value\",\"object_boolean_key\":true},\"array_key\":[1,2,3]},\"context\":\"context\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.core.event\",\"reason\":{\"type\":\"request\",\"request\":{\"id\":\"obj_123\",\"idempotency_key\":\"idempotency_key\"}},\"type\":\"type\"}"); + "{\"context\":\"context\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.core.event\",\"reason\":{\"type\":\"request\",\"request\":{\"id\":\"obj_123\",\"idempotency_key\":\"idempotency_key\"}},\"type\":\"type\"}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.Event event = client.v2().core().events().retrieve("ll_123"); From 8484ec04e2919795950d007faea536eece5291a0 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 18:41:58 +0000 Subject: [PATCH 2/2] Update generated code for v2124 and --- API_VERSION | 2 +- OPENAPI_VERSION | 2 +- .../stripe/param/v2/core/EventListParams.java | 188 ++++++++++++------ 3 files changed, 126 insertions(+), 66 deletions(-) diff --git a/API_VERSION b/API_VERSION index 4abc1b1af37..3304332752d 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -4e44e29e54f43547d4bff8d37c18e4f8453fb18f \ No newline at end of file +e62524b587909bee231a15ce0dc618f1d04f69a4 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e67a81ed1b3..ea1ecdee172 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2123 \ No newline at end of file +v2124 \ No newline at end of file diff --git a/src/main/java/com/stripe/param/v2/core/EventListParams.java b/src/main/java/com/stripe/param/v2/core/EventListParams.java index be4f3b17dbd..c0d2274654f 100644 --- a/src/main/java/com/stripe/param/v2/core/EventListParams.java +++ b/src/main/java/com/stripe/param/v2/core/EventListParams.java @@ -14,6 +14,10 @@ @Getter @EqualsAndHashCode(callSuper = false) public class EventListParams extends ApiRequestParams { + /** Set of filters to query events within a range of {@code created} timestamps. */ + @SerializedName("created") + Created created; + /** * 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 @@ -23,26 +27,10 @@ public class EventListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Filter for events created after the specified timestamp. */ - @SerializedName("gt") - Instant gt; - - /** Filter for events created at or after the specified timestamp. */ - @SerializedName("gte") - Instant gte; - /** The page size. */ @SerializedName("limit") Long limit; - /** Filter for events created before the specified timestamp. */ - @SerializedName("lt") - Instant lt; - - /** Filter for events created at or before the specified timestamp. */ - @SerializedName("lte") - Instant lte; - /** Primary object ID used to retrieve related events. */ @SerializedName("object_id") String objectId; @@ -52,20 +40,14 @@ public class EventListParams extends ApiRequestParams { List types; private EventListParams( + Created created, Map extraParams, - Instant gt, - Instant gte, Long limit, - Instant lt, - Instant lte, String objectId, List types) { + this.created = created; this.extraParams = extraParams; - this.gt = gt; - this.gte = gte; this.limit = limit; - this.lt = lt; - this.lte = lte; this.objectId = objectId; this.types = types; } @@ -75,18 +57,12 @@ public static Builder builder() { } public static class Builder { - private Map extraParams; - - private Instant gt; + private Created created; - private Instant gte; + private Map extraParams; private Long limit; - private Instant lt; - - private Instant lte; - private String objectId; private List types; @@ -94,14 +70,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public EventListParams build() { return new EventListParams( - this.extraParams, - this.gt, - this.gte, - this.limit, - this.lt, - this.lte, - this.objectId, - this.types); + this.created, this.extraParams, this.limit, this.objectId, this.types); + } + + /** Set of filters to query events within a range of {@code created} timestamps. */ + public Builder setCreated(EventListParams.Created created) { + this.created = created; + return this; } /** @@ -130,36 +105,12 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Filter for events created after the specified timestamp. */ - public Builder setGt(Instant gt) { - this.gt = gt; - return this; - } - - /** Filter for events created at or after the specified timestamp. */ - public Builder setGte(Instant gte) { - this.gte = gte; - return this; - } - /** The page size. */ public Builder setLimit(Long limit) { this.limit = limit; return this; } - /** Filter for events created before the specified timestamp. */ - public Builder setLt(Instant lt) { - this.lt = lt; - return this; - } - - /** Filter for events created at or before the specified timestamp. */ - public Builder setLte(Instant lte) { - this.lte = lte; - return this; - } - /** Primary object ID used to retrieve related events. */ public Builder setObjectId(String objectId) { this.objectId = objectId; @@ -192,4 +143,113 @@ public Builder addAllType(List elements) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Created { + /** + * 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 + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Filter for events created after the specified timestamp. */ + @SerializedName("gt") + Instant gt; + + /** Filter for events created at or after the specified timestamp. */ + @SerializedName("gte") + Instant gte; + + /** Filter for events created before the specified timestamp. */ + @SerializedName("lt") + Instant lt; + + /** Filter for events created at or before the specified timestamp. */ + @SerializedName("lte") + Instant lte; + + private Created( + Map extraParams, Instant gt, Instant gte, Instant lt, Instant lte) { + this.extraParams = extraParams; + this.gt = gt; + this.gte = gte; + this.lt = lt; + this.lte = lte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Instant gt; + + private Instant gte; + + private Instant lt; + + private Instant lte; + + /** Finalize and obtain parameter instance from this builder. */ + public EventListParams.Created build() { + return new EventListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * EventListParams.Created#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link EventListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Filter for events created after the specified timestamp. */ + public Builder setGt(Instant gt) { + this.gt = gt; + return this; + } + + /** Filter for events created at or after the specified timestamp. */ + public Builder setGte(Instant gte) { + this.gte = gte; + return this; + } + + /** Filter for events created before the specified timestamp. */ + public Builder setLt(Instant lt) { + this.lt = lt; + return this; + } + + /** Filter for events created at or before the specified timestamp. */ + public Builder setLte(Instant lte) { + this.lte = lte; + return this; + } + } + } }