@@ -19,6 +19,7 @@ import kotlin.jvm.optionals.getOrNull
1919/* * Retrieve a list of transactions across all public accounts. */
2020class AccountActivityListParams
2121private constructor (
22+ private val accountToken: String? ,
2223 private val begin: OffsetDateTime ? ,
2324 private val businessAccountToken: String? ,
2425 private val category: TransactionCategory ? ,
@@ -33,6 +34,9 @@ private constructor(
3334 private val additionalQueryParams: QueryParams ,
3435) : Params {
3536
37+ /* * Filter by account token */
38+ fun accountToken (): Optional <String > = Optional .ofNullable(accountToken)
39+
3640 /* *
3741 * Date string in RFC 3339 format. Only entries created after the specified time will be
3842 * included. UTC time zone.
@@ -96,6 +100,7 @@ private constructor(
96100 /* * A builder for [AccountActivityListParams]. */
97101 class Builder internal constructor() {
98102
103+ private var accountToken: String? = null
99104 private var begin: OffsetDateTime ? = null
100105 private var businessAccountToken: String? = null
101106 private var category: TransactionCategory ? = null
@@ -111,6 +116,7 @@ private constructor(
111116
112117 @JvmSynthetic
113118 internal fun from (accountActivityListParams : AccountActivityListParams ) = apply {
119+ accountToken = accountActivityListParams.accountToken
114120 begin = accountActivityListParams.begin
115121 businessAccountToken = accountActivityListParams.businessAccountToken
116122 category = accountActivityListParams.category
@@ -125,6 +131,12 @@ private constructor(
125131 additionalQueryParams = accountActivityListParams.additionalQueryParams.toBuilder()
126132 }
127133
134+ /* * Filter by account token */
135+ fun accountToken (accountToken : String? ) = apply { this .accountToken = accountToken }
136+
137+ /* * Alias for calling [Builder.accountToken] with `accountToken.orElse(null)`. */
138+ fun accountToken (accountToken : Optional <String >) = accountToken(accountToken.getOrNull())
139+
128140 /* *
129141 * Date string in RFC 3339 format. Only entries created after the specified time will be
130142 * included. UTC time zone.
@@ -340,6 +352,7 @@ private constructor(
340352 */
341353 fun build (): AccountActivityListParams =
342354 AccountActivityListParams (
355+ accountToken,
343356 begin,
344357 businessAccountToken,
345358 category,
@@ -360,6 +373,7 @@ private constructor(
360373 override fun _queryParams (): QueryParams =
361374 QueryParams .builder()
362375 .apply {
376+ accountToken?.let { put(" account_token" , it) }
363377 begin?.let { put(" begin" , DateTimeFormatter .ISO_OFFSET_DATE_TIME .format(it)) }
364378 businessAccountToken?.let { put(" business_account_token" , it) }
365379 category?.let { put(" category" , it.toString()) }
@@ -857,6 +871,7 @@ private constructor(
857871 }
858872
859873 return other is AccountActivityListParams &&
874+ accountToken == other.accountToken &&
860875 begin == other.begin &&
861876 businessAccountToken == other.businessAccountToken &&
862877 category == other.category &&
@@ -873,6 +888,7 @@ private constructor(
873888
874889 override fun hashCode (): Int =
875890 Objects .hash(
891+ accountToken,
876892 begin,
877893 businessAccountToken,
878894 category,
@@ -888,5 +904,5 @@ private constructor(
888904 )
889905
890906 override fun toString () =
891- " AccountActivityListParams{begin=$begin , businessAccountToken=$businessAccountToken , category=$category , end=$end , endingBefore=$endingBefore , financialAccountToken=$financialAccountToken , pageSize=$pageSize , result=$result , startingAfter=$startingAfter , status=$status , additionalHeaders=$additionalHeaders , additionalQueryParams=$additionalQueryParams }"
907+ " AccountActivityListParams{accountToken= $accountToken , begin=$begin , businessAccountToken=$businessAccountToken , category=$category , end=$end , endingBefore=$endingBefore , financialAccountToken=$financialAccountToken , pageSize=$pageSize , result=$result , startingAfter=$startingAfter , status=$status , additionalHeaders=$additionalHeaders , additionalQueryParams=$additionalQueryParams }"
892908}
0 commit comments