Skip to content

Commit db05641

Browse files
Update generated code (#2113)
* Update generated code for v2123 and * Update generated code for v2124 and --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
1 parent 0931ee3 commit db05641

File tree

5 files changed

+127
-72
lines changed

5 files changed

+127
-72
lines changed

API_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a4d4c803dcbf205368dc65179c7eca4748aadaf7
1+
e62524b587909bee231a15ce0dc618f1d04f69a4

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2123
1+
v2124

src/main/java/com/stripe/model/v2/core/Event.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import com.stripe.net.RequestOptions;
1515
import com.stripe.net.StripeResponseGetter;
1616
import java.time.Instant;
17-
import java.util.Map;
1817
import lombok.EqualsAndHashCode;
1918
import lombok.Getter;
2019
import lombok.Setter;
@@ -35,10 +34,6 @@
3534
@Setter
3635
@EqualsAndHashCode(callSuper = false)
3736
public class Event extends StripeObject implements HasId, StripeActiveObject {
38-
/** Before and after changes for the primary related object. */
39-
@SerializedName("changes")
40-
Map<String, Object> changes;
41-
4237
/** Authentication context needed to fetch the event or related object. */
4338
@SerializedName("context")
4439
String context;

src/main/java/com/stripe/param/v2/core/EventListParams.java

Lines changed: 124 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
@Getter
1515
@EqualsAndHashCode(callSuper = false)
1616
public class EventListParams extends ApiRequestParams {
17+
/** Set of filters to query events within a range of {@code created} timestamps. */
18+
@SerializedName("created")
19+
Created created;
20+
1721
/**
1822
* Map of extra parameters for custom features not available in this client library. The content
1923
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
@@ -23,26 +27,10 @@ public class EventListParams extends ApiRequestParams {
2327
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2428
Map<String, Object> extraParams;
2529

26-
/** Filter for events created after the specified timestamp. */
27-
@SerializedName("gt")
28-
Instant gt;
29-
30-
/** Filter for events created at or after the specified timestamp. */
31-
@SerializedName("gte")
32-
Instant gte;
33-
3430
/** The page size. */
3531
@SerializedName("limit")
3632
Long limit;
3733

38-
/** Filter for events created before the specified timestamp. */
39-
@SerializedName("lt")
40-
Instant lt;
41-
42-
/** Filter for events created at or before the specified timestamp. */
43-
@SerializedName("lte")
44-
Instant lte;
45-
4634
/** Primary object ID used to retrieve related events. */
4735
@SerializedName("object_id")
4836
String objectId;
@@ -52,20 +40,14 @@ public class EventListParams extends ApiRequestParams {
5240
List<String> types;
5341

5442
private EventListParams(
43+
Created created,
5544
Map<String, Object> extraParams,
56-
Instant gt,
57-
Instant gte,
5845
Long limit,
59-
Instant lt,
60-
Instant lte,
6146
String objectId,
6247
List<String> types) {
48+
this.created = created;
6349
this.extraParams = extraParams;
64-
this.gt = gt;
65-
this.gte = gte;
6650
this.limit = limit;
67-
this.lt = lt;
68-
this.lte = lte;
6951
this.objectId = objectId;
7052
this.types = types;
7153
}
@@ -75,33 +57,26 @@ public static Builder builder() {
7557
}
7658

7759
public static class Builder {
78-
private Map<String, Object> extraParams;
79-
80-
private Instant gt;
60+
private Created created;
8161

82-
private Instant gte;
62+
private Map<String, Object> extraParams;
8363

8464
private Long limit;
8565

86-
private Instant lt;
87-
88-
private Instant lte;
89-
9066
private String objectId;
9167

9268
private List<String> types;
9369

9470
/** Finalize and obtain parameter instance from this builder. */
9571
public EventListParams build() {
9672
return new EventListParams(
97-
this.extraParams,
98-
this.gt,
99-
this.gte,
100-
this.limit,
101-
this.lt,
102-
this.lte,
103-
this.objectId,
104-
this.types);
73+
this.created, this.extraParams, this.limit, this.objectId, this.types);
74+
}
75+
76+
/** Set of filters to query events within a range of {@code created} timestamps. */
77+
public Builder setCreated(EventListParams.Created created) {
78+
this.created = created;
79+
return this;
10580
}
10681

10782
/**
@@ -130,36 +105,12 @@ public Builder putAllExtraParam(Map<String, Object> map) {
130105
return this;
131106
}
132107

133-
/** Filter for events created after the specified timestamp. */
134-
public Builder setGt(Instant gt) {
135-
this.gt = gt;
136-
return this;
137-
}
138-
139-
/** Filter for events created at or after the specified timestamp. */
140-
public Builder setGte(Instant gte) {
141-
this.gte = gte;
142-
return this;
143-
}
144-
145108
/** The page size. */
146109
public Builder setLimit(Long limit) {
147110
this.limit = limit;
148111
return this;
149112
}
150113

151-
/** Filter for events created before the specified timestamp. */
152-
public Builder setLt(Instant lt) {
153-
this.lt = lt;
154-
return this;
155-
}
156-
157-
/** Filter for events created at or before the specified timestamp. */
158-
public Builder setLte(Instant lte) {
159-
this.lte = lte;
160-
return this;
161-
}
162-
163114
/** Primary object ID used to retrieve related events. */
164115
public Builder setObjectId(String objectId) {
165116
this.objectId = objectId;
@@ -192,4 +143,113 @@ public Builder addAllType(List<String> elements) {
192143
return this;
193144
}
194145
}
146+
147+
@Getter
148+
@EqualsAndHashCode(callSuper = false)
149+
public static class Created {
150+
/**
151+
* Map of extra parameters for custom features not available in this client library. The content
152+
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
153+
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
154+
* param object. Effectively, this map is flattened to its parent instance.
155+
*/
156+
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
157+
Map<String, Object> extraParams;
158+
159+
/** Filter for events created after the specified timestamp. */
160+
@SerializedName("gt")
161+
Instant gt;
162+
163+
/** Filter for events created at or after the specified timestamp. */
164+
@SerializedName("gte")
165+
Instant gte;
166+
167+
/** Filter for events created before the specified timestamp. */
168+
@SerializedName("lt")
169+
Instant lt;
170+
171+
/** Filter for events created at or before the specified timestamp. */
172+
@SerializedName("lte")
173+
Instant lte;
174+
175+
private Created(
176+
Map<String, Object> extraParams, Instant gt, Instant gte, Instant lt, Instant lte) {
177+
this.extraParams = extraParams;
178+
this.gt = gt;
179+
this.gte = gte;
180+
this.lt = lt;
181+
this.lte = lte;
182+
}
183+
184+
public static Builder builder() {
185+
return new Builder();
186+
}
187+
188+
public static class Builder {
189+
private Map<String, Object> extraParams;
190+
191+
private Instant gt;
192+
193+
private Instant gte;
194+
195+
private Instant lt;
196+
197+
private Instant lte;
198+
199+
/** Finalize and obtain parameter instance from this builder. */
200+
public EventListParams.Created build() {
201+
return new EventListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte);
202+
}
203+
204+
/**
205+
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
206+
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
207+
* EventListParams.Created#extraParams} for the field documentation.
208+
*/
209+
public Builder putExtraParam(String key, Object value) {
210+
if (this.extraParams == null) {
211+
this.extraParams = new HashMap<>();
212+
}
213+
this.extraParams.put(key, value);
214+
return this;
215+
}
216+
217+
/**
218+
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
219+
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
220+
* See {@link EventListParams.Created#extraParams} for the field documentation.
221+
*/
222+
public Builder putAllExtraParam(Map<String, Object> map) {
223+
if (this.extraParams == null) {
224+
this.extraParams = new HashMap<>();
225+
}
226+
this.extraParams.putAll(map);
227+
return this;
228+
}
229+
230+
/** Filter for events created after the specified timestamp. */
231+
public Builder setGt(Instant gt) {
232+
this.gt = gt;
233+
return this;
234+
}
235+
236+
/** Filter for events created at or after the specified timestamp. */
237+
public Builder setGte(Instant gte) {
238+
this.gte = gte;
239+
return this;
240+
}
241+
242+
/** Filter for events created before the specified timestamp. */
243+
public Builder setLt(Instant lt) {
244+
this.lt = lt;
245+
return this;
246+
}
247+
248+
/** Filter for events created at or before the specified timestamp. */
249+
public Builder setLte(Instant lte) {
250+
this.lte = lte;
251+
return this;
252+
}
253+
}
254+
}
195255
}

src/test/java/com/stripe/functional/GeneratedExamples.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3208,7 +3208,7 @@ public void testCoreEventsGetServices() throws StripeException {
32083208
null,
32093209
null,
32103210
com.stripe.model.v2.core.Event.class,
3211-
"{\"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\"}");
3211+
"{\"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\"}");
32123212
StripeClient client = new StripeClient(networkSpy);
32133213

32143214
com.stripe.model.v2.core.Event event = client.v2().core().events().retrieve("ll_123");

0 commit comments

Comments
 (0)