@@ -19,6 +19,7 @@ class AuthRuleV2ListParams
1919private constructor (
2020 private val accountToken: String? ,
2121 private val businessAccountToken: String? ,
22+ private val cardTags: CardTags ? ,
2223 private val cardToken: String? ,
2324 private val endingBefore: String? ,
2425 private val eventStream: EventStream ? ,
@@ -36,6 +37,14 @@ private constructor(
3637 /* * Only return Auth Rules that are bound to the provided business account token. */
3738 fun businessAccountToken (): Optional <String > = Optional .ofNullable(businessAccountToken)
3839
40+ /* *
41+ * Only return Auth Rules that would apply to a card carrying all of these tags, e.g.
42+ * `card_tags[segment]=gold&card_tags[region]=eu`. Returns rules bound to any of the tags and
43+ * leaves out rules that exclude one of them. Each key may be given once, with up to 10 keys.
44+ * Cannot be combined with `card_token`, `account_token` or `business_account_token`.
45+ */
46+ fun cardTags (): Optional <CardTags > = Optional .ofNullable(cardTags)
47+
3948 /* * Only return Auth Rules that are bound to the provided card token. */
4049 fun cardToken (): Optional <String > = Optional .ofNullable(cardToken)
4150
@@ -93,6 +102,7 @@ private constructor(
93102
94103 private var accountToken: String? = null
95104 private var businessAccountToken: String? = null
105+ private var cardTags: CardTags ? = null
96106 private var cardToken: String? = null
97107 private var endingBefore: String? = null
98108 private var eventStream: EventStream ? = null
@@ -107,6 +117,7 @@ private constructor(
107117 internal fun from (authRuleV2ListParams : AuthRuleV2ListParams ) = apply {
108118 accountToken = authRuleV2ListParams.accountToken
109119 businessAccountToken = authRuleV2ListParams.businessAccountToken
120+ cardTags = authRuleV2ListParams.cardTags
110121 cardToken = authRuleV2ListParams.cardToken
111122 endingBefore = authRuleV2ListParams.endingBefore
112123 eventStream = authRuleV2ListParams.eventStream
@@ -136,6 +147,17 @@ private constructor(
136147 fun businessAccountToken (businessAccountToken : Optional <String >) =
137148 businessAccountToken(businessAccountToken.getOrNull())
138149
150+ /* *
151+ * Only return Auth Rules that would apply to a card carrying all of these tags, e.g.
152+ * `card_tags[segment]=gold&card_tags[region]=eu`. Returns rules bound to any of the tags
153+ * and leaves out rules that exclude one of them. Each key may be given once, with up to 10
154+ * keys. Cannot be combined with `card_token`, `account_token` or `business_account_token`.
155+ */
156+ fun cardTags (cardTags : CardTags ? ) = apply { this .cardTags = cardTags }
157+
158+ /* * Alias for calling [Builder.cardTags] with `cardTags.orElse(null)`. */
159+ fun cardTags (cardTags : Optional <CardTags >) = cardTags(cardTags.getOrNull())
160+
139161 /* * Only return Auth Rules that are bound to the provided card token. */
140162 fun cardToken (cardToken : String? ) = apply { this .cardToken = cardToken }
141163
@@ -320,6 +342,7 @@ private constructor(
320342 AuthRuleV2ListParams (
321343 accountToken,
322344 businessAccountToken,
345+ cardTags,
323346 cardToken,
324347 endingBefore,
325348 eventStream,
@@ -339,6 +362,13 @@ private constructor(
339362 .apply {
340363 accountToken?.let { put(" account_token" , it) }
341364 businessAccountToken?.let { put(" business_account_token" , it) }
365+ cardTags?.let {
366+ it._additionalProperties ().keys().forEach { key ->
367+ it._additionalProperties ().values(key).forEach { value ->
368+ put(" card_tags[$key ]" , value)
369+ }
370+ }
371+ }
342372 cardToken?.let { put(" card_token" , it) }
343373 endingBefore?.let { put(" ending_before" , it) }
344374 eventStream?.let { put(" event_stream" , it.toString()) }
@@ -350,6 +380,107 @@ private constructor(
350380 }
351381 .build()
352382
383+ /* *
384+ * Only return Auth Rules that would apply to a card carrying all of these tags, e.g.
385+ * `card_tags[segment]=gold&card_tags[region]=eu`. Returns rules bound to any of the tags and
386+ * leaves out rules that exclude one of them. Each key may be given once, with up to 10 keys.
387+ * Cannot be combined with `card_token`, `account_token` or `business_account_token`.
388+ */
389+ class CardTags private constructor(private val additionalProperties : QueryParams ) {
390+
391+ /* * Query params to send with the request. */
392+ fun _additionalProperties (): QueryParams = additionalProperties
393+
394+ fun toBuilder () = Builder ().from(this )
395+
396+ companion object {
397+
398+ /* * Returns a mutable builder for constructing an instance of [CardTags]. */
399+ @JvmStatic fun builder () = Builder ()
400+ }
401+
402+ /* * A builder for [CardTags]. */
403+ class Builder internal constructor() {
404+
405+ private var additionalProperties: QueryParams .Builder = QueryParams .builder()
406+
407+ @JvmSynthetic
408+ internal fun from (cardTags : CardTags ) = apply {
409+ additionalProperties = cardTags.additionalProperties.toBuilder()
410+ }
411+
412+ fun additionalProperties (additionalProperties : QueryParams ) = apply {
413+ this .additionalProperties.clear()
414+ putAllAdditionalProperties(additionalProperties)
415+ }
416+
417+ fun additionalProperties (additionalProperties : Map <String , Iterable <String >>) = apply {
418+ this .additionalProperties.clear()
419+ putAllAdditionalProperties(additionalProperties)
420+ }
421+
422+ fun putAdditionalProperty (key : String , value : String ) = apply {
423+ additionalProperties.put(key, value)
424+ }
425+
426+ fun putAdditionalProperties (key : String , values : Iterable <String >) = apply {
427+ additionalProperties.put(key, values)
428+ }
429+
430+ fun putAllAdditionalProperties (additionalProperties : QueryParams ) = apply {
431+ this .additionalProperties.putAll(additionalProperties)
432+ }
433+
434+ fun putAllAdditionalProperties (additionalProperties : Map <String , Iterable <String >>) =
435+ apply {
436+ this .additionalProperties.putAll(additionalProperties)
437+ }
438+
439+ fun replaceAdditionalProperties (key : String , value : String ) = apply {
440+ additionalProperties.replace(key, value)
441+ }
442+
443+ fun replaceAdditionalProperties (key : String , values : Iterable <String >) = apply {
444+ additionalProperties.replace(key, values)
445+ }
446+
447+ fun replaceAllAdditionalProperties (additionalProperties : QueryParams ) = apply {
448+ this .additionalProperties.replaceAll(additionalProperties)
449+ }
450+
451+ fun replaceAllAdditionalProperties (
452+ additionalProperties : Map <String , Iterable <String >>
453+ ) = apply { this .additionalProperties.replaceAll(additionalProperties) }
454+
455+ fun removeAdditionalProperties (key : String ) = apply { additionalProperties.remove(key) }
456+
457+ fun removeAllAdditionalProperties (keys : Set <String >) = apply {
458+ additionalProperties.removeAll(keys)
459+ }
460+
461+ /* *
462+ * Returns an immutable instance of [CardTags].
463+ *
464+ * Further updates to this [Builder] will not mutate the returned instance.
465+ */
466+ fun build (): CardTags = CardTags (additionalProperties.build())
467+ }
468+
469+ override fun equals (other : Any? ): Boolean {
470+ if (this == = other) {
471+ return true
472+ }
473+
474+ return other is CardTags && additionalProperties == other.additionalProperties
475+ }
476+
477+ private val hashCode: Int by lazy { Objects .hash(additionalProperties) }
478+
479+ override fun hashCode (): Int = hashCode
480+
481+ override fun toString () = " CardTags{additionalProperties=$additionalProperties }"
482+ }
483+
353484 /* *
354485 * Only return Auth Rules that are bound to the provided scope. When no token is provided,
355486 * `CARD` also returns Auth Rules that include a `CARD_TAG` entity.
@@ -514,6 +645,7 @@ private constructor(
514645 return other is AuthRuleV2ListParams &&
515646 accountToken == other.accountToken &&
516647 businessAccountToken == other.businessAccountToken &&
648+ cardTags == other.cardTags &&
517649 cardToken == other.cardToken &&
518650 endingBefore == other.endingBefore &&
519651 eventStream == other.eventStream &&
@@ -529,6 +661,7 @@ private constructor(
529661 Objects .hash(
530662 accountToken,
531663 businessAccountToken,
664+ cardTags,
532665 cardToken,
533666 endingBefore,
534667 eventStream,
@@ -541,5 +674,5 @@ private constructor(
541674 )
542675
543676 override fun toString () =
544- " AuthRuleV2ListParams{accountToken=$accountToken , businessAccountToken=$businessAccountToken , cardToken=$cardToken , endingBefore=$endingBefore , eventStream=$eventStream , eventStreams=$eventStreams , pageSize=$pageSize , scope=$scope , startingAfter=$startingAfter , additionalHeaders=$additionalHeaders , additionalQueryParams=$additionalQueryParams }"
677+ " AuthRuleV2ListParams{accountToken=$accountToken , businessAccountToken=$businessAccountToken , cardTags= $cardTags , cardToken=$cardToken , endingBefore=$endingBefore , eventStream=$eventStream , eventStreams=$eventStreams , pageSize=$pageSize , scope=$scope , startingAfter=$startingAfter , additionalHeaders=$additionalHeaders , additionalQueryParams=$additionalQueryParams }"
545678}
0 commit comments