3
3
4
4
import com .google .gson .annotations .SerializedName ;
5
5
import com .stripe .net .ApiRequestParams ;
6
+ import java .time .Instant ;
6
7
import java .util .HashMap ;
7
8
import java .util .Map ;
8
9
import lombok .Getter ;
9
10
10
11
@ Getter
11
12
public class EventListParams extends ApiRequestParams {
13
+ /** Filter for events created after the specified timestamp. */
14
+ @ SerializedName ("created_gt" )
15
+ Instant createdGt ;
16
+
17
+ /** Filter for events created at or after the specified timestamp. */
18
+ @ SerializedName ("created_gte" )
19
+ Instant createdGte ;
20
+
21
+ /** Filter for events created before the specified timestamp. */
22
+ @ SerializedName ("created_lt" )
23
+ Instant createdLt ;
24
+
25
+ /** Filter for events created at or before the specified timestamp. */
26
+ @ SerializedName ("created_lte" )
27
+ Instant createdLte ;
28
+
29
+ /**
30
+ * Filter events based on whether they were successfully delivered to all subscribed event
31
+ * destinations. If false, events which are still pending or have failed all delivery attempts to
32
+ * a event destination will be returned.
33
+ */
34
+ @ SerializedName ("delivery_success" )
35
+ Boolean deliverySuccess ;
36
+
12
37
/**
13
38
* Map of extra parameters for custom features not available in this client library. The content
14
39
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
@@ -22,7 +47,7 @@ public class EventListParams extends ApiRequestParams {
22
47
@ SerializedName ("limit" )
23
48
Integer limit ;
24
49
25
- /** <strong>Required.</strong> Primary object ID used to retrieve related events. */
50
+ /** Primary object ID used to retrieve related events. */
26
51
@ SerializedName ("object_id" )
27
52
String objectId ;
28
53
@@ -31,7 +56,20 @@ public class EventListParams extends ApiRequestParams {
31
56
String page ;
32
57
33
58
private EventListParams (
34
- Map <String , Object > extraParams , Integer limit , String objectId , String page ) {
59
+ Instant createdGt ,
60
+ Instant createdGte ,
61
+ Instant createdLt ,
62
+ Instant createdLte ,
63
+ Boolean deliverySuccess ,
64
+ Map <String , Object > extraParams ,
65
+ Integer limit ,
66
+ String objectId ,
67
+ String page ) {
68
+ this .createdGt = createdGt ;
69
+ this .createdGte = createdGte ;
70
+ this .createdLt = createdLt ;
71
+ this .createdLte = createdLte ;
72
+ this .deliverySuccess = deliverySuccess ;
35
73
this .extraParams = extraParams ;
36
74
this .limit = limit ;
37
75
this .objectId = objectId ;
@@ -43,6 +81,16 @@ public static Builder builder() {
43
81
}
44
82
45
83
public static class Builder {
84
+ private Instant createdGt ;
85
+
86
+ private Instant createdGte ;
87
+
88
+ private Instant createdLt ;
89
+
90
+ private Instant createdLte ;
91
+
92
+ private Boolean deliverySuccess ;
93
+
46
94
private Map <String , Object > extraParams ;
47
95
48
96
private Integer limit ;
@@ -53,7 +101,50 @@ public static class Builder {
53
101
54
102
/** Finalize and obtain parameter instance from this builder. */
55
103
public EventListParams build () {
56
- return new EventListParams (this .extraParams , this .limit , this .objectId , this .page );
104
+ return new EventListParams (
105
+ this .createdGt ,
106
+ this .createdGte ,
107
+ this .createdLt ,
108
+ this .createdLte ,
109
+ this .deliverySuccess ,
110
+ this .extraParams ,
111
+ this .limit ,
112
+ this .objectId ,
113
+ this .page );
114
+ }
115
+
116
+ /** Filter for events created after the specified timestamp. */
117
+ public Builder setCreatedGt (Instant createdGt ) {
118
+ this .createdGt = createdGt ;
119
+ return this ;
120
+ }
121
+
122
+ /** Filter for events created at or after the specified timestamp. */
123
+ public Builder setCreatedGte (Instant createdGte ) {
124
+ this .createdGte = createdGte ;
125
+ return this ;
126
+ }
127
+
128
+ /** Filter for events created before the specified timestamp. */
129
+ public Builder setCreatedLt (Instant createdLt ) {
130
+ this .createdLt = createdLt ;
131
+ return this ;
132
+ }
133
+
134
+ /** Filter for events created at or before the specified timestamp. */
135
+ public Builder setCreatedLte (Instant createdLte ) {
136
+ this .createdLte = createdLte ;
137
+ return this ;
138
+ }
139
+
140
+ /**
141
+ * Filter events based on whether they were successfully delivered to all subscribed event
142
+ * destinations. If false, events which are still pending or have failed all delivery attempts
143
+ * to a event destination will be returned.
144
+ */
145
+ public Builder setDeliverySuccess (Boolean deliverySuccess ) {
146
+ this .deliverySuccess = deliverySuccess ;
147
+ return this ;
57
148
}
58
149
59
150
/**
@@ -88,7 +179,7 @@ public Builder setLimit(Integer limit) {
88
179
return this ;
89
180
}
90
181
91
- /** <strong>Required.</strong> Primary object ID used to retrieve related events. */
182
+ /** Primary object ID used to retrieve related events. */
92
183
public Builder setObjectId (String objectId ) {
93
184
this .objectId = objectId ;
94
185
return this ;
0 commit comments