1414@ Getter
1515@ EqualsAndHashCode (callSuper = false )
1616public 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}
0 commit comments