From d328881ae9a73edf95f5528fcb721d4b5e12e3a3 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Wed, 6 Nov 2024 22:26:33 +0000 Subject: [PATCH] chore(api): adds replacement_account_token to Card create parameters --- .../com/lithic/api/models/CardCreateParams.kt | 56 +++++++++++++++++-- .../lithic/api/models/CardCreateParamsTest.kt | 3 + .../lithic/api/services/ErrorHandlingTest.kt | 11 ++++ .../lithic/api/services/ServiceParamsTest.kt | 1 + .../api/services/blocking/CardServiceTest.kt | 1 + 5 files changed, 66 insertions(+), 6 deletions(-) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt index b1e87be84..dfbe428ec 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt @@ -32,6 +32,7 @@ constructor( private val memo: String?, private val pin: String?, private val productId: String?, + private val replacementAccountToken: String?, private val replacementFor: String?, private val shippingAddress: ShippingAddress?, private val shippingMethod: ShippingMethod?, @@ -63,6 +64,8 @@ constructor( fun productId(): Optional = Optional.ofNullable(productId) + fun replacementAccountToken(): Optional = Optional.ofNullable(replacementAccountToken) + fun replacementFor(): Optional = Optional.ofNullable(replacementFor) fun shippingAddress(): Optional = Optional.ofNullable(shippingAddress) @@ -88,6 +91,7 @@ constructor( memo, pin, productId, + replacementAccountToken, replacementFor, shippingAddress, shippingMethod, @@ -116,6 +120,7 @@ constructor( private val memo: String?, private val pin: String?, private val productId: String?, + private val replacementAccountToken: String?, private val replacementFor: String?, private val shippingAddress: ShippingAddress?, private val shippingMethod: ShippingMethod?, @@ -194,6 +199,16 @@ constructor( */ @JsonProperty("product_id") fun productId(): String? = productId + /** + * Restricted field limited to select use cases. Lithic will reach out directly if this + * field should be used. Globally unique identifier for the replacement card's account. If + * this field is specified, `replacement_for` must also be specified. If `replacement_for` + * is specified and this field is omitted, the replacement card's account will be inferred + * from the card being replaced. + */ + @JsonProperty("replacement_account_token") + fun replacementAccountToken(): String? = replacementAccountToken + /** * Only applicable to cards of type `PHYSICAL`. Globally unique identifier for the card that * this physical card will replace. @@ -268,6 +283,7 @@ constructor( private var memo: String? = null private var pin: String? = null private var productId: String? = null + private var replacementAccountToken: String? = null private var replacementFor: String? = null private var shippingAddress: ShippingAddress? = null private var shippingMethod: ShippingMethod? = null @@ -288,6 +304,7 @@ constructor( this.memo = cardCreateBody.memo this.pin = cardCreateBody.pin this.productId = cardCreateBody.productId + this.replacementAccountToken = cardCreateBody.replacementAccountToken this.replacementFor = cardCreateBody.replacementFor this.shippingAddress = cardCreateBody.shippingAddress this.shippingMethod = cardCreateBody.shippingMethod @@ -378,6 +395,18 @@ constructor( @JsonProperty("product_id") fun productId(productId: String) = apply { this.productId = productId } + /** + * Restricted field limited to select use cases. Lithic will reach out directly if this + * field should be used. Globally unique identifier for the replacement card's account. + * If this field is specified, `replacement_for` must also be specified. If + * `replacement_for` is specified and this field is omitted, the replacement card's + * account will be inferred from the card being replaced. + */ + @JsonProperty("replacement_account_token") + fun replacementAccountToken(replacementAccountToken: String) = apply { + this.replacementAccountToken = replacementAccountToken + } + /** * Only applicable to cards of type `PHYSICAL`. Globally unique identifier for the card * that this physical card will replace. @@ -470,6 +499,7 @@ constructor( memo, pin, productId, + replacementAccountToken, replacementFor, shippingAddress, shippingMethod, @@ -485,20 +515,20 @@ constructor( return true } - return /* spotless:off */ other is CardCreateBody && this.type == other.type && this.accountToken == other.accountToken && this.cardProgramToken == other.cardProgramToken && this.carrier == other.carrier && this.digitalCardArtToken == other.digitalCardArtToken && this.expMonth == other.expMonth && this.expYear == other.expYear && this.memo == other.memo && this.pin == other.pin && this.productId == other.productId && this.replacementFor == other.replacementFor && this.shippingAddress == other.shippingAddress && this.shippingMethod == other.shippingMethod && this.spendLimit == other.spendLimit && this.spendLimitDuration == other.spendLimitDuration && this.state == other.state && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CardCreateBody && this.type == other.type && this.accountToken == other.accountToken && this.cardProgramToken == other.cardProgramToken && this.carrier == other.carrier && this.digitalCardArtToken == other.digitalCardArtToken && this.expMonth == other.expMonth && this.expYear == other.expYear && this.memo == other.memo && this.pin == other.pin && this.productId == other.productId && this.replacementAccountToken == other.replacementAccountToken && this.replacementFor == other.replacementFor && this.shippingAddress == other.shippingAddress && this.shippingMethod == other.shippingMethod && this.spendLimit == other.spendLimit && this.spendLimitDuration == other.spendLimitDuration && this.state == other.state && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, accountToken, cardProgramToken, carrier, digitalCardArtToken, expMonth, expYear, memo, pin, productId, replacementFor, shippingAddress, shippingMethod, spendLimit, spendLimitDuration, state, additionalProperties) /* spotless:on */ + hashCode = /* spotless:off */ Objects.hash(type, accountToken, cardProgramToken, carrier, digitalCardArtToken, expMonth, expYear, memo, pin, productId, replacementAccountToken, replacementFor, shippingAddress, shippingMethod, spendLimit, spendLimitDuration, state, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = - "CardCreateBody{type=$type, accountToken=$accountToken, cardProgramToken=$cardProgramToken, carrier=$carrier, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, memo=$memo, pin=$pin, productId=$productId, replacementFor=$replacementFor, shippingAddress=$shippingAddress, shippingMethod=$shippingMethod, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalProperties=$additionalProperties}" + "CardCreateBody{type=$type, accountToken=$accountToken, cardProgramToken=$cardProgramToken, carrier=$carrier, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, memo=$memo, pin=$pin, productId=$productId, replacementAccountToken=$replacementAccountToken, replacementFor=$replacementFor, shippingAddress=$shippingAddress, shippingMethod=$shippingMethod, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalProperties=$additionalProperties}" } fun _additionalHeaders(): Map> = additionalHeaders @@ -512,15 +542,15 @@ constructor( return true } - return /* spotless:off */ other is CardCreateParams && this.type == other.type && this.accountToken == other.accountToken && this.cardProgramToken == other.cardProgramToken && this.carrier == other.carrier && this.digitalCardArtToken == other.digitalCardArtToken && this.expMonth == other.expMonth && this.expYear == other.expYear && this.memo == other.memo && this.pin == other.pin && this.productId == other.productId && this.replacementFor == other.replacementFor && this.shippingAddress == other.shippingAddress && this.shippingMethod == other.shippingMethod && this.spendLimit == other.spendLimit && this.spendLimitDuration == other.spendLimitDuration && this.state == other.state && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is CardCreateParams && this.type == other.type && this.accountToken == other.accountToken && this.cardProgramToken == other.cardProgramToken && this.carrier == other.carrier && this.digitalCardArtToken == other.digitalCardArtToken && this.expMonth == other.expMonth && this.expYear == other.expYear && this.memo == other.memo && this.pin == other.pin && this.productId == other.productId && this.replacementAccountToken == other.replacementAccountToken && this.replacementFor == other.replacementFor && this.shippingAddress == other.shippingAddress && this.shippingMethod == other.shippingMethod && this.spendLimit == other.spendLimit && this.spendLimitDuration == other.spendLimitDuration && this.state == other.state && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(type, accountToken, cardProgramToken, carrier, digitalCardArtToken, expMonth, expYear, memo, pin, productId, replacementFor, shippingAddress, shippingMethod, spendLimit, spendLimitDuration, state, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + return /* spotless:off */ Objects.hash(type, accountToken, cardProgramToken, carrier, digitalCardArtToken, expMonth, expYear, memo, pin, productId, replacementAccountToken, replacementFor, shippingAddress, shippingMethod, spendLimit, spendLimitDuration, state, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ } override fun toString() = - "CardCreateParams{type=$type, accountToken=$accountToken, cardProgramToken=$cardProgramToken, carrier=$carrier, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, memo=$memo, pin=$pin, productId=$productId, replacementFor=$replacementFor, shippingAddress=$shippingAddress, shippingMethod=$shippingMethod, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "CardCreateParams{type=$type, accountToken=$accountToken, cardProgramToken=$cardProgramToken, carrier=$carrier, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, memo=$memo, pin=$pin, productId=$productId, replacementAccountToken=$replacementAccountToken, replacementFor=$replacementFor, shippingAddress=$shippingAddress, shippingMethod=$shippingMethod, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" fun toBuilder() = Builder().from(this) @@ -542,6 +572,7 @@ constructor( private var memo: String? = null private var pin: String? = null private var productId: String? = null + private var replacementAccountToken: String? = null private var replacementFor: String? = null private var shippingAddress: ShippingAddress? = null private var shippingMethod: ShippingMethod? = null @@ -564,6 +595,7 @@ constructor( this.memo = cardCreateParams.memo this.pin = cardCreateParams.pin this.productId = cardCreateParams.productId + this.replacementAccountToken = cardCreateParams.replacementAccountToken this.replacementFor = cardCreateParams.replacementFor this.shippingAddress = cardCreateParams.shippingAddress this.shippingMethod = cardCreateParams.shippingMethod @@ -647,6 +679,17 @@ constructor( */ fun productId(productId: String) = apply { this.productId = productId } + /** + * Restricted field limited to select use cases. Lithic will reach out directly if this + * field should be used. Globally unique identifier for the replacement card's account. If + * this field is specified, `replacement_for` must also be specified. If `replacement_for` + * is specified and this field is omitted, the replacement card's account will be inferred + * from the card being replaced. + */ + fun replacementAccountToken(replacementAccountToken: String) = apply { + this.replacementAccountToken = replacementAccountToken + } + /** * Only applicable to cards of type `PHYSICAL`. Globally unique identifier for the card that * this physical card will replace. @@ -803,6 +846,7 @@ constructor( memo, pin, productId, + replacementAccountToken, replacementFor, shippingAddress, shippingMethod, diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardCreateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardCreateParamsTest.kt index cfb96e071..22f3893f3 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardCreateParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardCreateParamsTest.kt @@ -21,6 +21,7 @@ class CardCreateParamsTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -58,6 +59,7 @@ class CardCreateParamsTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -91,6 +93,7 @@ class CardCreateParamsTest { assertThat(body.memo()).isEqualTo("New Card") assertThat(body.pin()).isEqualTo("pin") assertThat(body.productId()).isEqualTo("1") + assertThat(body.replacementAccountToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.replacementFor()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.shippingAddress()) .isEqualTo( diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/ErrorHandlingTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/ErrorHandlingTest.kt index 11aacc8b5..78ac4a932 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/ErrorHandlingTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/ErrorHandlingTest.kt @@ -70,6 +70,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -147,6 +148,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -194,6 +196,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -241,6 +244,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -288,6 +292,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -335,6 +340,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -382,6 +388,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -429,6 +436,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -476,6 +484,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -528,6 +537,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() @@ -574,6 +584,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/ServiceParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/ServiceParamsTest.kt index 4e1e82900..9a99cc281 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/ServiceParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/ServiceParamsTest.kt @@ -68,6 +68,7 @@ class ServiceParamsTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/CardServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/CardServiceTest.kt index f5fe0aaae..5f5e85224 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/CardServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/CardServiceTest.kt @@ -34,6 +34,7 @@ class CardServiceTest { .memo("New Card") .pin("pin") .productId("1") + .replacementAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .replacementFor("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shippingAddress( ShippingAddress.builder()