Skip to content

Commit

Permalink
feat(api)!: deprecate 'auth rule token' in 'card' and 'account holder…
Browse files Browse the repository at this point in the history
…' models (#257)

## Migration
The deprecated files will be removed in a future release. Use the `/auth_rules` endpoints to fetch Auth Rule information instead.
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 23, 2024
1 parent 383cc43 commit 45a7586
Show file tree
Hide file tree
Showing 49 changed files with 6,414 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 122
configured_endpoints: 127
28 changes: 24 additions & 4 deletions lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ private constructor(
fun accountHolder(): Optional<AccountHolder> =
Optional.ofNullable(accountHolder.getNullable("account_holder"))

/** List of identifiers for the Auth Rule(s) that are applied on the account. */
/**
* List of identifiers for the Auth Rule(s) that are applied on the account. This field is
* deprecated and will no longer be populated in the `account_holder` object. The key will be
* removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth
* Rule information instead.
*/
fun authRuleTokens(): Optional<List<String>> =
Optional.ofNullable(authRuleTokens.getNullable("auth_rule_tokens"))

Expand Down Expand Up @@ -81,7 +86,12 @@ private constructor(

@JsonProperty("account_holder") @ExcludeMissing fun _accountHolder() = accountHolder

/** List of identifiers for the Auth Rule(s) that are applied on the account. */
/**
* List of identifiers for the Auth Rule(s) that are applied on the account. This field is
* deprecated and will no longer be populated in the `account_holder` object. The key will be
* removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth
* Rule information instead.
*/
@JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens

/**
Expand Down Expand Up @@ -211,11 +221,21 @@ private constructor(
this.accountHolder = accountHolder
}

/** List of identifiers for the Auth Rule(s) that are applied on the account. */
/**
* List of identifiers for the Auth Rule(s) that are applied on the account. This field is
* deprecated and will no longer be populated in the `account_holder` object. The key will
* be removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch
* Auth Rule information instead.
*/
fun authRuleTokens(authRuleTokens: List<String>) =
authRuleTokens(JsonField.of(authRuleTokens))

/** List of identifiers for the Auth Rule(s) that are applied on the account. */
/**
* List of identifiers for the Auth Rule(s) that are applied on the account. This field is
* deprecated and will no longer be populated in the `account_holder` object. The key will
* be removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch
* Auth Rule information instead.
*/
@JsonProperty("auth_rule_tokens")
@ExcludeMissing
fun authRuleTokens(authRuleTokens: JsonField<List<String>>) = apply {
Expand Down
28 changes: 24 additions & 4 deletions lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ private constructor(
/** Globally unique identifier for the account to which the card belongs. */
fun accountToken(): String = accountToken.getRequired("account_token")

/** List of identifiers for the Auth Rule(s) that are applied on the card. */
/**
* List of identifiers for the Auth Rule(s) that are applied on the card. This field is
* deprecated and will no longer be populated in the `Card` object. The key will be removed from
* the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth Rule
* information instead.
*/
fun authRuleTokens(): Optional<List<String>> =
Optional.ofNullable(authRuleTokens.getNullable("auth_rule_tokens"))

Expand Down Expand Up @@ -167,7 +172,12 @@ private constructor(
/** Globally unique identifier for the account to which the card belongs. */
@JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken

/** List of identifiers for the Auth Rule(s) that are applied on the card. */
/**
* List of identifiers for the Auth Rule(s) that are applied on the card. This field is
* deprecated and will no longer be populated in the `Card` object. The key will be removed from
* the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth Rule
* information instead.
*/
@JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens

/** Globally unique identifier for the card program on which the card exists. */
Expand Down Expand Up @@ -433,11 +443,21 @@ private constructor(
this.accountToken = accountToken
}

/** List of identifiers for the Auth Rule(s) that are applied on the card. */
/**
* List of identifiers for the Auth Rule(s) that are applied on the card. This field is
* deprecated and will no longer be populated in the `Card` object. The key will be removed
* from the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth Rule
* information instead.
*/
fun authRuleTokens(authRuleTokens: List<String>) =
authRuleTokens(JsonField.of(authRuleTokens))

/** List of identifiers for the Auth Rule(s) that are applied on the card. */
/**
* List of identifiers for the Auth Rule(s) that are applied on the card. This field is
* deprecated and will no longer be populated in the `Card` object. The key will be removed
* from the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth Rule
* information instead.
*/
@JsonProperty("auth_rule_tokens")
@ExcludeMissing
fun authRuleTokens(authRuleTokens: JsonField<List<String>>) = apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import java.util.Optional
class CardUpdateParams
constructor(
private val cardToken: String,
private val authRuleToken: String?,
private val digitalCardArtToken: String?,
private val memo: String?,
private val pin: String?,
Expand All @@ -35,8 +34,6 @@ constructor(

fun cardToken(): String = cardToken

fun authRuleToken(): Optional<String> = Optional.ofNullable(authRuleToken)

fun digitalCardArtToken(): Optional<String> = Optional.ofNullable(digitalCardArtToken)

fun memo(): Optional<String> = Optional.ofNullable(memo)
Expand All @@ -52,7 +49,6 @@ constructor(
@JvmSynthetic
internal fun getBody(): CardUpdateBody {
return CardUpdateBody(
authRuleToken,
digitalCardArtToken,
memo,
pin,
Expand All @@ -78,7 +74,6 @@ constructor(
@NoAutoDetect
class CardUpdateBody
internal constructor(
private val authRuleToken: String?,
private val digitalCardArtToken: String?,
private val memo: String?,
private val pin: String?,
Expand All @@ -90,12 +85,6 @@ constructor(

private var hashCode: Int = 0

/**
* Identifier for any Auth Rules that will be applied to transactions taking place with the
* card.
*/
@JsonProperty("auth_rule_token") fun authRuleToken(): String? = authRuleToken

/**
* Specifies the digital card art to be displayed in the user’s digital wallet after
* tokenization. This artwork must be approved by Mastercard and configured by Lithic to
Expand Down Expand Up @@ -161,7 +150,6 @@ constructor(
}

return other is CardUpdateBody &&
this.authRuleToken == other.authRuleToken &&
this.digitalCardArtToken == other.digitalCardArtToken &&
this.memo == other.memo &&
this.pin == other.pin &&
Expand All @@ -175,7 +163,6 @@ constructor(
if (hashCode == 0) {
hashCode =
Objects.hash(
authRuleToken,
digitalCardArtToken,
memo,
pin,
Expand All @@ -189,7 +176,7 @@ constructor(
}

override fun toString() =
"CardUpdateBody{authRuleToken=$authRuleToken, digitalCardArtToken=$digitalCardArtToken, memo=$memo, pin=$pin, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalProperties=$additionalProperties}"
"CardUpdateBody{digitalCardArtToken=$digitalCardArtToken, memo=$memo, pin=$pin, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalProperties=$additionalProperties}"

companion object {

Expand All @@ -198,7 +185,6 @@ constructor(

class Builder {

private var authRuleToken: String? = null
private var digitalCardArtToken: String? = null
private var memo: String? = null
private var pin: String? = null
Expand All @@ -209,7 +195,6 @@ constructor(

@JvmSynthetic
internal fun from(cardUpdateBody: CardUpdateBody) = apply {
this.authRuleToken = cardUpdateBody.authRuleToken
this.digitalCardArtToken = cardUpdateBody.digitalCardArtToken
this.memo = cardUpdateBody.memo
this.pin = cardUpdateBody.pin
Expand All @@ -219,13 +204,6 @@ constructor(
additionalProperties(cardUpdateBody.additionalProperties)
}

/**
* Identifier for any Auth Rules that will be applied to transactions taking place with
* the card.
*/
@JsonProperty("auth_rule_token")
fun authRuleToken(authRuleToken: String) = apply { this.authRuleToken = authRuleToken }

/**
* Specifies the digital card art to be displayed in the user’s digital wallet after
* tokenization. This artwork must be approved by Mastercard and configured by Lithic to
Expand Down Expand Up @@ -303,7 +281,6 @@ constructor(

fun build(): CardUpdateBody =
CardUpdateBody(
authRuleToken,
digitalCardArtToken,
memo,
pin,
Expand All @@ -328,7 +305,6 @@ constructor(

return other is CardUpdateParams &&
this.cardToken == other.cardToken &&
this.authRuleToken == other.authRuleToken &&
this.digitalCardArtToken == other.digitalCardArtToken &&
this.memo == other.memo &&
this.pin == other.pin &&
Expand All @@ -343,7 +319,6 @@ constructor(
override fun hashCode(): Int {
return Objects.hash(
cardToken,
authRuleToken,
digitalCardArtToken,
memo,
pin,
Expand All @@ -357,7 +332,7 @@ constructor(
}

override fun toString() =
"CardUpdateParams{cardToken=$cardToken, authRuleToken=$authRuleToken, digitalCardArtToken=$digitalCardArtToken, memo=$memo, pin=$pin, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
"CardUpdateParams{cardToken=$cardToken, digitalCardArtToken=$digitalCardArtToken, memo=$memo, pin=$pin, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"

fun toBuilder() = Builder().from(this)

Expand All @@ -370,7 +345,6 @@ constructor(
class Builder {

private var cardToken: String? = null
private var authRuleToken: String? = null
private var digitalCardArtToken: String? = null
private var memo: String? = null
private var pin: String? = null
Expand All @@ -384,7 +358,6 @@ constructor(
@JvmSynthetic
internal fun from(cardUpdateParams: CardUpdateParams) = apply {
this.cardToken = cardUpdateParams.cardToken
this.authRuleToken = cardUpdateParams.authRuleToken
this.digitalCardArtToken = cardUpdateParams.digitalCardArtToken
this.memo = cardUpdateParams.memo
this.pin = cardUpdateParams.pin
Expand All @@ -398,12 +371,6 @@ constructor(

fun cardToken(cardToken: String) = apply { this.cardToken = cardToken }

/**
* Identifier for any Auth Rules that will be applied to transactions taking place with the
* card.
*/
fun authRuleToken(authRuleToken: String) = apply { this.authRuleToken = authRuleToken }

/**
* Specifies the digital card art to be displayed in the user’s digital wallet after
* tokenization. This artwork must be approved by Mastercard and configured by Lithic to
Expand Down Expand Up @@ -516,7 +483,6 @@ constructor(
fun build(): CardUpdateParams =
CardUpdateParams(
checkNotNull(cardToken) { "`cardToken` is required but was not set" },
authRuleToken,
digitalCardArtToken,
memo,
pin,
Expand Down
Loading

0 comments on commit 45a7586

Please sign in to comment.