Skip to content

Commit 47fd0cf

Browse files
committed
feat(api)!: remove avs_type property, add dispute evidence filename, and mark properties nullable (#5)
1 parent 9143442 commit 47fd0cf

21 files changed

Lines changed: 200 additions & 357 deletions

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

Lines changed: 1 addition & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private constructor(
2626
private val blockedMcc: JsonField<List<String>>,
2727
private val allowedCountries: JsonField<List<String>>,
2828
private val blockedCountries: JsonField<List<String>>,
29-
private val avsType: JsonField<AvsType>,
3029
private val accountTokens: JsonField<List<String>>,
3130
private val cardTokens: JsonField<List<String>>,
3231
private val programLevel: JsonField<Boolean>,
@@ -70,17 +69,6 @@ private constructor(
7069
fun blockedCountries(): Optional<List<String>> =
7170
Optional.ofNullable(blockedCountries.getNullable("blocked_countries"))
7271

73-
/**
74-
* Address verification to confirm that postal code entered at point of transaction (if
75-
* applicable) matches the postal code on file for a given card. Since this check is performed
76-
* against the address submitted via the Enroll Consumer endpoint, it should only be used in
77-
* cases where card users are enrolled with their own accounts. Available values:
78-
*
79-
* - `ZIP_ONLY` - AVS check is performed to confirm ZIP code entered at point of transaction (if
80-
* applicable) matches address on file.
81-
*/
82-
fun avsType(): Optional<AvsType> = Optional.ofNullable(avsType.getNullable("avs_type"))
83-
8472
/**
8573
* Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note that
8674
* only this field or `card_tokens` can be provided for a given Auth Rule.
@@ -129,17 +117,6 @@ private constructor(
129117
/** Countries in which the Auth Rule automatically declines transactions. */
130118
@JsonProperty("blocked_countries") @ExcludeMissing fun _blockedCountries() = blockedCountries
131119

132-
/**
133-
* Address verification to confirm that postal code entered at point of transaction (if
134-
* applicable) matches the postal code on file for a given card. Since this check is performed
135-
* against the address submitted via the Enroll Consumer endpoint, it should only be used in
136-
* cases where card users are enrolled with their own accounts. Available values:
137-
*
138-
* - `ZIP_ONLY` - AVS check is performed to confirm ZIP code entered at point of transaction (if
139-
* applicable) matches address on file.
140-
*/
141-
@JsonProperty("avs_type") @ExcludeMissing fun _avsType() = avsType
142-
143120
/**
144121
* Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note that
145122
* only this field or `card_tokens` can be provided for a given Auth Rule.
@@ -168,7 +145,6 @@ private constructor(
168145
blockedMcc()
169146
allowedCountries()
170147
blockedCountries()
171-
avsType()
172148
accountTokens()
173149
cardTokens()
174150
programLevel()
@@ -191,7 +167,6 @@ private constructor(
191167
this.blockedMcc == other.blockedMcc &&
192168
this.allowedCountries == other.allowedCountries &&
193169
this.blockedCountries == other.blockedCountries &&
194-
this.avsType == other.avsType &&
195170
this.accountTokens == other.accountTokens &&
196171
this.cardTokens == other.cardTokens &&
197172
this.programLevel == other.programLevel &&
@@ -209,7 +184,6 @@ private constructor(
209184
blockedMcc,
210185
allowedCountries,
211186
blockedCountries,
212-
avsType,
213187
accountTokens,
214188
cardTokens,
215189
programLevel,
@@ -220,7 +194,7 @@ private constructor(
220194
}
221195

222196
override fun toString() =
223-
"AuthRule{token=$token, state=$state, previousAuthRuleTokens=$previousAuthRuleTokens, allowedMcc=$allowedMcc, blockedMcc=$blockedMcc, allowedCountries=$allowedCountries, blockedCountries=$blockedCountries, avsType=$avsType, accountTokens=$accountTokens, cardTokens=$cardTokens, programLevel=$programLevel, additionalProperties=$additionalProperties}"
197+
"AuthRule{token=$token, state=$state, previousAuthRuleTokens=$previousAuthRuleTokens, allowedMcc=$allowedMcc, blockedMcc=$blockedMcc, allowedCountries=$allowedCountries, blockedCountries=$blockedCountries, accountTokens=$accountTokens, cardTokens=$cardTokens, programLevel=$programLevel, additionalProperties=$additionalProperties}"
224198

225199
companion object {
226200

@@ -236,7 +210,6 @@ private constructor(
236210
private var blockedMcc: JsonField<List<String>> = JsonMissing.of()
237211
private var allowedCountries: JsonField<List<String>> = JsonMissing.of()
238212
private var blockedCountries: JsonField<List<String>> = JsonMissing.of()
239-
private var avsType: JsonField<AvsType> = JsonMissing.of()
240213
private var accountTokens: JsonField<List<String>> = JsonMissing.of()
241214
private var cardTokens: JsonField<List<String>> = JsonMissing.of()
242215
private var programLevel: JsonField<Boolean> = JsonMissing.of()
@@ -251,7 +224,6 @@ private constructor(
251224
this.blockedMcc = authRule.blockedMcc
252225
this.allowedCountries = authRule.allowedCountries
253226
this.blockedCountries = authRule.blockedCountries
254-
this.avsType = authRule.avsType
255227
this.accountTokens = authRule.accountTokens
256228
this.cardTokens = authRule.cardTokens
257229
this.programLevel = authRule.programLevel
@@ -337,30 +309,6 @@ private constructor(
337309
this.blockedCountries = blockedCountries
338310
}
339311

340-
/**
341-
* Address verification to confirm that postal code entered at point of transaction (if
342-
* applicable) matches the postal code on file for a given card. Since this check is
343-
* performed against the address submitted via the Enroll Consumer endpoint, it should only
344-
* be used in cases where card users are enrolled with their own accounts. Available values:
345-
*
346-
* - `ZIP_ONLY` - AVS check is performed to confirm ZIP code entered at point of transaction
347-
* (if applicable) matches address on file.
348-
*/
349-
fun avsType(avsType: AvsType) = avsType(JsonField.of(avsType))
350-
351-
/**
352-
* Address verification to confirm that postal code entered at point of transaction (if
353-
* applicable) matches the postal code on file for a given card. Since this check is
354-
* performed against the address submitted via the Enroll Consumer endpoint, it should only
355-
* be used in cases where card users are enrolled with their own accounts. Available values:
356-
*
357-
* - `ZIP_ONLY` - AVS check is performed to confirm ZIP code entered at point of transaction
358-
* (if applicable) matches address on file.
359-
*/
360-
@JsonProperty("avs_type")
361-
@ExcludeMissing
362-
fun avsType(avsType: JsonField<AvsType>) = apply { this.avsType = avsType }
363-
364312
/**
365313
* Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note
366314
* that only this field or `card_tokens` can be provided for a given Auth Rule.
@@ -424,7 +372,6 @@ private constructor(
424372
blockedMcc.map { it.toUnmodifiable() },
425373
allowedCountries.map { it.toUnmodifiable() },
426374
blockedCountries.map { it.toUnmodifiable() },
427-
avsType,
428375
accountTokens.map { it.toUnmodifiable() },
429376
cardTokens.map { it.toUnmodifiable() },
430377
programLevel,
@@ -488,55 +435,4 @@ private constructor(
488435

489436
fun asString(): String = _value().asStringOrThrow()
490437
}
491-
492-
class AvsType
493-
@JsonCreator
494-
private constructor(
495-
private val value: JsonField<String>,
496-
) {
497-
498-
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
499-
500-
override fun equals(other: Any?): Boolean {
501-
if (this === other) {
502-
return true
503-
}
504-
505-
return other is AvsType && this.value == other.value
506-
}
507-
508-
override fun hashCode() = value.hashCode()
509-
510-
override fun toString() = value.toString()
511-
512-
companion object {
513-
514-
@JvmField val ZIP_ONLY = AvsType(JsonField.of("ZIP_ONLY"))
515-
516-
@JvmStatic fun of(value: String) = AvsType(JsonField.of(value))
517-
}
518-
519-
enum class Known {
520-
ZIP_ONLY,
521-
}
522-
523-
enum class Value {
524-
ZIP_ONLY,
525-
_UNKNOWN,
526-
}
527-
528-
fun value(): Value =
529-
when (this) {
530-
ZIP_ONLY -> Value.ZIP_ONLY
531-
else -> Value._UNKNOWN
532-
}
533-
534-
fun known(): Known =
535-
when (this) {
536-
ZIP_ONLY -> Known.ZIP_ONLY
537-
else -> throw LithicInvalidDataException("Unknown AvsType: $value")
538-
}
539-
540-
fun asString(): String = _value().asStringOrThrow()
541-
}
542438
}

0 commit comments

Comments
 (0)