@@ -9,11 +9,14 @@ import com.lithic.api.core.NoAutoDetect
99import com.lithic.api.core.toUnmodifiable
1010import com.lithic.api.errors.LithicInvalidDataException
1111import com.lithic.api.models.*
12+ import java.time.OffsetDateTime
1213import java.util.Objects
1314import java.util.Optional
1415
1516class PaymentListParams
1617constructor (
18+ private val begin: OffsetDateTime ? ,
19+ private val end: OffsetDateTime ? ,
1720 private val endingBefore: String? ,
1821 private val financialAccountToken: String? ,
1922 private val pageSize: Long? ,
@@ -24,6 +27,10 @@ constructor(
2427 private val additionalHeaders: Map <String , List <String >>,
2528) {
2629
30+ fun begin (): Optional <OffsetDateTime > = Optional .ofNullable(begin)
31+
32+ fun end (): Optional <OffsetDateTime > = Optional .ofNullable(end)
33+
2734 fun endingBefore (): Optional <String > = Optional .ofNullable(endingBefore)
2835
2936 fun financialAccountToken (): Optional <String > = Optional .ofNullable(financialAccountToken)
@@ -39,6 +46,8 @@ constructor(
3946 @JvmSynthetic
4047 internal fun getQueryParams (): Map <String , List <String >> {
4148 val params = mutableMapOf<String , List <String >>()
49+ this .begin?.let { params.put(" begin" , listOf (it.toString())) }
50+ this .end?.let { params.put(" end" , listOf (it.toString())) }
4251 this .endingBefore?.let { params.put(" ending_before" , listOf (it.toString())) }
4352 this .financialAccountToken?.let {
4453 params.put(" financial_account_token" , listOf (it.toString()))
@@ -63,6 +72,8 @@ constructor(
6372 }
6473
6574 return other is PaymentListParams &&
75+ this .begin == other.begin &&
76+ this .end == other.end &&
6677 this .endingBefore == other.endingBefore &&
6778 this .financialAccountToken == other.financialAccountToken &&
6879 this .pageSize == other.pageSize &&
@@ -75,6 +86,8 @@ constructor(
7586
7687 override fun hashCode (): Int {
7788 return Objects .hash(
89+ begin,
90+ end,
7891 endingBefore,
7992 financialAccountToken,
8093 pageSize,
@@ -87,7 +100,7 @@ constructor(
87100 }
88101
89102 override fun toString () =
90- " PaymentListParams{endingBefore=$endingBefore , financialAccountToken=$financialAccountToken , pageSize=$pageSize , result=$result , startingAfter=$startingAfter , status=$status , additionalQueryParams=$additionalQueryParams , additionalHeaders=$additionalHeaders }"
103+ " PaymentListParams{begin= $begin , end= $end , endingBefore=$endingBefore , financialAccountToken=$financialAccountToken , pageSize=$pageSize , result=$result , startingAfter=$startingAfter , status=$status , additionalQueryParams=$additionalQueryParams , additionalHeaders=$additionalHeaders }"
91104
92105 fun toBuilder () = Builder ().from(this )
93106
@@ -99,6 +112,8 @@ constructor(
99112 @NoAutoDetect
100113 class Builder {
101114
115+ private var begin: OffsetDateTime ? = null
116+ private var end: OffsetDateTime ? = null
102117 private var endingBefore: String? = null
103118 private var financialAccountToken: String? = null
104119 private var pageSize: Long? = null
@@ -110,6 +125,8 @@ constructor(
110125
111126 @JvmSynthetic
112127 internal fun from (paymentListParams : PaymentListParams ) = apply {
128+ this .begin = paymentListParams.begin
129+ this .end = paymentListParams.end
113130 this .endingBefore = paymentListParams.endingBefore
114131 this .financialAccountToken = paymentListParams.financialAccountToken
115132 this .pageSize = paymentListParams.pageSize
@@ -120,6 +137,18 @@ constructor(
120137 additionalHeaders(paymentListParams.additionalHeaders)
121138 }
122139
140+ /* *
141+ * Date string in RFC 3339 format. Only entries created after the specified time will be
142+ * included. UTC time zone.
143+ */
144+ fun begin (begin : OffsetDateTime ) = apply { this .begin = begin }
145+
146+ /* *
147+ * Date string in RFC 3339 format. Only entries created before the specified time will be
148+ * included. UTC time zone.
149+ */
150+ fun end (end : OffsetDateTime ) = apply { this .end = end }
151+
123152 /* *
124153 * A cursor representing an item's token before which a page of results should end. Used to
125154 * retrieve the previous page of results before this item.
@@ -185,6 +214,8 @@ constructor(
185214
186215 fun build (): PaymentListParams =
187216 PaymentListParams (
217+ begin,
218+ end,
188219 endingBefore,
189220 financialAccountToken,
190221 pageSize,
@@ -275,53 +306,47 @@ constructor(
275306
276307 companion object {
277308
309+ @JvmField val DECLINED = Status (JsonField .of(" DECLINED" ))
310+
278311 @JvmField val PENDING = Status (JsonField .of(" PENDING" ))
279312
280- @JvmField val VOIDED = Status (JsonField .of(" VOIDED " ))
313+ @JvmField val RETURNED = Status (JsonField .of(" RETURNED " ))
281314
282315 @JvmField val SETTLED = Status (JsonField .of(" SETTLED" ))
283316
284- @JvmField val DECLINED = Status (JsonField .of(" DECLINED" ))
285-
286- @JvmField val EXPIRED = Status (JsonField .of(" EXPIRED" ))
287-
288317 @JvmStatic fun of (value : String ) = Status (JsonField .of(value))
289318 }
290319
291320 enum class Known {
321+ DECLINED ,
292322 PENDING ,
293- VOIDED ,
323+ RETURNED ,
294324 SETTLED ,
295- DECLINED ,
296- EXPIRED ,
297325 }
298326
299327 enum class Value {
328+ DECLINED ,
300329 PENDING ,
301- VOIDED ,
330+ RETURNED ,
302331 SETTLED ,
303- DECLINED ,
304- EXPIRED ,
305332 _UNKNOWN ,
306333 }
307334
308335 fun value (): Value =
309336 when (this ) {
337+ DECLINED -> Value .DECLINED
310338 PENDING -> Value .PENDING
311- VOIDED -> Value .VOIDED
339+ RETURNED -> Value .RETURNED
312340 SETTLED -> Value .SETTLED
313- DECLINED -> Value .DECLINED
314- EXPIRED -> Value .EXPIRED
315341 else -> Value ._UNKNOWN
316342 }
317343
318344 fun known (): Known =
319345 when (this ) {
346+ DECLINED -> Known .DECLINED
320347 PENDING -> Known .PENDING
321- VOIDED -> Known .VOIDED
348+ RETURNED -> Known .RETURNED
322349 SETTLED -> Known .SETTLED
323- DECLINED -> Known .DECLINED
324- EXPIRED -> Known .EXPIRED
325350 else -> throw LithicInvalidDataException (" Unknown Status: $value " )
326351 }
327352
0 commit comments