Skip to content

Commit 32207a1

Browse files
committed
refactor(api)!: remove previous_auth_rule_tokens from auth rules (#15)
# Migration Any references to the `previous_auth_rule_tokens` property will need to be removed.
1 parent 39d4c66 commit 32207a1

8 files changed

Lines changed: 2 additions & 76 deletions

File tree

lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class AuthRule
2121
private constructor(
2222
private val token: JsonField<String>,
2323
private val state: JsonField<State>,
24-
private val previousAuthRuleTokens: JsonField<List<String>>,
2524
private val allowedMcc: JsonField<List<String>>,
2625
private val blockedMcc: JsonField<List<String>>,
2726
private val allowedCountries: JsonField<List<String>>,
@@ -42,13 +41,6 @@ private constructor(
4241
/** Indicates whether the Auth Rule is ACTIVE or INACTIVE */
4342
fun state(): Optional<State> = Optional.ofNullable(state.getNullable("state"))
4443

45-
/**
46-
* Identifier for the Auth Rule(s) that a new Auth Rule replaced; will be returned only if an
47-
* Auth Rule is applied to entities that previously already had one applied.
48-
*/
49-
fun previousAuthRuleTokens(): Optional<List<String>> =
50-
Optional.ofNullable(previousAuthRuleTokens.getNullable("previous_auth_rule_tokens"))
51-
5244
/** Merchant category codes for which the Auth Rule permits transactions. */
5345
fun allowedMcc(): Optional<List<String>> =
5446
Optional.ofNullable(allowedMcc.getNullable("allowed_mcc"))
@@ -93,14 +85,6 @@ private constructor(
9385
/** Indicates whether the Auth Rule is ACTIVE or INACTIVE */
9486
@JsonProperty("state") @ExcludeMissing fun _state() = state
9587

96-
/**
97-
* Identifier for the Auth Rule(s) that a new Auth Rule replaced; will be returned only if an
98-
* Auth Rule is applied to entities that previously already had one applied.
99-
*/
100-
@JsonProperty("previous_auth_rule_tokens")
101-
@ExcludeMissing
102-
fun _previousAuthRuleTokens() = previousAuthRuleTokens
103-
10488
/** Merchant category codes for which the Auth Rule permits transactions. */
10589
@JsonProperty("allowed_mcc") @ExcludeMissing fun _allowedMcc() = allowedMcc
10690

@@ -140,7 +124,6 @@ private constructor(
140124
if (!validated) {
141125
token()
142126
state()
143-
previousAuthRuleTokens()
144127
allowedMcc()
145128
blockedMcc()
146129
allowedCountries()
@@ -162,7 +145,6 @@ private constructor(
162145
return other is AuthRule &&
163146
this.token == other.token &&
164147
this.state == other.state &&
165-
this.previousAuthRuleTokens == other.previousAuthRuleTokens &&
166148
this.allowedMcc == other.allowedMcc &&
167149
this.blockedMcc == other.blockedMcc &&
168150
this.allowedCountries == other.allowedCountries &&
@@ -179,7 +161,6 @@ private constructor(
179161
Objects.hash(
180162
token,
181163
state,
182-
previousAuthRuleTokens,
183164
allowedMcc,
184165
blockedMcc,
185166
allowedCountries,
@@ -194,7 +175,7 @@ private constructor(
194175
}
195176

196177
override fun toString() =
197-
"AuthRule{token=$token, state=$state, previousAuthRuleTokens=$previousAuthRuleTokens, allowedMcc=$allowedMcc, blockedMcc=$blockedMcc, allowedCountries=$allowedCountries, blockedCountries=$blockedCountries, accountTokens=$accountTokens, cardTokens=$cardTokens, programLevel=$programLevel, additionalProperties=$additionalProperties}"
178+
"AuthRule{token=$token, state=$state, allowedMcc=$allowedMcc, blockedMcc=$blockedMcc, allowedCountries=$allowedCountries, blockedCountries=$blockedCountries, accountTokens=$accountTokens, cardTokens=$cardTokens, programLevel=$programLevel, additionalProperties=$additionalProperties}"
198179

199180
companion object {
200181

@@ -205,7 +186,6 @@ private constructor(
205186

206187
private var token: JsonField<String> = JsonMissing.of()
207188
private var state: JsonField<State> = JsonMissing.of()
208-
private var previousAuthRuleTokens: JsonField<List<String>> = JsonMissing.of()
209189
private var allowedMcc: JsonField<List<String>> = JsonMissing.of()
210190
private var blockedMcc: JsonField<List<String>> = JsonMissing.of()
211191
private var allowedCountries: JsonField<List<String>> = JsonMissing.of()
@@ -219,7 +199,6 @@ private constructor(
219199
internal fun from(authRule: AuthRule) = apply {
220200
this.token = authRule.token
221201
this.state = authRule.state
222-
this.previousAuthRuleTokens = authRule.previousAuthRuleTokens
223202
this.allowedMcc = authRule.allowedMcc
224203
this.blockedMcc = authRule.blockedMcc
225204
this.allowedCountries = authRule.allowedCountries
@@ -246,23 +225,6 @@ private constructor(
246225
@ExcludeMissing
247226
fun state(state: JsonField<State>) = apply { this.state = state }
248227

249-
/**
250-
* Identifier for the Auth Rule(s) that a new Auth Rule replaced; will be returned only if
251-
* an Auth Rule is applied to entities that previously already had one applied.
252-
*/
253-
fun previousAuthRuleTokens(previousAuthRuleTokens: List<String>) =
254-
previousAuthRuleTokens(JsonField.of(previousAuthRuleTokens))
255-
256-
/**
257-
* Identifier for the Auth Rule(s) that a new Auth Rule replaced; will be returned only if
258-
* an Auth Rule is applied to entities that previously already had one applied.
259-
*/
260-
@JsonProperty("previous_auth_rule_tokens")
261-
@ExcludeMissing
262-
fun previousAuthRuleTokens(previousAuthRuleTokens: JsonField<List<String>>) = apply {
263-
this.previousAuthRuleTokens = previousAuthRuleTokens
264-
}
265-
266228
/** Merchant category codes for which the Auth Rule permits transactions. */
267229
fun allowedMcc(allowedMcc: List<String>) = allowedMcc(JsonField.of(allowedMcc))
268230

@@ -367,7 +329,6 @@ private constructor(
367329
AuthRule(
368330
token,
369331
state,
370-
previousAuthRuleTokens.map { it.toUnmodifiable() },
371332
allowedMcc.map { it.toUnmodifiable() },
372333
blockedMcc.map { it.toUnmodifiable() },
373334
allowedCountries.map { it.toUnmodifiable() },

lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleRemoveResponse.kt

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class AuthRuleRemoveResponse
1919
private constructor(
2020
private val accountTokens: JsonField<List<String>>,
2121
private val cardTokens: JsonField<List<String>>,
22-
private val previousAuthRuleTokens: JsonField<List<String>>,
2322
private val programLevel: JsonField<Boolean>,
2423
private val additionalProperties: Map<String, JsonValue>,
2524
) {
@@ -34,20 +33,13 @@ private constructor(
3433
fun cardTokens(): Optional<List<String>> =
3534
Optional.ofNullable(cardTokens.getNullable("card_tokens"))
3635

37-
fun previousAuthRuleTokens(): Optional<List<String>> =
38-
Optional.ofNullable(previousAuthRuleTokens.getNullable("previous_auth_rule_tokens"))
39-
4036
fun programLevel(): Optional<Boolean> =
4137
Optional.ofNullable(programLevel.getNullable("program_level"))
4238

4339
@JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens
4440

4541
@JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens
4642

47-
@JsonProperty("previous_auth_rule_tokens")
48-
@ExcludeMissing
49-
fun _previousAuthRuleTokens() = previousAuthRuleTokens
50-
5143
@JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel
5244

5345
@JsonAnyGetter
@@ -58,7 +50,6 @@ private constructor(
5850
if (!validated) {
5951
accountTokens()
6052
cardTokens()
61-
previousAuthRuleTokens()
6253
programLevel()
6354
validated = true
6455
}
@@ -74,7 +65,6 @@ private constructor(
7465
return other is AuthRuleRemoveResponse &&
7566
this.accountTokens == other.accountTokens &&
7667
this.cardTokens == other.cardTokens &&
77-
this.previousAuthRuleTokens == other.previousAuthRuleTokens &&
7868
this.programLevel == other.programLevel &&
7969
this.additionalProperties == other.additionalProperties
8070
}
@@ -85,7 +75,6 @@ private constructor(
8575
Objects.hash(
8676
accountTokens,
8777
cardTokens,
88-
previousAuthRuleTokens,
8978
programLevel,
9079
additionalProperties,
9180
)
@@ -94,7 +83,7 @@ private constructor(
9483
}
9584

9685
override fun toString() =
97-
"AuthRuleRemoveResponse{accountTokens=$accountTokens, cardTokens=$cardTokens, previousAuthRuleTokens=$previousAuthRuleTokens, programLevel=$programLevel, additionalProperties=$additionalProperties}"
86+
"AuthRuleRemoveResponse{accountTokens=$accountTokens, cardTokens=$cardTokens, programLevel=$programLevel, additionalProperties=$additionalProperties}"
9887

9988
companion object {
10089

@@ -105,15 +94,13 @@ private constructor(
10594

10695
private var accountTokens: JsonField<List<String>> = JsonMissing.of()
10796
private var cardTokens: JsonField<List<String>> = JsonMissing.of()
108-
private var previousAuthRuleTokens: JsonField<List<String>> = JsonMissing.of()
10997
private var programLevel: JsonField<Boolean> = JsonMissing.of()
11098
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
11199

112100
@JvmSynthetic
113101
internal fun from(authRuleRemoveResponse: AuthRuleRemoveResponse) = apply {
114102
this.accountTokens = authRuleRemoveResponse.accountTokens
115103
this.cardTokens = authRuleRemoveResponse.cardTokens
116-
this.previousAuthRuleTokens = authRuleRemoveResponse.previousAuthRuleTokens
117104
this.programLevel = authRuleRemoveResponse.programLevel
118105
additionalProperties(authRuleRemoveResponse.additionalProperties)
119106
}
@@ -132,15 +119,6 @@ private constructor(
132119
@ExcludeMissing
133120
fun cardTokens(cardTokens: JsonField<List<String>>) = apply { this.cardTokens = cardTokens }
134121

135-
fun previousAuthRuleTokens(previousAuthRuleTokens: List<String>) =
136-
previousAuthRuleTokens(JsonField.of(previousAuthRuleTokens))
137-
138-
@JsonProperty("previous_auth_rule_tokens")
139-
@ExcludeMissing
140-
fun previousAuthRuleTokens(previousAuthRuleTokens: JsonField<List<String>>) = apply {
141-
this.previousAuthRuleTokens = previousAuthRuleTokens
142-
}
143-
144122
fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel))
145123

146124
@JsonProperty("program_level")
@@ -167,7 +145,6 @@ private constructor(
167145
AuthRuleRemoveResponse(
168146
accountTokens.map { it.toUnmodifiable() },
169147
cardTokens.map { it.toUnmodifiable() },
170-
previousAuthRuleTokens.map { it.toUnmodifiable() },
171148
programLevel,
172149
additionalProperties.toUnmodifiable(),
173150
)

lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleApplyResponseTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class AuthRuleApplyResponseTest {
1313
AuthRule.builder()
1414
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
1515
.state(AuthRule.State.ACTIVE)
16-
.previousAuthRuleTokens(listOf("string"))
1716
.allowedMcc(listOf("string"))
1817
.blockedMcc(listOf("string"))
1918
.allowedCountries(listOf("string"))
@@ -30,7 +29,6 @@ class AuthRuleApplyResponseTest {
3029
AuthRule.builder()
3130
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
3231
.state(AuthRule.State.ACTIVE)
33-
.previousAuthRuleTokens(listOf("string"))
3432
.allowedMcc(listOf("string"))
3533
.blockedMcc(listOf("string"))
3634
.allowedCountries(listOf("string"))

lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleCreateResponseTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class AuthRuleCreateResponseTest {
1313
AuthRule.builder()
1414
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
1515
.state(AuthRule.State.ACTIVE)
16-
.previousAuthRuleTokens(listOf("string"))
1716
.allowedMcc(listOf("string"))
1817
.blockedMcc(listOf("string"))
1918
.allowedCountries(listOf("string"))
@@ -30,7 +29,6 @@ class AuthRuleCreateResponseTest {
3029
AuthRule.builder()
3130
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
3231
.state(AuthRule.State.ACTIVE)
33-
.previousAuthRuleTokens(listOf("string"))
3432
.allowedMcc(listOf("string"))
3533
.blockedMcc(listOf("string"))
3634
.allowedCountries(listOf("string"))

lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleRemoveResponseTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ class AuthRuleRemoveResponseTest {
1111
AuthRuleRemoveResponse.builder()
1212
.accountTokens(listOf("string"))
1313
.cardTokens(listOf("string"))
14-
.previousAuthRuleTokens(listOf("string"))
1514
.programLevel(true)
1615
.build()
1716
assertThat(authRuleRemoveResponse).isNotNull
1817
assertThat(authRuleRemoveResponse.accountTokens().get()).containsExactly("string")
1918
assertThat(authRuleRemoveResponse.cardTokens().get()).containsExactly("string")
20-
assertThat(authRuleRemoveResponse.previousAuthRuleTokens().get()).containsExactly("string")
2119
assertThat(authRuleRemoveResponse.programLevel()).contains(true)
2220
}
2321
}

lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleRetrieveResponseTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class AuthRuleRetrieveResponseTest {
1414
AuthRule.builder()
1515
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
1616
.state(AuthRule.State.ACTIVE)
17-
.previousAuthRuleTokens(listOf("string"))
1817
.allowedMcc(listOf("string"))
1918
.blockedMcc(listOf("string"))
2019
.allowedCountries(listOf("string"))
@@ -32,7 +31,6 @@ class AuthRuleRetrieveResponseTest {
3231
AuthRule.builder()
3332
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
3433
.state(AuthRule.State.ACTIVE)
35-
.previousAuthRuleTokens(listOf("string"))
3634
.allowedMcc(listOf("string"))
3735
.blockedMcc(listOf("string"))
3836
.allowedCountries(listOf("string"))

lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class AuthRuleTest {
1111
AuthRule.builder()
1212
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
1313
.state(AuthRule.State.ACTIVE)
14-
.previousAuthRuleTokens(listOf("string"))
1514
.allowedMcc(listOf("string"))
1615
.blockedMcc(listOf("string"))
1716
.allowedCountries(listOf("string"))
@@ -23,7 +22,6 @@ class AuthRuleTest {
2322
assertThat(authRule).isNotNull
2423
assertThat(authRule.token()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
2524
assertThat(authRule.state()).contains(AuthRule.State.ACTIVE)
26-
assertThat(authRule.previousAuthRuleTokens().get()).containsExactly("string")
2725
assertThat(authRule.allowedMcc().get()).containsExactly("string")
2826
assertThat(authRule.blockedMcc().get()).containsExactly("string")
2927
assertThat(authRule.allowedCountries().get()).containsExactly("string")

lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleUpdateResponseTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class AuthRuleUpdateResponseTest {
1313
AuthRule.builder()
1414
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
1515
.state(AuthRule.State.ACTIVE)
16-
.previousAuthRuleTokens(listOf("string"))
1716
.allowedMcc(listOf("string"))
1817
.blockedMcc(listOf("string"))
1918
.allowedCountries(listOf("string"))
@@ -30,7 +29,6 @@ class AuthRuleUpdateResponseTest {
3029
AuthRule.builder()
3130
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
3231
.state(AuthRule.State.ACTIVE)
33-
.previousAuthRuleTokens(listOf("string"))
3432
.allowedMcc(listOf("string"))
3533
.blockedMcc(listOf("string"))
3634
.allowedCountries(listOf("string"))

0 commit comments

Comments
 (0)