3
3
4
4
import com .google .gson .annotations .SerializedName ;
5
5
import com .stripe .net .ApiRequestParams ;
6
- import java .time .Instant ;
7
6
import java .util .HashMap ;
8
7
import java .util .Map ;
9
8
import lombok .Getter ;
10
9
11
10
@ Getter
12
11
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
-
37
12
/**
38
13
* Map of extra parameters for custom features not available in this client library. The content
39
14
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
@@ -47,7 +22,7 @@ public class EventListParams extends ApiRequestParams {
47
22
@ SerializedName ("limit" )
48
23
Integer limit ;
49
24
50
- /** Primary object ID used to retrieve related events. */
25
+ /** <strong>Required.</strong> Primary object ID used to retrieve related events. */
51
26
@ SerializedName ("object_id" )
52
27
String objectId ;
53
28
@@ -56,20 +31,7 @@ public class EventListParams extends ApiRequestParams {
56
31
String page ;
57
32
58
33
private EventListParams (
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 ;
34
+ Map <String , Object > extraParams , Integer limit , String objectId , String page ) {
73
35
this .extraParams = extraParams ;
74
36
this .limit = limit ;
75
37
this .objectId = objectId ;
@@ -81,16 +43,6 @@ public static Builder builder() {
81
43
}
82
44
83
45
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
-
94
46
private Map <String , Object > extraParams ;
95
47
96
48
private Integer limit ;
@@ -101,50 +53,7 @@ public static class Builder {
101
53
102
54
/** Finalize and obtain parameter instance from this builder. */
103
55
public EventListParams build () {
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 ;
56
+ return new EventListParams (this .extraParams , this .limit , this .objectId , this .page );
148
57
}
149
58
150
59
/**
@@ -179,7 +88,7 @@ public Builder setLimit(Integer limit) {
179
88
return this ;
180
89
}
181
90
182
- /** Primary object ID used to retrieve related events. */
91
+ /** <strong>Required.</strong> Primary object ID used to retrieve related events. */
183
92
public Builder setObjectId (String objectId ) {
184
93
this .objectId = objectId ;
185
94
return this ;
0 commit comments