@@ -8,7 +8,6 @@ import com.lithic.api.core.JsonField
88import com.lithic.api.core.Params
99import com.lithic.api.core.http.Headers
1010import com.lithic.api.core.http.QueryParams
11- import com.lithic.api.core.toImmutable
1211import com.lithic.api.errors.LithicInvalidDataException
1312import java.time.OffsetDateTime
1413import java.time.format.DateTimeFormatter
@@ -27,9 +26,9 @@ private constructor(
2726 private val endingBefore: String? ,
2827 private val financialAccountToken: String? ,
2928 private val pageSize: Long? ,
30- private val result: List < Result > ? ,
29+ private val result: Result ? ,
3130 private val startingAfter: String? ,
32- private val status: List < Status > ? ,
31+ private val status: Status ? ,
3332 private val additionalHeaders: Headers ,
3433 private val additionalQueryParams: QueryParams ,
3534) : Params {
@@ -68,7 +67,7 @@ private constructor(
6867 fun pageSize (): Optional <Long > = Optional .ofNullable(pageSize)
6968
7069 /* * Filter by transaction result */
71- fun result (): Optional <List < Result > > = Optional .ofNullable(result)
70+ fun result (): Optional <Result > = Optional .ofNullable(result)
7271
7372 /* *
7473 * A cursor representing an item's token after which a page of results should begin. Used to
@@ -77,7 +76,7 @@ private constructor(
7776 fun startingAfter (): Optional <String > = Optional .ofNullable(startingAfter)
7877
7978 /* * Filter by transaction status */
80- fun status (): Optional <List < Status > > = Optional .ofNullable(status)
79+ fun status (): Optional <Status > = Optional .ofNullable(status)
8180
8281 /* * Additional headers to send with the request. */
8382 fun _additionalHeaders (): Headers = additionalHeaders
@@ -108,9 +107,9 @@ private constructor(
108107 private var endingBefore: String? = null
109108 private var financialAccountToken: String? = null
110109 private var pageSize: Long? = null
111- private var result: MutableList < Result > ? = null
110+ private var result: Result ? = null
112111 private var startingAfter: String? = null
113- private var status: MutableList < Status > ? = null
112+ private var status: Status ? = null
114113 private var additionalHeaders: Headers .Builder = Headers .builder()
115114 private var additionalQueryParams: QueryParams .Builder = QueryParams .builder()
116115
@@ -124,9 +123,9 @@ private constructor(
124123 endingBefore = accountActivityListParams.endingBefore
125124 financialAccountToken = accountActivityListParams.financialAccountToken
126125 pageSize = accountActivityListParams.pageSize
127- result = accountActivityListParams.result?.toMutableList()
126+ result = accountActivityListParams.result
128127 startingAfter = accountActivityListParams.startingAfter
129- status = accountActivityListParams.status?.toMutableList()
128+ status = accountActivityListParams.status
130129 additionalHeaders = accountActivityListParams.additionalHeaders.toBuilder()
131130 additionalQueryParams = accountActivityListParams.additionalQueryParams.toBuilder()
132131 }
@@ -208,19 +207,10 @@ private constructor(
208207 fun pageSize (pageSize : Optional <Long >) = pageSize(pageSize.getOrNull())
209208
210209 /* * Filter by transaction result */
211- fun result (result : List < Result > ? ) = apply { this .result = result?.toMutableList() }
210+ fun result (result : Result ? ) = apply { this .result = result }
212211
213212 /* * Alias for calling [Builder.result] with `result.orElse(null)`. */
214- fun result (result : Optional <List <Result >>) = result(result.getOrNull())
215-
216- /* *
217- * Adds a single [Result] to [Builder.result].
218- *
219- * @throws IllegalStateException if the field was previously set to a non-list.
220- */
221- fun addResult (result : Result ) = apply {
222- this .result = (this .result ? : mutableListOf ()).apply { add(result) }
223- }
213+ fun result (result : Optional <Result >) = result(result.getOrNull())
224214
225215 /* *
226216 * A cursor representing an item's token after which a page of results should begin. Used to
@@ -233,19 +223,10 @@ private constructor(
233223 startingAfter(startingAfter.getOrNull())
234224
235225 /* * Filter by transaction status */
236- fun status (status : List < Status > ? ) = apply { this .status = status?.toMutableList() }
226+ fun status (status : Status ? ) = apply { this .status = status }
237227
238228 /* * Alias for calling [Builder.status] with `status.orElse(null)`. */
239- fun status (status : Optional <List <Status >>) = status(status.getOrNull())
240-
241- /* *
242- * Adds a single [Status] to [Builder.status].
243- *
244- * @throws IllegalStateException if the field was previously set to a non-list.
245- */
246- fun addStatus (status : Status ) = apply {
247- this .status = (this .status ? : mutableListOf ()).apply { add(status) }
248- }
229+ fun status (status : Optional <Status >) = status(status.getOrNull())
249230
250231 fun additionalHeaders (additionalHeaders : Headers ) = apply {
251232 this .additionalHeaders.clear()
@@ -360,9 +341,9 @@ private constructor(
360341 endingBefore,
361342 financialAccountToken,
362343 pageSize,
363- result?.toImmutable() ,
344+ result,
364345 startingAfter,
365- status?.toImmutable() ,
346+ status,
366347 additionalHeaders.build(),
367348 additionalQueryParams.build(),
368349 )
@@ -381,9 +362,9 @@ private constructor(
381362 endingBefore?.let { put(" ending_before" , it) }
382363 financialAccountToken?.let { put(" financial_account_token" , it) }
383364 pageSize?.let { put(" page_size" , it.toString()) }
384- result?.let { put(" result" , it.joinToString( " , " ) { it. toString() } ) }
365+ result?.let { put(" result" , it.toString()) }
385366 startingAfter?.let { put(" starting_after" , it) }
386- status?.let { put(" status" , it.joinToString( " , " ) { it. toString() } ) }
367+ status?.let { put(" status" , it.toString()) }
387368 putAll(additionalQueryParams)
388369 }
389370 .build()
@@ -585,6 +566,7 @@ private constructor(
585566 override fun toString () = value.toString()
586567 }
587568
569+ /* * Filter by transaction result */
588570 class Result @JsonCreator private constructor(private val value : JsonField <String >) : Enum {
589571
590572 /* *
@@ -710,6 +692,7 @@ private constructor(
710692 override fun toString () = value.toString()
711693 }
712694
695+ /* * Filter by transaction status */
713696 class Status @JsonCreator private constructor(private val value : JsonField <String >) : Enum {
714697
715698 /* *
@@ -730,14 +713,14 @@ private constructor(
730713
731714 @JvmField val PENDING = of(" PENDING" )
732715
733- @JvmField val SETTLED = of(" SETTLED" )
734-
735- @JvmField val VOIDED = of(" VOIDED" )
736-
737716 @JvmField val RETURNED = of(" RETURNED" )
738717
739718 @JvmField val REVERSED = of(" REVERSED" )
740719
720+ @JvmField val SETTLED = of(" SETTLED" )
721+
722+ @JvmField val VOIDED = of(" VOIDED" )
723+
741724 @JvmStatic fun of (value : String ) = Status (JsonField .of(value))
742725 }
743726
@@ -746,10 +729,10 @@ private constructor(
746729 DECLINED ,
747730 EXPIRED ,
748731 PENDING ,
749- SETTLED ,
750- VOIDED ,
751732 RETURNED ,
752733 REVERSED ,
734+ SETTLED ,
735+ VOIDED ,
753736 }
754737
755738 /* *
@@ -765,10 +748,10 @@ private constructor(
765748 DECLINED ,
766749 EXPIRED ,
767750 PENDING ,
768- SETTLED ,
769- VOIDED ,
770751 RETURNED ,
771752 REVERSED ,
753+ SETTLED ,
754+ VOIDED ,
772755 /* * An enum member indicating that [Status] was instantiated with an unknown value. */
773756 _UNKNOWN ,
774757 }
@@ -785,10 +768,10 @@ private constructor(
785768 DECLINED -> Value .DECLINED
786769 EXPIRED -> Value .EXPIRED
787770 PENDING -> Value .PENDING
788- SETTLED -> Value .SETTLED
789- VOIDED -> Value .VOIDED
790771 RETURNED -> Value .RETURNED
791772 REVERSED -> Value .REVERSED
773+ SETTLED -> Value .SETTLED
774+ VOIDED -> Value .VOIDED
792775 else -> Value ._UNKNOWN
793776 }
794777
@@ -806,10 +789,10 @@ private constructor(
806789 DECLINED -> Known .DECLINED
807790 EXPIRED -> Known .EXPIRED
808791 PENDING -> Known .PENDING
809- SETTLED -> Known .SETTLED
810- VOIDED -> Known .VOIDED
811792 RETURNED -> Known .RETURNED
812793 REVERSED -> Known .REVERSED
794+ SETTLED -> Known .SETTLED
795+ VOIDED -> Known .VOIDED
813796 else -> throw LithicInvalidDataException (" Unknown Status: $value " )
814797 }
815798
0 commit comments