From 2a2a00acc9cd3a92991a7ae50b6e02cdebaa930d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:11:20 +0000 Subject: [PATCH 01/18] fix(types): add EMPTY exemption type, make fields optional in Account/Card/NonPciCard --- .stats.yml | 4 +- .../kotlin/com/lithic/api/models/Account.kt | 5 ++- ...tHolderSimulateEnrollmentReviewResponse.kt | 13 ++++-- .../api/models/AccountHolderUpdateResponse.kt | 6 +-- .../lithic/api/models/AccountUpdateParams.kt | 10 ++++- .../main/kotlin/com/lithic/api/models/Card.kt | 37 +++++++++++----- .../com/lithic/api/models/NonPciCard.kt | 44 +++++++++++++------ .../kotlin/com/lithic/api/models/CardTest.kt | 2 +- .../com/lithic/api/models/NonPciCardTest.kt | 2 +- 9 files changed, 85 insertions(+), 38 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1a1957f0a..ccbfde879 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d29b68bb85936070878d8badaa8a7c5991313285e70a990bc812c838eba85373.yml -openapi_spec_hash: 54b44da68df22eb0ea99f2bc564667a2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-dc8aacc11d74a1e25c95ba549dd0f4a4e735cbf7562fc6b17b0c81d62fd5475c.yml +openapi_spec_hash: 1906583f260a3e9ace5ae38fd2254763 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt index e10c836a8..076c8a777 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt @@ -504,7 +504,10 @@ private constructor( * * `OTHER` - The reason for the account's current status does not fall into any of the * above categories. A comment should be provided to specify the particular reason. */ - fun substatus(substatus: Substatus) = substatus(JsonField.of(substatus)) + fun substatus(substatus: Substatus?) = substatus(JsonField.ofNullable(substatus)) + + /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ + fun substatus(substatus: Optional) = substatus(substatus.getOrNull()) /** * Sets [Builder.substatus] to an arbitrary JSON value. diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt index 380871128..1c070317d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt @@ -209,7 +209,7 @@ private constructor( fun email(): Optional = email.getOptional("email") /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder is + * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder is * not KYC-Exempt. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the @@ -733,10 +733,15 @@ private constructor( fun email(email: JsonField) = apply { this.email = email } /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder + * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder * is not KYC-Exempt. */ - fun exemptionType(exemptionType: ExemptionType) = exemptionType(JsonField.of(exemptionType)) + fun exemptionType(exemptionType: ExemptionType?) = + exemptionType(JsonField.ofNullable(exemptionType)) + + /** Alias for calling [Builder.exemptionType] with `exemptionType.orElse(null)`. */ + fun exemptionType(exemptionType: Optional) = + exemptionType(exemptionType.getOrNull()) /** * Sets [Builder.exemptionType] to an arbitrary JSON value. @@ -1871,7 +1876,7 @@ private constructor( } /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder is + * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder is * not KYC-Exempt. */ class ExemptionType @JsonCreator private constructor(private val value: JsonField) : diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt index 538514761..4b7bbe625 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt @@ -402,7 +402,7 @@ private constructor( fun email(): Optional = email.getOptional("email") /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder + * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder * is not KYC-Exempt. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the @@ -927,7 +927,7 @@ private constructor( fun email(email: JsonField) = apply { this.email = email } /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account * holder is not KYC-Exempt. */ fun exemptionType(exemptionType: ExemptionType) = @@ -2098,7 +2098,7 @@ private constructor( } /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder + * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder * is not KYC-Exempt. */ class ExemptionType @JsonCreator private constructor(private val value: JsonField) : diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt index 9a75e9e55..d84a4d310 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt @@ -337,7 +337,10 @@ private constructor( * * `OTHER` - The reason for the account's current status does not fall into any of the * above categories. A comment should be provided to specify the particular reason. */ - fun substatus(substatus: Substatus) = apply { body.substatus(substatus) } + fun substatus(substatus: Substatus?) = apply { body.substatus(substatus) } + + /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ + fun substatus(substatus: Optional) = substatus(substatus.getOrNull()) /** * Sets [Builder.substatus] to an arbitrary JSON value. @@ -864,7 +867,10 @@ private constructor( * * `OTHER` - The reason for the account's current status does not fall into any of the * above categories. A comment should be provided to specify the particular reason. */ - fun substatus(substatus: Substatus) = substatus(JsonField.of(substatus)) + fun substatus(substatus: Substatus?) = substatus(JsonField.ofNullable(substatus)) + + /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ + fun substatus(substatus: Optional) = substatus(substatus.getOrNull()) /** * Sets [Builder.substatus] to an arbitrary JSON value. diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt index 605ca9af2..b6d2162d6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt @@ -206,12 +206,12 @@ private constructor( fun created(): OffsetDateTime = created.getRequired("created") /** - * Deprecated: Funding account for the card. + * Funding account for a card * - * @throws LithicInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun funding(): NonPciCard.FundingAccount = funding.getRequired("funding") + fun funding(): Optional = funding.getOptional("funding") /** * Last four digits of the card number. @@ -822,8 +822,11 @@ private constructor( */ fun created(created: JsonField) = apply { this.created = created } - /** Deprecated: Funding account for the card. */ - fun funding(funding: NonPciCard.FundingAccount) = funding(JsonField.of(funding)) + /** Funding account for a card */ + fun funding(funding: NonPciCard.FundingAccount?) = funding(JsonField.ofNullable(funding)) + + /** Alias for calling [Builder.funding] with `funding.orElse(null)`. */ + fun funding(funding: Optional) = funding(funding.getOrNull()) /** * Sets [Builder.funding] to an arbitrary JSON value. @@ -1040,8 +1043,14 @@ private constructor( * tokenization. This artwork must be approved by Mastercard and configured by Lithic to * use. */ - fun digitalCardArtToken(digitalCardArtToken: String) = - digitalCardArtToken(JsonField.of(digitalCardArtToken)) + fun digitalCardArtToken(digitalCardArtToken: String?) = + digitalCardArtToken(JsonField.ofNullable(digitalCardArtToken)) + + /** + * Alias for calling [Builder.digitalCardArtToken] with `digitalCardArtToken.orElse(null)`. + */ + fun digitalCardArtToken(digitalCardArtToken: Optional) = + digitalCardArtToken(digitalCardArtToken.getOrNull()) /** * Sets [Builder.digitalCardArtToken] to an arbitrary JSON value. @@ -1159,7 +1168,10 @@ private constructor( * use. Specifies the configuration (i.e., physical card art) that the card should be * manufactured with. */ - fun productId(productId: String) = productId(JsonField.of(productId)) + fun productId(productId: String?) = productId(JsonField.ofNullable(productId)) + + /** Alias for calling [Builder.productId] with `productId.orElse(null)`. */ + fun productId(productId: Optional) = productId(productId.getOrNull()) /** * Sets [Builder.productId] to an arbitrary JSON value. @@ -1212,7 +1224,10 @@ private constructor( * has been returned. * `OTHER` - The reason for the status does not fall into any of the * above categories. A comment can be provided to specify the reason. */ - fun substatus(substatus: NonPciCard.Substatus) = substatus(JsonField.of(substatus)) + fun substatus(substatus: NonPciCard.Substatus?) = substatus(JsonField.ofNullable(substatus)) + + /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ + fun substatus(substatus: Optional) = substatus(substatus.getOrNull()) /** * Sets [Builder.substatus] to an arbitrary JSON value. @@ -1336,7 +1351,7 @@ private constructor( accountToken() cardProgramToken() created() - funding().validate() + funding().ifPresent { it.validate() } lastFour() pinStatus().validate() spendLimit() diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt index b736b2c5a..295e7a801 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt @@ -170,12 +170,12 @@ private constructor( fun created(): OffsetDateTime = created.getRequired("created") /** - * Deprecated: Funding account for the card. + * Funding account for a card * - * @throws LithicInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun funding(): FundingAccount = funding.getRequired("funding") + fun funding(): Optional = funding.getOptional("funding") /** * Last four digits of the card number. @@ -745,8 +745,11 @@ private constructor( */ fun created(created: JsonField) = apply { this.created = created } - /** Deprecated: Funding account for the card. */ - fun funding(funding: FundingAccount) = funding(JsonField.of(funding)) + /** Funding account for a card */ + fun funding(funding: FundingAccount?) = funding(JsonField.ofNullable(funding)) + + /** Alias for calling [Builder.funding] with `funding.orElse(null)`. */ + fun funding(funding: Optional) = funding(funding.getOrNull()) /** * Sets [Builder.funding] to an arbitrary JSON value. @@ -957,8 +960,14 @@ private constructor( * tokenization. This artwork must be approved by Mastercard and configured by Lithic to * use. */ - fun digitalCardArtToken(digitalCardArtToken: String) = - digitalCardArtToken(JsonField.of(digitalCardArtToken)) + fun digitalCardArtToken(digitalCardArtToken: String?) = + digitalCardArtToken(JsonField.ofNullable(digitalCardArtToken)) + + /** + * Alias for calling [Builder.digitalCardArtToken] with `digitalCardArtToken.orElse(null)`. + */ + fun digitalCardArtToken(digitalCardArtToken: Optional) = + digitalCardArtToken(digitalCardArtToken.getOrNull()) /** * Sets [Builder.digitalCardArtToken] to an arbitrary JSON value. @@ -1076,7 +1085,10 @@ private constructor( * use. Specifies the configuration (i.e., physical card art) that the card should be * manufactured with. */ - fun productId(productId: String) = productId(JsonField.of(productId)) + fun productId(productId: String?) = productId(JsonField.ofNullable(productId)) + + /** Alias for calling [Builder.productId] with `productId.orElse(null)`. */ + fun productId(productId: Optional) = productId(productId.getOrNull()) /** * Sets [Builder.productId] to an arbitrary JSON value. @@ -1129,7 +1141,10 @@ private constructor( * has been returned. * `OTHER` - The reason for the status does not fall into any of the * above categories. A comment can be provided to specify the reason. */ - fun substatus(substatus: Substatus) = substatus(JsonField.of(substatus)) + fun substatus(substatus: Substatus?) = substatus(JsonField.ofNullable(substatus)) + + /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ + fun substatus(substatus: Optional) = substatus(substatus.getOrNull()) /** * Sets [Builder.substatus] to an arbitrary JSON value. @@ -1223,7 +1238,7 @@ private constructor( accountToken() cardProgramToken() created() - funding().validate() + funding().ifPresent { it.validate() } lastFour() pinStatus().validate() spendLimit() @@ -1288,7 +1303,7 @@ private constructor( (if (replacementFor.asKnown().isPresent) 1 else 0) + (substatus.asKnown().getOrNull()?.validity() ?: 0) - /** Deprecated: Funding account for the card. */ + /** Funding account for a card */ class FundingAccount @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -1574,7 +1589,10 @@ private constructor( } /** The nickname given to the `FundingAccount` or `null` if it has no nickname. */ - fun nickname(nickname: String) = nickname(JsonField.of(nickname)) + fun nickname(nickname: String?) = nickname(JsonField.ofNullable(nickname)) + + /** Alias for calling [Builder.nickname] with `nickname.orElse(null)`. */ + fun nickname(nickname: Optional) = nickname(nickname.getOrNull()) /** * Sets [Builder.nickname] to an arbitrary JSON value. diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTest.kt index e257cbab9..cdadd7a87 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTest.kt @@ -59,7 +59,7 @@ internal class CardTest { assertThat(card.cardProgramToken()).isEqualTo("5e9483eb-8103-4e16-9794-2106111b2eca") assertThat(card.created()).isEqualTo(OffsetDateTime.parse("2021-06-28T22:53:15Z")) assertThat(card.funding()) - .isEqualTo( + .contains( NonPciCard.FundingAccount.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/NonPciCardTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/NonPciCardTest.kt index c9e11ef66..50aba8bd6 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/NonPciCardTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/NonPciCardTest.kt @@ -57,7 +57,7 @@ internal class NonPciCardTest { assertThat(nonPciCard.cardProgramToken()).isEqualTo("5e9483eb-8103-4e16-9794-2106111b2eca") assertThat(nonPciCard.created()).isEqualTo(OffsetDateTime.parse("2021-06-28T22:53:15Z")) assertThat(nonPciCard.funding()) - .isEqualTo( + .contains( NonPciCard.FundingAccount.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) From 386e6bb68e78c4dd7ca9fa217cbb6132daa912f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:35:08 +0000 Subject: [PATCH 02/18] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ccbfde879..a0da87563 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-dc8aacc11d74a1e25c95ba549dd0f4a4e735cbf7562fc6b17b0c81d62fd5475c.yml -openapi_spec_hash: 1906583f260a3e9ace5ae38fd2254763 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-599dd2ac665b09566a84c4871ffb3b7313f6b40d0808b8ab4df63bec608b4f9f.yml +openapi_spec_hash: 429e0ad5e3aae4f63935859c2ac64fdc config_hash: ac8326134e692f3f3bdec82396bbec80 From 638084a329e3e2da55a350e950f6752e185b5ae4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:46:27 +0000 Subject: [PATCH 03/18] feat(api): add AMEX to Network enum in settlement params and models --- .stats.yml | 4 ++-- .../api/models/ReportSettlementNetworkTotalListParams.kt | 6 ++++++ .../main/kotlin/com/lithic/api/models/SettlementDetail.kt | 6 ++++++ .../com/lithic/api/models/SettlementSummaryDetails.kt | 6 ++++++ .../models/ReportSettlementNetworkTotalListParamsTest.kt | 6 +++--- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index a0da87563..cba45ec26 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-599dd2ac665b09566a84c4871ffb3b7313f6b40d0808b8ab4df63bec608b4f9f.yml -openapi_spec_hash: 429e0ad5e3aae4f63935859c2ac64fdc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ab626b78e088455e814b80debc85d420839bc11f95416491fef6a0460f2d95ed.yml +openapi_spec_hash: f6ae1bbed371a5d45927cd63797a9908 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt index 8a01a41b5..550364f2f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt @@ -394,6 +394,8 @@ private constructor( companion object { + @JvmField val AMEX = of("AMEX") + @JvmField val VISA = of("VISA") @JvmField val MASTERCARD = of("MASTERCARD") @@ -407,6 +409,7 @@ private constructor( /** An enum containing [Network]'s known values. */ enum class Known { + AMEX, VISA, MASTERCARD, MAESTRO, @@ -423,6 +426,7 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { + AMEX, VISA, MASTERCARD, MAESTRO, @@ -440,6 +444,7 @@ private constructor( */ fun value(): Value = when (this) { + AMEX -> Value.AMEX VISA -> Value.VISA MASTERCARD -> Value.MASTERCARD MAESTRO -> Value.MAESTRO @@ -458,6 +463,7 @@ private constructor( */ fun known(): Known = when (this) { + AMEX -> Known.AMEX VISA -> Known.VISA MASTERCARD -> Known.MASTERCARD MAESTRO -> Known.MAESTRO diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt index d0eb9c223..300bd7349 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt @@ -1048,6 +1048,8 @@ private constructor( companion object { + @JvmField val AMEX = of("AMEX") + @JvmField val INTERLINK = of("INTERLINK") @JvmField val MAESTRO = of("MAESTRO") @@ -1063,6 +1065,7 @@ private constructor( /** An enum containing [Network]'s known values. */ enum class Known { + AMEX, INTERLINK, MAESTRO, MASTERCARD, @@ -1080,6 +1083,7 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { + AMEX, INTERLINK, MAESTRO, MASTERCARD, @@ -1098,6 +1102,7 @@ private constructor( */ fun value(): Value = when (this) { + AMEX -> Value.AMEX INTERLINK -> Value.INTERLINK MAESTRO -> Value.MAESTRO MASTERCARD -> Value.MASTERCARD @@ -1117,6 +1122,7 @@ private constructor( */ fun known(): Known = when (this) { + AMEX -> Known.AMEX INTERLINK -> Known.INTERLINK MAESTRO -> Known.MAESTRO MASTERCARD -> Known.MASTERCARD diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt index 2ccf58242..853ff9b01 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt @@ -461,6 +461,8 @@ private constructor( companion object { + @JvmField val AMEX = of("AMEX") + @JvmField val INTERLINK = of("INTERLINK") @JvmField val MAESTRO = of("MAESTRO") @@ -476,6 +478,7 @@ private constructor( /** An enum containing [Network]'s known values. */ enum class Known { + AMEX, INTERLINK, MAESTRO, MASTERCARD, @@ -493,6 +496,7 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { + AMEX, INTERLINK, MAESTRO, MASTERCARD, @@ -511,6 +515,7 @@ private constructor( */ fun value(): Value = when (this) { + AMEX -> Value.AMEX INTERLINK -> Value.INTERLINK MAESTRO -> Value.MAESTRO MASTERCARD -> Value.MASTERCARD @@ -530,6 +535,7 @@ private constructor( */ fun known(): Known = when (this) { + AMEX -> Known.AMEX INTERLINK -> Known.INTERLINK MAESTRO -> Known.MAESTRO MASTERCARD -> Known.MASTERCARD diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParamsTest.kt index f02ea7495..29fecaa0f 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParamsTest.kt @@ -17,7 +17,7 @@ internal class ReportSettlementNetworkTotalListParamsTest { .end(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .endingBefore("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .institutionId("institution_id") - .network(ReportSettlementNetworkTotalListParams.Network.VISA) + .network(ReportSettlementNetworkTotalListParams.Network.AMEX) .pageSize(1L) .reportDate(LocalDate.parse("2019-12-27")) .reportDateBegin(LocalDate.parse("2019-12-27")) @@ -35,7 +35,7 @@ internal class ReportSettlementNetworkTotalListParamsTest { .end(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .endingBefore("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .institutionId("institution_id") - .network(ReportSettlementNetworkTotalListParams.Network.VISA) + .network(ReportSettlementNetworkTotalListParams.Network.AMEX) .pageSize(1L) .reportDate(LocalDate.parse("2019-12-27")) .reportDateBegin(LocalDate.parse("2019-12-27")) @@ -53,7 +53,7 @@ internal class ReportSettlementNetworkTotalListParamsTest { .put("end", "2019-12-27T18:11:19.117Z") .put("ending_before", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("institution_id", "institution_id") - .put("network", "VISA") + .put("network", "AMEX") .put("page_size", "1") .put("report_date", "2019-12-27") .put("report_date_begin", "2019-12-27") From 36c34a04d23013e6504d322f84ed85506ab46220 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 20:36:30 +0000 Subject: [PATCH 04/18] docs(api): update exp_month/exp_year descriptions in card create/renew --- .stats.yml | 2 +- .../com/lithic/api/models/CardCreateParams.kt | 23 ++++++++++++------- .../com/lithic/api/models/CardRenewParams.kt | 23 ++++++++++++------- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index cba45ec26..bf2a162bb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ab626b78e088455e814b80debc85d420839bc11f95416491fef6a0460f2d95ed.yml -openapi_spec_hash: f6ae1bbed371a5d45927cd63797a9908 +openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 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 efa44b41c..68a64b274 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 @@ -106,7 +106,7 @@ private constructor( /** * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an expiration - * date will be generated. + * date five years in the future will be generated. Five years is the maximum expiration date. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -115,7 +115,8 @@ private constructor( /** * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an - * expiration date will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -591,7 +592,8 @@ private constructor( /** * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an - * expiration date will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. */ fun expMonth(expMonth: String) = apply { body.expMonth(expMonth) } @@ -605,7 +607,8 @@ private constructor( /** * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an - * expiration date will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. */ fun expYear(expYear: String) = apply { body.expYear(expYear) } @@ -1181,7 +1184,8 @@ private constructor( /** * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an - * expiration date will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -1190,7 +1194,8 @@ private constructor( /** * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an - * expiration date will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -1721,7 +1726,8 @@ private constructor( /** * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an - * expiration date will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. */ fun expMonth(expMonth: String) = expMonth(JsonField.of(expMonth)) @@ -1736,7 +1742,8 @@ private constructor( /** * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an - * expiration date will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. */ fun expYear(expYear: String) = expYear(JsonField.of(expYear)) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt index 0f50a0c78..a98d73c1e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt @@ -58,7 +58,7 @@ private constructor( /** * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an expiration - * date six years in the future will be generated. + * date five years in the future will be generated. Five years is the maximum expiration date. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -67,7 +67,8 @@ private constructor( /** * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an - * expiration date six years in the future will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -232,7 +233,8 @@ private constructor( /** * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an - * expiration date six years in the future will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. */ fun expMonth(expMonth: String) = apply { body.expMonth(expMonth) } @@ -246,7 +248,8 @@ private constructor( /** * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an - * expiration date six years in the future will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. */ fun expYear(expYear: String) = apply { body.expYear(expYear) } @@ -510,7 +513,8 @@ private constructor( /** * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an - * expiration date six years in the future will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -519,7 +523,8 @@ private constructor( /** * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an - * expiration date six years in the future will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -681,7 +686,8 @@ private constructor( /** * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an - * expiration date six years in the future will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. */ fun expMonth(expMonth: String) = expMonth(JsonField.of(expMonth)) @@ -696,7 +702,8 @@ private constructor( /** * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an - * expiration date six years in the future will be generated. + * expiration date five years in the future will be generated. Five years is the maximum + * expiration date. */ fun expYear(expYear: String) = expYear(JsonField.of(expYear)) From 0493d0ad4f3d8e45f35b652e670e505bcbfaf67a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 22:32:58 +0000 Subject: [PATCH 05/18] feat: support setting headers via env --- .../src/main/kotlin/com/lithic/api/core/ClientOptions.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt index f90712b8f..667a1df54 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt @@ -428,6 +428,14 @@ private constructor( } (System.getProperty("lithic.webhookSecret") ?: System.getenv("LITHIC_WEBHOOK_SECRET")) ?.let { webhookSecret(it) } + System.getenv("LITHIC_CUSTOM_HEADERS")?.let { customHeadersEnv -> + for (line in customHeadersEnv.split("\n")) { + val colon = line.indexOf(':') + if (colon >= 0) { + putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim()) + } + } + } } /** From a2900ed6d6c1dda7d5145329972e1acce7a5201f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 19:04:15 +0000 Subject: [PATCH 06/18] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bf2a162bb..6e83ca3b0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ab626b78e088455e814b80debc85d420839bc11f95416491fef6a0460f2d95ed.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d6101c64c957742cde9cfdc5d9213ce4e36aa43d045030fa142e27a46b60884a.yml openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 From 1f426b03a04940fa694e812d8886efaf4b4d2365 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 18:19:37 +0000 Subject: [PATCH 07/18] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6e83ca3b0..a6ff90866 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d6101c64c957742cde9cfdc5d9213ce4e36aa43d045030fa142e27a46b60884a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-d6101c64c957742cde9cfdc5d9213ce4e36aa43d045030fa142e27a46b60884a.yml openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 From 793c2b6023d0a490c367322620d1a8b5ab554554 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:27:06 +0000 Subject: [PATCH 08/18] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a6ff90866..e494edd93 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-d6101c64c957742cde9cfdc5d9213ce4e36aa43d045030fa142e27a46b60884a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0572da655d188e23459f2115b03b27040b4c4d3b47e4a86510803892d0d1b0aa.yml openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 From 1ccf96d80d888a5c0756ef5a115dd3e810f9f25b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 18:46:12 +0000 Subject: [PATCH 09/18] docs(api): improve event_tokens and transaction_token field docs in SettlementDetail --- .stats.yml | 4 ++-- .../com/lithic/api/models/SettlementDetail.kt | 22 +++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index e494edd93..5a9e4234e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0572da655d188e23459f2115b03b27040b4c4d3b47e4a86510803892d0d1b0aa.yml -openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-a46ebb10f6bb217a591206f0574450c324f108dbd32a2d62727cd8186d85e94f.yml +openapi_spec_hash: f320c173152f74b0799166b6ef5b82cd config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt index 300bd7349..bbbbeddfa 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt @@ -186,7 +186,8 @@ private constructor( fun disputesGrossAmount(): Long = disputesGrossAmount.getRequired("disputes_gross_amount") /** - * Globally unique identifiers denoting the Events associated with this settlement. + * Array of globally unique identifiers for the financial events that comprise this settlement. + * Use these tokens to access detailed event-level information. * * @throws LithicInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -262,7 +263,11 @@ private constructor( fun settlementDate(): String = settlementDate.getRequired("settlement_date") /** - * Globally unique identifier denoting the associated Transaction object. + * Globally unique identifier denoting the associated transaction. For settlement records with + * type `CLEARING`, `FINANCIAL`, or `NON-FINANCIAL`, this references a card transaction token. + * For settlement records with type `CHARGEBACK`, `REPRESENTMENT`, `PREARBITRATION`, + * `ARBITRATION`, or `COLLABORATION`, this references the dispute transaction token. May be null + * for certain settlement types. * * @throws LithicInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -676,7 +681,10 @@ private constructor( this.disputesGrossAmount = disputesGrossAmount } - /** Globally unique identifiers denoting the Events associated with this settlement. */ + /** + * Array of globally unique identifiers for the financial events that comprise this + * settlement. Use these tokens to access detailed event-level information. + */ fun eventTokens(eventTokens: List) = eventTokens(JsonField.of(eventTokens)) /** @@ -818,7 +826,13 @@ private constructor( this.settlementDate = settlementDate } - /** Globally unique identifier denoting the associated Transaction object. */ + /** + * Globally unique identifier denoting the associated transaction. For settlement records + * with type `CLEARING`, `FINANCIAL`, or `NON-FINANCIAL`, this references a card transaction + * token. For settlement records with type `CHARGEBACK`, `REPRESENTMENT`, `PREARBITRATION`, + * `ARBITRATION`, or `COLLABORATION`, this references the dispute transaction token. May be + * null for certain settlement types. + */ fun transactionToken(transactionToken: String) = transactionToken(JsonField.of(transactionToken)) From 746bf4a1c7e5de2f4c498d411422827c2107ffc5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 15:24:12 +0000 Subject: [PATCH 10/18] docs: clarify forwards compat behavior --- README.md | 4 +- .../api/client/okhttp/LithicOkHttpClient.kt | 3 + .../client/okhttp/LithicOkHttpClientAsync.kt | 3 + .../com/lithic/api/core/ClientOptions.kt | 6 + .../com/lithic/api/core/RequestOptions.kt | 9 + .../kotlin/com/lithic/api/models/Account.kt | 53 ++ .../models/AccountActivityListPageResponse.kt | 8 + .../api/models/AccountActivityListParams.kt | 27 ++ .../api/models/AccountActivityListResponse.kt | 115 +++++ ...ountActivityRetrieveTransactionResponse.kt | 115 +++++ .../api/models/AccountFinancialAccountType.kt | 8 + .../com/lithic/api/models/AccountHolder.kt | 91 ++++ .../api/models/AccountHolderCreateParams.kt | 78 +++ .../api/models/AccountHolderCreateResponse.kt | 26 + .../AccountHolderCreatedWebhookEvent.kt | 26 + ...ccountHolderDocumentUpdatedWebhookEvent.kt | 55 +++ .../lithic/api/models/AccountHolderEntity.kt | 35 ++ .../models/AccountHolderEntityCreateParams.kt | 27 ++ .../AccountHolderListDocumentsResponse.kt | 8 + .../models/AccountHolderListPageResponse.kt | 8 + ...rSimulateEnrollmentDocumentReviewParams.kt | 27 ++ ...untHolderSimulateEnrollmentReviewParams.kt | 27 ++ ...tHolderSimulateEnrollmentReviewResponse.kt | 92 ++++ .../api/models/AccountHolderUpdateParams.kt | 98 ++++ .../api/models/AccountHolderUpdateResponse.kt | 155 ++++++ .../AccountHolderUpdatedWebhookEvent.kt | 154 ++++++ .../AccountHolderUploadDocumentParams.kt | 18 + .../AccountHolderVerificationWebhookEvent.kt | 26 + .../api/models/AccountListPageResponse.kt | 8 + .../lithic/api/models/AccountSpendLimits.kt | 35 ++ .../lithic/api/models/AccountUpdateParams.kt | 36 ++ .../kotlin/com/lithic/api/models/Address.kt | 8 + .../com/lithic/api/models/AddressUpdate.kt | 8 + .../kotlin/com/lithic/api/models/ApiStatus.kt | 8 + .../kotlin/com/lithic/api/models/AuthRule.kt | 134 ++++++ .../lithic/api/models/AuthRuleCondition.kt | 8 + .../models/AuthRuleV2BacktestCreateParams.kt | 9 + .../api/models/AuthRuleV2CreateParams.kt | 218 +++++++++ .../api/models/AuthRuleV2DraftParams.kt | 47 ++ .../api/models/AuthRuleV2ListPageResponse.kt | 8 + .../lithic/api/models/AuthRuleV2ListParams.kt | 9 + .../AuthRuleV2ListResultsPageResponse.kt | 8 + .../api/models/AuthRuleV2UpdateParams.kt | 98 ++++ .../com/lithic/api/models/AuthRuleVersion.kt | 55 +++ ...hRulesBacktestReportCreatedWebhookEvent.kt | 17 + .../com/lithic/api/models/AuthStreamSecret.kt | 8 + .../models/AuthenticationSimulateResponse.kt | 8 + .../api/models/BacktestCreateResponse.kt | 8 + .../com/lithic/api/models/BacktestResults.kt | 26 + .../com/lithic/api/models/BacktestStats.kt | 27 ++ .../kotlin/com/lithic/api/models/Balance.kt | 17 + .../api/models/BalanceListPageResponse.kt | 8 + .../lithic/api/models/BalanceListParams.kt | 9 + .../api/models/BalanceUpdatedWebhookEvent.kt | 17 + .../api/models/BookTransferCreateParams.kt | 36 ++ .../models/BookTransferListPageResponse.kt | 8 + .../api/models/BookTransferListParams.kt | 27 ++ .../lithic/api/models/BookTransferResponse.kt | 92 ++++ .../api/models/BookTransferRetryParams.kt | 9 + .../api/models/BookTransferReverseParams.kt | 9 + ...kTransferTransactionCreatedWebhookEvent.kt | 17 + ...kTransferTransactionUpdatedWebhookEvent.kt | 17 + .../main/kotlin/com/lithic/api/models/Card.kt | 8 + ...uthorizationApprovalRequestWebhookEvent.kt | 334 +++++++++++++ ...horizationChallengeResponseWebhookEvent.kt | 35 ++ .../api/models/CardBalanceListPageResponse.kt | 8 + .../com/lithic/api/models/CardBulkOrder.kt | 26 + .../api/models/CardBulkOrderCreateParams.kt | 18 + .../models/CardBulkOrderListPageResponse.kt | 8 + .../api/models/CardBulkOrderUpdateParams.kt | 18 + .../api/models/CardConvertPhysicalParams.kt | 18 + .../api/models/CardConvertedWebhookEvent.kt | 17 + .../com/lithic/api/models/CardCreateParams.kt | 45 ++ .../api/models/CardCreatedWebhookEvent.kt | 17 + ...ardFinancialTransactionListPageResponse.kt | 8 + .../CardFinancialTransactionListParams.kt | 27 ++ .../lithic/api/models/CardListPageResponse.kt | 8 + .../com/lithic/api/models/CardListParams.kt | 9 + .../com/lithic/api/models/CardProgram.kt | 8 + .../api/models/CardProgramListPageResponse.kt | 8 + .../lithic/api/models/CardProvisionParams.kt | 18 + .../api/models/CardProvisionResponse.kt | 46 ++ .../lithic/api/models/CardReissueParams.kt | 18 + .../api/models/CardReissuedWebhookEvent.kt | 17 + .../com/lithic/api/models/CardRenewParams.kt | 18 + .../api/models/CardRenewedWebhookEvent.kt | 17 + .../api/models/CardSearchByPanParams.kt | 9 + .../api/models/CardShippedWebhookEvent.kt | 26 + .../com/lithic/api/models/CardSpendLimits.kt | 35 ++ ...nsactionEnhancedDataCreatedWebhookEvent.kt | 17 + ...nsactionEnhancedDataUpdatedWebhookEvent.kt | 17 + .../CardTransactionUpdatedWebhookEvent.kt | 17 + .../com/lithic/api/models/CardUpdateParams.kt | 36 ++ .../api/models/CardUpdatedWebhookEvent.kt | 17 + .../api/models/CardWebProvisionParams.kt | 18 + .../api/models/CardWebProvisionResponse.kt | 75 +++ .../api/models/CardholderAuthentication.kt | 44 ++ .../kotlin/com/lithic/api/models/Carrier.kt | 8 + .../com/lithic/api/models/CategoryBalances.kt | 8 + .../com/lithic/api/models/CategoryDetails.kt | 8 + .../com/lithic/api/models/CategoryTier.kt | 8 + .../lithic/api/models/ChallengeResponse.kt | 8 + .../com/lithic/api/models/ChallengeResult.kt | 8 + .../models/Conditional3dsActionParameters.kt | 36 ++ .../models/ConditionalAchActionParameters.kt | 115 +++++ .../lithic/api/models/ConditionalAttribute.kt | 8 + ...onditionalAuthorizationActionParameters.kt | 66 +++ .../api/models/ConditionalBlockParameters.kt | 8 + .../lithic/api/models/ConditionalOperation.kt | 8 + ...ConditionalTokenizationActionParameters.kt | 125 +++++ .../com/lithic/api/models/ConditionalValue.kt | 37 ++ .../CreditProductPrimeRateCreateParams.kt | 9 + .../DecisioningRetrieveSecretResponse.kt | 8 + .../kotlin/com/lithic/api/models/Device.kt | 8 + .../com/lithic/api/models/DigitalCardArt.kt | 17 + .../models/DigitalCardArtListPageResponse.kt | 8 + ...TokenizationApprovalRequestWebhookEvent.kt | 63 +++ ...talWalletTokenizationResultWebhookEvent.kt | 36 ++ ...actorAuthenticationCodeSentWebhookEvent.kt | 36 ++ ...TwoFactorAuthenticationCodeWebhookEvent.kt | 36 ++ ...alWalletTokenizationUpdatedWebhookEvent.kt | 17 + .../kotlin/com/lithic/api/models/Dispute.kt | 35 ++ .../lithic/api/models/DisputeCreateParams.kt | 18 + .../com/lithic/api/models/DisputeEvidence.kt | 17 + ...DisputeEvidenceUploadFailedWebhookEvent.kt | 17 + .../DisputeInitiateEvidenceUploadParams.kt | 9 + .../DisputeListEvidencesPageResponse.kt | 8 + .../api/models/DisputeListPageResponse.kt | 8 + .../lithic/api/models/DisputeListParams.kt | 9 + .../DisputeTransactionCreatedWebhookEvent.kt | 17 + .../DisputeTransactionUpdatedWebhookEvent.kt | 17 + .../lithic/api/models/DisputeUpdateParams.kt | 18 + .../api/models/DisputeUpdatedWebhookEvent.kt | 17 + .../kotlin/com/lithic/api/models/DisputeV2.kt | 242 ++++++++++ .../api/models/DisputesV2ListPageResponse.kt | 8 + .../kotlin/com/lithic/api/models/Document.kt | 56 +++ .../EnhancedCommercialDataRetrieveResponse.kt | 8 + .../com/lithic/api/models/EnhancedData.kt | 106 ++++ .../lithic/api/models/EntityCreateResponse.kt | 26 + .../kotlin/com/lithic/api/models/Event.kt | 26 + .../models/EventListAttemptsPageResponse.kt | 8 + .../api/models/EventListAttemptsParams.kt | 9 + .../api/models/EventListPageResponse.kt | 8 + .../com/lithic/api/models/EventListParams.kt | 9 + .../com/lithic/api/models/EventStream.kt | 8 + .../lithic/api/models/EventSubscription.kt | 17 + .../models/EventSubscriptionCreateParams.kt | 18 + ...entSubscriptionListAttemptsPageResponse.kt | 8 + .../EventSubscriptionListAttemptsParams.kt | 9 + .../EventSubscriptionListPageResponse.kt | 8 + ...tSubscriptionSendSimulatedExampleParams.kt | 18 + .../models/EventSubscriptionUpdateParams.kt | 18 + .../com/lithic/api/models/ExtendedCredit.kt | 8 + .../lithic/api/models/ExternalBankAccount.kt | 35 ++ .../api/models/ExternalBankAccountAddress.kt | 8 + .../models/ExternalBankAccountCreateParams.kt | 118 +++++ .../ExternalBankAccountCreateResponse.kt | 53 ++ .../ExternalBankAccountCreatedWebhookEvent.kt | 17 + .../ExternalBankAccountListPageResponse.kt | 8 + .../models/ExternalBankAccountListParams.kt | 27 ++ .../models/ExternalBankAccountListResponse.kt | 53 ++ ...rnalBankAccountMicroDepositCreateParams.kt | 9 + .../ExternalBankAccountRetrieveResponse.kt | 53 ++ ...rnalBankAccountRetryMicroDepositsParams.kt | 9 + ...alBankAccountRetryMicroDepositsResponse.kt | 53 ++ .../ExternalBankAccountRetryPrenoteParams.kt | 9 + ...lBankAccountSetVerificationMethodParams.kt | 18 + .../models/ExternalBankAccountUpdateParams.kt | 18 + .../ExternalBankAccountUpdateResponse.kt | 53 ++ .../ExternalBankAccountUpdatedWebhookEvent.kt | 17 + .../com/lithic/api/models/ExternalPayment.kt | 92 ++++ .../api/models/ExternalPaymentCancelParams.kt | 9 + .../api/models/ExternalPaymentCreateParams.kt | 36 ++ .../ExternalPaymentCreatedWebhookEvent.kt | 17 + .../models/ExternalPaymentListPageResponse.kt | 8 + .../api/models/ExternalPaymentListParams.kt | 27 ++ .../models/ExternalPaymentReleaseParams.kt | 9 + .../models/ExternalPaymentReverseParams.kt | 9 + .../api/models/ExternalPaymentSettleParams.kt | 18 + .../ExternalPaymentUpdatedWebhookEvent.kt | 17 + .../com/lithic/api/models/ExternalResource.kt | 8 + .../lithic/api/models/ExternalResourceType.kt | 8 + .../com/lithic/api/models/FinancialAccount.kt | 54 +++ .../api/models/FinancialAccountBalance.kt | 17 + ...FinancialAccountBalanceListPageResponse.kt | 8 + .../models/FinancialAccountCreateParams.kt | 18 + .../FinancialAccountCreatedWebhookEvent.kt | 17 + .../models/FinancialAccountCreditConfig.kt | 17 + ...lAccountCreditConfigurationUpdateParams.kt | 18 + ...untInterestTierScheduleListPageResponse.kt | 8 + ...AccountInterestTierScheduleUpdateParams.kt | 9 + .../FinancialAccountListPageResponse.kt | 8 + .../api/models/FinancialAccountListParams.kt | 9 + ...inancialAccountLoanTapeListPageResponse.kt | 8 + ...ncialAccountRegisterAccountNumberParams.kt | 9 + .../models/FinancialAccountUpdateParams.kt | 9 + .../FinancialAccountUpdateStatusParams.kt | 27 ++ .../FinancialAccountUpdatedWebhookEvent.kt | 17 + .../com/lithic/api/models/FinancialEvent.kt | 26 + .../lithic/api/models/FinancialTransaction.kt | 35 ++ .../FinancialTransactionListPageResponse.kt | 8 + .../models/FinancialTransactionListParams.kt | 27 ++ .../models/FraudTransactionReportParams.kt | 27 ++ .../com/lithic/api/models/FundingEvent.kt | 26 + .../models/FundingEventCreatedWebhookEvent.kt | 17 + .../models/FundingEventListPageResponse.kt | 8 + .../FundingEventRetrieveDetailsResponse.kt | 8 + .../main/kotlin/com/lithic/api/models/Hold.kt | 35 ++ .../com/lithic/api/models/HoldCreateParams.kt | 9 + .../kotlin/com/lithic/api/models/HoldEvent.kt | 35 ++ .../lithic/api/models/HoldListPageResponse.kt | 8 + .../com/lithic/api/models/HoldListParams.kt | 9 + .../com/lithic/api/models/HoldVoidParams.kt | 9 + .../models/InstanceFinancialAccountType.kt | 8 + .../lithic/api/models/InterestTierSchedule.kt | 8 + .../lithic/api/models/InternalTransaction.kt | 64 +++ .../InternalTransactionCreatedWebhookEvent.kt | 17 + .../InternalTransactionUpdatedWebhookEvent.kt | 17 + .../main/kotlin/com/lithic/api/models/Kyb.kt | 35 ++ .../lithic/api/models/KybBusinessEntity.kt | 17 + .../main/kotlin/com/lithic/api/models/Kyc.kt | 26 + .../kotlin/com/lithic/api/models/KycExempt.kt | 26 + .../kotlin/com/lithic/api/models/LoanTape.kt | 103 ++++ .../api/models/LoanTapeConfiguration.kt | 8 + .../api/models/LoanTapeCreatedWebhookEvent.kt | 17 + .../models/LoanTapeRebuildConfiguration.kt | 8 + .../api/models/LoanTapeUpdatedWebhookEvent.kt | 17 + .../models/ManagementOperationCreateParams.kt | 45 ++ .../ManagementOperationCreatedWebhookEvent.kt | 17 + .../ManagementOperationListPageResponse.kt | 8 + .../models/ManagementOperationListParams.kt | 18 + .../ManagementOperationReverseParams.kt | 9 + .../models/ManagementOperationTransaction.kt | 101 ++++ .../ManagementOperationUpdatedWebhookEvent.kt | 17 + .../kotlin/com/lithic/api/models/Merchant.kt | 8 + .../api/models/MerchantLockParameters.kt | 17 + .../com/lithic/api/models/MessageAttempt.kt | 17 + .../api/models/MicroDepositCreateResponse.kt | 53 ++ .../com/lithic/api/models/NetworkProgram.kt | 8 + .../models/NetworkProgramListPageResponse.kt | 8 + .../com/lithic/api/models/NetworkTotal.kt | 26 + .../models/NetworkTotalCreatedWebhookEvent.kt | 17 + .../models/NetworkTotalUpdatedWebhookEvent.kt | 17 + .../com/lithic/api/models/NonPciCard.kt | 73 +++ .../kotlin/com/lithic/api/models/OwnerType.kt | 8 + .../lithic/api/models/ParsedWebhookEvent.kt | 154 ++++++ .../kotlin/com/lithic/api/models/Payment.kt | 206 ++++++++ .../lithic/api/models/PaymentCreateParams.kt | 55 +++ .../api/models/PaymentCreateResponse.kt | 8 + .../api/models/PaymentListPageResponse.kt | 8 + .../lithic/api/models/PaymentListParams.kt | 27 ++ .../lithic/api/models/PaymentRetryResponse.kt | 8 + .../lithic/api/models/PaymentReturnParams.kt | 9 + .../api/models/PaymentSimulateActionParams.kt | 27 ++ .../models/PaymentSimulateActionResponse.kt | 17 + .../models/PaymentSimulateReceiptParams.kt | 18 + .../models/PaymentSimulateReceiptResponse.kt | 17 + .../models/PaymentSimulateReleaseParams.kt | 9 + .../models/PaymentSimulateReleaseResponse.kt | 17 + .../api/models/PaymentSimulateReturnParams.kt | 9 + .../models/PaymentSimulateReturnResponse.kt | 17 + .../PaymentTransactionCreatedWebhookEvent.kt | 17 + .../PaymentTransactionUpdatedWebhookEvent.kt | 17 + .../api/models/PrimeRateRetrieveResponse.kt | 17 + .../lithic/api/models/ProvisionResponse.kt | 8 + ...ReportSettlementListDetailsPageResponse.kt | 8 + ...tSettlementNetworkTotalListPageResponse.kt | 8 + .../ReportSettlementNetworkTotalListParams.kt | 9 + .../com/lithic/api/models/ReportStats.kt | 255 ++++++++++ .../com/lithic/api/models/RequiredDocument.kt | 8 + .../ResponderEndpointCheckStatusParams.kt | 9 + .../models/ResponderEndpointCreateParams.kt | 18 + .../models/ResponderEndpointCreateResponse.kt | 8 + .../models/ResponderEndpointDeleteParams.kt | 9 + .../api/models/ResponderEndpointStatus.kt | 8 + .../com/lithic/api/models/RuleFeature.kt | 228 +++++++++ .../com/lithic/api/models/SettlementDetail.kt | 35 ++ .../com/lithic/api/models/SettlementReport.kt | 8 + .../SettlementReportUpdatedWebhookEvent.kt | 17 + .../api/models/SettlementSummaryDetails.kt | 17 + .../com/lithic/api/models/ShippingAddress.kt | 8 + .../lithic/api/models/SpendLimitDuration.kt | 8 + .../kotlin/com/lithic/api/models/Statement.kt | 103 ++++ .../lithic/api/models/StatementLineItems.kt | 37 ++ .../com/lithic/api/models/StatementTotals.kt | 8 + .../com/lithic/api/models/Statements.kt | 8 + .../models/StatementsCreatedWebhookEvent.kt | 17 + .../SubscriptionRetrieveSecretResponse.kt | 8 + .../api/models/ThreeDSAuthentication.kt | 281 +++++++++++ ...thenticationApprovalRequestWebhookEvent.kt | 17 + ...eeDSAuthenticationChallengeWebhookEvent.kt | 36 ++ ...hreeDSAuthenticationCreatedWebhookEvent.kt | 17 + ...eDSAuthenticationSimulateOtpEntryParams.kt | 9 + .../ThreeDSAuthenticationSimulateParams.kt | 36 ++ ...hreeDSAuthenticationUpdatedWebhookEvent.kt | 17 + .../kotlin/com/lithic/api/models/TokenInfo.kt | 17 + .../com/lithic/api/models/TokenMetadata.kt | 36 ++ .../com/lithic/api/models/Tokenization.kt | 64 +++ ...TokenizationApprovalRequestWebhookEvent.kt | 63 +++ ...nizationDecisioningRotateSecretResponse.kt | 8 + .../api/models/TokenizationDeclineReason.kt | 8 + .../models/TokenizationListPageResponse.kt | 8 + .../api/models/TokenizationListParams.kt | 9 + .../TokenizationResendActivationCodeParams.kt | 18 + .../models/TokenizationResultWebhookEvent.kt | 36 ++ .../api/models/TokenizationRuleResult.kt | 17 + .../lithic/api/models/TokenizationSecret.kt | 8 + .../api/models/TokenizationSimulateParams.kt | 27 ++ .../api/models/TokenizationTfaReason.kt | 8 + ...actorAuthenticationCodeSentWebhookEvent.kt | 36 ++ ...TwoFactorAuthenticationCodeWebhookEvent.kt | 36 ++ .../TokenizationUpdateDigitalCardArtParams.kt | 9 + .../models/TokenizationUpdatedWebhookEvent.kt | 17 + .../com/lithic/api/models/Transaction.kt | 418 ++++++++++++++++ .../api/models/TransactionListPageResponse.kt | 8 + .../api/models/TransactionListParams.kt | 18 + .../api/models/TransactionReportResponse.kt | 26 + .../api/models/TransactionRetrieveResponse.kt | 26 + ...actionSimulateAuthorizationAdviceParams.kt | 9 + ...tionSimulateAuthorizationAdviceResponse.kt | 8 + .../TransactionSimulateAuthorizationParams.kt | 18 + ...ransactionSimulateAuthorizationResponse.kt | 8 + .../TransactionSimulateClearingParams.kt | 9 + .../TransactionSimulateClearingResponse.kt | 8 + ...SimulateCreditAuthorizationAdviceParams.kt | 9 + ...mulateCreditAuthorizationAdviceResponse.kt | 8 + ...actionSimulateCreditAuthorizationParams.kt | 9 + ...tionSimulateCreditAuthorizationResponse.kt | 8 + .../models/TransactionSimulateReturnParams.kt | 9 + .../TransactionSimulateReturnResponse.kt | 8 + ...TransactionSimulateReturnReversalParams.kt | 9 + ...ansactionSimulateReturnReversalResponse.kt | 8 + .../models/TransactionSimulateVoidParams.kt | 18 + .../models/TransactionSimulateVoidResponse.kt | 8 + .../kotlin/com/lithic/api/models/Transfer.kt | 35 ++ .../lithic/api/models/TransferCreateParams.kt | 9 + .../api/models/TransferLimitsResponse.kt | 37 ++ .../api/models/TypescriptCodeParameters.kt | 8 + .../api/models/V2ListResultsResponse.kt | 453 ++++++++++++++++++ .../api/models/V2ListVersionsResponse.kt | 8 + .../api/models/V2RetrieveFeaturesResponse.kt | 37 ++ .../api/models/V2RetrieveReportResponse.kt | 17 + .../lithic/api/models/VelocityLimitFilters.kt | 17 + .../lithic/api/models/VelocityLimitParams.kt | 17 + .../lithic/api/models/VelocityLimitPeriod.kt | 132 +++++ .../lithic/api/models/VerificationMethod.kt | 8 + .../api/models/WalletDecisioningInfo.kt | 8 + .../com/lithic/api/models/WirePartyDetails.kt | 8 + 348 files changed, 10903 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0af7be254..c4538513a 100644 --- a/README.md +++ b/README.md @@ -751,7 +751,9 @@ In rare cases, the API may return a response that doesn't match the expected typ By default, the SDK will not throw an exception in this case. It will throw [`LithicInvalidDataException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicInvalidDataException.kt) only if you directly access the property. -If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`: +Validating the response is _not_ forwards compatible with new types from the API for existing fields. + +If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`: ```java import com.lithic.api.models.Card; diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt index 824255b18..b18253dd6 100644 --- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt +++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt @@ -236,6 +236,9 @@ class LithicOkHttpClient private constructor() { /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt index 9224b3804..ac8fa16b4 100644 --- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt +++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt @@ -236,6 +236,9 @@ class LithicOkHttpClientAsync private constructor() { /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt index 667a1df54..4a5bdd8c2 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt @@ -80,6 +80,9 @@ private constructor( /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for existing + * fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ @@ -275,6 +278,9 @@ private constructor( /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/RequestOptions.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/RequestOptions.kt index ee9fe54c2..4ff16b664 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/RequestOptions.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/RequestOptions.kt @@ -33,6 +33,15 @@ class RequestOptions private constructor(val responseValidation: Boolean?, val t private var responseValidation: Boolean? = null private var timeout: Timeout? = null + /** + * Whether to call `validate` on the response before returning it. + * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * + * Defaults to false, which means the shape of the response will not be validated upfront. + * Instead, validation will only occur for the parts of the response that are accessed. + */ fun responseValidation(responseValidation: Boolean) = apply { this.responseValidation = responseValidation } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt index 076c8a777..a34b3df3d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt @@ -586,6 +586,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Account = apply { if (validated) { return@apply @@ -820,6 +828,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SpendLimit = apply { if (validated) { return@apply @@ -977,6 +994,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1254,6 +1280,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolder = apply { if (validated) { return@apply @@ -1461,6 +1496,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Substatus = apply { if (validated) { return@apply @@ -1799,6 +1843,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationAddress = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt index db504ef48..7fc1a6eb9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt @@ -218,6 +218,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountActivityListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt index b368fcff1..037acc597 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt @@ -582,6 +582,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionCategory = apply { if (validated) { return@apply @@ -708,6 +717,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -864,6 +882,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt index 0ad887846..022943a3b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt @@ -116,6 +116,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = accountActivityListResponse.accept(new AccountActivityListResponse.Visitor>() { + * @Override + * public Optional visitInternal(FinancialTransaction internal_) { + * return Optional.of(internal_.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { internal_ != null -> visitor.visitInternal(internal_) @@ -130,6 +159,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountActivityListResponse = apply { if (validated) { return@apply @@ -994,6 +1031,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialTransaction = apply { if (validated) { return@apply @@ -1262,6 +1308,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionCategory = apply { if (validated) { return@apply @@ -1386,6 +1442,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Family = apply { if (validated) { return@apply @@ -1520,6 +1586,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -1678,6 +1754,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply @@ -3219,6 +3305,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardTransaction = apply { if (validated) { return@apply @@ -3388,6 +3483,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Family = apply { if (validated) { return@apply @@ -3546,6 +3651,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt index 10fb37151..44cdf66df 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt @@ -116,6 +116,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = accountActivityRetrieveTransactionResponse.accept(new AccountActivityRetrieveTransactionResponse.Visitor>() { + * @Override + * public Optional visitInternal(FinancialTransaction internal_) { + * return Optional.of(internal_.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { internal_ != null -> visitor.visitInternal(internal_) @@ -130,6 +159,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountActivityRetrieveTransactionResponse = apply { if (validated) { return@apply @@ -1016,6 +1053,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialTransaction = apply { if (validated) { return@apply @@ -1284,6 +1330,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionCategory = apply { if (validated) { return@apply @@ -1408,6 +1464,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Family = apply { if (validated) { return@apply @@ -1542,6 +1608,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -1700,6 +1776,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply @@ -3241,6 +3327,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardTransaction = apply { if (validated) { return@apply @@ -3410,6 +3505,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Family = apply { if (validated) { return@apply @@ -3568,6 +3673,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountFinancialAccountType.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountFinancialAccountType.kt index c69e04f63..b71436641 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountFinancialAccountType.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountFinancialAccountType.kt @@ -100,6 +100,14 @@ private constructor(private val value: JsonField) : Enum { private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountFinancialAccountType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt index 2c2f571fe..ef3c727a0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt @@ -999,6 +999,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolder = apply { if (validated) { return@apply @@ -1407,6 +1415,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderIndividualResponse = apply { if (validated) { return@apply @@ -1883,6 +1900,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderBusinessResponse = apply { if (validated) { return@apply @@ -2049,6 +2075,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExemptionType = apply { if (validated) { return@apply @@ -2200,6 +2235,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -2382,6 +2426,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatusReason = apply { if (validated) { return@apply @@ -2513,6 +2566,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UserType = apply { if (validated) { return@apply @@ -2790,6 +2852,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderVerificationApplication = apply { if (validated) { return@apply @@ -2938,6 +3009,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -3123,6 +3204,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatusReason = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt index 8445efb3b..6e3edd9f5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt @@ -262,6 +262,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitKyb(Kyb kyb) { + * return Optional.of(kyb.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { kyb != null -> visitor.visitKyb(kyb) @@ -273,6 +302,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -968,6 +1006,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KybDelegated = apply { if (validated) { return@apply @@ -1386,6 +1434,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): KybDelegatedBusinessEntity = apply { if (validated) { return@apply @@ -1845,6 +1903,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): KybDelegatedIndividual = apply { if (validated) { return@apply @@ -2007,6 +2075,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Workflow = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt index c6820f40c..9044f05ec 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt @@ -409,6 +409,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderCreateResponse = apply { if (validated) { return@apply @@ -558,6 +566,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -869,6 +886,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatusReasons = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreatedWebhookEvent.kt index b36c267e8..ef2933d6e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreatedWebhookEvent.kt @@ -384,6 +384,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderCreatedWebhookEvent = apply { if (validated) { return@apply @@ -506,6 +514,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -632,6 +649,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderDocumentUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderDocumentUpdatedWebhookEvent.kt index cdde246aa..82898d45b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderDocumentUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderDocumentUpdatedWebhookEvent.kt @@ -388,6 +388,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderDocumentUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -510,6 +518,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -741,6 +758,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DocumentType = apply { if (validated) { return@apply @@ -1191,6 +1217,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RequiredDocumentUpload = apply { if (validated) { return@apply @@ -1326,6 +1361,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ImageType = apply { if (validated) { return@apply @@ -1479,6 +1524,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DocumentUploadStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntity.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntity.kt index 47572e3d8..521a8e3be 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntity.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntity.kt @@ -474,6 +474,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderEntity = apply { if (validated) { return@apply @@ -821,6 +829,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Address = apply { if (validated) { return@apply @@ -986,6 +1003,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityStatus = apply { if (validated) { return@apply @@ -1114,6 +1140,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntityCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntityCreateParams.kt index fc08f3045..d9d39ec2d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntityCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntityCreateParams.kt @@ -897,6 +897,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreateEntityRequest = apply { if (validated) { return@apply @@ -1281,6 +1290,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Address = apply { if (validated) { return@apply @@ -1433,6 +1451,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListDocumentsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListDocumentsResponse.kt index 97fa2d330..b790c1a47 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListDocumentsResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListDocumentsResponse.kt @@ -136,6 +136,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderListDocumentsResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListPageResponse.kt index 0390db024..059394d75 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListPageResponse.kt @@ -181,6 +181,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentDocumentReviewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentDocumentReviewParams.kt index ff1c258e4..e6471981d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentDocumentReviewParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentDocumentReviewParams.kt @@ -643,6 +643,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SimulateEnrollmentDocumentReviewRequest = apply { if (validated) { return@apply @@ -805,6 +814,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -997,6 +1015,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DocumentUploadStatusReasons = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewParams.kt index 94680149b..72877df47 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewParams.kt @@ -528,6 +528,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SimulateEnrollmentReviewRequest = apply { if (validated) { return@apply @@ -675,6 +684,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -958,6 +976,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatusReason = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt index 1c070317d..2fbef4a30 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt @@ -1007,6 +1007,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderSimulateEnrollmentReviewResponse = apply { if (validated) { return@apply @@ -1408,6 +1416,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Individual = apply { if (validated) { return@apply @@ -1770,6 +1787,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Address = apply { if (validated) { return@apply @@ -1970,6 +1997,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExemptionType = apply { if (validated) { return@apply @@ -2113,6 +2149,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -2424,6 +2469,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatusReasons = apply { if (validated) { return@apply @@ -2557,6 +2611,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UserType = apply { if (validated) { return@apply @@ -2888,6 +2951,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationApplication = apply { if (validated) { return@apply @@ -3032,6 +3104,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -3348,6 +3430,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatusReasons = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateParams.kt index 8d405a3ad..5150871fe 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateParams.kt @@ -285,6 +285,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitKybPatchRequest(KybPatchRequest kybPatchRequest) { + * return Optional.of(kybPatchRequest.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { kybPatchRequest != null -> visitor.visitKybPatchRequest(kybPatchRequest) @@ -295,6 +324,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -887,6 +925,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KybPatchRequest = apply { if (validated) { return@apply @@ -1350,6 +1398,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): IndividualPatch = apply { if (validated) { return@apply @@ -1841,6 +1899,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): KybBusinessEntityPatch = apply { if (validated) { return@apply @@ -2105,6 +2173,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KycPatchRequest = apply { if (validated) { return@apply @@ -2560,6 +2638,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): IndividualPatch = apply { if (validated) { return@apply @@ -3019,6 +3107,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PatchRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt index 4b7bbe625..2ac0fd197 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt @@ -55,6 +55,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = accountHolderUpdateResponse.accept(new AccountHolderUpdateResponse.Visitor>() { + * @Override + * public Optional visitKybKycPatch(KybKycPatchResponse kybKycPatch) { + * return Optional.of(kybKycPatch.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { kybKycPatch != null -> visitor.visitKybKycPatch(kybKycPatch) @@ -64,6 +93,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderUpdateResponse = apply { if (validated) { return@apply @@ -1203,6 +1240,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KybKycPatchResponse = apply { if (validated) { return@apply @@ -1619,6 +1665,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Individual = apply { if (validated) { return@apply @@ -1992,6 +2048,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Address = apply { if (validated) { return@apply @@ -2194,6 +2260,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExemptionType = apply { if (validated) { return@apply @@ -2341,6 +2417,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -2657,6 +2743,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatusReasons = apply { if (validated) { return@apply @@ -2795,6 +2891,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UserType = apply { if (validated) { return@apply @@ -3142,6 +3248,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationApplication = apply { if (validated) { return@apply @@ -3288,6 +3404,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -3607,6 +3733,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): StatusReasons = apply { if (validated) { return@apply @@ -4108,6 +4244,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PatchResponse = apply { if (validated) { return@apply @@ -4469,6 +4614,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Address = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdatedWebhookEvent.kt index 2853c9250..0f5e90f6f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdatedWebhookEvent.kt @@ -69,6 +69,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = accountHolderUpdatedWebhookEvent.accept(new AccountHolderUpdatedWebhookEvent.Visitor>() { + * @Override + * public Optional visitKybPayload(KybPayload kybPayload) { + * return Optional.of(kybPayload.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { kybPayload != null -> visitor.visitKybPayload(kybPayload) @@ -79,6 +108,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -615,6 +652,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KybPayload = apply { if (validated) { return@apply @@ -899,6 +945,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateRequest = apply { if (validated) { return@apply @@ -1296,6 +1352,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Individual = apply { if (validated) { return@apply @@ -1676,6 +1742,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Address = apply { if (validated) { return@apply @@ -1896,6 +1972,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -2202,6 +2288,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KycPayload = apply { if (validated) { return@apply @@ -2349,6 +2444,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateRequest = apply { if (validated) { return@apply @@ -2744,6 +2849,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Individual = apply { if (validated) { return@apply @@ -3124,6 +3239,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Address = apply { if (validated) { return@apply @@ -3335,6 +3460,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -3872,6 +4007,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LegacyPayload = apply { if (validated) { return@apply @@ -4005,6 +4149,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUploadDocumentParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUploadDocumentParams.kt index caf308a7d..216c21253 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUploadDocumentParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUploadDocumentParams.kt @@ -482,6 +482,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -725,6 +734,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DocumentType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderVerificationWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderVerificationWebhookEvent.kt index 63533cca8..36d14a8b9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderVerificationWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderVerificationWebhookEvent.kt @@ -325,6 +325,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderVerificationWebhookEvent = apply { if (validated) { return@apply @@ -445,6 +453,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -577,6 +594,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountListPageResponse.kt index 9de383f89..08833c296 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountListPageResponse.kt @@ -178,6 +178,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt index 6e914fdfa..cba0e614b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt @@ -207,6 +207,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountSpendLimits = apply { if (validated) { return@apply @@ -410,6 +418,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AvailableSpendLimit = apply { if (validated) { return@apply @@ -624,6 +641,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SpendLimit = apply { if (validated) { return@apply @@ -850,6 +876,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SpendVelocity = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt index d84a4d310..9fd8d821c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt @@ -942,6 +942,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1110,6 +1119,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1299,6 +1317,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Substatus = apply { if (validated) { return@apply @@ -1595,6 +1622,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationAddress = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Address.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Address.kt index 251f675b2..b33a4f5a8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Address.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Address.kt @@ -311,6 +311,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Address = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AddressUpdate.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AddressUpdate.kt index f62d09bce..80554daec 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AddressUpdate.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AddressUpdate.kt @@ -286,6 +286,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AddressUpdate = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ApiStatus.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ApiStatus.kt index 0ec8538f5..e2529b0c3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ApiStatus.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ApiStatus.kt @@ -109,6 +109,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ApiStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt index 6741e8056..213e89ab7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt @@ -821,6 +821,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRule = apply { if (validated) { return@apply @@ -1092,6 +1100,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CurrentVersion = apply { if (validated) { return@apply @@ -1210,6 +1227,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = parameters.accept(new Parameters.Visitor>() { + * @Override + * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) { + * return Optional.of(conditionalBlock.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock) @@ -1230,6 +1277,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Parameters = apply { if (validated) { return@apply @@ -1890,6 +1947,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DraftVersion = apply { if (validated) { return@apply @@ -2012,6 +2078,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = parameters.accept(new Parameters.Visitor>() { + * @Override + * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) { + * return Optional.of(conditionalBlock.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock) @@ -2032,6 +2128,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Parameters = apply { if (validated) { return@apply @@ -2470,6 +2576,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -2623,6 +2739,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleState = apply { if (validated) { return@apply @@ -2782,6 +2907,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt index 36cc454d0..24b8c8aba 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt @@ -312,6 +312,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleCondition = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2BacktestCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2BacktestCreateParams.kt index 12f72e913..6a572b839 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2BacktestCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2BacktestCreateParams.kt @@ -435,6 +435,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BacktestRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt index c90ef0ae5..6b25888a8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt @@ -246,6 +246,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitAccountLevelRule(AccountLevelRule accountLevelRule) { + * return Optional.of(accountLevelRule.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { accountLevelRule != null -> visitor.visitAccountLevelRule(accountLevelRule) @@ -256,6 +285,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -860,6 +898,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountLevelRule = apply { if (validated) { return@apply @@ -994,6 +1042,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = parameters.accept(new Parameters.Visitor>() { + * @Override + * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) { + * return Optional.of(conditionalBlock.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock) @@ -1018,6 +1096,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Parameters = apply { if (validated) { return@apply @@ -1501,6 +1589,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): AuthRuleType = apply { if (validated) { return@apply @@ -1951,6 +2049,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardLevelRule = apply { if (validated) { return@apply @@ -2083,6 +2191,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = parameters.accept(new Parameters.Visitor>() { + * @Override + * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) { + * return Optional.of(conditionalBlock.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock) @@ -2107,6 +2245,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Parameters = apply { if (validated) { return@apply @@ -2590,6 +2738,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): AuthRuleType = apply { if (validated) { return@apply @@ -3198,6 +3356,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ProgramLevelRule = apply { if (validated) { return@apply @@ -3336,6 +3504,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = parameters.accept(new Parameters.Visitor>() { + * @Override + * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) { + * return Optional.of(conditionalBlock.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock) @@ -3360,6 +3558,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Parameters = apply { if (validated) { return@apply @@ -3843,6 +4051,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): AuthRuleType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt index c375bbbb6..18c3943f6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt @@ -494,6 +494,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -625,6 +634,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = parameters.accept(new Parameters.Visitor>() { + * @Override + * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) { + * return Optional.of(conditionalBlock.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock) @@ -644,6 +682,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Parameters = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponse.kt index e9f95f3c1..3d3300d41 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponse.kt @@ -181,6 +181,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleV2ListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt index 87e83eaec..0966add33 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt @@ -450,6 +450,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Scope = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponse.kt index 4276fd480..3a25d7ed0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponse.kt @@ -210,6 +210,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleV2ListResultsPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt index c55df6a61..0c0a0b4e2 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt @@ -270,6 +270,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitAccountLevelRule(AccountLevelRule accountLevelRule) { + * return Optional.of(accountLevelRule.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { accountLevelRule != null -> visitor.visitAccountLevelRule(accountLevelRule) @@ -280,6 +309,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -701,6 +739,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountLevelRule = apply { if (validated) { return@apply @@ -828,6 +876,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1096,6 +1154,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardLevelRule = apply { if (validated) { return@apply @@ -1221,6 +1289,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1647,6 +1725,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ProgramLevelRule = apply { if (validated) { return@apply @@ -1778,6 +1866,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): State = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt index c3918b33c..2044a2680 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt @@ -305,6 +305,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleVersion = apply { if (validated) { return@apply @@ -424,6 +432,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = parameters.accept(new Parameters.Visitor>() { + * @Override + * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) { + * return Optional.of(conditionalBlock.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock) @@ -443,6 +480,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Parameters = apply { if (validated) { return@apply @@ -861,6 +907,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleVersionState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt index ff370c130..0c5d8b43b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt @@ -265,6 +265,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRulesBacktestReportCreatedWebhookEvent = apply { if (validated) { return@apply @@ -382,6 +390,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthStreamSecret.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthStreamSecret.kt index ef0a8ecdc..14b354311 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthStreamSecret.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthStreamSecret.kt @@ -113,6 +113,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthStreamSecret = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationSimulateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationSimulateResponse.kt index 5512e68af..15e6c5e1b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationSimulateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationSimulateResponse.kt @@ -117,6 +117,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthenticationSimulateResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestCreateResponse.kt index 9d383130c..e3e72ab64 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestCreateResponse.kt @@ -120,6 +120,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BacktestCreateResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt index 6ace5eb0b..7c75ae5ba 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt @@ -211,6 +211,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BacktestResults = apply { if (validated) { return@apply @@ -390,6 +398,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Results = apply { if (validated) { return@apply @@ -594,6 +611,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BacktestSimulationParameters = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt index f26fbdc65..f0a7f793d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt @@ -280,6 +280,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BacktestStats = apply { if (validated) { return@apply @@ -538,6 +546,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Example = apply { if (validated) { return@apply @@ -670,6 +687,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Decision = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt index 2f5c9d450..f9f4e799f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt @@ -519,6 +519,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Balance = apply { if (validated) { return@apply @@ -669,6 +677,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListPageResponse.kt index 3036f1d76..5a93ede2b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListPageResponse.kt @@ -178,6 +178,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BalanceListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListParams.kt index 9fc6ad4b4..c65efde51 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListParams.kt @@ -347,6 +347,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceUpdatedWebhookEvent.kt index 70e8dbd4c..8b7cdcfea 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceUpdatedWebhookEvent.kt @@ -186,6 +186,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BalanceUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -298,6 +306,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt index b61270767..6272f8821 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt @@ -1067,6 +1067,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreateBookTransferRequest = apply { if (validated) { return@apply @@ -1292,6 +1301,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferCategory = apply { if (validated) { return@apply @@ -1620,6 +1638,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferType = apply { if (validated) { return@apply @@ -1750,6 +1777,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OnClosedAccount = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListPageResponse.kt index 3466f1e59..bcc12b208 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListPageResponse.kt @@ -177,6 +177,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListParams.kt index 874693b3c..ae97f9ae4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListParams.kt @@ -505,6 +505,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferCategory = apply { if (validated) { return@apply @@ -631,6 +640,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -757,6 +775,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt index b5aaffabe..d69299aa8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt @@ -762,6 +762,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferResponse = apply { if (validated) { return@apply @@ -953,6 +961,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferCategory = apply { if (validated) { return@apply @@ -1387,6 +1404,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferEvent = apply { if (validated) { return@apply @@ -1527,6 +1553,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferDetailedResults = apply { if (validated) { return@apply @@ -1660,6 +1696,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -1992,6 +2038,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferType = apply { if (validated) { return@apply @@ -2149,6 +2205,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Family = apply { if (validated) { return@apply @@ -2278,6 +2343,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -2432,6 +2506,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply @@ -2679,6 +2762,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSeries = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt index 193e3c6de..73a8326f0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt @@ -392,6 +392,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RetryBookTransferRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferReverseParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferReverseParams.kt index 29edfbc0b..10926d9ac 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferReverseParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferReverseParams.kt @@ -350,6 +350,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionCreatedWebhookEvent.kt index 402c6edc5..7d229cd77 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionCreatedWebhookEvent.kt @@ -843,6 +843,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferTransactionCreatedWebhookEvent = apply { if (validated) { return@apply @@ -986,6 +994,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionUpdatedWebhookEvent.kt index 9f582acff..b3b73db1e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionUpdatedWebhookEvent.kt @@ -843,6 +843,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BookTransferTransactionUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -986,6 +994,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt index b6d2162d6..7b619e656 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt @@ -1342,6 +1342,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Card = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt index a90b2f513..09a7f2047 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt @@ -1423,6 +1423,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardAuthorizationApprovalRequestWebhookEvent = apply { if (validated) { return@apply @@ -1740,6 +1748,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Amounts = apply { if (validated) { return@apply @@ -1974,6 +1991,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConvertedAmount = apply { if (validated) { return@apply @@ -2185,6 +2212,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Amount = apply { if (validated) { return@apply @@ -2458,6 +2495,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Avs = apply { if (validated) { return@apply @@ -2608,6 +2654,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AddressMatchResult = apply { if (validated) { return@apply @@ -3016,6 +3072,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AsaRequestCard = apply { if (validated) { return@apply @@ -3168,6 +3233,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SpendLimitDuration = apply { if (validated) { return@apply @@ -3315,6 +3390,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -3469,6 +3554,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardType = apply { if (validated) { return@apply @@ -3626,6 +3721,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -4167,6 +4271,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionMerchant = apply { if (validated) { return@apply @@ -4538,6 +4651,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ServiceLocation = apply { if (validated) { return@apply @@ -4711,6 +4833,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AsaRequestStatus = apply { if (validated) { return@apply @@ -4849,6 +4980,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionInitiator = apply { if (validated) { return@apply @@ -4977,6 +5117,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -5284,6 +5433,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AsaRequestFleetInfo = apply { if (validated) { return@apply @@ -5422,6 +5580,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FleetPromptCode = apply { if (validated) { return@apply @@ -5561,6 +5729,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FleetRestrictionCode = apply { if (validated) { return@apply @@ -5837,6 +6015,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LatestChallenge = apply { if (validated) { return@apply @@ -5978,6 +6165,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -6150,6 +6347,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Network = apply { if (validated) { return@apply @@ -6341,6 +6547,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AsaNetworkSpecificData = apply { if (validated) { return@apply @@ -6629,6 +6844,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AsaNetworkSpecificDataMastercard = apply { if (validated) { return@apply @@ -6866,6 +7091,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): OnBehalfServiceResult = apply { if (validated) { return@apply @@ -7078,6 +7313,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AsaNetworkSpecificDataVisa = apply { if (validated) { return@apply @@ -7280,6 +7525,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Pos = apply { if (validated) { return@apply @@ -7531,6 +7785,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AsaRequestPosEntryMode = apply { if (validated) { return@apply @@ -7663,6 +7927,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Card = apply { if (validated) { return@apply @@ -7838,6 +8112,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Cardholder = apply { if (validated) { return@apply @@ -8047,6 +8331,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Pan = apply { if (validated) { return@apply @@ -8549,6 +8843,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AsaPosTerminal = apply { if (validated) { return@apply @@ -8696,6 +9000,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -8842,6 +9156,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): PinCapability = apply { if (validated) { return@apply @@ -9105,6 +9429,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationChallengeResponseWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationChallengeResponseWebhookEvent.kt index ba0b8c2f8..b25e3f7a0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationChallengeResponseWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationChallengeResponseWebhookEvent.kt @@ -423,6 +423,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardAuthorizationChallengeResponseWebhookEvent = apply { if (validated) { return@apply @@ -549,6 +557,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChallengeMethod = apply { if (validated) { return@apply @@ -672,6 +689,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -798,6 +824,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Response = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBalanceListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBalanceListPageResponse.kt index de66298c0..884a921e0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBalanceListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBalanceListPageResponse.kt @@ -182,6 +182,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardBalanceListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt index d0a765734..c8e431ee8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt @@ -429,6 +429,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardBulkOrder = apply { if (validated) { return@apply @@ -574,6 +582,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ShippingMethod = apply { if (validated) { return@apply @@ -703,6 +720,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt index e230278b1..fa8e66bac 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt @@ -520,6 +520,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreateBulkOrderRequest = apply { if (validated) { return@apply @@ -678,6 +687,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ShippingMethod = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListPageResponse.kt index 2d10152ee..5c7be111a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListPageResponse.kt @@ -181,6 +181,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardBulkOrderListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt index 2acbedea9..5afd1a354 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt @@ -382,6 +382,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateBulkOrderRequest = apply { if (validated) { return@apply @@ -507,6 +516,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt index cf9eef55f..c6d2cd0ca 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt @@ -657,6 +657,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -848,6 +857,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ShippingMethod = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertedWebhookEvent.kt index f22f05feb..c33598207 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertedWebhookEvent.kt @@ -169,6 +169,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardConvertedWebhookEvent = apply { if (validated) { return@apply @@ -281,6 +289,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply 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 68a64b274..908d33f3c 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 @@ -2063,6 +2063,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2314,6 +2323,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2522,6 +2540,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ReplacementSubstatus = apply { if (validated) { return@apply @@ -2695,6 +2722,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ShippingMethod = apply { if (validated) { return@apply @@ -2825,6 +2861,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreatedWebhookEvent.kt index f811cd601..83103a644 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreatedWebhookEvent.kt @@ -213,6 +213,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardCreatedWebhookEvent = apply { if (validated) { return@apply @@ -327,6 +335,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListPageResponse.kt index 6c256504d..a5ac35bca 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListPageResponse.kt @@ -184,6 +184,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardFinancialTransactionListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListParams.kt index 2b2c085dc..cb08efd33 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListParams.kt @@ -402,6 +402,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Category = apply { if (validated) { return@apply @@ -528,6 +537,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -678,6 +696,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListPageResponse.kt index 248710f1f..c77380b0d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListPageResponse.kt @@ -178,6 +178,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt index 750ff0d53..c567fda26 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt @@ -419,6 +419,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt index 485b9f183..db0415fcd 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt @@ -438,6 +438,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardProgram = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgramListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgramListPageResponse.kt index f9d40cf32..cce79aea6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgramListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgramListPageResponse.kt @@ -178,6 +178,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardProgramListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionParams.kt index d163e2849..7edef2787 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionParams.kt @@ -766,6 +766,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -934,6 +943,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DigitalWallet = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt index 8382e238f..f53ea4dfb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt @@ -150,6 +150,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardProvisionResponse = apply { if (validated) { return@apply @@ -220,6 +228,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = provisioningPayload.accept(new ProvisioningPayload.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -229,6 +266,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ProvisioningPayload = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt index 5567f4697..09545c5c3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt @@ -627,6 +627,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -818,6 +827,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ShippingMethod = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissuedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissuedWebhookEvent.kt index db0ad80b1..3b07dadc3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissuedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissuedWebhookEvent.kt @@ -168,6 +168,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardReissuedWebhookEvent = apply { if (validated) { return@apply @@ -280,6 +288,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt index a98d73c1e..248bcf9d2 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt @@ -807,6 +807,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1012,6 +1021,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ShippingMethod = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewedWebhookEvent.kt index 03834f563..2dc25c6de 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewedWebhookEvent.kt @@ -317,6 +317,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardRenewedWebhookEvent = apply { if (validated) { return@apply @@ -437,6 +445,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSearchByPanParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSearchByPanParams.kt index 6bfce74d2..deab4b3ed 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSearchByPanParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSearchByPanParams.kt @@ -358,6 +358,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardShippedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardShippedWebhookEvent.kt index 3cc66baac..ee2a5d0d5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardShippedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardShippedWebhookEvent.kt @@ -301,6 +301,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardShippedWebhookEvent = apply { if (validated) { return@apply @@ -419,6 +427,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -607,6 +624,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ShippingMethod = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt index 08d43702f..665dab979 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt @@ -207,6 +207,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardSpendLimits = apply { if (validated) { return@apply @@ -410,6 +418,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AvailableSpendLimit = apply { if (validated) { return@apply @@ -624,6 +641,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SpendLimit = apply { if (validated) { return@apply @@ -850,6 +876,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SpendVelocity = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataCreatedWebhookEvent.kt index 6037dd0ea..2798c9221 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataCreatedWebhookEvent.kt @@ -344,6 +344,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardTransactionEnhancedDataCreatedWebhookEvent = apply { if (validated) { return@apply @@ -468,6 +476,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataUpdatedWebhookEvent.kt index a2cc1de04..658f29c2c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataUpdatedWebhookEvent.kt @@ -344,6 +344,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardTransactionEnhancedDataUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -468,6 +476,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt index 9264643cc..41f17e73b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt @@ -1453,6 +1453,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardTransactionUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -1619,6 +1627,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdateParams.kt index 711420e84..de774c839 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdateParams.kt @@ -1161,6 +1161,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1334,6 +1343,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PinStatus = apply { if (validated) { return@apply @@ -1471,6 +1489,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1675,6 +1702,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Substatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt index ee5b33230..ef075984f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt @@ -228,6 +228,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -342,6 +350,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt index a3f1273f7..3ba3fa88b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt @@ -616,6 +616,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -770,6 +779,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DigitalWallet = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt index 28fece954..234b57250 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt @@ -55,6 +55,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = cardWebProvisionResponse.accept(new CardWebProvisionResponse.Visitor>() { + * @Override + * public Optional visitAppleWebPushProvisioning(AppleWebPushProvisioningResponse appleWebPushProvisioning) { + * return Optional.of(appleWebPushProvisioning.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { appleWebPushProvisioning != null -> @@ -66,6 +95,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardWebProvisionResponse = apply { if (validated) { return@apply @@ -395,6 +432,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AppleWebPushProvisioningResponse = apply { if (validated) { return@apply @@ -658,6 +704,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): WebPushProvisioningResponseJws = apply { if (validated) { return@apply @@ -805,6 +861,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): WebPushProvisioningResponseHeader = apply { if (validated) { return@apply @@ -1040,6 +1106,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): GoogleWebPushProvisioningResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardholderAuthentication.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardholderAuthentication.kt index a36a944e3..ab137282c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardholderAuthentication.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardholderAuthentication.kt @@ -349,6 +349,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardholderAuthentication = apply { if (validated) { return@apply @@ -483,6 +491,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthenticationMethod = apply { if (validated) { return@apply @@ -627,6 +644,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthenticationResult = apply { if (validated) { return@apply @@ -781,6 +807,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DecisionMadeBy = apply { if (validated) { return@apply @@ -926,6 +961,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LiabilityShift = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Carrier.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Carrier.kt index 7fb386853..89ad9ef86 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Carrier.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Carrier.kt @@ -117,6 +117,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Carrier = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt index 906e45055..6ba66a214 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt @@ -187,6 +187,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CategoryBalances = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryDetails.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryDetails.kt index 2f5118ce9..e84942d18 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryDetails.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryDetails.kt @@ -204,6 +204,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CategoryDetails = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryTier.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryTier.kt index 47e372e3e..f865113c9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryTier.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryTier.kt @@ -143,6 +143,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CategoryTier = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResponse.kt index 4d7334d7f..e3d4f0a3d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResponse.kt @@ -178,6 +178,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChallengeResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResult.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResult.kt index 58a7296b6..e28a4adcb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResult.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResult.kt @@ -96,6 +96,14 @@ class ChallengeResult @JsonCreator private constructor(private val value: JsonFi private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChallengeResult = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt index df68c5f73..95bb0e4bd 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt @@ -191,6 +191,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Conditional3dsActionParameters = apply { if (validated) { return@apply @@ -314,6 +322,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Authentication3dsAction = apply { if (validated) { return@apply @@ -605,6 +622,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Condition = apply { if (validated) { return@apply @@ -794,6 +820,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Attribute = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAchActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAchActionParameters.kt index e0ae0a4ad..1f29b9ce8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAchActionParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAchActionParameters.kt @@ -205,6 +205,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConditionalAchActionParameters = apply { if (validated) { return@apply @@ -257,6 +265,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = action.accept(new Action.Visitor>() { + * @Override + * public Optional visitApproveActionAch(ApproveActionAch approveActionAch) { + * return Optional.of(approveActionAch.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { approveActionAch != null -> visitor.visitApproveActionAch(approveActionAch) @@ -266,6 +303,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -531,6 +577,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ApproveActionAch = apply { if (validated) { return@apply @@ -644,6 +700,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -859,6 +925,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ReturnAction = apply { if (validated) { return@apply @@ -1392,6 +1468,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Code = apply { if (validated) { return@apply @@ -1517,6 +1603,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1810,6 +1906,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Condition = apply { if (validated) { return@apply @@ -1973,6 +2078,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Attribute = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAttribute.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAttribute.kt index 2acb37675..3ed858da5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAttribute.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAttribute.kt @@ -228,6 +228,14 @@ class ConditionalAttribute @JsonCreator private constructor(private val value: J private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConditionalAttribute = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt index 643ffb572..0afe4cb7f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt @@ -193,6 +193,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConditionalAuthorizationActionParameters = apply { if (validated) { return@apply @@ -314,6 +322,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthorizationAction = apply { if (validated) { return@apply @@ -795,6 +812,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Condition = apply { if (validated) { return@apply @@ -1218,6 +1244,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Attribute = apply { if (validated) { return@apply @@ -1407,6 +1443,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Parameters = apply { if (validated) { return@apply @@ -1546,6 +1592,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Interval = apply { if (validated) { return@apply @@ -1684,6 +1740,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Scope = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalBlockParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalBlockParameters.kt index 2c7696831..878cfb2bb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalBlockParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalBlockParameters.kt @@ -151,6 +151,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConditionalBlockParameters = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalOperation.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalOperation.kt index 6acf65f7e..21c7102bb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalOperation.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalOperation.kt @@ -175,6 +175,14 @@ class ConditionalOperation @JsonCreator private constructor(private val value: J private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConditionalOperation = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalTokenizationActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalTokenizationActionParameters.kt index 792291b0d..3894f58ae 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalTokenizationActionParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalTokenizationActionParameters.kt @@ -211,6 +211,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConditionalTokenizationActionParameters = apply { if (validated) { return@apply @@ -265,6 +273,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = action.accept(new Action.Visitor>() { + * @Override + * public Optional visitDeclineActionTokenization(DeclineActionTokenization declineActionTokenization) { + * return Optional.of(declineActionTokenization.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { declineActionTokenization != null -> @@ -275,6 +312,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -581,6 +627,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DeclineActionTokenization = apply { if (validated) { return@apply @@ -697,6 +753,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -900,6 +966,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Reason = apply { if (validated) { return@apply @@ -1109,6 +1185,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RequireTfaAction = apply { if (validated) { return@apply @@ -1225,6 +1311,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1436,6 +1532,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Reason = apply { if (validated) { return@apply @@ -1787,6 +1893,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Condition = apply { if (validated) { return@apply @@ -2006,6 +2121,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Attribute = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalValue.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalValue.kt index dcaacaad2..00144363e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalValue.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalValue.kt @@ -72,6 +72,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = conditionalValue.accept(new ConditionalValue.Visitor>() { + * @Override + * public Optional visitRegex(String regex) { + * return Optional.of(regex.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { regex != null -> visitor.visitRegex(regex) @@ -83,6 +112,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConditionalValue = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CreditProductPrimeRateCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CreditProductPrimeRateCreateParams.kt index 4deeae2e5..67bfc7173 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CreditProductPrimeRateCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CreditProductPrimeRateCreateParams.kt @@ -460,6 +460,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InterestRate = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DecisioningRetrieveSecretResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DecisioningRetrieveSecretResponse.kt index a86ba9dca..89a8a3042 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DecisioningRetrieveSecretResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DecisioningRetrieveSecretResponse.kt @@ -118,6 +118,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DecisioningRetrieveSecretResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Device.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Device.kt index 8cd755d75..0c130a3f3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Device.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Device.kt @@ -212,6 +212,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Device = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt index 3521bf440..bc024197f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt @@ -367,6 +367,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DigitalCardArt = apply { if (validated) { return@apply @@ -493,6 +501,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Network = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArtListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArtListPageResponse.kt index 0283eaf24..4f4c2db52 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArtListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArtListPageResponse.kt @@ -182,6 +182,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DigitalCardArtListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationApprovalRequestWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationApprovalRequestWebhookEvent.kt index 4d91a7b58..7fbb4af86 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationApprovalRequestWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationApprovalRequestWebhookEvent.kt @@ -805,6 +805,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DigitalWalletTokenizationApprovalRequestWebhookEvent = apply { if (validated) { return@apply @@ -948,6 +956,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -1087,6 +1104,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): IssuerDecision = apply { if (validated) { return@apply @@ -1218,6 +1244,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationChannel = apply { if (validated) { return@apply @@ -1487,6 +1522,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomerTokenizationDecision = apply { if (validated) { return@apply @@ -1638,6 +1682,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Outcome = apply { if (validated) { return@apply @@ -1816,6 +1870,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationSource = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationResultWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationResultWebhookEvent.kt index 00c3e292d..e23f81140 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationResultWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationResultWebhookEvent.kt @@ -348,6 +348,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DigitalWalletTokenizationResultWebhookEvent = apply { if (validated) { return@apply @@ -469,6 +477,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -958,6 +975,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationResultDetails = apply { if (validated) { return@apply @@ -1160,6 +1186,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationDeclineReason = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent.kt index 1d0074a28..1095774cf 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent.kt @@ -350,6 +350,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent = apply { if (validated) { return@apply @@ -548,6 +556,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ActivationMethod = apply { if (validated) { return@apply @@ -671,6 +688,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -816,6 +843,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent.kt index 54d1c639e..fdf172dea 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent.kt @@ -390,6 +390,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent = apply { if (validated) { return@apply @@ -590,6 +598,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ActivationMethod = apply { if (validated) { return@apply @@ -713,6 +730,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -858,6 +885,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationUpdatedWebhookEvent.kt index e7c7ea9e8..f2758de13 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationUpdatedWebhookEvent.kt @@ -288,6 +288,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DigitalWalletTokenizationUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -407,6 +415,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt index d98b38266..dce9379aa 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt @@ -991,6 +991,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Dispute = apply { if (validated) { return@apply @@ -1228,6 +1236,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Reason = apply { if (validated) { return@apply @@ -1469,6 +1486,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ResolutionReason = apply { if (validated) { return@apply @@ -1641,6 +1667,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeCreateParams.kt index 671b8c35a..39e5d795f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeCreateParams.kt @@ -645,6 +645,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -872,6 +881,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Reason = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeEvidence.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeEvidence.kt index d08578be1..ffc44384e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeEvidence.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeEvidence.kt @@ -374,6 +374,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DisputeEvidence = apply { if (validated) { return@apply @@ -528,6 +536,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UploadStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeEvidenceUploadFailedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeEvidenceUploadFailedWebhookEvent.kt index 3ec958c7a..6c7ea0f52 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeEvidenceUploadFailedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeEvidenceUploadFailedWebhookEvent.kt @@ -427,6 +427,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DisputeEvidenceUploadFailedWebhookEvent = apply { if (validated) { return@apply @@ -551,6 +559,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeInitiateEvidenceUploadParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeInitiateEvidenceUploadParams.kt index 22bd90101..fd13ef64e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeInitiateEvidenceUploadParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeInitiateEvidenceUploadParams.kt @@ -356,6 +356,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListEvidencesPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListEvidencesPageResponse.kt index 307c03717..7fa31d972 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListEvidencesPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListEvidencesPageResponse.kt @@ -183,6 +183,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DisputeListEvidencesPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListPageResponse.kt index 0c62813b9..0ac6668a4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListPageResponse.kt @@ -178,6 +178,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DisputeListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListParams.kt index 79e03cf6b..5cca3eeea 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListParams.kt @@ -437,6 +437,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEvent.kt index 7bfdb617f..cff15494e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEvent.kt @@ -723,6 +723,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DisputeTransactionCreatedWebhookEvent = apply { if (validated) { return@apply @@ -861,6 +869,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEvent.kt index 1c6073980..bd1984283 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEvent.kt @@ -723,6 +723,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DisputeTransactionUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -861,6 +869,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeUpdateParams.kt index a590433f8..dad06a3a2 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeUpdateParams.kt @@ -553,6 +553,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -770,6 +779,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Reason = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeUpdatedWebhookEvent.kt index ca1a568e4..bdb9956e3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeUpdatedWebhookEvent.kt @@ -1056,6 +1056,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DisputeUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -1202,6 +1210,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeV2.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeV2.kt index 96a60f6bd..f28270bf9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeV2.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeV2.kt @@ -663,6 +663,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DisputeV2 = apply { if (validated) { return@apply @@ -824,6 +832,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Disposition = apply { if (validated) { return@apply @@ -1093,6 +1110,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Event = apply { if (validated) { return@apply @@ -1165,6 +1191,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = data.accept(new Data.Visitor>() { + * @Override + * public Optional visitWorkflow(WorkflowEventData workflow) { + * return Optional.of(workflow.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { workflow != null -> visitor.visitWorkflow(workflow) @@ -1176,6 +1232,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Data = apply { if (validated) { return@apply @@ -1680,6 +1746,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): WorkflowEventData = apply { if (validated) { return@apply @@ -1819,6 +1895,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -1974,6 +2060,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Disposition = apply { if (validated) { return@apply @@ -2102,6 +2198,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Stage = apply { if (validated) { return@apply @@ -2230,6 +2336,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2542,6 +2658,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): FinancialEventData = apply { if (validated) { return@apply @@ -2672,6 +2798,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Polarity = apply { if (validated) { return@apply @@ -2824,6 +2960,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Stage = apply { if (validated) { return@apply @@ -2952,6 +3098,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -3253,6 +3409,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): CardholderLiabilityEventData = apply { if (validated) { return@apply @@ -3389,6 +3555,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -3517,6 +3693,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -3676,6 +3862,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -4039,6 +4235,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LiabilityAllocation = apply { if (validated) { return@apply @@ -4193,6 +4398,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Network = apply { if (validated) { return@apply @@ -4319,6 +4533,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -4579,6 +4802,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSeries = apply { if (validated) { return@apply @@ -4697,6 +4929,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputesV2ListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputesV2ListPageResponse.kt index aec266095..bf54b914e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputesV2ListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputesV2ListPageResponse.kt @@ -182,6 +182,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DisputesV2ListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Document.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Document.kt index af6829da6..ab8493a7f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Document.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Document.kt @@ -323,6 +323,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Document = apply { if (validated) { return@apply @@ -550,6 +558,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DocumentType = apply { if (validated) { return@apply @@ -1095,6 +1112,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RequiredDocumentUpload = apply { if (validated) { return@apply @@ -1232,6 +1258,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ImageType = apply { if (validated) { return@apply @@ -1385,6 +1421,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DocumentUploadStatus = apply { if (validated) { return@apply @@ -1581,6 +1627,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DocumentUploadStatusReasons = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EnhancedCommercialDataRetrieveResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EnhancedCommercialDataRetrieveResponse.kt index d9b24c14d..0bcc12fb2 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EnhancedCommercialDataRetrieveResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EnhancedCommercialDataRetrieveResponse.kt @@ -149,6 +149,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EnhancedCommercialDataRetrieveResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EnhancedData.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EnhancedData.kt index 602f864f8..ddd27500e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EnhancedData.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EnhancedData.kt @@ -290,6 +290,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EnhancedData = apply { if (validated) { return@apply @@ -628,6 +636,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CommonData = apply { if (validated) { return@apply @@ -900,6 +917,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItem = apply { if (validated) { return@apply @@ -1149,6 +1176,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TaxData = apply { if (validated) { return@apply @@ -1284,6 +1321,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): TaxExemptIndicator = apply { if (validated) { return@apply @@ -1710,6 +1757,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Fleet = apply { if (validated) { return@apply @@ -1951,6 +2007,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AmountTotals = apply { if (validated) { return@apply @@ -2242,6 +2308,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FuelData = apply { if (validated) { return@apply @@ -3238,6 +3314,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): FuelType = apply { if (validated) { return@apply @@ -3404,6 +3490,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): FuelUnitOfMeasure = apply { if (validated) { return@apply @@ -3577,6 +3673,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ServiceType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EntityCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EntityCreateResponse.kt index 85a0d73db..9c173510b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EntityCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EntityCreateResponse.kt @@ -367,6 +367,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityCreateResponse = apply { if (validated) { return@apply @@ -506,6 +514,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityStatus = apply { if (validated) { return@apply @@ -817,6 +834,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatusReasons = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt index caf888f2c..703256af8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt @@ -413,6 +413,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Event = apply { if (validated) { return@apply @@ -957,6 +965,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -1053,6 +1070,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Payload = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListAttemptsPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListAttemptsPageResponse.kt index c65715879..09aa88767 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListAttemptsPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListAttemptsPageResponse.kt @@ -178,6 +178,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventListAttemptsPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListAttemptsParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListAttemptsParams.kt index 202238363..08a39153e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListAttemptsParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListAttemptsParams.kt @@ -399,6 +399,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListPageResponse.kt index 82d1170fb..ea11f97dd 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListPageResponse.kt @@ -175,6 +175,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt index f8a8d29bc..02ddc8b44 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt @@ -830,6 +830,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventStream.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventStream.kt index e90c95b9e..67244248e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventStream.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventStream.kt @@ -111,6 +111,14 @@ class EventStream @JsonCreator private constructor(private val value: JsonField< private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventStream = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt index 9a039466f..e4de107d8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt @@ -286,6 +286,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventSubscription = apply { if (validated) { return@apply @@ -832,6 +840,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt index 5e3e8d128..df9d4ecf7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt @@ -586,6 +586,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1154,6 +1163,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListAttemptsPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListAttemptsPageResponse.kt index 59902c72c..5386dc430 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListAttemptsPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListAttemptsPageResponse.kt @@ -181,6 +181,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventSubscriptionListAttemptsPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListAttemptsParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListAttemptsParams.kt index 0f0758e4c..4a724667a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListAttemptsParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListAttemptsParams.kt @@ -411,6 +411,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListPageResponse.kt index 1e21bb621..518bfce02 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionListPageResponse.kt @@ -180,6 +180,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventSubscriptionListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt index 85a54c166..a66dc8990 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt @@ -365,6 +365,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -836,6 +845,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt index c57c87f8f..e799a8714 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt @@ -609,6 +609,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1177,6 +1186,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExtendedCredit.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExtendedCredit.kt index 2a7ddcc45..4c45d3b70 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExtendedCredit.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExtendedCredit.kt @@ -134,6 +134,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExtendedCredit = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccount.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccount.kt index e5d21dcb9..fdc609e38 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccount.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccount.kt @@ -992,6 +992,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccount = apply { if (validated) { return@apply @@ -1154,6 +1162,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1283,6 +1300,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -1425,6 +1451,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt index 098c1fcdb..3809949e9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt @@ -283,6 +283,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccountAddress = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt index acc4f7a82..37a35fcc7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt @@ -269,6 +269,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitBankVerifiedCreateBankAccountApiRequest(BankVerifiedCreateBankAccountApiRequest bankVerifiedCreateBankAccountApiRequest) { + * return Optional.of(bankVerifiedCreateBankAccountApiRequest.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { bankVerifiedCreateBankAccountApiRequest != null -> @@ -282,6 +311,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1259,6 +1297,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BankVerifiedCreateBankAccountApiRequest = apply { if (validated) { return@apply @@ -1413,6 +1461,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -2210,6 +2268,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternallyVerifiedCreateBankAccountApiRequest = apply { if (validated) { return@apply @@ -2360,6 +2428,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -2494,6 +2572,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ExternallyVerifiedVerificationMethod = apply { if (validated) { return@apply @@ -3281,6 +3369,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UnverifiedCreateBankAccountApiRequest = apply { if (validated) { return@apply @@ -3431,6 +3529,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -3564,6 +3672,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): UnverifiedVerificationMethod = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt index af26e919a..cb59c1b39 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt @@ -996,6 +996,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccountCreateResponse = apply { if (validated) { return@apply @@ -1154,6 +1162,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OwnerType = apply { if (validated) { return@apply @@ -1286,6 +1303,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1415,6 +1441,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -1558,6 +1593,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationMethod = apply { if (validated) { return@apply @@ -1700,6 +1744,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreatedWebhookEvent.kt index 52af81a06..f8762d651 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreatedWebhookEvent.kt @@ -1071,6 +1071,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccountCreatedWebhookEvent = apply { if (validated) { return@apply @@ -1225,6 +1233,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListPageResponse.kt index c923766e0..d8b909c52 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListPageResponse.kt @@ -183,6 +183,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccountListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListParams.kt index 9faea6bd4..ef1cc992a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListParams.kt @@ -456,6 +456,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -590,6 +599,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountState = apply { if (validated) { return@apply @@ -731,6 +749,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt index 372181958..8a7c4ceb2 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt @@ -995,6 +995,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccountListResponse = apply { if (validated) { return@apply @@ -1153,6 +1161,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OwnerType = apply { if (validated) { return@apply @@ -1285,6 +1302,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1414,6 +1440,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -1557,6 +1592,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationMethod = apply { if (validated) { return@apply @@ -1699,6 +1743,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountMicroDepositCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountMicroDepositCreateParams.kt index 411f31565..08730d0c1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountMicroDepositCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountMicroDepositCreateParams.kt @@ -419,6 +419,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): MicroDepositVerificationRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt index 3a05c857a..3182b76e9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt @@ -996,6 +996,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccountRetrieveResponse = apply { if (validated) { return@apply @@ -1154,6 +1162,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OwnerType = apply { if (validated) { return@apply @@ -1286,6 +1303,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1415,6 +1441,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -1558,6 +1593,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationMethod = apply { if (validated) { return@apply @@ -1700,6 +1744,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsParams.kt index 47f62474e..9e665b855 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsParams.kt @@ -381,6 +381,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RetryMicroDepositVerificationRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt index 61488f6cb..2e118b3b1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt @@ -1000,6 +1000,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccountRetryMicroDepositsResponse = apply { if (validated) { return@apply @@ -1158,6 +1166,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OwnerType = apply { if (validated) { return@apply @@ -1290,6 +1307,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1419,6 +1445,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -1562,6 +1597,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationMethod = apply { if (validated) { return@apply @@ -1704,6 +1748,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryPrenoteParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryPrenoteParams.kt index 4279cd9be..a4ef610d3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryPrenoteParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryPrenoteParams.kt @@ -377,6 +377,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RetryPrenoteVerificationRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountSetVerificationMethodParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountSetVerificationMethodParams.kt index 135ab2e35..096817136 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountSetVerificationMethodParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountSetVerificationMethodParams.kt @@ -500,6 +500,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SetVerificationMethodRequest = apply { if (validated) { return@apply @@ -656,6 +665,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SetVerificationMethodAllowedVerificationMethods = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParams.kt index ad547bf08..6fbd09da5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParams.kt @@ -892,6 +892,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateBankAccountApiRequest = apply { if (validated) { return@apply @@ -1066,6 +1075,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountTypeExternal = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt index 5bdd71dde..8157eb85b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt @@ -996,6 +996,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccountUpdateResponse = apply { if (validated) { return@apply @@ -1154,6 +1162,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OwnerType = apply { if (validated) { return@apply @@ -1286,6 +1303,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1415,6 +1441,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -1558,6 +1593,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationMethod = apply { if (validated) { return@apply @@ -1700,6 +1744,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdatedWebhookEvent.kt index 9971dcf7f..d1d986b8b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdatedWebhookEvent.kt @@ -1071,6 +1071,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalBankAccountUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -1225,6 +1233,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt index d3190bb8c..7643d0349 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt @@ -617,6 +617,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPayment = apply { if (validated) { return@apply @@ -785,6 +793,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply @@ -941,6 +958,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentCategory = apply { if (validated) { return@apply @@ -1355,6 +1381,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentEvent = apply { if (validated) { return@apply @@ -1490,6 +1525,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DetailedResults = apply { if (validated) { return@apply @@ -1623,6 +1668,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -1926,6 +1981,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentEventType = apply { if (validated) { return@apply @@ -2083,6 +2148,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Family = apply { if (validated) { return@apply @@ -2215,6 +2289,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentDirection = apply { if (validated) { return@apply @@ -2344,6 +2427,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCancelParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCancelParams.kt index c22993d17..b028f0c18 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCancelParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCancelParams.kt @@ -443,6 +443,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentActionRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt index db934b2b7..201de3314 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt @@ -889,6 +889,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreateExternalPaymentRequest = apply { if (validated) { return@apply @@ -1089,6 +1098,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentCategory = apply { if (validated) { return@apply @@ -1221,6 +1239,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentDirection = apply { if (validated) { return@apply @@ -1354,6 +1381,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentProgressTo = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreatedWebhookEvent.kt index 532973319..35da491a8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreatedWebhookEvent.kt @@ -693,6 +693,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentCreatedWebhookEvent = apply { if (validated) { return@apply @@ -831,6 +839,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListPageResponse.kt index 758e3c0c5..53752362e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListPageResponse.kt @@ -180,6 +180,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListParams.kt index 40205f39d..6bed53d3c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListParams.kt @@ -478,6 +478,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentCategory = apply { if (validated) { return@apply @@ -608,6 +617,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -762,6 +780,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentReleaseParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentReleaseParams.kt index 3ee7aa58a..bb2ed5985 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentReleaseParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentReleaseParams.kt @@ -443,6 +443,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentActionRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentReverseParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentReverseParams.kt index e79ddc8f9..fa957eaee 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentReverseParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentReverseParams.kt @@ -443,6 +443,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentActionRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentSettleParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentSettleParams.kt index 8576de6a3..d7f52e3ac 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentSettleParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentSettleParams.kt @@ -515,6 +515,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentActionWithProgressToRequest = apply { if (validated) { return@apply @@ -663,6 +672,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentProgressTo = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentUpdatedWebhookEvent.kt index dd7ad1eff..097dca1f9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentUpdatedWebhookEvent.kt @@ -693,6 +693,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalPaymentUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -831,6 +839,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalResource.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalResource.kt index c7786e482..5c6b2b503 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalResource.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalResource.kt @@ -227,6 +227,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalResource = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalResourceType.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalResourceType.kt index b13500c5b..d7371e62a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalResourceType.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalResourceType.kt @@ -109,6 +109,14 @@ class ExternalResourceType @JsonCreator private constructor(private val value: J private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalResourceType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt index ae6f5a5dd..74626780e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt @@ -614,6 +614,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccount = apply { if (validated) { return@apply @@ -988,6 +996,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountCreditConfig = apply { if (validated) { return@apply @@ -1157,6 +1174,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AutoCollectionConfigurationResponse = apply { if (validated) { return@apply @@ -1341,6 +1368,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountStatus = apply { if (validated) { return@apply @@ -1499,6 +1535,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountSubstatus = apply { if (validated) { return@apply @@ -1684,6 +1729,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountBalance.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountBalance.kt index 1ad665cfa..b6e1cb400 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountBalance.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountBalance.kt @@ -499,6 +499,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountBalance = apply { if (validated) { return@apply @@ -643,6 +651,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountBalanceListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountBalanceListPageResponse.kt index 375727917..02a71bab8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountBalanceListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountBalanceListPageResponse.kt @@ -186,6 +186,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountBalanceListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreateParams.kt index 2e0de032a..70470c8da 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreateParams.kt @@ -562,6 +562,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreateFinancialAccountRequest = apply { if (validated) { return@apply @@ -699,6 +708,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEvent.kt index 8ae1b086c..1e252bc70 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEvent.kt @@ -682,6 +682,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountCreatedWebhookEvent = apply { if (validated) { return@apply @@ -818,6 +826,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfig.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfig.kt index b9414ab1e..539eb15bc 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfig.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfig.kt @@ -366,6 +366,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountCreditConfig = apply { if (validated) { return@apply @@ -531,6 +539,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AutoCollectionConfigurationResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfigurationUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfigurationUpdateParams.kt index 66e496368..2381dcaf0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfigurationUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfigurationUpdateParams.kt @@ -655,6 +655,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountCreditConfigRequest = apply { if (validated) { return@apply @@ -838,6 +847,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AutoCollectionConfigurationRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInterestTierScheduleListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInterestTierScheduleListPageResponse.kt index 2a99c55f3..e11455a36 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInterestTierScheduleListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInterestTierScheduleListPageResponse.kt @@ -185,6 +185,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountInterestTierScheduleListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInterestTierScheduleUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInterestTierScheduleUpdateParams.kt index 516680be2..eff25c40e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInterestTierScheduleUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInterestTierScheduleUpdateParams.kt @@ -459,6 +459,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateTierScheduleEntryRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListPageResponse.kt index 9c6440cf0..d73f77378 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListPageResponse.kt @@ -180,6 +180,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListParams.kt index fb45c6252..904a28e52 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListParams.kt @@ -323,6 +323,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountLoanTapeListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountLoanTapeListPageResponse.kt index db4654bec..0097bccd7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountLoanTapeListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountLoanTapeListPageResponse.kt @@ -179,6 +179,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountLoanTapeListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountRegisterAccountNumberParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountRegisterAccountNumberParams.kt index e561a38f0..d0885eaeb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountRegisterAccountNumberParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountRegisterAccountNumberParams.kt @@ -395,6 +395,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RegisterAccountNumberRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateParams.kt index 974dcab3e..0d667c009 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateParams.kt @@ -354,6 +354,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateFinancialAccountRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParams.kt index ff5bc5154..edcc18bc7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParams.kt @@ -554,6 +554,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateFinancialAccountStatusRequest = apply { if (validated) { return@apply @@ -714,6 +723,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountStatus = apply { if (validated) { return@apply @@ -874,6 +892,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateFinancialAccountSubstatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEvent.kt index ad785d9c4..48d29c4ca 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEvent.kt @@ -682,6 +682,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -818,6 +826,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt index 018609405..32c33ed68 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt @@ -253,6 +253,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialEvent = apply { if (validated) { return@apply @@ -378,6 +386,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -1018,6 +1035,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialEventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt index 36cb09116..d1212e233 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt @@ -565,6 +565,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialTransaction = apply { if (validated) { return@apply @@ -717,6 +725,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Category = apply { if (validated) { return@apply @@ -846,6 +863,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -1004,6 +1030,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransactionListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransactionListPageResponse.kt index 9431a8811..4f6bb709f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransactionListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransactionListPageResponse.kt @@ -184,6 +184,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialTransactionListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransactionListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransactionListParams.kt index 7e91ec40a..4d7a5bcf8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransactionListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransactionListParams.kt @@ -418,6 +418,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Category = apply { if (validated) { return@apply @@ -544,6 +553,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -694,6 +712,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FraudTransactionReportParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FraudTransactionReportParams.kt index ceee26690..31e7855fe 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FraudTransactionReportParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FraudTransactionReportParams.kt @@ -631,6 +631,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FraudReportRequest = apply { if (validated) { return@apply @@ -790,6 +799,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FraudStatus = apply { if (validated) { return@apply @@ -955,6 +973,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FraudType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEvent.kt index cdaf22447..ea4ea4256 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEvent.kt @@ -465,6 +465,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FundingEvent = apply { if (validated) { return@apply @@ -600,6 +608,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CollectionResourceType = apply { if (validated) { return@apply @@ -799,6 +816,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FundingEventSettlement = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventCreatedWebhookEvent.kt index 0331c096e..ce0f33367 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventCreatedWebhookEvent.kt @@ -526,6 +526,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FundingEventCreatedWebhookEvent = apply { if (validated) { return@apply @@ -652,6 +660,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventListPageResponse.kt index 959c50dd8..bbbde9eaf 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventListPageResponse.kt @@ -180,6 +180,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FundingEventListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventRetrieveDetailsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventRetrieveDetailsResponse.kt index 3d0af2f66..b152bc338 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventRetrieveDetailsResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FundingEventRetrieveDetailsResponse.kt @@ -218,6 +218,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FundingEventRetrieveDetailsResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Hold.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Hold.kt index 44b397dc4..c3b3e648f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Hold.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Hold.kt @@ -559,6 +559,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Hold = apply { if (validated) { return@apply @@ -733,6 +741,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): HoldStatus = apply { if (validated) { return@apply @@ -853,6 +870,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Family = apply { if (validated) { return@apply @@ -982,6 +1008,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldCreateParams.kt index 8ff7ac505..c52780375 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldCreateParams.kt @@ -656,6 +656,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreateHoldRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldEvent.kt index 0c877899c..ae664a4d7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldEvent.kt @@ -414,6 +414,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): HoldEvent = apply { if (validated) { return@apply @@ -545,6 +553,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DetailedResults = apply { if (validated) { return@apply @@ -674,6 +691,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -816,6 +842,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): HoldEventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldListPageResponse.kt index 71ebf38a6..fa32b28cf 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldListPageResponse.kt @@ -175,6 +175,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): HoldListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldListParams.kt index 50ff2995f..ae7694ee7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldListParams.kt @@ -410,6 +410,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): HoldStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldVoidParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldVoidParams.kt index 656c3ec41..4887bd067 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldVoidParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldVoidParams.kt @@ -356,6 +356,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VoidHoldRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt index efaaa1246..48aa3086d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt @@ -160,6 +160,14 @@ private constructor(private val value: JsonField) : Enum { private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InstanceFinancialAccountType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InterestTierSchedule.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InterestTierSchedule.kt index 4ae7a2599..f975836c4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InterestTierSchedule.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InterestTierSchedule.kt @@ -249,6 +249,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InterestTierSchedule = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransaction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransaction.kt index ca7c7903a..c354d8c95 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransaction.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransaction.kt @@ -494,6 +494,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InternalTransaction = apply { if (validated) { return@apply @@ -621,6 +629,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Category = apply { if (validated) { return@apply @@ -900,6 +917,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InternalAdjustmentEvent = apply { if (validated) { return@apply @@ -1030,6 +1056,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -1151,6 +1187,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1304,6 +1350,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -1457,6 +1512,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransactionCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransactionCreatedWebhookEvent.kt index cac7d5a25..84aa2d289 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransactionCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransactionCreatedWebhookEvent.kt @@ -566,6 +566,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InternalTransactionCreatedWebhookEvent = apply { if (validated) { return@apply @@ -698,6 +706,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransactionUpdatedWebhookEvent.kt index 157addcf1..2df26b073 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransactionUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InternalTransactionUpdatedWebhookEvent.kt @@ -566,6 +566,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InternalTransactionUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -698,6 +706,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyb.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyb.kt index 142ebf726..8676c694c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyb.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyb.kt @@ -554,6 +554,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Kyb = apply { if (validated) { return@apply @@ -959,6 +967,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KybIndividual = apply { if (validated) { return@apply @@ -1385,6 +1402,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BusinessEntity = apply { if (validated) { return@apply @@ -1543,6 +1569,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Workflow = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/KybBusinessEntity.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/KybBusinessEntity.kt index 0fce031fa..72aac350d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/KybBusinessEntity.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/KybBusinessEntity.kt @@ -365,6 +365,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KybBusinessEntity = apply { if (validated) { return@apply @@ -707,6 +715,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Address = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyc.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyc.kt index 40c8045e5..4a4cd26e5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyc.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyc.kt @@ -301,6 +301,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Kyc = apply { if (validated) { return@apply @@ -698,6 +706,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Individual = apply { if (validated) { return@apply @@ -860,6 +877,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Workflow = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt index 3e77e54fc..d93403632 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt @@ -443,6 +443,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KycExempt = apply { if (validated) { return@apply @@ -577,6 +585,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KycExemptionType = apply { if (validated) { return@apply @@ -697,6 +714,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Workflow = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt index de8899a75..d763b048f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt @@ -960,6 +960,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LoanTape = apply { if (validated) { return@apply @@ -1449,6 +1457,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountStanding = apply { if (validated) { return@apply @@ -1663,6 +1680,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountState = apply { if (validated) { return@apply @@ -1804,6 +1831,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): FinancialAccountStatus = apply { if (validated) { return@apply @@ -1967,6 +2004,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): FinancialAccountSubstatus = apply { if (validated) { return@apply @@ -2125,6 +2172,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PeriodState = apply { if (validated) { return@apply @@ -2450,6 +2507,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Balances = apply { if (validated) { return@apply @@ -2901,6 +2967,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InterestDetails = apply { if (validated) { return@apply @@ -3039,6 +3114,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InterestCalculationMethod = apply { if (validated) { return@apply @@ -3256,6 +3341,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BalanceDetails = apply { if (validated) { return@apply @@ -3630,6 +3724,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentAllocation = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeConfiguration.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeConfiguration.kt index e7fdc727f..018d0a605 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeConfiguration.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeConfiguration.kt @@ -377,6 +377,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LoanTapeConfiguration = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEvent.kt index c5087b934..cb81e1353 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEvent.kt @@ -1031,6 +1031,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LoanTapeCreatedWebhookEvent = apply { if (validated) { return@apply @@ -1185,6 +1193,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeRebuildConfiguration.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeRebuildConfiguration.kt index fe327d24e..e76e83029 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeRebuildConfiguration.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeRebuildConfiguration.kt @@ -216,6 +216,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LoanTapeRebuildConfiguration = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEvent.kt index dd2defbb0..0a68f5e4e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEvent.kt @@ -1031,6 +1031,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LoanTapeUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -1185,6 +1193,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreateParams.kt index cb3200ded..f84492a1d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreateParams.kt @@ -1018,6 +1018,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreateManagementOperationRequest = apply { if (validated) { return@apply @@ -1221,6 +1230,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationCategory = apply { if (validated) { return@apply @@ -1354,6 +1372,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationDirection = apply { if (validated) { return@apply @@ -1625,6 +1652,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationEventType = apply { if (validated) { return@apply @@ -1755,6 +1791,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OnClosedAccount = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreatedWebhookEvent.kt index 37406a7bb..0e5c7326e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreatedWebhookEvent.kt @@ -806,6 +806,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationCreatedWebhookEvent = apply { if (validated) { return@apply @@ -948,6 +956,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationListPageResponse.kt index 70293cb13..a0bf94399 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationListPageResponse.kt @@ -183,6 +183,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationListParams.kt index 44adbc6aa..6b1a40240 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationListParams.kt @@ -461,6 +461,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationCategory = apply { if (validated) { return@apply @@ -615,6 +624,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationReverseParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationReverseParams.kt index 212d973c4..c201a48ad 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationReverseParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationReverseParams.kt @@ -447,6 +447,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationActionRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationTransaction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationTransaction.kt index b47a6e808..744006b8a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationTransaction.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationTransaction.kt @@ -707,6 +707,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationTransaction = apply { if (validated) { return@apply @@ -879,6 +887,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply @@ -1030,6 +1047,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationCategory = apply { if (validated) { return@apply @@ -1163,6 +1189,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationDirection = apply { if (validated) { return@apply @@ -1611,6 +1646,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationEvent = apply { if (validated) { return@apply @@ -1748,6 +1792,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DetailedResults = apply { if (validated) { return@apply @@ -1881,6 +1935,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -2156,6 +2220,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationEventType = apply { if (validated) { return@apply @@ -2315,6 +2389,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Family = apply { if (validated) { return@apply @@ -2444,6 +2527,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -2690,6 +2782,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSeries = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationUpdatedWebhookEvent.kt index 42b2140e1..2369cb184 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationUpdatedWebhookEvent.kt @@ -806,6 +806,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ManagementOperationUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -948,6 +956,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Merchant.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Merchant.kt index a445045e2..c10e35938 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Merchant.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Merchant.kt @@ -365,6 +365,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Merchant = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MerchantLockParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MerchantLockParameters.kt index 31aed5cfa..49271a588 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MerchantLockParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MerchantLockParameters.kt @@ -157,6 +157,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): MerchantLockParameters = apply { if (validated) { return@apply @@ -372,6 +380,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Merchant = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt index 8be345d83..cc012859b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt @@ -403,6 +403,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): MessageAttempt = apply { if (validated) { return@apply @@ -543,6 +551,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt index fe3d96dbb..c52e91692 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt @@ -992,6 +992,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): MicroDepositCreateResponse = apply { if (validated) { return@apply @@ -1150,6 +1158,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OwnerType = apply { if (validated) { return@apply @@ -1282,6 +1299,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1411,6 +1437,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -1554,6 +1589,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationMethod = apply { if (validated) { return@apply @@ -1696,6 +1740,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkProgram.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkProgram.kt index 1a557beaf..afc2b3298 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkProgram.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkProgram.kt @@ -259,6 +259,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): NetworkProgram = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkProgramListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkProgramListPageResponse.kt index e82cd299c..663598690 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkProgramListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkProgramListPageResponse.kt @@ -182,6 +182,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): NetworkProgramListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotal.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotal.kt index 2fe079c17..7642eabdb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotal.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotal.kt @@ -563,6 +563,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): NetworkTotal = apply { if (validated) { return@apply @@ -858,6 +866,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Amounts = apply { if (validated) { return@apply @@ -1028,6 +1045,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Network = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotalCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotalCreatedWebhookEvent.kt index 0ac4b43d6..07d4a95c0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotalCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotalCreatedWebhookEvent.kt @@ -629,6 +629,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): NetworkTotalCreatedWebhookEvent = apply { if (validated) { return@apply @@ -763,6 +771,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotalUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotalUpdatedWebhookEvent.kt index 014bc0206..51dfd9151 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotalUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NetworkTotalUpdatedWebhookEvent.kt @@ -629,6 +629,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): NetworkTotalUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -763,6 +771,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt index 295e7a801..acd53f0e3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt @@ -1229,6 +1229,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): NonPciCard = apply { if (validated) { return@apply @@ -1653,6 +1661,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FundingAccount = apply { if (validated) { return@apply @@ -1795,6 +1812,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -1926,6 +1953,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2097,6 +2134,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PinStatus = apply { if (validated) { return@apply @@ -2254,6 +2300,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): State = apply { if (validated) { return@apply @@ -2413,6 +2468,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2613,6 +2677,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Substatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/OwnerType.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/OwnerType.kt index 736c41370..c235c7f09 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/OwnerType.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/OwnerType.kt @@ -92,6 +92,14 @@ class OwnerType @JsonCreator private constructor(private val value: JsonField = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = parsedWebhookEvent.accept(new ParsedWebhookEvent.Visitor>() { + * @Override + * public Optional visitAccountHolderCreated(AccountHolderCreatedWebhookEvent accountHolderCreated) { + * return Optional.of(accountHolderCreated.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { accountHolderCreated != null -> visitor.visitAccountHolderCreated(accountHolderCreated) @@ -750,6 +779,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ParsedWebhookEvent = apply { if (validated) { return@apply @@ -3002,6 +3039,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KybPayload = apply { if (validated) { return@apply @@ -3286,6 +3332,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateRequest = apply { if (validated) { return@apply @@ -3683,6 +3739,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Individual = apply { if (validated) { return@apply @@ -4063,6 +4129,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Address = apply { if (validated) { return@apply @@ -4283,6 +4359,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -4589,6 +4675,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): KycPayload = apply { if (validated) { return@apply @@ -4736,6 +4831,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdateRequest = apply { if (validated) { return@apply @@ -5131,6 +5236,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Individual = apply { if (validated) { return@apply @@ -5511,6 +5626,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Address = apply { if (validated) { return@apply @@ -5722,6 +5847,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -6259,6 +6394,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LegacyPayload = apply { if (validated) { return@apply @@ -6392,6 +6536,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt index aeab8be6b..358ed5fd2 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt @@ -997,6 +997,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Payment = apply { if (validated) { return@apply @@ -1278,6 +1286,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionCategory = apply { if (validated) { return@apply @@ -1406,6 +1423,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Direction = apply { if (validated) { return@apply @@ -1906,6 +1932,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentEvent = apply { if (validated) { return@apply @@ -2040,6 +2075,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -2342,6 +2387,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentEventType = apply { if (validated) { return@apply @@ -2505,6 +2560,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DetailedResult = apply { if (validated) { return@apply @@ -2660,6 +2725,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Family = apply { if (validated) { return@apply @@ -2792,6 +2866,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Method = apply { if (validated) { return@apply @@ -2854,6 +2937,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = methodAttributes.accept(new MethodAttributes.Visitor>() { + * @Override + * public Optional visitAch(AchMethodAttributes ach) { + * return Optional.of(ach.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { ach != null -> visitor.visitAch(ach) @@ -2863,6 +2975,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): MethodAttributes = apply { if (validated) { return@apply @@ -3509,6 +3630,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AchMethodAttributes = apply { if (validated) { return@apply @@ -3670,6 +3801,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): SecCode = apply { if (validated) { return@apply @@ -4092,6 +4233,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): WireMethodAttributes = apply { if (validated) { return@apply @@ -4224,6 +4375,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): WireNetwork = apply { if (validated) { return@apply @@ -4475,6 +4636,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RelatedAccountTokens = apply { if (validated) { return@apply @@ -4617,6 +4787,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionResult = apply { if (validated) { return@apply @@ -4749,6 +4928,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Source = apply { if (validated) { return@apply @@ -4903,6 +5091,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionStatus = apply { if (validated) { return@apply @@ -5073,6 +5270,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransferType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt index 706984049..823df27a3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt @@ -935,6 +935,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreatePaymentRequest = apply { if (validated) { return@apply @@ -1108,6 +1117,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Method = apply { if (validated) { return@apply @@ -1387,6 +1405,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentMethodRequestAttributes = apply { if (validated) { return@apply @@ -1518,6 +1545,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SecCode = apply { if (validated) { return@apply @@ -1666,6 +1703,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1818,6 +1864,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Hold = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt index d915118ed..3cdb38844 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt @@ -1068,6 +1068,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentCreateResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentListPageResponse.kt index 31bed2929..a9e9bcf3c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentListPageResponse.kt @@ -178,6 +178,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentListParams.kt index 9086413fe..4c4a0518f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentListParams.kt @@ -436,6 +436,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Category = apply { if (validated) { return@apply @@ -561,6 +570,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -698,6 +716,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt index b18727010..ee8a141e4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt @@ -1068,6 +1068,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentRetryResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentReturnParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentReturnParams.kt index d06496048..e40778434 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentReturnParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentReturnParams.kt @@ -716,6 +716,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentReturnRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionParams.kt index c82e62c01..df13ef6b5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionParams.kt @@ -678,6 +678,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SimulateActionRequest = apply { if (validated) { return@apply @@ -887,6 +896,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SupportedSimulationTypes = apply { if (validated) { return@apply @@ -1031,6 +1049,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SupportedSimulationDeclineReasons = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt index ef4709493..03de1630b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt @@ -218,6 +218,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentSimulateActionResponse = apply { if (validated) { return@apply @@ -336,6 +344,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptParams.kt index 75da56c0e..7a6f13a6c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptParams.kt @@ -633,6 +633,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SimulateReceiptRequest = apply { if (validated) { return@apply @@ -790,6 +799,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ReceiptType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt index 5d9f6b044..54a33a602 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt @@ -219,6 +219,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentSimulateReceiptResponse = apply { if (validated) { return@apply @@ -337,6 +345,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseParams.kt index 8b6ce1aa6..60fe94ed2 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseParams.kt @@ -372,6 +372,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SimulateOriginationReleaseRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt index c32db1b7f..f7855f339 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt @@ -219,6 +219,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentSimulateReleaseResponse = apply { if (validated) { return@apply @@ -337,6 +345,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnParams.kt index fe2a928d6..b9849cfe4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnParams.kt @@ -446,6 +446,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SimulateOriginationReturnRequest = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt index b051c6388..54287822e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt @@ -218,6 +218,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentSimulateReturnResponse = apply { if (validated) { return@apply @@ -336,6 +344,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEvent.kt index 288e503c4..0eb0951a8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEvent.kt @@ -1079,6 +1079,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentTransactionCreatedWebhookEvent = apply { if (validated) { return@apply @@ -1233,6 +1241,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEvent.kt index b1a1e812a..89e1e68b8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEvent.kt @@ -1079,6 +1079,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentTransactionUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -1233,6 +1241,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PrimeRateRetrieveResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PrimeRateRetrieveResponse.kt index 6d7f4c7a2..4639f00d6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PrimeRateRetrieveResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PrimeRateRetrieveResponse.kt @@ -184,6 +184,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PrimeRateRetrieveResponse = apply { if (validated) { return@apply @@ -369,6 +377,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InterestRate = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ProvisionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ProvisionResponse.kt index 3cdb92ccd..3be817d7b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ProvisionResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ProvisionResponse.kt @@ -197,6 +197,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ProvisionResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementListDetailsPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementListDetailsPageResponse.kt index 21e32fa2e..4dcb14c34 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementListDetailsPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementListDetailsPageResponse.kt @@ -184,6 +184,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ReportSettlementListDetailsPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPageResponse.kt index 248a7ab66..ae1ac9555 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPageResponse.kt @@ -185,6 +185,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ReportSettlementNetworkTotalListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt index 550364f2f..22cd26575 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt @@ -485,6 +485,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Network = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt index f2dabce8c..d2696ce13 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt @@ -281,6 +281,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ReportStats = apply { if (validated) { return@apply @@ -377,6 +385,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ActionCounts = apply { if (validated) { return@apply @@ -714,6 +731,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Example = apply { if (validated) { return@apply @@ -815,6 +841,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = action.accept(new Action.Visitor>() { + * @Override + * public Optional visitDeclineActionAuthorization(DeclineActionAuthorization declineActionAuthorization) { + * return Optional.of(declineActionAuthorization.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { declineActionAuthorization != null -> @@ -833,6 +889,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -1276,6 +1342,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DeclineActionAuthorization = apply { if (validated) { return@apply @@ -1777,6 +1853,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): DetailedResult = apply { if (validated) { return@apply @@ -1904,6 +1990,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2083,6 +2179,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ChallengeActionAuthorization = apply { if (validated) { return@apply @@ -2197,6 +2303,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2380,6 +2496,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ResultAuthentication3dsAction = apply { if (validated) { return@apply @@ -2507,6 +2633,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Authentication3dsAction = apply { if (validated) { return@apply @@ -2723,6 +2859,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DeclineActionTokenization = apply { if (validated) { return@apply @@ -2841,6 +2987,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -3047,6 +3203,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Reason = apply { if (validated) { return@apply @@ -3263,6 +3429,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RequireTfaAction = apply { if (validated) { return@apply @@ -3381,6 +3557,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -3595,6 +3781,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Reason = apply { if (validated) { return@apply @@ -3776,6 +3972,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ApproveActionAch = apply { if (validated) { return@apply @@ -3891,6 +4097,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -4110,6 +4326,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ReturnAction = apply { if (validated) { return@apply @@ -4645,6 +4871,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Code = apply { if (validated) { return@apply @@ -4773,6 +5009,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -4955,6 +5201,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleVersionState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/RequiredDocument.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/RequiredDocument.kt index 5d4dae120..dc71d00e9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/RequiredDocument.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/RequiredDocument.kt @@ -249,6 +249,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RequiredDocument = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCheckStatusParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCheckStatusParams.kt index 1f81106e9..c96085f4a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCheckStatusParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCheckStatusParams.kt @@ -286,6 +286,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateParams.kt index 3728c0b9e..17609079a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateParams.kt @@ -390,6 +390,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -531,6 +540,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateResponse.kt index 5c557e7ad..e2e7bac0d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateResponse.kt @@ -119,6 +119,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ResponderEndpointCreateResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointDeleteParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointDeleteParams.kt index 581f34f56..2155de618 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointDeleteParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointDeleteParams.kt @@ -320,6 +320,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointStatus.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointStatus.kt index 2bd29ca67..5a9e51d03 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointStatus.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointStatus.kt @@ -148,6 +148,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ResponderEndpointStatus = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/RuleFeature.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/RuleFeature.kt index 4202f3283..122ac03b3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/RuleFeature.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/RuleFeature.kt @@ -128,6 +128,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = ruleFeature.accept(new RuleFeature.Visitor>() { + * @Override + * public Optional visitAuthorization(AuthorizationFeature authorization) { + * return Optional.of(authorization.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { authorization != null -> visitor.visitAuthorization(authorization) @@ -145,6 +174,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RuleFeature = apply { if (validated) { return@apply @@ -579,6 +616,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthorizationFeature = apply { if (validated) { return@apply @@ -690,6 +736,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -892,6 +948,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthenticationFeature = apply { if (validated) { return@apply @@ -1003,6 +1068,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1205,6 +1280,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationFeature = apply { if (validated) { return@apply @@ -1316,6 +1400,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1518,6 +1612,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AchReceiptFeature = apply { if (validated) { return@apply @@ -1629,6 +1732,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1827,6 +1940,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardFeature = apply { if (validated) { return@apply @@ -1938,6 +2060,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2140,6 +2272,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderFeature = apply { if (validated) { return@apply @@ -2251,6 +2392,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2453,6 +2604,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): IpMetadataFeature = apply { if (validated) { return@apply @@ -2564,6 +2724,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2908,6 +3078,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SpendVelocityFeature = apply { if (validated) { return@apply @@ -3037,6 +3216,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VelocityScope = apply { if (validated) { return@apply @@ -3158,6 +3347,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -3402,6 +3601,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionHistorySignalsFeature = apply { if (validated) { return@apply @@ -3531,6 +3739,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Scope = apply { if (validated) { return@apply @@ -3652,6 +3870,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt index bbbbeddfa..77a8d8e41 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt @@ -981,6 +981,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SettlementDetail = apply { if (validated) { return@apply @@ -1159,6 +1167,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Network = apply { if (validated) { return@apply @@ -1294,6 +1311,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OtherFeesDetails = apply { if (validated) { return@apply @@ -1473,6 +1499,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReport.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReport.kt index 9c97acad0..fefa61cb3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReport.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReport.kt @@ -614,6 +614,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SettlementReport = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReportUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReportUpdatedWebhookEvent.kt index 2f05ec4a4..479bf876f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReportUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReportUpdatedWebhookEvent.kt @@ -671,6 +671,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SettlementReportUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -803,6 +811,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt index 853ff9b01..e2897defc 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt @@ -406,6 +406,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SettlementSummaryDetails = apply { if (validated) { return@apply @@ -558,6 +566,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Network = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt index 6cb8bec9e..50c91bebb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt @@ -504,6 +504,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ShippingAddress = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SpendLimitDuration.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SpendLimitDuration.kt index 96d095051..c35024313 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SpendLimitDuration.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SpendLimitDuration.kt @@ -119,6 +119,14 @@ class SpendLimitDuration @JsonCreator private constructor(private val value: Jso private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SpendLimitDuration = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt index 0ff48a049..05e007e82 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt @@ -1038,6 +1038,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Statement = apply { if (validated) { return@apply @@ -1529,6 +1537,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountStanding = apply { if (validated) { return@apply @@ -1743,6 +1760,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialAccountState = apply { if (validated) { return@apply @@ -1884,6 +1911,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): FinancialAccountStatus = apply { if (validated) { return@apply @@ -2047,6 +2084,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): FinancialAccountSubstatus = apply { if (validated) { return@apply @@ -2205,6 +2252,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PeriodState = apply { if (validated) { return@apply @@ -2438,6 +2495,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AmountDue = apply { if (validated) { return@apply @@ -2582,6 +2648,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatementType = apply { if (validated) { return@apply @@ -3015,6 +3090,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InterestDetails = apply { if (validated) { return@apply @@ -3153,6 +3237,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InterestCalculationMethod = apply { if (validated) { return@apply @@ -3596,6 +3690,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PayoffDetails = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt index 80dd0c94a..a1244b1d0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt @@ -183,6 +183,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatementLineItems = apply { if (validated) { return@apply @@ -858,6 +866,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatementLineItemResponse = apply { if (validated) { return@apply @@ -1131,6 +1148,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionCategory = apply { if (validated) { return@apply @@ -1775,6 +1802,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FinancialEventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementTotals.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementTotals.kt index 5316d13ce..f699756cb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementTotals.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementTotals.kt @@ -450,6 +450,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatementTotals = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statements.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statements.kt index fc7b3184c..4c147259a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statements.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statements.kt @@ -175,6 +175,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Statements = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt index b2c79f019..74121c56a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt @@ -1110,6 +1110,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatementsCreatedWebhookEvent = apply { if (validated) { return@apply @@ -1266,6 +1274,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SubscriptionRetrieveSecretResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SubscriptionRetrieveSecretResponse.kt index f73ea80bd..367be5ef5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SubscriptionRetrieveSecretResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SubscriptionRetrieveSecretResponse.kt @@ -118,6 +118,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SubscriptionRetrieveSecretResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthentication.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthentication.kt index c6e0383b7..7dcfe8843 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthentication.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthentication.kt @@ -1025,6 +1025,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ThreeDSAuthentication = apply { if (validated) { return@apply @@ -1189,6 +1197,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -1333,6 +1350,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthenticationResult = apply { if (validated) { return@apply @@ -1472,6 +1498,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardExpiryCheck = apply { if (validated) { return@apply @@ -2002,6 +2037,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Cardholder = apply { if (validated) { return@apply @@ -2164,6 +2208,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AddressMatchResult = apply { if (validated) { return@apply @@ -2508,6 +2562,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillingAddress = apply { if (validated) { return@apply @@ -2884,6 +2948,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ShippingAddress = apply { if (validated) { return@apply @@ -3087,6 +3161,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Channel = apply { if (validated) { return@apply @@ -3413,6 +3496,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Merchant = apply { if (validated) { return@apply @@ -4018,6 +4110,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RiskIndicator = apply { if (validated) { return@apply @@ -4174,6 +4276,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DeliveryTimeFrame = apply { if (validated) { return@apply @@ -4313,6 +4425,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): OrderAvailability = apply { if (validated) { return@apply @@ -4450,6 +4572,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ReorderItems = apply { if (validated) { return@apply @@ -4633,6 +4765,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ShippingMethod = apply { if (validated) { return@apply @@ -4829,6 +4971,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): MessageCategory = apply { if (validated) { return@apply @@ -5007,6 +5158,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ThreeDSRequestorChallengeIndicator = apply { if (validated) { return@apply @@ -5229,6 +5389,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AdditionalData = apply { if (validated) { return@apply @@ -5356,6 +5525,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): NetworkDecision = apply { if (validated) { return@apply @@ -5938,6 +6117,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): App = apply { if (validated) { return@apply @@ -6177,6 +6365,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthenticationRequestType = apply { if (validated) { return@apply @@ -6615,6 +6812,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Browser = apply { if (validated) { return@apply @@ -6919,6 +7125,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChallengeMetadata = apply { if (validated) { return@apply @@ -7044,6 +7259,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): MethodType = apply { if (validated) { return@apply @@ -7232,6 +7457,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -7396,6 +7631,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChallengeOrchestratedBy = apply { if (validated) { return@apply @@ -7553,6 +7797,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DecisionMadeBy = apply { if (validated) { return@apply @@ -7773,6 +8026,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ThreeRiRequestType = apply { if (validated) { return@apply @@ -8174,6 +8436,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Transaction = apply { if (validated) { return@apply @@ -8322,6 +8593,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEvent.kt index 26e91639d..76db24e51 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEvent.kt @@ -1157,6 +1157,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ThreeDSAuthenticationApprovalRequestWebhookEvent = apply { if (validated) { return@apply @@ -1310,6 +1318,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationChallengeWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationChallengeWebhookEvent.kt index 469ec3540..7b96fd845 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationChallengeWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationChallengeWebhookEvent.kt @@ -217,6 +217,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ThreeDSAuthenticationChallengeWebhookEvent = apply { if (validated) { return@apply @@ -503,6 +511,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Challenge = apply { if (validated) { return@apply @@ -627,6 +644,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChallengeMethodType = apply { if (validated) { return@apply @@ -778,6 +805,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationCreatedWebhookEvent.kt index 23aea275d..0417e3cd1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationCreatedWebhookEvent.kt @@ -1158,6 +1158,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ThreeDSAuthenticationCreatedWebhookEvent = apply { if (validated) { return@apply @@ -1308,6 +1316,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateOtpEntryParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateOtpEntryParams.kt index 5e4eea75a..eb361e243 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateOtpEntryParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateOtpEntryParams.kt @@ -438,6 +438,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt index 41ea77398..b629abb53 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt @@ -594,6 +594,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SimulateAuthenticationRequest = apply { if (validated) { return@apply @@ -886,6 +895,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Merchant = apply { if (validated) { return@apply @@ -1093,6 +1111,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Transaction = apply { if (validated) { return@apply @@ -1242,6 +1269,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardExpiryCheck = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationUpdatedWebhookEvent.kt index 679149e0f..b7e230718 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationUpdatedWebhookEvent.kt @@ -1158,6 +1158,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ThreeDSAuthenticationUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -1308,6 +1316,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenInfo.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenInfo.kt index 4bff18ffc..5c959acf4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenInfo.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenInfo.kt @@ -142,6 +142,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenInfo = apply { if (validated) { return@apply @@ -285,6 +293,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): WalletType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenMetadata.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenMetadata.kt index ea61538f7..071a7baa0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenMetadata.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenMetadata.kt @@ -317,6 +317,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenMetadata = apply { if (validated) { return@apply @@ -635,6 +643,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PaymentAccountInfo = apply { if (validated) { return@apply @@ -792,6 +809,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountHolderData = apply { if (validated) { return@apply @@ -1018,6 +1045,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenRequestorName = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt index 66428ec8c..b4866a83c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt @@ -700,6 +700,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Tokenization = apply { if (validated) { return@apply @@ -870,6 +878,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1061,6 +1078,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenRequestorName = apply { if (validated) { return@apply @@ -1192,6 +1218,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationChannel = apply { if (validated) { return@apply @@ -1621,6 +1656,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationEvent = apply { if (validated) { return@apply @@ -1822,6 +1866,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationEventOutcome = apply { if (validated) { return@apply @@ -1968,6 +2022,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationApprovalRequestWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationApprovalRequestWebhookEvent.kt index c3a0b0751..423fd07d8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationApprovalRequestWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationApprovalRequestWebhookEvent.kt @@ -775,6 +775,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationApprovalRequestWebhookEvent = apply { if (validated) { return@apply @@ -1061,6 +1069,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomerTokenizationDecision = apply { if (validated) { return@apply @@ -1212,6 +1229,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Outcome = apply { if (validated) { return@apply @@ -1357,6 +1384,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -1496,6 +1532,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): IssuerDecision = apply { if (validated) { return@apply @@ -1627,6 +1672,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationChannel = apply { if (validated) { return@apply @@ -1782,6 +1836,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationSource = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationDecisioningRotateSecretResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationDecisioningRotateSecretResponse.kt index 5fdad4b2e..e5ce68239 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationDecisioningRotateSecretResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationDecisioningRotateSecretResponse.kt @@ -119,6 +119,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationDecisioningRotateSecretResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationDeclineReason.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationDeclineReason.kt index c94a79348..586a453e9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationDeclineReason.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationDeclineReason.kt @@ -165,6 +165,14 @@ private constructor(private val value: JsonField) : Enum { private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationDeclineReason = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationListPageResponse.kt index 0a7a3dffd..67a940c61 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationListPageResponse.kt @@ -163,6 +163,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationListParams.kt index 13558b366..299c18153 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationListParams.kt @@ -414,6 +414,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationChannel = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationResendActivationCodeParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationResendActivationCodeParams.kt index f4cea5670..9a4e02cd8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationResendActivationCodeParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationResendActivationCodeParams.kt @@ -392,6 +392,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -536,6 +545,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ActivationMethodType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationResultWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationResultWebhookEvent.kt index 28235b5c3..c900bbc0a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationResultWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationResultWebhookEvent.kt @@ -345,6 +345,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationResultWebhookEvent = apply { if (validated) { return@apply @@ -465,6 +473,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply @@ -954,6 +971,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationResultDetails = apply { if (validated) { return@apply @@ -1156,6 +1182,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationDeclineReason = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationRuleResult.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationRuleResult.kt index 291ef70af..1c5470359 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationRuleResult.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationRuleResult.kt @@ -260,6 +260,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationRuleResult = apply { if (validated) { return@apply @@ -392,6 +400,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSecret.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSecret.kt index b4debebfb..1ef65d4ec 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSecret.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSecret.kt @@ -113,6 +113,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationSecret = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSimulateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSimulateParams.kt index 4d7272e24..5602cccc7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSimulateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSimulateParams.kt @@ -879,6 +879,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1062,6 +1071,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationSource = apply { if (validated) { return@apply @@ -1203,6 +1221,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): WalletRecommendedDecision = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTfaReason.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTfaReason.kt index 48cb3c602..16f7abffc 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTfaReason.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTfaReason.kt @@ -175,6 +175,14 @@ class TokenizationTfaReason @JsonCreator private constructor(private val value: private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationTfaReason = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTwoFactorAuthenticationCodeSentWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTwoFactorAuthenticationCodeSentWebhookEvent.kt index f269e5a88..643fa2bd6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTwoFactorAuthenticationCodeSentWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTwoFactorAuthenticationCodeSentWebhookEvent.kt @@ -344,6 +344,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationTwoFactorAuthenticationCodeSentWebhookEvent = apply { if (validated) { return@apply @@ -542,6 +550,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ActivationMethod = apply { if (validated) { return@apply @@ -665,6 +682,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -810,6 +837,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTwoFactorAuthenticationCodeWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTwoFactorAuthenticationCodeWebhookEvent.kt index 7036fab1b..16c842501 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTwoFactorAuthenticationCodeWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationTwoFactorAuthenticationCodeWebhookEvent.kt @@ -386,6 +386,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationTwoFactorAuthenticationCodeWebhookEvent = apply { if (validated) { return@apply @@ -586,6 +594,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ActivationMethod = apply { if (validated) { return@apply @@ -709,6 +726,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -854,6 +881,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationUpdateDigitalCardArtParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationUpdateDigitalCardArtParams.kt index 17b9092fd..cec9533fe 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationUpdateDigitalCardArtParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationUpdateDigitalCardArtParams.kt @@ -393,6 +393,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationUpdatedWebhookEvent.kt index fa7b65cbb..2efcda98b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationUpdatedWebhookEvent.kt @@ -286,6 +286,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationUpdatedWebhookEvent = apply { if (validated) { return@apply @@ -404,6 +412,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt index 620482f37..bdf0e3a38 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt @@ -1358,6 +1358,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Transaction = apply { if (validated) { return@apply @@ -1658,6 +1666,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionAmounts = apply { if (validated) { return@apply @@ -1899,6 +1916,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Cardholder = apply { if (validated) { return@apply @@ -2110,6 +2137,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Hold = apply { if (validated) { return@apply @@ -2318,6 +2355,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Merchant = apply { if (validated) { return@apply @@ -2526,6 +2573,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Settlement = apply { if (validated) { return@apply @@ -2749,6 +2806,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Avs = apply { if (validated) { return@apply @@ -3300,6 +3366,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionMerchant = apply { if (validated) { return@apply @@ -3501,6 +3576,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Network = apply { if (validated) { return@apply @@ -3689,6 +3773,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Pos = apply { if (validated) { return@apply @@ -3959,6 +4052,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PosEntryMode = apply { if (validated) { return@apply @@ -4097,6 +4200,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Card = apply { if (validated) { return@apply @@ -4278,6 +4391,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Cardholder = apply { if (validated) { return@apply @@ -4487,6 +4610,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Pan = apply { if (validated) { return@apply @@ -4989,6 +5122,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PosTerminal = apply { if (validated) { return@apply @@ -5136,6 +5279,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -5282,6 +5435,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): PinCapability = apply { if (validated) { return@apply @@ -5545,6 +5708,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -5870,6 +6043,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DeclineResult = apply { if (validated) { return@apply @@ -6193,6 +6375,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ServiceLocation = apply { if (validated) { return@apply @@ -6358,6 +6549,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -6458,6 +6658,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Tags = apply { if (validated) { return@apply @@ -7086,6 +7295,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionEvent = apply { if (validated) { return@apply @@ -7341,6 +7559,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionEventAmounts = apply { if (validated) { return@apply @@ -7582,6 +7810,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Cardholder = apply { if (validated) { return@apply @@ -7798,6 +8036,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Merchant = apply { if (validated) { return@apply @@ -8061,6 +8309,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Settlement = apply { if (validated) { return@apply @@ -8585,6 +8843,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DetailedResult = apply { if (validated) { return@apply @@ -8719,6 +8987,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EffectivePolarity = apply { if (validated) { return@apply @@ -9002,6 +9280,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): NetworkInfo = apply { if (validated) { return@apply @@ -9232,6 +9520,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Acquirer = apply { if (validated) { return@apply @@ -9483,6 +9781,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Amex = apply { if (validated) { return@apply @@ -9870,6 +10178,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Mastercard = apply { if (validated) { return@apply @@ -10129,6 +10447,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Visa = apply { if (validated) { return@apply @@ -10433,6 +10761,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DeclineResult = apply { if (validated) { return@apply @@ -10732,6 +11070,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RuleResult = apply { if (validated) { return@apply @@ -11226,6 +11574,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DetailedResult = apply { if (validated) { return@apply @@ -11449,6 +11807,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -11580,6 +11948,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountType = apply { if (validated) { return@apply @@ -11779,6 +12157,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): NetworkSpecificData = apply { if (validated) { return@apply @@ -12098,6 +12486,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): MastercardNetworkSpecificData = apply { if (validated) { return@apply @@ -12339,6 +12737,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): OnBehalfServiceResult = apply { if (validated) { return@apply @@ -12568,6 +12976,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): VisaNetworkSpecificData = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionListPageResponse.kt index 5d253f008..3d488b54f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionListPageResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionListParams.kt index c2cdd10a7..544b283d1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionListParams.kt @@ -427,6 +427,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -579,6 +588,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CardTransactionStatusFilter = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionReportResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionReportResponse.kt index ff89eccac..1e2571781 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionReportResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionReportResponse.kt @@ -389,6 +389,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionReportResponse = apply { if (validated) { return@apply @@ -540,6 +548,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FraudStatus = apply { if (validated) { return@apply @@ -705,6 +722,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FraudType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionRetrieveResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionRetrieveResponse.kt index 06af5316d..8c57bca94 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionRetrieveResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionRetrieveResponse.kt @@ -389,6 +389,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionRetrieveResponse = apply { if (validated) { return@apply @@ -540,6 +548,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FraudStatus = apply { if (validated) { return@apply @@ -705,6 +722,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FraudType = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceParams.kt index 67f8b914f..d101216cb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceParams.kt @@ -437,6 +437,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceResponse.kt index dcbe0d0db..a333c7211 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSimulateAuthorizationAdviceResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationParams.kt index 99ffddc82..6325674aa 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationParams.kt @@ -1304,6 +1304,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1521,6 +1530,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationResponse.kt index cd06abd2e..8288c02ef 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationResponse.kt @@ -167,6 +167,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSimulateAuthorizationResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateClearingParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateClearingParams.kt index bef278f19..c55973a8d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateClearingParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateClearingParams.kt @@ -457,6 +457,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateClearingResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateClearingResponse.kt index 32a485559..a97fedd4e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateClearingResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateClearingResponse.kt @@ -132,6 +132,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSimulateClearingResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceParams.kt index ffcdff033..22c143c0e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceParams.kt @@ -885,6 +885,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceResponse.kt index 4458b7a86..5dd8bd5bf 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceResponse.kt @@ -166,6 +166,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSimulateCreditAuthorizationAdviceResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationParams.kt index 1fc37b716..07fc1b0df 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationParams.kt @@ -886,6 +886,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationResponse.kt index 4b9958ad4..ce3dbe8d1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSimulateCreditAuthorizationResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnParams.kt index abcada28d..d382601e4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnParams.kt @@ -494,6 +494,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnResponse.kt index 7514985be..2d3015017 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSimulateReturnResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnReversalParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnReversalParams.kt index c6af58186..5b02965e1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnReversalParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnReversalParams.kt @@ -362,6 +362,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnReversalResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnReversalResponse.kt index e3a8718ec..861182b5a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnReversalResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnReversalResponse.kt @@ -132,6 +132,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSimulateReturnReversalResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateVoidParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateVoidParams.kt index 55436ef98..fdcd1729d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateVoidParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateVoidParams.kt @@ -509,6 +509,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -654,6 +663,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateVoidResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateVoidResponse.kt index 1156952f1..20f43ab2f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateVoidResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateVoidResponse.kt @@ -128,6 +128,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransactionSimulateVoidResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transfer.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transfer.kt index 779436a8e..03d95f6cd 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transfer.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transfer.kt @@ -619,6 +619,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Transfer = apply { if (validated) { return@apply @@ -754,6 +762,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Category = apply { if (validated) { return@apply @@ -883,6 +900,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Result = apply { if (validated) { return@apply @@ -1034,6 +1060,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferCreateParams.kt index 59dd74d9a..7191bd829 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferCreateParams.kt @@ -636,6 +636,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitsResponse.kt index 94ec2d979..97b525ce4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitsResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitsResponse.kt @@ -185,6 +185,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransferLimitsResponse = apply { if (validated) { return@apply @@ -532,6 +540,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TransferLimitItem = apply { if (validated) { return@apply @@ -733,6 +750,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DirectionalLimits = apply { if (validated) { return@apply @@ -928,6 +955,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): LimitWithProgress = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TypescriptCodeParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TypescriptCodeParameters.kt index 348a2d248..b526f3b31 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TypescriptCodeParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TypescriptCodeParameters.kt @@ -230,6 +230,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TypescriptCodeParameters = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt index 219b0ba9c..7667bf61a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt @@ -75,6 +75,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = v2ListResultsResponse.accept(new V2ListResultsResponse.Visitor>() { + * @Override + * public Optional visitAuthorizationResult(AuthorizationResult authorizationResult) { + * return Optional.of(authorizationResult.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { authorizationResult != null -> visitor.visitAuthorizationResult(authorizationResult) @@ -87,6 +116,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): V2ListResultsResponse = apply { if (validated) { return@apply @@ -753,6 +790,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthorizationResult = apply { if (validated) { return@apply @@ -823,6 +869,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = action.accept(new Action.Visitor>() { + * @Override + * public Optional visitDeclineActionAuthorization(DeclineActionAuthorization declineActionAuthorization) { + * return Optional.of(declineActionAuthorization.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { declineActionAuthorization != null -> @@ -834,6 +910,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -1197,6 +1283,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DeclineActionAuthorization = apply { if (validated) { return@apply @@ -1700,6 +1796,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): DetailedResult = apply { if (validated) { return@apply @@ -1827,6 +1933,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2048,6 +2164,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ChallengeActionAuthorization = apply { if (validated) { return@apply @@ -2165,6 +2291,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -2314,6 +2450,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventStream = apply { if (validated) { return@apply @@ -2446,6 +2592,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleState = apply { if (validated) { return@apply @@ -2981,6 +3137,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Authentication3dsResult = apply { if (validated) { return@apply @@ -3184,6 +3349,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -3312,6 +3487,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Authentication3dsAction = apply { if (validated) { return@apply @@ -3459,6 +3644,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventStream = apply { if (validated) { return@apply @@ -3591,6 +3786,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleState = apply { if (validated) { return@apply @@ -4137,6 +4342,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TokenizationResult = apply { if (validated) { return@apply @@ -4205,6 +4419,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = action.accept(new Action.Visitor>() { + * @Override + * public Optional visitDeclineActionTokenization(DeclineActionTokenization declineActionTokenization) { + * return Optional.of(declineActionTokenization.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { declineActionTokenization != null -> @@ -4215,6 +4459,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -4567,6 +4821,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DeclineActionTokenization = apply { if (validated) { return@apply @@ -4687,6 +4951,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -4893,6 +5167,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Reason = apply { if (validated) { return@apply @@ -5149,6 +5433,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RequireTfaAction = apply { if (validated) { return@apply @@ -5269,6 +5563,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -5483,6 +5787,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Reason = apply { if (validated) { return@apply @@ -5633,6 +5947,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventStream = apply { if (validated) { return@apply @@ -5765,6 +6089,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleState = apply { if (validated) { return@apply @@ -6308,6 +6642,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AchResult = apply { if (validated) { return@apply @@ -6376,6 +6719,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = action.accept(new Action.Visitor>() { + * @Override + * public Optional visitApproveActionAch(ApproveActionAch approveActionAch) { + * return Optional.of(approveActionAch.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { approveActionAch != null -> visitor.visitApproveActionAch(approveActionAch) @@ -6385,6 +6758,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -6693,6 +7076,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ApproveActionAch = apply { if (validated) { return@apply @@ -6811,6 +7204,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -7072,6 +7475,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ReturnAction = apply { if (validated) { return@apply @@ -7609,6 +8022,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Code = apply { if (validated) { return@apply @@ -7737,6 +8160,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -7893,6 +8326,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EventStream = apply { if (validated) { return@apply @@ -8025,6 +8468,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AuthRuleState = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListVersionsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListVersionsResponse.kt index 85b5aed57..bd5abccdf 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListVersionsResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListVersionsResponse.kt @@ -147,6 +147,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): V2ListVersionsResponse = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponse.kt index 18a813a49..84e983bc6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponse.kt @@ -192,6 +192,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): V2RetrieveFeaturesResponse = apply { if (validated) { return@apply @@ -477,6 +485,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SpendFeatureState = apply { if (validated) { return@apply @@ -604,6 +621,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VelocityScope = apply { if (validated) { return@apply @@ -807,6 +834,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Value = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt index 5c82063fb..71ba4038d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt @@ -260,6 +260,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): V2RetrieveReportResponse = apply { if (validated) { return@apply @@ -462,6 +470,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DailyStatistic = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitFilters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitFilters.kt index d1cccd43a..0435bb2a5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitFilters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitFilters.kt @@ -398,6 +398,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VelocityLimitFilters = apply { if (validated) { return@apply @@ -602,6 +610,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): IncludePanEntryMode = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt index 7b89e4613..58113d288 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt @@ -333,6 +333,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VelocityLimitParams = apply { if (validated) { return@apply @@ -459,6 +467,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VelocityScope = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitPeriod.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitPeriod.kt index dd37a2799..ac9a45391 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitPeriod.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitPeriod.kt @@ -104,6 +104,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = velocityLimitPeriod.accept(new VelocityLimitPeriod.Visitor>() { + * @Override + * public Optional visitTrailingWindowObject(TrailingWindowObject trailingWindowObject) { + * return Optional.of(trailingWindowObject.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { trailingWindowObject != null -> visitor.visitTrailingWindowObject(trailingWindowObject) @@ -116,6 +145,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VelocityLimitPeriod = apply { if (validated) { return@apply @@ -511,6 +548,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TrailingWindowObject = apply { if (validated) { return@apply @@ -623,6 +669,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -791,6 +847,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FixedWindowDay = apply { if (validated) { return@apply @@ -899,6 +964,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1109,6 +1184,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FixedWindowWeek = apply { if (validated) { return@apply @@ -1221,6 +1305,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1437,6 +1531,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FixedWindowMonth = apply { if (validated) { return@apply @@ -1549,6 +1652,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1800,6 +1913,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FixedWindowYear = apply { if (validated) { return@apply @@ -1914,6 +2036,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VerificationMethod.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VerificationMethod.kt index c284b1450..b1ce98355 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VerificationMethod.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VerificationMethod.kt @@ -114,6 +114,14 @@ class VerificationMethod @JsonCreator private constructor(private val value: Jso private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): VerificationMethod = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/WalletDecisioningInfo.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/WalletDecisioningInfo.kt index 68c09eab4..7385e6d92 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/WalletDecisioningInfo.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/WalletDecisioningInfo.kt @@ -295,6 +295,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): WalletDecisioningInfo = apply { if (validated) { return@apply diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/WirePartyDetails.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/WirePartyDetails.kt index c8b335637..578557e84 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/WirePartyDetails.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/WirePartyDetails.kt @@ -232,6 +232,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): WirePartyDetails = apply { if (validated) { return@apply From af54a46bbbdbb176835e48074572df830dbc39c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 17:17:31 +0000 Subject: [PATCH 11/18] feat(client): more robust error parsing --- .../kotlin/com/lithic/api/errors/BadRequestException.kt | 6 +++++- .../com/lithic/api/errors/InternalServerException.kt | 7 ++++++- .../main/kotlin/com/lithic/api/errors/NotFoundException.kt | 6 +++++- .../com/lithic/api/errors/PermissionDeniedException.kt | 6 +++++- .../kotlin/com/lithic/api/errors/RateLimitException.kt | 6 +++++- .../kotlin/com/lithic/api/errors/UnauthorizedException.kt | 6 +++++- .../com/lithic/api/errors/UnexpectedStatusCodeException.kt | 7 ++++++- .../com/lithic/api/errors/UnprocessableEntityException.kt | 6 +++++- 8 files changed, 42 insertions(+), 8 deletions(-) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt index c62f9aa7d..5affead20 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt @@ -5,12 +5,16 @@ package com.lithic.api.errors import com.lithic.api.core.JsonValue import com.lithic.api.core.checkRequired import com.lithic.api.core.http.Headers +import com.lithic.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class BadRequestException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - LithicServiceException("400: $body", cause) { + LithicServiceException( + "400: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 400 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt index ab4984f76..5e26debc1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt @@ -5,6 +5,7 @@ package com.lithic.api.errors import com.lithic.api.core.JsonValue import com.lithic.api.core.checkRequired import com.lithic.api.core.http.Headers +import com.lithic.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -14,7 +15,11 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : LithicServiceException("$statusCode: $body", cause) { +) : + LithicServiceException( + "$statusCode: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = statusCode diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt index 679ba27d6..51b0ebecf 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt @@ -5,12 +5,16 @@ package com.lithic.api.errors import com.lithic.api.core.JsonValue import com.lithic.api.core.checkRequired import com.lithic.api.core.http.Headers +import com.lithic.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class NotFoundException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - LithicServiceException("404: $body", cause) { + LithicServiceException( + "404: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 404 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt index 57ac7e4ba..3bc0206d7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt @@ -5,12 +5,16 @@ package com.lithic.api.errors import com.lithic.api.core.JsonValue import com.lithic.api.core.checkRequired import com.lithic.api.core.http.Headers +import com.lithic.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class PermissionDeniedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - LithicServiceException("403: $body", cause) { + LithicServiceException( + "403: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 403 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt index e4392faca..611834161 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt @@ -5,12 +5,16 @@ package com.lithic.api.errors import com.lithic.api.core.JsonValue import com.lithic.api.core.checkRequired import com.lithic.api.core.http.Headers +import com.lithic.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class RateLimitException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - LithicServiceException("429: $body", cause) { + LithicServiceException( + "429: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 429 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt index 258621983..89c417b8a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt @@ -5,12 +5,16 @@ package com.lithic.api.errors import com.lithic.api.core.JsonValue import com.lithic.api.core.checkRequired import com.lithic.api.core.http.Headers +import com.lithic.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class UnauthorizedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - LithicServiceException("401: $body", cause) { + LithicServiceException( + "401: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 401 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt index 13bfc75b2..d7c58ebc5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt @@ -5,6 +5,7 @@ package com.lithic.api.errors import com.lithic.api.core.JsonValue import com.lithic.api.core.checkRequired import com.lithic.api.core.http.Headers +import com.lithic.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -14,7 +15,11 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : LithicServiceException("$statusCode: $body", cause) { +) : + LithicServiceException( + "$statusCode: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = statusCode diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt index 4b296accd..f6d12260b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt @@ -5,12 +5,16 @@ package com.lithic.api.errors import com.lithic.api.core.JsonValue import com.lithic.api.core.checkRequired import com.lithic.api.core.http.Headers +import com.lithic.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class UnprocessableEntityException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - LithicServiceException("422: $body", cause) { + LithicServiceException( + "422: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 422 From 1728d1a87fbefc15fd86228d122d3a6e2ec53afb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 20:11:38 +0000 Subject: [PATCH 12/18] chore: remove duplicated dokka setup --- build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 666c01572..bf64b9ac9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,7 +21,6 @@ subprojects { group = "Verification" description = "Verifies all source files are formatted." } - apply(plugin = "org.jetbrains.dokka") } subprojects { From 1743358e72d12f38c5012963276deef9f78831d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 23:27:44 +0000 Subject: [PATCH 13/18] perf(client): create one json mapper --- .../src/main/kotlin/com/lithic/api/core/ObjectMappers.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt index c40847243..262d820fc 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt @@ -29,7 +29,9 @@ import java.time.ZoneId import java.time.format.DateTimeFormatter import java.time.temporal.ChronoField -fun jsonMapper(): JsonMapper = +fun jsonMapper(): JsonMapper = JSON_MAPPER + +private val JSON_MAPPER: JsonMapper = JsonMapper.builder() .addModule(kotlinModule()) .addModule(Jdk8Module()) From 183501b5aa6bde88a884b70a370f848b29cdcd8b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 18:51:49 +0000 Subject: [PATCH 14/18] feat(client): support proxy authentication --- README.md | 15 ++ .../api/client/okhttp/LithicOkHttpClient.kt | 17 ++ .../client/okhttp/LithicOkHttpClientAsync.kt | 17 ++ .../lithic/api/client/okhttp/OkHttpClient.kt | 234 +++++++++++------- .../api/core/http/ProxyAuthenticator.kt | 59 +++++ 5 files changed, 257 insertions(+), 85 deletions(-) create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/core/http/ProxyAuthenticator.kt diff --git a/README.md b/README.md index c4538513a..80f40ba29 100644 --- a/README.md +++ b/README.md @@ -500,6 +500,21 @@ LithicClient client = LithicOkHttpClient.builder() .build(); ``` +If the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`: + +```java +import com.lithic.api.client.LithicClient; +import com.lithic.api.client.okhttp.LithicOkHttpClient; +import com.lithic.api.core.http.ProxyAuthenticator; + +LithicClient client = LithicOkHttpClient.builder() + .fromEnv() + .proxy(...) + // Or a custom implementation of `ProxyAuthenticator`. + .proxyAuthenticator(ProxyAuthenticator.basic("username", "password")) + .build(); +``` + ### Connection pooling To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods: diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt index b18253dd6..39b27e2fd 100644 --- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt +++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt @@ -11,6 +11,7 @@ import com.lithic.api.core.Timeout import com.lithic.api.core.http.AsyncStreamResponse import com.lithic.api.core.http.Headers import com.lithic.api.core.http.HttpClient +import com.lithic.api.core.http.ProxyAuthenticator import com.lithic.api.core.http.QueryParams import com.lithic.api.core.jsonMapper import java.net.Proxy @@ -49,6 +50,7 @@ class LithicOkHttpClient private constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var dispatcherExecutorService: ExecutorService? = null private var proxy: Proxy? = null + private var proxyAuthenticator: ProxyAuthenticator? = null private var maxIdleConnections: Int? = null private var keepAliveDuration: Duration? = null private var sslSocketFactory: SSLSocketFactory? = null @@ -79,6 +81,20 @@ class LithicOkHttpClient private constructor() { /** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */ fun proxy(proxy: Optional) = proxy(proxy.getOrNull()) + /** + * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication + * Required`. + */ + fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply { + this.proxyAuthenticator = proxyAuthenticator + } + + /** + * Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`. + */ + fun proxyAuthenticator(proxyAuthenticator: Optional) = + proxyAuthenticator(proxyAuthenticator.getOrNull()) + /** * The maximum number of idle connections kept by the underlying OkHttp connection pool. * @@ -389,6 +405,7 @@ class LithicOkHttpClient private constructor() { OkHttpClient.builder() .timeout(clientOptions.timeout()) .proxy(proxy) + .proxyAuthenticator(proxyAuthenticator) .maxIdleConnections(maxIdleConnections) .keepAliveDuration(keepAliveDuration) .dispatcherExecutorService(dispatcherExecutorService) diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt index ac8fa16b4..026e630e2 100644 --- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt +++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt @@ -11,6 +11,7 @@ import com.lithic.api.core.Timeout import com.lithic.api.core.http.AsyncStreamResponse import com.lithic.api.core.http.Headers import com.lithic.api.core.http.HttpClient +import com.lithic.api.core.http.ProxyAuthenticator import com.lithic.api.core.http.QueryParams import com.lithic.api.core.jsonMapper import java.net.Proxy @@ -49,6 +50,7 @@ class LithicOkHttpClientAsync private constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var dispatcherExecutorService: ExecutorService? = null private var proxy: Proxy? = null + private var proxyAuthenticator: ProxyAuthenticator? = null private var maxIdleConnections: Int? = null private var keepAliveDuration: Duration? = null private var sslSocketFactory: SSLSocketFactory? = null @@ -79,6 +81,20 @@ class LithicOkHttpClientAsync private constructor() { /** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */ fun proxy(proxy: Optional) = proxy(proxy.getOrNull()) + /** + * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication + * Required`. + */ + fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply { + this.proxyAuthenticator = proxyAuthenticator + } + + /** + * Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`. + */ + fun proxyAuthenticator(proxyAuthenticator: Optional) = + proxyAuthenticator(proxyAuthenticator.getOrNull()) + /** * The maximum number of idle connections kept by the underlying OkHttp connection pool. * @@ -389,6 +405,7 @@ class LithicOkHttpClientAsync private constructor() { OkHttpClient.builder() .timeout(clientOptions.timeout()) .proxy(proxy) + .proxyAuthenticator(proxyAuthenticator) .maxIdleConnections(maxIdleConnections) .keepAliveDuration(keepAliveDuration) .dispatcherExecutorService(dispatcherExecutorService) diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt index 5c5c11677..e8f4cd8d1 100644 --- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt +++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt @@ -8,9 +8,11 @@ import com.lithic.api.core.http.HttpMethod import com.lithic.api.core.http.HttpRequest import com.lithic.api.core.http.HttpRequestBody import com.lithic.api.core.http.HttpResponse +import com.lithic.api.core.http.ProxyAuthenticator import com.lithic.api.errors.LithicIoException import java.io.IOException import java.io.InputStream +import java.io.OutputStream import java.net.Proxy import java.time.Duration import java.util.concurrent.CancellationException @@ -20,10 +22,12 @@ import java.util.concurrent.TimeUnit import javax.net.ssl.HostnameVerifier import javax.net.ssl.SSLSocketFactory import javax.net.ssl.X509TrustManager +import kotlin.jvm.optionals.getOrNull import okhttp3.Call import okhttp3.Callback import okhttp3.ConnectionPool import okhttp3.Dispatcher +import okhttp3.HttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.MediaType import okhttp3.MediaType.Companion.toMediaType @@ -33,6 +37,8 @@ import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.Response import okhttp3.logging.HttpLoggingInterceptor import okio.BufferedSink +import okio.buffer +import okio.sink class OkHttpClient internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient { @@ -41,7 +47,7 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie val call = newCall(request, requestOptions) return try { - call.execute().toResponse() + call.execute().toHttpResponse() } catch (e: IOException) { throw LithicIoException("Request failed", e) } finally { @@ -59,7 +65,7 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie call.enqueue( object : Callback { override fun onResponse(call: Call, response: Response) { - future.complete(response.toResponse()) + future.complete(response.toHttpResponse()) } override fun onFailure(call: Call, e: IOException) { @@ -111,89 +117,6 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie return client.newCall(request.toRequest(client)) } - private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient): Request { - var body: RequestBody? = body?.toRequestBody() - if (body == null && requiresBody(method)) { - body = "".toRequestBody() - } - - val builder = Request.Builder().url(toUrl()).method(method.name, body) - headers.names().forEach { name -> - headers.values(name).forEach { builder.addHeader(name, it) } - } - - if ( - !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0 - ) { - builder.addHeader( - "X-Stainless-Read-Timeout", - Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(), - ) - } - if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) { - builder.addHeader( - "X-Stainless-Timeout", - Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(), - ) - } - - return builder.build() - } - - /** `OkHttpClient` always requires a request body for some methods. */ - private fun requiresBody(method: HttpMethod): Boolean = - when (method) { - HttpMethod.POST, - HttpMethod.PUT, - HttpMethod.PATCH -> true - else -> false - } - - private fun HttpRequest.toUrl(): String { - val builder = baseUrl.toHttpUrl().newBuilder() - pathSegments.forEach(builder::addPathSegment) - queryParams.keys().forEach { key -> - queryParams.values(key).forEach { builder.addQueryParameter(key, it) } - } - - return builder.toString() - } - - private fun HttpRequestBody.toRequestBody(): RequestBody { - val mediaType = contentType()?.toMediaType() - val length = contentLength() - - return object : RequestBody() { - override fun contentType(): MediaType? = mediaType - - override fun contentLength(): Long = length - - override fun isOneShot(): Boolean = !repeatable() - - override fun writeTo(sink: BufferedSink) = writeTo(sink.outputStream()) - } - } - - private fun Response.toResponse(): HttpResponse { - val headers = headers.toHeaders() - - return object : HttpResponse { - override fun statusCode(): Int = code - - override fun headers(): Headers = headers - - override fun body(): InputStream = body!!.byteStream() - - override fun close() = body!!.close() - } - } - - private fun okhttp3.Headers.toHeaders(): Headers { - val headersBuilder = Headers.builder() - forEach { (name, value) -> headersBuilder.put(name, value) } - return headersBuilder.build() - } - companion object { @JvmStatic fun builder() = Builder() } @@ -202,6 +125,7 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie private var timeout: Timeout = Timeout.default() private var proxy: Proxy? = null + private var proxyAuthenticator: ProxyAuthenticator? = null private var maxIdleConnections: Int? = null private var keepAliveDuration: Duration? = null private var dispatcherExecutorService: ExecutorService? = null @@ -215,6 +139,10 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie fun proxy(proxy: Proxy?) = apply { this.proxy = proxy } + fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply { + this.proxyAuthenticator = proxyAuthenticator + } + /** * Sets the maximum number of idle connections kept by the underlying [ConnectionPool]. * @@ -264,6 +192,19 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie .callTimeout(timeout.request()) .proxy(proxy) .apply { + proxyAuthenticator?.let { auth -> + proxyAuthenticator { route, response -> + auth + .authenticate( + route?.proxy ?: Proxy.NO_PROXY, + response.request.toHttpRequest(), + response.toHttpResponse(), + ) + .getOrNull() + ?.toRequest(client = null) + } + } + dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) } val maxIdleConnections = maxIdleConnections @@ -303,3 +244,126 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie ) } } + +private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient?): Request { + var body: RequestBody? = body?.toRequestBody() + if (body == null && requiresBody(method)) { + body = "".toRequestBody() + } + + val builder = Request.Builder().url(toUrl()).method(method.name, body) + headers.names().forEach { name -> headers.values(name).forEach { builder.addHeader(name, it) } } + + if (client != null) { + if ( + !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0 + ) { + builder.addHeader( + "X-Stainless-Read-Timeout", + Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(), + ) + } + if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) { + builder.addHeader( + "X-Stainless-Timeout", + Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(), + ) + } + } + + return builder.build() +} + +/** `OkHttpClient` always requires a request body for some methods. */ +private fun requiresBody(method: HttpMethod): Boolean = + when (method) { + HttpMethod.POST, + HttpMethod.PUT, + HttpMethod.PATCH -> true + else -> false + } + +private fun HttpRequest.toUrl(): String { + val builder = baseUrl.toHttpUrl().newBuilder() + pathSegments.forEach(builder::addPathSegment) + queryParams.keys().forEach { key -> + queryParams.values(key).forEach { builder.addQueryParameter(key, it) } + } + + return builder.toString() +} + +private fun HttpRequestBody.toRequestBody(): RequestBody { + val mediaType = contentType()?.toMediaType() + val length = contentLength() + + return object : RequestBody() { + override fun contentType(): MediaType? = mediaType + + override fun contentLength(): Long = length + + override fun isOneShot(): Boolean = !repeatable() + + override fun writeTo(sink: BufferedSink) = writeTo(sink.outputStream()) + } +} + +private fun Request.toHttpRequest(): HttpRequest { + val builder = HttpRequest.builder().method(HttpMethod.valueOf(method)).baseUrl(url.toBaseUrl()) + url.pathSegments.forEach(builder::addPathSegment) + url.queryParameterNames.forEach { name -> + url.queryParameterValues(name).filterNotNull().forEach { builder.putQueryParam(name, it) } + } + headers.forEach { (name, value) -> builder.putHeader(name, value) } + body?.let { builder.body(it.toHttpRequestBody()) } + return builder.build() +} + +private fun HttpUrl.toBaseUrl(): String = buildString { + append(scheme).append("://").append(host) + if (port != HttpUrl.defaultPort(scheme)) { + append(":").append(port) + } +} + +private fun RequestBody.toHttpRequestBody(): HttpRequestBody { + val mediaType = contentType()?.toString() + val length = contentLength() + val isOneShot = isOneShot() + val source = this + return object : HttpRequestBody { + override fun contentType(): String? = mediaType + + override fun contentLength(): Long = length + + override fun repeatable(): Boolean = !isOneShot + + override fun writeTo(outputStream: OutputStream) { + val sink = outputStream.sink().buffer() + source.writeTo(sink) + sink.flush() + } + + override fun close() {} + } +} + +private fun Response.toHttpResponse(): HttpResponse { + val headers = headers.toHeaders() + + return object : HttpResponse { + override fun statusCode(): Int = code + + override fun headers(): Headers = headers + + override fun body(): InputStream = body!!.byteStream() + + override fun close() = body!!.close() + } +} + +private fun okhttp3.Headers.toHeaders(): Headers { + val headersBuilder = Headers.builder() + forEach { (name, value) -> headersBuilder.put(name, value) } + return headersBuilder.build() +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/ProxyAuthenticator.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/ProxyAuthenticator.kt new file mode 100644 index 000000000..08d8441ac --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/ProxyAuthenticator.kt @@ -0,0 +1,59 @@ +package com.lithic.api.core.http + +import java.net.Proxy +import java.nio.charset.Charset +import java.nio.charset.StandardCharsets +import java.util.Base64 +import java.util.Optional + +/** + * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication Required`. + * + * Implementations inspect the 407 [response] (typically its `Proxy-Authenticate` header) and return + * the request to retry with a `Proxy-Authorization` header set, or [Optional.empty] to abandon + * authentication and surface the 407 to the caller. + * + * Implementations must be thread-safe; they may be invoked concurrently from multiple HTTP calls. + */ +fun interface ProxyAuthenticator { + + /** + * @param proxy the proxy that produced the challenge, or [Proxy.NO_PROXY] if the route is not + * yet established + * @param request the request that produced [response] + * @param response the 407 challenge response + * @return the retry request to send (typically [request] with a `Proxy-Authorization` header + * added), or [Optional.empty] to abandon authentication + */ + fun authenticate( + proxy: Proxy, + request: HttpRequest, + response: HttpResponse, + ): Optional + + companion object { + + /** + * A [ProxyAuthenticator] that uses RFC 7617 Basic authentication with the ISO-8859-1 + * charset. + */ + @JvmStatic + fun basic(username: String, password: String): ProxyAuthenticator = + basic(username, password, StandardCharsets.ISO_8859_1) + + /** + * A [ProxyAuthenticator] that uses RFC 7617 Basic authentication with the given [charset]. + */ + @JvmStatic + fun basic(username: String, password: String, charset: Charset): ProxyAuthenticator { + val token = + Base64.getEncoder().encodeToString("$username:$password".toByteArray(charset)) + val headerValue = "Basic $token" + return ProxyAuthenticator { _, request, _ -> + Optional.of( + request.toBuilder().putHeader("Proxy-Authorization", headerValue).build() + ) + } + } + } +} From 6a44f6b77dc5749fe3e39e6deee4e0e2de316efe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 20:11:32 +0000 Subject: [PATCH 15/18] feat(api): add IS_NEW_MERCHANT attribute to authorization action parameters --- .stats.yml | 4 ++-- .../ConditionalAuthorizationActionParameters.kt | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5a9e4234e..e3e60713a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-a46ebb10f6bb217a591206f0574450c324f108dbd32a2d62727cd8186d85e94f.yml -openapi_spec_hash: f320c173152f74b0799166b6ef5b82cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-92d7ce0702a494edb7beb0ad484c4f24aca65777197d40b2108d05c13c3fa505.yml +openapi_spec_hash: 35e4b9edb38ef23f528fcfbfeaabac02 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt index 0afe4cb7f..d9a2e04e3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt @@ -485,6 +485,9 @@ private constructor( * for the entity. Requires `parameters.scope`. * * `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in the * entity's transaction history. Requires `parameters.scope`. + * * `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the card's + * approved transaction history (capped at the 1000 most recently seen merchants). Valid + * values are `TRUE`, `FALSE`. Card-scoped only; no `parameters` required. * * `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as a * percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. * @@ -694,6 +697,9 @@ private constructor( * transaction for the entity. Requires `parameters.scope`. * * `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in the * entity's transaction history. Requires `parameters.scope`. + * * `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the card's + * approved transaction history (capped at the 1000 most recently seen merchants). + * Valid values are `TRUE`, `FALSE`. Card-scoped only; no `parameters` required. * * `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as a * percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. */ @@ -944,6 +950,9 @@ private constructor( * for the entity. Requires `parameters.scope`. * * `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in the * entity's transaction history. Requires `parameters.scope`. + * * `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the card's + * approved transaction history (capped at the 1000 most recently seen merchants). Valid + * values are `TRUE`, `FALSE`. Card-scoped only; no `parameters` required. * * `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as a * percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. */ @@ -1032,6 +1041,8 @@ private constructor( @JvmField val DISTINCT_COUNTRY_COUNT = of("DISTINCT_COUNTRY_COUNT") + @JvmField val IS_NEW_MERCHANT = of("IS_NEW_MERCHANT") + @JvmField val THREE_DS_SUCCESS_RATE = of("THREE_DS_SUCCESS_RATE") @JvmStatic fun of(value: String) = Attribute(JsonField.of(value)) @@ -1074,6 +1085,7 @@ private constructor( CONSECUTIVE_DECLINES, TIME_SINCE_LAST_TRANSACTION, DISTINCT_COUNTRY_COUNT, + IS_NEW_MERCHANT, THREE_DS_SUCCESS_RATE, } @@ -1122,6 +1134,7 @@ private constructor( CONSECUTIVE_DECLINES, TIME_SINCE_LAST_TRANSACTION, DISTINCT_COUNTRY_COUNT, + IS_NEW_MERCHANT, THREE_DS_SUCCESS_RATE, /** * An enum member indicating that [Attribute] was instantiated with an unknown @@ -1174,6 +1187,7 @@ private constructor( CONSECUTIVE_DECLINES -> Value.CONSECUTIVE_DECLINES TIME_SINCE_LAST_TRANSACTION -> Value.TIME_SINCE_LAST_TRANSACTION DISTINCT_COUNTRY_COUNT -> Value.DISTINCT_COUNTRY_COUNT + IS_NEW_MERCHANT -> Value.IS_NEW_MERCHANT THREE_DS_SUCCESS_RATE -> Value.THREE_DS_SUCCESS_RATE else -> Value._UNKNOWN } @@ -1224,6 +1238,7 @@ private constructor( CONSECUTIVE_DECLINES -> Known.CONSECUTIVE_DECLINES TIME_SINCE_LAST_TRANSACTION -> Known.TIME_SINCE_LAST_TRANSACTION DISTINCT_COUNTRY_COUNT -> Known.DISTINCT_COUNTRY_COUNT + IS_NEW_MERCHANT -> Known.IS_NEW_MERCHANT THREE_DS_SUCCESS_RATE -> Known.THREE_DS_SUCCESS_RATE else -> throw LithicInvalidDataException("Unknown Attribute: $value") } From 064ee523f9ced5648ad252fd7a625709b61ad1f4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 10:38:44 +0000 Subject: [PATCH 16/18] feat(api): add CARD_TRANSACTION_UPDATE event stream and conditional action to auth rules --- .stats.yml | 6 +- .../kotlin/com/lithic/api/models/AuthRule.kt | 166 +- .../api/models/AuthRuleV2CreateParams.kt | 258 +++- .../api/models/AuthRuleV2DraftParams.kt | 87 ++ .../com/lithic/api/models/AuthRuleVersion.kt | 78 + .../api/models/CardTransactionUpdateAction.kt | 1143 ++++++++++++++ ...alCardTransactionUpdateActionParameters.kt | 1367 +++++++++++++++++ .../com/lithic/api/models/EventStream.kt | 6 + .../lithic/api/models/SpendVelocityFilters.kt | 810 ++++++++++ .../models/CardTransactionUpdateActionTest.kt | 106 ++ ...rdTransactionUpdateActionParametersTest.kt | 215 +++ .../api/models/SpendVelocityFiltersTest.kt | 85 + 12 files changed, 4312 insertions(+), 15 deletions(-) create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalCardTransactionUpdateActionParameters.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/SpendVelocityFilters.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTransactionUpdateActionTest.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/ConditionalCardTransactionUpdateActionParametersTest.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/SpendVelocityFiltersTest.kt diff --git a/.stats.yml b/.stats.yml index e3e60713a..883f26c00 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-92d7ce0702a494edb7beb0ad484c4f24aca65777197d40b2108d05c13c3fa505.yml -openapi_spec_hash: 35e4b9edb38ef23f528fcfbfeaabac02 -config_hash: ac8326134e692f3f3bdec82396bbec80 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0f374e78a0212145a2f55a55dfc39a612de19094d5152ae26b1bc74b01b9e343.yml +openapi_spec_hash: ec888cdaebea979a2cd6231ca04c346c +config_hash: 01dfc901bb6d54b0f582155d779bcbe0 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt index 213e89ab7..c259a8dc6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt @@ -205,7 +205,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. * @@ -655,7 +655,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. */ @@ -1038,6 +1038,20 @@ private constructor( Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction) ) + /** + * Alias for calling [parameters] with + * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`. + */ + fun parameters( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + parameters( + Parameters.ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) + ) + /** * Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`. */ @@ -1152,6 +1166,9 @@ private constructor( private val conditionalAchAction: ConditionalAchActionParameters? = null, private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null, + private val conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters? = + null, private val typescriptCode: TypescriptCodeParameters? = null, private val _json: JsonValue? = null, ) { @@ -1179,6 +1196,10 @@ private constructor( fun conditionalTokenizationAction(): Optional = Optional.ofNullable(conditionalTokenizationAction) + fun conditionalCardTransactionUpdateAction(): + Optional = + Optional.ofNullable(conditionalCardTransactionUpdateAction) + /** Parameters for defining a TypeScript code rule */ fun typescriptCode(): Optional = Optional.ofNullable(typescriptCode) @@ -1197,6 +1218,9 @@ private constructor( fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null + fun isConditionalCardTransactionUpdateAction(): Boolean = + conditionalCardTransactionUpdateAction != null + fun isTypescriptCode(): Boolean = typescriptCode != null /** Deprecated: Use CONDITIONAL_ACTION instead. */ @@ -1221,6 +1245,12 @@ private constructor( fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters = conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction") + fun asConditionalCardTransactionUpdateAction(): + ConditionalCardTransactionUpdateActionParameters = + conditionalCardTransactionUpdateAction.getOrThrow( + "conditionalCardTransactionUpdateAction" + ) + /** Parameters for defining a TypeScript code rule */ fun asTypescriptCode(): TypescriptCodeParameters = typescriptCode.getOrThrow("typescriptCode") @@ -1271,6 +1301,10 @@ private constructor( visitor.visitConditionalAchAction(conditionalAchAction) conditionalTokenizationAction != null -> visitor.visitConditionalTokenizationAction(conditionalTokenizationAction) + conditionalCardTransactionUpdateAction != null -> + visitor.visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode) else -> visitor.unknown(_json) } @@ -1334,6 +1368,13 @@ private constructor( conditionalTokenizationAction.validate() } + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) { + conditionalCardTransactionUpdateAction.validate() + } + override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) { typescriptCode.validate() } @@ -1387,6 +1428,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = conditionalTokenizationAction.validity() + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = conditionalCardTransactionUpdateAction.validity() + override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) = typescriptCode.validity() @@ -1407,6 +1453,8 @@ private constructor( conditionalAuthorizationAction == other.conditionalAuthorizationAction && conditionalAchAction == other.conditionalAchAction && conditionalTokenizationAction == other.conditionalTokenizationAction && + conditionalCardTransactionUpdateAction == + other.conditionalCardTransactionUpdateAction && typescriptCode == other.typescriptCode } @@ -1419,6 +1467,7 @@ private constructor( conditionalAuthorizationAction, conditionalAchAction, conditionalTokenizationAction, + conditionalCardTransactionUpdateAction, typescriptCode, ) @@ -1436,6 +1485,8 @@ private constructor( "Parameters{conditionalAchAction=$conditionalAchAction}" conditionalTokenizationAction != null -> "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}" + conditionalCardTransactionUpdateAction != null -> + "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}" typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}" _json != null -> "Parameters{_unknown=$_json}" else -> throw IllegalStateException("Invalid Parameters") @@ -1475,6 +1526,16 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction) + @JvmStatic + fun ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + Parameters( + conditionalCardTransactionUpdateAction = + conditionalCardTransactionUpdateAction + ) + /** Parameters for defining a TypeScript code rule */ @JvmStatic fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) = @@ -1511,6 +1572,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ): T + fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ): T + /** Parameters for defining a TypeScript code rule */ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T @@ -1570,6 +1636,18 @@ private constructor( ?.let { Parameters(conditionalTokenizationAction = it, _json = json) }, + tryDeserialize( + node, + jacksonTypeRef< + ConditionalCardTransactionUpdateActionParameters + >(), + ) + ?.let { + Parameters( + conditionalCardTransactionUpdateAction = it, + _json = json, + ) + }, tryDeserialize(node, jacksonTypeRef()) ?.let { Parameters(typescriptCode = it, _json = json) }, ) @@ -1610,6 +1688,8 @@ private constructor( generator.writeObject(value.conditionalAchAction) value.conditionalTokenizationAction != null -> generator.writeObject(value.conditionalTokenizationAction) + value.conditionalCardTransactionUpdateAction != null -> + generator.writeObject(value.conditionalCardTransactionUpdateAction) value.typescriptCode != null -> generator.writeObject(value.typescriptCode) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Parameters") @@ -1860,6 +1940,20 @@ private constructor( Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction) ) + /** + * Alias for calling [parameters] with + * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`. + */ + fun parameters( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + parameters( + Parameters.ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) + ) + /** * Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`. */ @@ -2003,6 +2097,9 @@ private constructor( private val conditionalAchAction: ConditionalAchActionParameters? = null, private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null, + private val conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters? = + null, private val typescriptCode: TypescriptCodeParameters? = null, private val _json: JsonValue? = null, ) { @@ -2030,6 +2127,10 @@ private constructor( fun conditionalTokenizationAction(): Optional = Optional.ofNullable(conditionalTokenizationAction) + fun conditionalCardTransactionUpdateAction(): + Optional = + Optional.ofNullable(conditionalCardTransactionUpdateAction) + /** Parameters for defining a TypeScript code rule */ fun typescriptCode(): Optional = Optional.ofNullable(typescriptCode) @@ -2048,6 +2149,9 @@ private constructor( fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null + fun isConditionalCardTransactionUpdateAction(): Boolean = + conditionalCardTransactionUpdateAction != null + fun isTypescriptCode(): Boolean = typescriptCode != null /** Deprecated: Use CONDITIONAL_ACTION instead. */ @@ -2072,6 +2176,12 @@ private constructor( fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters = conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction") + fun asConditionalCardTransactionUpdateAction(): + ConditionalCardTransactionUpdateActionParameters = + conditionalCardTransactionUpdateAction.getOrThrow( + "conditionalCardTransactionUpdateAction" + ) + /** Parameters for defining a TypeScript code rule */ fun asTypescriptCode(): TypescriptCodeParameters = typescriptCode.getOrThrow("typescriptCode") @@ -2122,6 +2232,10 @@ private constructor( visitor.visitConditionalAchAction(conditionalAchAction) conditionalTokenizationAction != null -> visitor.visitConditionalTokenizationAction(conditionalTokenizationAction) + conditionalCardTransactionUpdateAction != null -> + visitor.visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode) else -> visitor.unknown(_json) } @@ -2185,6 +2299,13 @@ private constructor( conditionalTokenizationAction.validate() } + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) { + conditionalCardTransactionUpdateAction.validate() + } + override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) { typescriptCode.validate() } @@ -2238,6 +2359,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = conditionalTokenizationAction.validity() + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = conditionalCardTransactionUpdateAction.validity() + override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) = typescriptCode.validity() @@ -2258,6 +2384,8 @@ private constructor( conditionalAuthorizationAction == other.conditionalAuthorizationAction && conditionalAchAction == other.conditionalAchAction && conditionalTokenizationAction == other.conditionalTokenizationAction && + conditionalCardTransactionUpdateAction == + other.conditionalCardTransactionUpdateAction && typescriptCode == other.typescriptCode } @@ -2270,6 +2398,7 @@ private constructor( conditionalAuthorizationAction, conditionalAchAction, conditionalTokenizationAction, + conditionalCardTransactionUpdateAction, typescriptCode, ) @@ -2287,6 +2416,8 @@ private constructor( "Parameters{conditionalAchAction=$conditionalAchAction}" conditionalTokenizationAction != null -> "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}" + conditionalCardTransactionUpdateAction != null -> + "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}" typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}" _json != null -> "Parameters{_unknown=$_json}" else -> throw IllegalStateException("Invalid Parameters") @@ -2326,6 +2457,16 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction) + @JvmStatic + fun ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + Parameters( + conditionalCardTransactionUpdateAction = + conditionalCardTransactionUpdateAction + ) + /** Parameters for defining a TypeScript code rule */ @JvmStatic fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) = @@ -2362,6 +2503,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ): T + fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ): T + /** Parameters for defining a TypeScript code rule */ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T @@ -2421,6 +2567,18 @@ private constructor( ?.let { Parameters(conditionalTokenizationAction = it, _json = json) }, + tryDeserialize( + node, + jacksonTypeRef< + ConditionalCardTransactionUpdateActionParameters + >(), + ) + ?.let { + Parameters( + conditionalCardTransactionUpdateAction = it, + _json = json, + ) + }, tryDeserialize(node, jacksonTypeRef()) ?.let { Parameters(typescriptCode = it, _json = json) }, ) @@ -2461,6 +2619,8 @@ private constructor( generator.writeObject(value.conditionalAchAction) value.conditionalTokenizationAction != null -> generator.writeObject(value.conditionalTokenizationAction) + value.conditionalCardTransactionUpdateAction != null -> + generator.writeObject(value.conditionalCardTransactionUpdateAction) value.typescriptCode != null -> generator.writeObject(value.typescriptCode) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Parameters") @@ -2795,7 +2955,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. */ diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt index 6b25888a8..c89f285dd 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt @@ -516,7 +516,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. * @@ -734,6 +734,20 @@ private constructor( Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction) ) + /** + * Alias for calling [parameters] with + * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`. + */ + fun parameters( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + parameters( + Parameters.ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) + ) + /** * Alias for calling [parameters] with * `Parameters.ofTypescriptCode(typescriptCode)`. @@ -751,7 +765,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. */ @@ -961,6 +975,9 @@ private constructor( private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null, + private val conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters? = + null, private val typescriptCode: TypescriptCodeParameters? = null, private val _json: JsonValue? = null, ) { @@ -990,6 +1007,10 @@ private constructor( Optional = Optional.ofNullable(conditionalTokenizationAction) + fun conditionalCardTransactionUpdateAction(): + Optional = + Optional.ofNullable(conditionalCardTransactionUpdateAction) + /** Parameters for defining a TypeScript code rule */ fun typescriptCode(): Optional = Optional.ofNullable(typescriptCode) @@ -1011,6 +1032,9 @@ private constructor( fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null + fun isConditionalCardTransactionUpdateAction(): Boolean = + conditionalCardTransactionUpdateAction != null + fun isTypescriptCode(): Boolean = typescriptCode != null /** Deprecated: Use CONDITIONAL_ACTION instead. */ @@ -1036,6 +1060,12 @@ private constructor( fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters = conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction") + fun asConditionalCardTransactionUpdateAction(): + ConditionalCardTransactionUpdateActionParameters = + conditionalCardTransactionUpdateAction.getOrThrow( + "conditionalCardTransactionUpdateAction" + ) + /** Parameters for defining a TypeScript code rule */ fun asTypescriptCode(): TypescriptCodeParameters = typescriptCode.getOrThrow("typescriptCode") @@ -1090,6 +1120,10 @@ private constructor( visitor.visitConditionalTokenizationAction( conditionalTokenizationAction ) + conditionalCardTransactionUpdateAction != null -> + visitor.visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode) else -> visitor.unknown(_json) } @@ -1155,6 +1189,13 @@ private constructor( conditionalTokenizationAction.validate() } + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) { + conditionalCardTransactionUpdateAction.validate() + } + override fun visitTypescriptCode( typescriptCode: TypescriptCodeParameters ) { @@ -1212,6 +1253,11 @@ private constructor( ConditionalTokenizationActionParameters ) = conditionalTokenizationAction.validity() + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = conditionalCardTransactionUpdateAction.validity() + override fun visitTypescriptCode( typescriptCode: TypescriptCodeParameters ) = typescriptCode.validity() @@ -1233,6 +1279,8 @@ private constructor( conditionalAuthorizationAction == other.conditionalAuthorizationAction && conditionalAchAction == other.conditionalAchAction && conditionalTokenizationAction == other.conditionalTokenizationAction && + conditionalCardTransactionUpdateAction == + other.conditionalCardTransactionUpdateAction && typescriptCode == other.typescriptCode } @@ -1245,6 +1293,7 @@ private constructor( conditionalAuthorizationAction, conditionalAchAction, conditionalTokenizationAction, + conditionalCardTransactionUpdateAction, typescriptCode, ) @@ -1262,6 +1311,8 @@ private constructor( "Parameters{conditionalAchAction=$conditionalAchAction}" conditionalTokenizationAction != null -> "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}" + conditionalCardTransactionUpdateAction != null -> + "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}" typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}" _json != null -> "Parameters{_unknown=$_json}" else -> throw IllegalStateException("Invalid Parameters") @@ -1303,6 +1354,16 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction) + @JvmStatic + fun ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + Parameters( + conditionalCardTransactionUpdateAction = + conditionalCardTransactionUpdateAction + ) + /** Parameters for defining a TypeScript code rule */ @JvmStatic fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) = @@ -1339,6 +1400,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ): T + fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ): T + /** Parameters for defining a TypeScript code rule */ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T @@ -1413,6 +1479,18 @@ private constructor( _json = json, ) }, + tryDeserialize( + node, + jacksonTypeRef< + ConditionalCardTransactionUpdateActionParameters + >(), + ) + ?.let { + Parameters( + conditionalCardTransactionUpdateAction = it, + _json = json, + ) + }, tryDeserialize(node, jacksonTypeRef()) ?.let { Parameters(typescriptCode = it, _json = json) }, ) @@ -1454,6 +1532,8 @@ private constructor( generator.writeObject(value.conditionalAchAction) value.conditionalTokenizationAction != null -> generator.writeObject(value.conditionalTokenizationAction) + value.conditionalCardTransactionUpdateAction != null -> + generator.writeObject(value.conditionalCardTransactionUpdateAction) value.typescriptCode != null -> generator.writeObject(value.typescriptCode) value._json != null -> generator.writeObject(value._json) @@ -1472,7 +1552,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. */ @@ -1725,7 +1805,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. * @@ -1939,6 +2019,20 @@ private constructor( Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction) ) + /** + * Alias for calling [parameters] with + * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`. + */ + fun parameters( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + parameters( + Parameters.ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) + ) + /** * Alias for calling [parameters] with * `Parameters.ofTypescriptCode(typescriptCode)`. @@ -1956,7 +2050,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. */ @@ -2110,6 +2204,9 @@ private constructor( private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null, + private val conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters? = + null, private val typescriptCode: TypescriptCodeParameters? = null, private val _json: JsonValue? = null, ) { @@ -2139,6 +2236,10 @@ private constructor( Optional = Optional.ofNullable(conditionalTokenizationAction) + fun conditionalCardTransactionUpdateAction(): + Optional = + Optional.ofNullable(conditionalCardTransactionUpdateAction) + /** Parameters for defining a TypeScript code rule */ fun typescriptCode(): Optional = Optional.ofNullable(typescriptCode) @@ -2160,6 +2261,9 @@ private constructor( fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null + fun isConditionalCardTransactionUpdateAction(): Boolean = + conditionalCardTransactionUpdateAction != null + fun isTypescriptCode(): Boolean = typescriptCode != null /** Deprecated: Use CONDITIONAL_ACTION instead. */ @@ -2185,6 +2289,12 @@ private constructor( fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters = conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction") + fun asConditionalCardTransactionUpdateAction(): + ConditionalCardTransactionUpdateActionParameters = + conditionalCardTransactionUpdateAction.getOrThrow( + "conditionalCardTransactionUpdateAction" + ) + /** Parameters for defining a TypeScript code rule */ fun asTypescriptCode(): TypescriptCodeParameters = typescriptCode.getOrThrow("typescriptCode") @@ -2239,6 +2349,10 @@ private constructor( visitor.visitConditionalTokenizationAction( conditionalTokenizationAction ) + conditionalCardTransactionUpdateAction != null -> + visitor.visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode) else -> visitor.unknown(_json) } @@ -2304,6 +2418,13 @@ private constructor( conditionalTokenizationAction.validate() } + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) { + conditionalCardTransactionUpdateAction.validate() + } + override fun visitTypescriptCode( typescriptCode: TypescriptCodeParameters ) { @@ -2361,6 +2482,11 @@ private constructor( ConditionalTokenizationActionParameters ) = conditionalTokenizationAction.validity() + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = conditionalCardTransactionUpdateAction.validity() + override fun visitTypescriptCode( typescriptCode: TypescriptCodeParameters ) = typescriptCode.validity() @@ -2382,6 +2508,8 @@ private constructor( conditionalAuthorizationAction == other.conditionalAuthorizationAction && conditionalAchAction == other.conditionalAchAction && conditionalTokenizationAction == other.conditionalTokenizationAction && + conditionalCardTransactionUpdateAction == + other.conditionalCardTransactionUpdateAction && typescriptCode == other.typescriptCode } @@ -2394,6 +2522,7 @@ private constructor( conditionalAuthorizationAction, conditionalAchAction, conditionalTokenizationAction, + conditionalCardTransactionUpdateAction, typescriptCode, ) @@ -2411,6 +2540,8 @@ private constructor( "Parameters{conditionalAchAction=$conditionalAchAction}" conditionalTokenizationAction != null -> "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}" + conditionalCardTransactionUpdateAction != null -> + "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}" typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}" _json != null -> "Parameters{_unknown=$_json}" else -> throw IllegalStateException("Invalid Parameters") @@ -2452,6 +2583,16 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction) + @JvmStatic + fun ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + Parameters( + conditionalCardTransactionUpdateAction = + conditionalCardTransactionUpdateAction + ) + /** Parameters for defining a TypeScript code rule */ @JvmStatic fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) = @@ -2488,6 +2629,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ): T + fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ): T + /** Parameters for defining a TypeScript code rule */ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T @@ -2562,6 +2708,18 @@ private constructor( _json = json, ) }, + tryDeserialize( + node, + jacksonTypeRef< + ConditionalCardTransactionUpdateActionParameters + >(), + ) + ?.let { + Parameters( + conditionalCardTransactionUpdateAction = it, + _json = json, + ) + }, tryDeserialize(node, jacksonTypeRef()) ?.let { Parameters(typescriptCode = it, _json = json) }, ) @@ -2603,6 +2761,8 @@ private constructor( generator.writeObject(value.conditionalAchAction) value.conditionalTokenizationAction != null -> generator.writeObject(value.conditionalTokenizationAction) + value.conditionalCardTransactionUpdateAction != null -> + generator.writeObject(value.conditionalCardTransactionUpdateAction) value.typescriptCode != null -> generator.writeObject(value.typescriptCode) value._json != null -> generator.writeObject(value._json) @@ -2621,7 +2781,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. */ @@ -2887,7 +3047,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. * @@ -3142,6 +3302,20 @@ private constructor( Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction) ) + /** + * Alias for calling [parameters] with + * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`. + */ + fun parameters( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + parameters( + Parameters.ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) + ) + /** * Alias for calling [parameters] with * `Parameters.ofTypescriptCode(typescriptCode)`. @@ -3173,7 +3347,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. */ @@ -3423,6 +3597,9 @@ private constructor( private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null, + private val conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters? = + null, private val typescriptCode: TypescriptCodeParameters? = null, private val _json: JsonValue? = null, ) { @@ -3452,6 +3629,10 @@ private constructor( Optional = Optional.ofNullable(conditionalTokenizationAction) + fun conditionalCardTransactionUpdateAction(): + Optional = + Optional.ofNullable(conditionalCardTransactionUpdateAction) + /** Parameters for defining a TypeScript code rule */ fun typescriptCode(): Optional = Optional.ofNullable(typescriptCode) @@ -3473,6 +3654,9 @@ private constructor( fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null + fun isConditionalCardTransactionUpdateAction(): Boolean = + conditionalCardTransactionUpdateAction != null + fun isTypescriptCode(): Boolean = typescriptCode != null /** Deprecated: Use CONDITIONAL_ACTION instead. */ @@ -3498,6 +3682,12 @@ private constructor( fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters = conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction") + fun asConditionalCardTransactionUpdateAction(): + ConditionalCardTransactionUpdateActionParameters = + conditionalCardTransactionUpdateAction.getOrThrow( + "conditionalCardTransactionUpdateAction" + ) + /** Parameters for defining a TypeScript code rule */ fun asTypescriptCode(): TypescriptCodeParameters = typescriptCode.getOrThrow("typescriptCode") @@ -3552,6 +3742,10 @@ private constructor( visitor.visitConditionalTokenizationAction( conditionalTokenizationAction ) + conditionalCardTransactionUpdateAction != null -> + visitor.visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode) else -> visitor.unknown(_json) } @@ -3617,6 +3811,13 @@ private constructor( conditionalTokenizationAction.validate() } + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) { + conditionalCardTransactionUpdateAction.validate() + } + override fun visitTypescriptCode( typescriptCode: TypescriptCodeParameters ) { @@ -3674,6 +3875,11 @@ private constructor( ConditionalTokenizationActionParameters ) = conditionalTokenizationAction.validity() + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = conditionalCardTransactionUpdateAction.validity() + override fun visitTypescriptCode( typescriptCode: TypescriptCodeParameters ) = typescriptCode.validity() @@ -3695,6 +3901,8 @@ private constructor( conditionalAuthorizationAction == other.conditionalAuthorizationAction && conditionalAchAction == other.conditionalAchAction && conditionalTokenizationAction == other.conditionalTokenizationAction && + conditionalCardTransactionUpdateAction == + other.conditionalCardTransactionUpdateAction && typescriptCode == other.typescriptCode } @@ -3707,6 +3915,7 @@ private constructor( conditionalAuthorizationAction, conditionalAchAction, conditionalTokenizationAction, + conditionalCardTransactionUpdateAction, typescriptCode, ) @@ -3724,6 +3933,8 @@ private constructor( "Parameters{conditionalAchAction=$conditionalAchAction}" conditionalTokenizationAction != null -> "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}" + conditionalCardTransactionUpdateAction != null -> + "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}" typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}" _json != null -> "Parameters{_unknown=$_json}" else -> throw IllegalStateException("Invalid Parameters") @@ -3765,6 +3976,16 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction) + @JvmStatic + fun ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + Parameters( + conditionalCardTransactionUpdateAction = + conditionalCardTransactionUpdateAction + ) + /** Parameters for defining a TypeScript code rule */ @JvmStatic fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) = @@ -3801,6 +4022,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ): T + fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ): T + /** Parameters for defining a TypeScript code rule */ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T @@ -3875,6 +4101,18 @@ private constructor( _json = json, ) }, + tryDeserialize( + node, + jacksonTypeRef< + ConditionalCardTransactionUpdateActionParameters + >(), + ) + ?.let { + Parameters( + conditionalCardTransactionUpdateAction = it, + _json = json, + ) + }, tryDeserialize(node, jacksonTypeRef()) ?.let { Parameters(typescriptCode = it, _json = json) }, ) @@ -3916,6 +4154,8 @@ private constructor( generator.writeObject(value.conditionalAchAction) value.conditionalTokenizationAction != null -> generator.writeObject(value.conditionalTokenizationAction) + value.conditionalCardTransactionUpdateAction != null -> + generator.writeObject(value.conditionalCardTransactionUpdateAction) value.typescriptCode != null -> generator.writeObject(value.typescriptCode) value._json != null -> generator.writeObject(value._json) @@ -3934,7 +4174,7 @@ private constructor( * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream. * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. */ diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt index 18c3943f6..1453ca694 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt @@ -180,6 +180,14 @@ private constructor( body.parameters(conditionalTokenizationAction) } + /** + * Alias for calling [parameters] with + * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`. + */ + fun parameters( + conditionalCardTransactionUpdateAction: ConditionalCardTransactionUpdateActionParameters + ) = apply { body.parameters(conditionalCardTransactionUpdateAction) } + /** Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`. */ fun parameters(typescriptCode: TypescriptCodeParameters) = apply { body.parameters(typescriptCode) @@ -459,6 +467,20 @@ private constructor( Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction) ) + /** + * Alias for calling [parameters] with + * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`. + */ + fun parameters( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + parameters( + Parameters.ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) + ) + /** * Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`. */ @@ -560,6 +582,9 @@ private constructor( null, private val conditionalAchAction: ConditionalAchActionParameters? = null, private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null, + private val conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters? = + null, private val typescriptCode: TypescriptCodeParameters? = null, private val _json: JsonValue? = null, ) { @@ -586,6 +611,10 @@ private constructor( fun conditionalTokenizationAction(): Optional = Optional.ofNullable(conditionalTokenizationAction) + fun conditionalCardTransactionUpdateAction(): + Optional = + Optional.ofNullable(conditionalCardTransactionUpdateAction) + /** Parameters for defining a TypeScript code rule */ fun typescriptCode(): Optional = Optional.ofNullable(typescriptCode) @@ -604,6 +633,9 @@ private constructor( fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null + fun isConditionalCardTransactionUpdateAction(): Boolean = + conditionalCardTransactionUpdateAction != null + fun isTypescriptCode(): Boolean = typescriptCode != null /** Deprecated: Use CONDITIONAL_ACTION instead. */ @@ -628,6 +660,12 @@ private constructor( fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters = conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction") + fun asConditionalCardTransactionUpdateAction(): + ConditionalCardTransactionUpdateActionParameters = + conditionalCardTransactionUpdateAction.getOrThrow( + "conditionalCardTransactionUpdateAction" + ) + /** Parameters for defining a TypeScript code rule */ fun asTypescriptCode(): TypescriptCodeParameters = typescriptCode.getOrThrow("typescriptCode") @@ -676,6 +714,10 @@ private constructor( visitor.visitConditionalAchAction(conditionalAchAction) conditionalTokenizationAction != null -> visitor.visitConditionalTokenizationAction(conditionalTokenizationAction) + conditionalCardTransactionUpdateAction != null -> + visitor.visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode) else -> visitor.unknown(_json) } @@ -738,6 +780,13 @@ private constructor( conditionalTokenizationAction.validate() } + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) { + conditionalCardTransactionUpdateAction.validate() + } + override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) { typescriptCode.validate() } @@ -791,6 +840,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = conditionalTokenizationAction.validity() + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = conditionalCardTransactionUpdateAction.validity() + override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) = typescriptCode.validity() @@ -811,6 +865,8 @@ private constructor( conditionalAuthorizationAction == other.conditionalAuthorizationAction && conditionalAchAction == other.conditionalAchAction && conditionalTokenizationAction == other.conditionalTokenizationAction && + conditionalCardTransactionUpdateAction == + other.conditionalCardTransactionUpdateAction && typescriptCode == other.typescriptCode } @@ -823,6 +879,7 @@ private constructor( conditionalAuthorizationAction, conditionalAchAction, conditionalTokenizationAction, + conditionalCardTransactionUpdateAction, typescriptCode, ) @@ -840,6 +897,8 @@ private constructor( "Parameters{conditionalAchAction=$conditionalAchAction}" conditionalTokenizationAction != null -> "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}" + conditionalCardTransactionUpdateAction != null -> + "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}" typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}" _json != null -> "Parameters{_unknown=$_json}" else -> throw IllegalStateException("Invalid Parameters") @@ -879,6 +938,15 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction) + @JvmStatic + fun ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + Parameters( + conditionalCardTransactionUpdateAction = conditionalCardTransactionUpdateAction + ) + /** Parameters for defining a TypeScript code rule */ @JvmStatic fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) = @@ -910,6 +978,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ): T + fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ): T + /** Parameters for defining a TypeScript code rule */ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T @@ -961,6 +1034,18 @@ private constructor( ?.let { Parameters(conditionalTokenizationAction = it, _json = json) }, + tryDeserialize( + node, + jacksonTypeRef< + ConditionalCardTransactionUpdateActionParameters + >(), + ) + ?.let { + Parameters( + conditionalCardTransactionUpdateAction = it, + _json = json, + ) + }, tryDeserialize(node, jacksonTypeRef())?.let { Parameters(typescriptCode = it, _json = json) }, @@ -1001,6 +1086,8 @@ private constructor( generator.writeObject(value.conditionalAchAction) value.conditionalTokenizationAction != null -> generator.writeObject(value.conditionalTokenizationAction) + value.conditionalCardTransactionUpdateAction != null -> + generator.writeObject(value.conditionalCardTransactionUpdateAction) value.typescriptCode != null -> generator.writeObject(value.typescriptCode) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Parameters") diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt index 2044a2680..0dc2810dc 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt @@ -232,6 +232,19 @@ private constructor( fun parameters(conditionalTokenizationAction: ConditionalTokenizationActionParameters) = parameters(Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)) + /** + * Alias for calling [parameters] with + * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`. + */ + fun parameters( + conditionalCardTransactionUpdateAction: ConditionalCardTransactionUpdateActionParameters + ) = + parameters( + Parameters.ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) + ) + /** Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`. */ fun parameters(typescriptCode: TypescriptCodeParameters) = parameters(Parameters.ofTypescriptCode(typescriptCode)) @@ -358,6 +371,9 @@ private constructor( null, private val conditionalAchAction: ConditionalAchActionParameters? = null, private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null, + private val conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters? = + null, private val typescriptCode: TypescriptCodeParameters? = null, private val _json: JsonValue? = null, ) { @@ -384,6 +400,10 @@ private constructor( fun conditionalTokenizationAction(): Optional = Optional.ofNullable(conditionalTokenizationAction) + fun conditionalCardTransactionUpdateAction(): + Optional = + Optional.ofNullable(conditionalCardTransactionUpdateAction) + /** Parameters for defining a TypeScript code rule */ fun typescriptCode(): Optional = Optional.ofNullable(typescriptCode) @@ -402,6 +422,9 @@ private constructor( fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null + fun isConditionalCardTransactionUpdateAction(): Boolean = + conditionalCardTransactionUpdateAction != null + fun isTypescriptCode(): Boolean = typescriptCode != null /** Deprecated: Use CONDITIONAL_ACTION instead. */ @@ -426,6 +449,12 @@ private constructor( fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters = conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction") + fun asConditionalCardTransactionUpdateAction(): + ConditionalCardTransactionUpdateActionParameters = + conditionalCardTransactionUpdateAction.getOrThrow( + "conditionalCardTransactionUpdateAction" + ) + /** Parameters for defining a TypeScript code rule */ fun asTypescriptCode(): TypescriptCodeParameters = typescriptCode.getOrThrow("typescriptCode") @@ -474,6 +503,10 @@ private constructor( visitor.visitConditionalAchAction(conditionalAchAction) conditionalTokenizationAction != null -> visitor.visitConditionalTokenizationAction(conditionalTokenizationAction) + conditionalCardTransactionUpdateAction != null -> + visitor.visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction + ) typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode) else -> visitor.unknown(_json) } @@ -536,6 +569,13 @@ private constructor( conditionalTokenizationAction.validate() } + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) { + conditionalCardTransactionUpdateAction.validate() + } + override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) { typescriptCode.validate() } @@ -589,6 +629,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = conditionalTokenizationAction.validity() + override fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = conditionalCardTransactionUpdateAction.validity() + override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) = typescriptCode.validity() @@ -609,6 +654,8 @@ private constructor( conditionalAuthorizationAction == other.conditionalAuthorizationAction && conditionalAchAction == other.conditionalAchAction && conditionalTokenizationAction == other.conditionalTokenizationAction && + conditionalCardTransactionUpdateAction == + other.conditionalCardTransactionUpdateAction && typescriptCode == other.typescriptCode } @@ -621,6 +668,7 @@ private constructor( conditionalAuthorizationAction, conditionalAchAction, conditionalTokenizationAction, + conditionalCardTransactionUpdateAction, typescriptCode, ) @@ -638,6 +686,8 @@ private constructor( "Parameters{conditionalAchAction=$conditionalAchAction}" conditionalTokenizationAction != null -> "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}" + conditionalCardTransactionUpdateAction != null -> + "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}" typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}" _json != null -> "Parameters{_unknown=$_json}" else -> throw IllegalStateException("Invalid Parameters") @@ -677,6 +727,15 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction) + @JvmStatic + fun ofConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ) = + Parameters( + conditionalCardTransactionUpdateAction = conditionalCardTransactionUpdateAction + ) + /** Parameters for defining a TypeScript code rule */ @JvmStatic fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) = @@ -708,6 +767,11 @@ private constructor( conditionalTokenizationAction: ConditionalTokenizationActionParameters ): T + fun visitConditionalCardTransactionUpdateAction( + conditionalCardTransactionUpdateAction: + ConditionalCardTransactionUpdateActionParameters + ): T + /** Parameters for defining a TypeScript code rule */ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T @@ -759,6 +823,18 @@ private constructor( ?.let { Parameters(conditionalTokenizationAction = it, _json = json) }, + tryDeserialize( + node, + jacksonTypeRef< + ConditionalCardTransactionUpdateActionParameters + >(), + ) + ?.let { + Parameters( + conditionalCardTransactionUpdateAction = it, + _json = json, + ) + }, tryDeserialize(node, jacksonTypeRef())?.let { Parameters(typescriptCode = it, _json = json) }, @@ -799,6 +875,8 @@ private constructor( generator.writeObject(value.conditionalAchAction) value.conditionalTokenizationAction != null -> generator.writeObject(value.conditionalTokenizationAction) + value.conditionalCardTransactionUpdateAction != null -> + generator.writeObject(value.conditionalCardTransactionUpdateAction) value.typescriptCode != null -> generator.writeObject(value.typescriptCode) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Parameters") diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt new file mode 100644 index 000000000..52b12b4bc --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt @@ -0,0 +1,1143 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.core.ObjectCodec +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.SerializerProvider +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.fasterxml.jackson.databind.annotation.JsonSerialize +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.BaseDeserializer +import com.lithic.api.core.BaseSerializer +import com.lithic.api.core.Enum +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonMissing +import com.lithic.api.core.JsonValue +import com.lithic.api.core.allMaxBy +import com.lithic.api.core.checkRequired +import com.lithic.api.core.getOrThrow +import com.lithic.api.errors.LithicInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +@JsonDeserialize(using = CardTransactionUpdateAction.Deserializer::class) +@JsonSerialize(using = CardTransactionUpdateAction.Serializer::class) +class CardTransactionUpdateAction +private constructor( + private val tag: TagAction? = null, + private val createCase: CreateCaseAction? = null, + private val _json: JsonValue? = null, +) { + + fun tag(): Optional = Optional.ofNullable(tag) + + fun createCase(): Optional = Optional.ofNullable(createCase) + + fun isTag(): Boolean = tag != null + + fun isCreateCase(): Boolean = createCase != null + + fun asTag(): TagAction = tag.getOrThrow("tag") + + fun asCreateCase(): CreateCaseAction = createCase.getOrThrow("createCase") + + fun _json(): Optional = Optional.ofNullable(_json) + + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.lithic.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = cardTransactionUpdateAction.accept(new CardTransactionUpdateAction.Visitor>() { + * @Override + * public Optional visitTag(TagAction tag) { + * return Optional.of(tag.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ + fun accept(visitor: Visitor): T = + when { + tag != null -> visitor.visitTag(tag) + createCase != null -> visitor.visitCreateCase(createCase) + else -> visitor.unknown(_json) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): CardTransactionUpdateAction = apply { + if (validated) { + return@apply + } + + accept( + object : Visitor { + override fun visitTag(tag: TagAction) { + tag.validate() + } + + override fun visitCreateCase(createCase: CreateCaseAction) { + createCase.validate() + } + } + ) + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + accept( + object : Visitor { + override fun visitTag(tag: TagAction) = tag.validity() + + override fun visitCreateCase(createCase: CreateCaseAction) = createCase.validity() + + override fun unknown(json: JsonValue?) = 0 + } + ) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardTransactionUpdateAction && + tag == other.tag && + createCase == other.createCase + } + + override fun hashCode(): Int = Objects.hash(tag, createCase) + + override fun toString(): String = + when { + tag != null -> "CardTransactionUpdateAction{tag=$tag}" + createCase != null -> "CardTransactionUpdateAction{createCase=$createCase}" + _json != null -> "CardTransactionUpdateAction{_unknown=$_json}" + else -> throw IllegalStateException("Invalid CardTransactionUpdateAction") + } + + companion object { + + @JvmStatic fun ofTag(tag: TagAction) = CardTransactionUpdateAction(tag = tag) + + @JvmStatic + fun ofCreateCase(createCase: CreateCaseAction) = + CardTransactionUpdateAction(createCase = createCase) + } + + /** + * An interface that defines how to map each variant of [CardTransactionUpdateAction] to a value + * of type [T]. + */ + interface Visitor { + + fun visitTag(tag: TagAction): T + + fun visitCreateCase(createCase: CreateCaseAction): T + + /** + * Maps an unknown variant of [CardTransactionUpdateAction] to a value of type [T]. + * + * An instance of [CardTransactionUpdateAction] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK is + * on an older version than the API, then the API may respond with new variants that the SDK + * is unaware of. + * + * @throws LithicInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw LithicInvalidDataException("Unknown CardTransactionUpdateAction: $json") + } + } + + internal class Deserializer : + BaseDeserializer(CardTransactionUpdateAction::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): CardTransactionUpdateAction { + val json = JsonValue.fromJsonNode(node) + + val bestMatches = + sequenceOf( + tryDeserialize(node, jacksonTypeRef())?.let { + CardTransactionUpdateAction(tag = it, _json = json) + }, + tryDeserialize(node, jacksonTypeRef())?.let { + CardTransactionUpdateAction(createCase = it, _json = json) + }, + ) + .filterNotNull() + .allMaxBy { it.validity() } + .toList() + return when (bestMatches.size) { + // This can happen if what we're deserializing is completely incompatible with all + // the possible variants (e.g. deserializing from boolean). + 0 -> CardTransactionUpdateAction(_json = json) + 1 -> bestMatches.single() + // If there's more than one match with the highest validity, then use the first + // completely valid match, or simply the first match if none are completely valid. + else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + } + } + } + + internal class Serializer : + BaseSerializer(CardTransactionUpdateAction::class) { + + override fun serialize( + value: CardTransactionUpdateAction, + generator: JsonGenerator, + provider: SerializerProvider, + ) { + when { + value.tag != null -> generator.writeObject(value.tag) + value.createCase != null -> generator.writeObject(value.createCase) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid CardTransactionUpdateAction") + } + } + } + + class TagAction + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val key: JsonField, + private val type: JsonField, + private val value: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("key") @ExcludeMissing key: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + @JsonProperty("value") @ExcludeMissing value: JsonField = JsonMissing.of(), + ) : this(key, type, value, mutableMapOf()) + + /** + * The key of the tag to apply to the transaction + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun key(): String = key.getRequired("key") + + /** + * Tag the transaction with key-value metadata + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun type(): Type = type.getRequired("type") + + /** + * The value of the tag to apply to the transaction + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun value(): String = value.getRequired("value") + + /** + * Returns the raw JSON value of [key]. + * + * Unlike [key], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("key") @ExcludeMissing fun _key(): JsonField = key + + /** + * Returns the raw JSON value of [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + + /** + * Returns the raw JSON value of [value]. + * + * Unlike [value], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [TagAction]. + * + * The following fields are required: + * ```java + * .key() + * .type() + * .value() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TagAction]. */ + class Builder internal constructor() { + + private var key: JsonField? = null + private var type: JsonField? = null + private var value: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(tagAction: TagAction) = apply { + key = tagAction.key + type = tagAction.type + value = tagAction.value + additionalProperties = tagAction.additionalProperties.toMutableMap() + } + + /** The key of the tag to apply to the transaction */ + fun key(key: String) = key(JsonField.of(key)) + + /** + * Sets [Builder.key] to an arbitrary JSON value. + * + * You should usually call [Builder.key] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun key(key: JsonField) = apply { this.key = key } + + /** Tag the transaction with key-value metadata */ + fun type(type: Type) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [Type] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun type(type: JsonField) = apply { this.type = type } + + /** The value of the tag to apply to the transaction */ + fun value(value: String) = value(JsonField.of(value)) + + /** + * Sets [Builder.value] to an arbitrary JSON value. + * + * You should usually call [Builder.value] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun value(value: JsonField) = apply { this.value = value } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [TagAction]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .key() + * .type() + * .value() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TagAction = + TagAction( + checkRequired("key", key), + checkRequired("type", type), + checkRequired("value", value), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): TagAction = apply { + if (validated) { + return@apply + } + + key() + type().validate() + value() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (key.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + (if (value.asKnown().isPresent) 1 else 0) + + /** Tag the transaction with key-value metadata */ + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val TAG = of("TAG") + + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } + + /** An enum containing [Type]'s known values. */ + enum class Known { + TAG + } + + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + TAG, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + TAG -> Value.TAG + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws LithicInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + TAG -> Known.TAG + else -> throw LithicInvalidDataException("Unknown Type: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LithicInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Type = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Type && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TagAction && + key == other.key && + type == other.type && + value == other.value && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(key, type, value, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TagAction{key=$key, type=$type, value=$value, additionalProperties=$additionalProperties}" + } + + class CreateCaseAction + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val queueToken: JsonField, + private val scope: JsonField, + private val type: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("queue_token") + @ExcludeMissing + queueToken: JsonField = JsonMissing.of(), + @JsonProperty("scope") @ExcludeMissing scope: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + ) : this(queueToken, scope, type, mutableMapOf()) + + /** + * The token of the queue to create the case in + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun queueToken(): String = queueToken.getRequired("queue_token") + + /** + * The scope of the case to create + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun scope(): Scope = scope.getRequired("scope") + + /** + * Create a case for the transaction + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun type(): Type = type.getRequired("type") + + /** + * Returns the raw JSON value of [queueToken]. + * + * Unlike [queueToken], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("queue_token") + @ExcludeMissing + fun _queueToken(): JsonField = queueToken + + /** + * Returns the raw JSON value of [scope]. + * + * Unlike [scope], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("scope") @ExcludeMissing fun _scope(): JsonField = scope + + /** + * Returns the raw JSON value of [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CreateCaseAction]. + * + * The following fields are required: + * ```java + * .queueToken() + * .scope() + * .type() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreateCaseAction]. */ + class Builder internal constructor() { + + private var queueToken: JsonField? = null + private var scope: JsonField? = null + private var type: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(createCaseAction: CreateCaseAction) = apply { + queueToken = createCaseAction.queueToken + scope = createCaseAction.scope + type = createCaseAction.type + additionalProperties = createCaseAction.additionalProperties.toMutableMap() + } + + /** The token of the queue to create the case in */ + fun queueToken(queueToken: String) = queueToken(JsonField.of(queueToken)) + + /** + * Sets [Builder.queueToken] to an arbitrary JSON value. + * + * You should usually call [Builder.queueToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun queueToken(queueToken: JsonField) = apply { this.queueToken = queueToken } + + /** The scope of the case to create */ + fun scope(scope: Scope) = scope(JsonField.of(scope)) + + /** + * Sets [Builder.scope] to an arbitrary JSON value. + * + * You should usually call [Builder.scope] with a well-typed [Scope] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun scope(scope: JsonField) = apply { this.scope = scope } + + /** Create a case for the transaction */ + fun type(type: Type) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [Type] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun type(type: JsonField) = apply { this.type = type } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [CreateCaseAction]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .queueToken() + * .scope() + * .type() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreateCaseAction = + CreateCaseAction( + checkRequired("queueToken", queueToken), + checkRequired("scope", scope), + checkRequired("type", type), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): CreateCaseAction = apply { + if (validated) { + return@apply + } + + queueToken() + scope().validate() + type().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (queueToken.asKnown().isPresent) 1 else 0) + + (scope.asKnown().getOrNull()?.validity() ?: 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + /** The scope of the case to create */ + class Scope @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val CARD = of("CARD") + + @JvmField val ACCOUNT = of("ACCOUNT") + + @JvmStatic fun of(value: String) = Scope(JsonField.of(value)) + } + + /** An enum containing [Scope]'s known values. */ + enum class Known { + CARD, + ACCOUNT, + } + + /** + * An enum containing [Scope]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Scope] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + CARD, + ACCOUNT, + /** + * An enum member indicating that [Scope] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + CARD -> Value.CARD + ACCOUNT -> Value.ACCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws LithicInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + CARD -> Known.CARD + ACCOUNT -> Known.ACCOUNT + else -> throw LithicInvalidDataException("Unknown Scope: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LithicInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Scope = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Scope && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Create a case for the transaction */ + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val CREATE_CASE = of("CREATE_CASE") + + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } + + /** An enum containing [Type]'s known values. */ + enum class Known { + CREATE_CASE + } + + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + CREATE_CASE, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + CREATE_CASE -> Value.CREATE_CASE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws LithicInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + CREATE_CASE -> Known.CREATE_CASE + else -> throw LithicInvalidDataException("Unknown Type: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LithicInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Type = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Type && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreateCaseAction && + queueToken == other.queueToken && + scope == other.scope && + type == other.type && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(queueToken, scope, type, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreateCaseAction{queueToken=$queueToken, scope=$scope, type=$type, additionalProperties=$additionalProperties}" + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalCardTransactionUpdateActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalCardTransactionUpdateActionParameters.kt new file mode 100644 index 000000000..573d613d5 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalCardTransactionUpdateActionParameters.kt @@ -0,0 +1,1367 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.lithic.api.core.Enum +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonMissing +import com.lithic.api.core.JsonValue +import com.lithic.api.core.checkKnown +import com.lithic.api.core.checkRequired +import com.lithic.api.core.toImmutable +import com.lithic.api.errors.LithicInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class ConditionalCardTransactionUpdateActionParameters +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val action: JsonField, + private val conditions: JsonField>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("action") + @ExcludeMissing + action: JsonField = JsonMissing.of(), + @JsonProperty("conditions") + @ExcludeMissing + conditions: JsonField> = JsonMissing.of(), + ) : this(action, conditions, mutableMapOf()) + + /** + * The action to take if the conditions are met. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun action(): CardTransactionUpdateAction = action.getRequired("action") + + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun conditions(): List = conditions.getRequired("conditions") + + /** + * Returns the raw JSON value of [action]. + * + * Unlike [action], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("action") + @ExcludeMissing + fun _action(): JsonField = action + + /** + * Returns the raw JSON value of [conditions]. + * + * Unlike [conditions], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("conditions") + @ExcludeMissing + fun _conditions(): JsonField> = conditions + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [ConditionalCardTransactionUpdateActionParameters]. + * + * The following fields are required: + * ```java + * .action() + * .conditions() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ConditionalCardTransactionUpdateActionParameters]. */ + class Builder internal constructor() { + + private var action: JsonField? = null + private var conditions: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + conditionalCardTransactionUpdateActionParameters: + ConditionalCardTransactionUpdateActionParameters + ) = apply { + action = conditionalCardTransactionUpdateActionParameters.action + conditions = + conditionalCardTransactionUpdateActionParameters.conditions.map { + it.toMutableList() + } + additionalProperties = + conditionalCardTransactionUpdateActionParameters.additionalProperties.toMutableMap() + } + + /** The action to take if the conditions are met. */ + fun action(action: CardTransactionUpdateAction) = action(JsonField.of(action)) + + /** + * Sets [Builder.action] to an arbitrary JSON value. + * + * You should usually call [Builder.action] with a well-typed [CardTransactionUpdateAction] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun action(action: JsonField) = apply { this.action = action } + + /** Alias for calling [action] with `CardTransactionUpdateAction.ofTag(tag)`. */ + fun action(tag: CardTransactionUpdateAction.TagAction) = + action(CardTransactionUpdateAction.ofTag(tag)) + + /** + * Alias for calling [action] with `CardTransactionUpdateAction.ofCreateCase(createCase)`. + */ + fun action(createCase: CardTransactionUpdateAction.CreateCaseAction) = + action(CardTransactionUpdateAction.ofCreateCase(createCase)) + + fun conditions(conditions: List) = conditions(JsonField.of(conditions)) + + /** + * Sets [Builder.conditions] to an arbitrary JSON value. + * + * You should usually call [Builder.conditions] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun conditions(conditions: JsonField>) = apply { + this.conditions = conditions.map { it.toMutableList() } + } + + /** + * Adds a single [Condition] to [conditions]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addCondition(condition: Condition) = apply { + conditions = + (conditions ?: JsonField.of(mutableListOf())).also { + checkKnown("conditions", it).add(condition) + } + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ConditionalCardTransactionUpdateActionParameters]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .action() + * .conditions() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ConditionalCardTransactionUpdateActionParameters = + ConditionalCardTransactionUpdateActionParameters( + checkRequired("action", action), + checkRequired("conditions", conditions).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): ConditionalCardTransactionUpdateActionParameters = apply { + if (validated) { + return@apply + } + + action().validate() + conditions().forEach { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (action.asKnown().getOrNull()?.validity() ?: 0) + + (conditions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + class Condition + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val attribute: JsonField, + private val operation: JsonField, + private val value: JsonField, + private val parameters: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("attribute") + @ExcludeMissing + attribute: JsonField = JsonMissing.of(), + @JsonProperty("operation") + @ExcludeMissing + operation: JsonField = JsonMissing.of(), + @JsonProperty("value") + @ExcludeMissing + value: JsonField = JsonMissing.of(), + @JsonProperty("parameters") + @ExcludeMissing + parameters: JsonField = JsonMissing.of(), + ) : this(attribute, operation, value, parameters, mutableMapOf()) + + /** + * The attribute to target. + * + * The following attributes may be targeted: + * * `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a business + * by the types of goods or services it provides. + * * `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all ISO 3166-1 + * alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands Antilles. + * * `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of the + * transaction. + * * `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor (merchant). + * * `DESCRIPTOR`: Short description of card acceptor. + * * `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer fee + * field in the settlement/cardholder billing currency. This is the amount the issuer + * should authorize against unless the issuer is paying the acquirer fee on behalf of the + * cardholder. + * * `RISK_SCORE`: Network-provided score assessing risk level associated with a given + * authorization. Scores are on a range of 0-999, with 0 representing the lowest risk and + * 999 representing the highest risk. For Visa transactions, where the raw score has a + * range of 0-99, Lithic will normalize the score by multiplying the raw score by 10x. + * * `TRANSACTION_STATUS`: The status of the transaction. Valid values are `PENDING`, + * `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, `EXPIRED`. + * * `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid values + * are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + * `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + * `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + * `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + * `RETURN_REVERSAL`. + * * `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer applies + * to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + * `TOKEN_AUTHENTICATED`. + * * `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number (PAN) was + * entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, `ECOMMERCE`, + * `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, `MAGNETIC_STRIPE`, + * `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + * * `WALLET_TYPE`: For transactions using a digital wallet token, indicates the source of + * the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, `SAMSUNG_PAY`, `MASTERPASS`, + * `MERCHANT`, `OTHER`, `NONE`. + * * `CARD_AGE`: The age of the card in seconds at the time of the transaction. + * * `ACCOUNT_AGE`: The age of the account in seconds at the time of the transaction. + * * `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified filters + * within the given period. Requires `parameters` with `scope`, `period`, and optional + * `filters`. + * * `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions matching the + * specified filters within the given period. Requires `parameters` with `scope`, + * `period`, and optional `filters`. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun attribute(): Attribute = attribute.getRequired("attribute") + + /** + * The operation to apply to the attribute + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun operation(): ConditionalOperation = operation.getRequired("operation") + + /** + * A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun value(): ConditionalValue = value.getRequired("value") + + /** + * Additional parameters for spend velocity attributes. Required when `attribute` is + * `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. Not used for other attributes. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun parameters(): Optional = parameters.getOptional("parameters") + + /** + * Returns the raw JSON value of [attribute]. + * + * Unlike [attribute], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("attribute") + @ExcludeMissing + fun _attribute(): JsonField = attribute + + /** + * Returns the raw JSON value of [operation]. + * + * Unlike [operation], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("operation") + @ExcludeMissing + fun _operation(): JsonField = operation + + /** + * Returns the raw JSON value of [value]. + * + * Unlike [value], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value + + /** + * Returns the raw JSON value of [parameters]. + * + * Unlike [parameters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("parameters") + @ExcludeMissing + fun _parameters(): JsonField = parameters + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Condition]. + * + * The following fields are required: + * ```java + * .attribute() + * .operation() + * .value() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Condition]. */ + class Builder internal constructor() { + + private var attribute: JsonField? = null + private var operation: JsonField? = null + private var value: JsonField? = null + private var parameters: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(condition: Condition) = apply { + attribute = condition.attribute + operation = condition.operation + value = condition.value + parameters = condition.parameters + additionalProperties = condition.additionalProperties.toMutableMap() + } + + /** + * The attribute to target. + * + * The following attributes may be targeted: + * * `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + * business by the types of goods or services it provides. + * * `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all ISO + * 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands + * Antilles. + * * `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of the + * transaction. + * * `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + * (merchant). + * * `DESCRIPTOR`: Short description of card acceptor. + * * `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer fee + * field in the settlement/cardholder billing currency. This is the amount the issuer + * should authorize against unless the issuer is paying the acquirer fee on behalf of + * the cardholder. + * * `RISK_SCORE`: Network-provided score assessing risk level associated with a given + * authorization. Scores are on a range of 0-999, with 0 representing the lowest risk + * and 999 representing the highest risk. For Visa transactions, where the raw score + * has a range of 0-99, Lithic will normalize the score by multiplying the raw score + * by 10x. + * * `TRANSACTION_STATUS`: The status of the transaction. Valid values are `PENDING`, + * `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, `EXPIRED`. + * * `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid + * values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + * `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + * `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + * `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + * `RETURN_REVERSAL`. + * * `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + * applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + * `TOKEN_AUTHENTICATED`. + * * `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number (PAN) + * was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, `ECOMMERCE`, + * `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, `MAGNETIC_STRIPE`, + * `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, `UNKNOWN`, or + * `CREDENTIAL_ON_FILE`. + * * `WALLET_TYPE`: For transactions using a digital wallet token, indicates the source + * of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, `SAMSUNG_PAY`, + * `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + * * `CARD_AGE`: The age of the card in seconds at the time of the transaction. + * * `ACCOUNT_AGE`: The age of the account in seconds at the time of the transaction. + * * `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified filters + * within the given period. Requires `parameters` with `scope`, `period`, and optional + * `filters`. + * * `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions matching + * the specified filters within the given period. Requires `parameters` with `scope`, + * `period`, and optional `filters`. + */ + fun attribute(attribute: Attribute) = attribute(JsonField.of(attribute)) + + /** + * Sets [Builder.attribute] to an arbitrary JSON value. + * + * You should usually call [Builder.attribute] with a well-typed [Attribute] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun attribute(attribute: JsonField) = apply { this.attribute = attribute } + + /** The operation to apply to the attribute */ + fun operation(operation: ConditionalOperation) = operation(JsonField.of(operation)) + + /** + * Sets [Builder.operation] to an arbitrary JSON value. + * + * You should usually call [Builder.operation] with a well-typed [ConditionalOperation] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun operation(operation: JsonField) = apply { + this.operation = operation + } + + /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ + fun value(value: ConditionalValue) = value(JsonField.of(value)) + + /** + * Sets [Builder.value] to an arbitrary JSON value. + * + * You should usually call [Builder.value] with a well-typed [ConditionalValue] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun value(value: JsonField) = apply { this.value = value } + + /** Alias for calling [value] with `ConditionalValue.ofRegex(regex)`. */ + fun value(regex: String) = value(ConditionalValue.ofRegex(regex)) + + /** Alias for calling [value] with `ConditionalValue.ofNumber(number)`. */ + fun value(number: Long) = value(ConditionalValue.ofNumber(number)) + + /** Alias for calling [value] with `ConditionalValue.ofListOfStrings(listOfStrings)`. */ + fun valueOfListOfStrings(listOfStrings: List) = + value(ConditionalValue.ofListOfStrings(listOfStrings)) + + /** Alias for calling [value] with `ConditionalValue.ofTimestamp(timestamp)`. */ + fun value(timestamp: OffsetDateTime) = value(ConditionalValue.ofTimestamp(timestamp)) + + /** + * Additional parameters for spend velocity attributes. Required when `attribute` is + * `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. Not used for other attributes. + */ + fun parameters(parameters: Parameters) = parameters(JsonField.of(parameters)) + + /** + * Sets [Builder.parameters] to an arbitrary JSON value. + * + * You should usually call [Builder.parameters] with a well-typed [Parameters] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun parameters(parameters: JsonField) = apply { + this.parameters = parameters + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Condition]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .attribute() + * .operation() + * .value() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Condition = + Condition( + checkRequired("attribute", attribute), + checkRequired("operation", operation), + checkRequired("value", value), + parameters, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Condition = apply { + if (validated) { + return@apply + } + + attribute().validate() + operation().validate() + value().validate() + parameters().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (attribute.asKnown().getOrNull()?.validity() ?: 0) + + (operation.asKnown().getOrNull()?.validity() ?: 0) + + (value.asKnown().getOrNull()?.validity() ?: 0) + + (parameters.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The attribute to target. + * + * The following attributes may be targeted: + * * `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a business + * by the types of goods or services it provides. + * * `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all ISO 3166-1 + * alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands Antilles. + * * `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of the + * transaction. + * * `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor (merchant). + * * `DESCRIPTOR`: Short description of card acceptor. + * * `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer fee + * field in the settlement/cardholder billing currency. This is the amount the issuer + * should authorize against unless the issuer is paying the acquirer fee on behalf of the + * cardholder. + * * `RISK_SCORE`: Network-provided score assessing risk level associated with a given + * authorization. Scores are on a range of 0-999, with 0 representing the lowest risk and + * 999 representing the highest risk. For Visa transactions, where the raw score has a + * range of 0-99, Lithic will normalize the score by multiplying the raw score by 10x. + * * `TRANSACTION_STATUS`: The status of the transaction. Valid values are `PENDING`, + * `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, `EXPIRED`. + * * `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid values + * are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + * `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + * `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + * `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + * `RETURN_REVERSAL`. + * * `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer applies + * to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + * `TOKEN_AUTHENTICATED`. + * * `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number (PAN) was + * entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, `ECOMMERCE`, + * `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, `MAGNETIC_STRIPE`, + * `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + * * `WALLET_TYPE`: For transactions using a digital wallet token, indicates the source of + * the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, `SAMSUNG_PAY`, `MASTERPASS`, + * `MERCHANT`, `OTHER`, `NONE`. + * * `CARD_AGE`: The age of the card in seconds at the time of the transaction. + * * `ACCOUNT_AGE`: The age of the account in seconds at the time of the transaction. + * * `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified filters + * within the given period. Requires `parameters` with `scope`, `period`, and optional + * `filters`. + * * `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions matching the + * specified filters within the given period. Requires `parameters` with `scope`, + * `period`, and optional `filters`. + */ + class Attribute @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val MCC = of("MCC") + + @JvmField val COUNTRY = of("COUNTRY") + + @JvmField val CURRENCY = of("CURRENCY") + + @JvmField val MERCHANT_ID = of("MERCHANT_ID") + + @JvmField val DESCRIPTOR = of("DESCRIPTOR") + + @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + + @JvmField val RISK_SCORE = of("RISK_SCORE") + + @JvmField val TRANSACTION_STATUS = of("TRANSACTION_STATUS") + + @JvmField val LAST_EVENT_TYPE = of("LAST_EVENT_TYPE") + + @JvmField val LIABILITY_SHIFT = of("LIABILITY_SHIFT") + + @JvmField val PAN_ENTRY_MODE = of("PAN_ENTRY_MODE") + + @JvmField val WALLET_TYPE = of("WALLET_TYPE") + + @JvmField val CARD_AGE = of("CARD_AGE") + + @JvmField val ACCOUNT_AGE = of("ACCOUNT_AGE") + + @JvmField val SPEND_VELOCITY_COUNT = of("SPEND_VELOCITY_COUNT") + + @JvmField val SPEND_VELOCITY_AMOUNT = of("SPEND_VELOCITY_AMOUNT") + + @JvmStatic fun of(value: String) = Attribute(JsonField.of(value)) + } + + /** An enum containing [Attribute]'s known values. */ + enum class Known { + MCC, + COUNTRY, + CURRENCY, + MERCHANT_ID, + DESCRIPTOR, + TRANSACTION_AMOUNT, + RISK_SCORE, + TRANSACTION_STATUS, + LAST_EVENT_TYPE, + LIABILITY_SHIFT, + PAN_ENTRY_MODE, + WALLET_TYPE, + CARD_AGE, + ACCOUNT_AGE, + SPEND_VELOCITY_COUNT, + SPEND_VELOCITY_AMOUNT, + } + + /** + * An enum containing [Attribute]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Attribute] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + MCC, + COUNTRY, + CURRENCY, + MERCHANT_ID, + DESCRIPTOR, + TRANSACTION_AMOUNT, + RISK_SCORE, + TRANSACTION_STATUS, + LAST_EVENT_TYPE, + LIABILITY_SHIFT, + PAN_ENTRY_MODE, + WALLET_TYPE, + CARD_AGE, + ACCOUNT_AGE, + SPEND_VELOCITY_COUNT, + SPEND_VELOCITY_AMOUNT, + /** + * An enum member indicating that [Attribute] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MCC -> Value.MCC + COUNTRY -> Value.COUNTRY + CURRENCY -> Value.CURRENCY + MERCHANT_ID -> Value.MERCHANT_ID + DESCRIPTOR -> Value.DESCRIPTOR + TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + RISK_SCORE -> Value.RISK_SCORE + TRANSACTION_STATUS -> Value.TRANSACTION_STATUS + LAST_EVENT_TYPE -> Value.LAST_EVENT_TYPE + LIABILITY_SHIFT -> Value.LIABILITY_SHIFT + PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE + WALLET_TYPE -> Value.WALLET_TYPE + CARD_AGE -> Value.CARD_AGE + ACCOUNT_AGE -> Value.ACCOUNT_AGE + SPEND_VELOCITY_COUNT -> Value.SPEND_VELOCITY_COUNT + SPEND_VELOCITY_AMOUNT -> Value.SPEND_VELOCITY_AMOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws LithicInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + MCC -> Known.MCC + COUNTRY -> Known.COUNTRY + CURRENCY -> Known.CURRENCY + MERCHANT_ID -> Known.MERCHANT_ID + DESCRIPTOR -> Known.DESCRIPTOR + TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + RISK_SCORE -> Known.RISK_SCORE + TRANSACTION_STATUS -> Known.TRANSACTION_STATUS + LAST_EVENT_TYPE -> Known.LAST_EVENT_TYPE + LIABILITY_SHIFT -> Known.LIABILITY_SHIFT + PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE + WALLET_TYPE -> Known.WALLET_TYPE + CARD_AGE -> Known.CARD_AGE + ACCOUNT_AGE -> Known.ACCOUNT_AGE + SPEND_VELOCITY_COUNT -> Known.SPEND_VELOCITY_COUNT + SPEND_VELOCITY_AMOUNT -> Known.SPEND_VELOCITY_AMOUNT + else -> throw LithicInvalidDataException("Unknown Attribute: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LithicInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Attribute = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Attribute && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Additional parameters for spend velocity attributes. Required when `attribute` is + * `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. Not used for other attributes. + */ + class Parameters + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val filters: JsonField, + private val period: JsonField, + private val scope: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("filters") + @ExcludeMissing + filters: JsonField = JsonMissing.of(), + @JsonProperty("period") + @ExcludeMissing + period: JsonField = JsonMissing.of(), + @JsonProperty("scope") @ExcludeMissing scope: JsonField = JsonMissing.of(), + ) : this(filters, period, scope, mutableMapOf()) + + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun filters(): Optional = filters.getOptional("filters") + + /** + * The time period over which to calculate the spend velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun period(): Optional = period.getOptional("period") + + /** + * The entity scope to evaluate the attribute against. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun scope(): Optional = scope.getOptional("scope") + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") + @ExcludeMissing + fun _filters(): JsonField = filters + + /** + * Returns the raw JSON value of [period]. + * + * Unlike [period], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("period") + @ExcludeMissing + fun _period(): JsonField = period + + /** + * Returns the raw JSON value of [scope]. + * + * Unlike [scope], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("scope") @ExcludeMissing fun _scope(): JsonField = scope + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Parameters]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Parameters]. */ + class Builder internal constructor() { + + private var filters: JsonField = JsonMissing.of() + private var period: JsonField = JsonMissing.of() + private var scope: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(parameters: Parameters) = apply { + filters = parameters.filters + period = parameters.period + scope = parameters.scope + additionalProperties = parameters.additionalProperties.toMutableMap() + } + + fun filters(filters: SpendVelocityFilters) = filters(JsonField.of(filters)) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed + * [SpendVelocityFilters] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun filters(filters: JsonField) = apply { + this.filters = filters + } + + /** The time period over which to calculate the spend velocity. */ + fun period(period: VelocityLimitPeriod) = period(JsonField.of(period)) + + /** + * Sets [Builder.period] to an arbitrary JSON value. + * + * You should usually call [Builder.period] with a well-typed [VelocityLimitPeriod] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun period(period: JsonField) = apply { this.period = period } + + /** + * Alias for calling [period] with + * `VelocityLimitPeriod.ofTrailingWindowObject(trailingWindowObject)`. + */ + fun period(trailingWindowObject: VelocityLimitPeriod.TrailingWindowObject) = + period(VelocityLimitPeriod.ofTrailingWindowObject(trailingWindowObject)) + + /** + * Alias for calling [period] with + * `VelocityLimitPeriod.ofFixedWindowDay(fixedWindowDay)`. + */ + fun period(fixedWindowDay: VelocityLimitPeriod.FixedWindowDay) = + period(VelocityLimitPeriod.ofFixedWindowDay(fixedWindowDay)) + + /** + * Alias for calling [period] with + * `VelocityLimitPeriod.ofFixedWindowWeek(fixedWindowWeek)`. + */ + fun period(fixedWindowWeek: VelocityLimitPeriod.FixedWindowWeek) = + period(VelocityLimitPeriod.ofFixedWindowWeek(fixedWindowWeek)) + + /** + * Alias for calling [period] with + * `VelocityLimitPeriod.ofFixedWindowMonth(fixedWindowMonth)`. + */ + fun period(fixedWindowMonth: VelocityLimitPeriod.FixedWindowMonth) = + period(VelocityLimitPeriod.ofFixedWindowMonth(fixedWindowMonth)) + + /** + * Alias for calling [period] with + * `VelocityLimitPeriod.ofFixedWindowYear(fixedWindowYear)`. + */ + fun period(fixedWindowYear: VelocityLimitPeriod.FixedWindowYear) = + period(VelocityLimitPeriod.ofFixedWindowYear(fixedWindowYear)) + + /** The entity scope to evaluate the attribute against. */ + fun scope(scope: Scope) = scope(JsonField.of(scope)) + + /** + * Sets [Builder.scope] to an arbitrary JSON value. + * + * You should usually call [Builder.scope] with a well-typed [Scope] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun scope(scope: JsonField) = apply { this.scope = scope } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Parameters]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Parameters = + Parameters(filters, period, scope, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Parameters = apply { + if (validated) { + return@apply + } + + filters().ifPresent { it.validate() } + period().ifPresent { it.validate() } + scope().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (filters.asKnown().getOrNull()?.validity() ?: 0) + + (period.asKnown().getOrNull()?.validity() ?: 0) + + (scope.asKnown().getOrNull()?.validity() ?: 0) + + /** The entity scope to evaluate the attribute against. */ + class Scope @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val CARD = of("CARD") + + @JvmField val ACCOUNT = of("ACCOUNT") + + @JvmField val GLOBAL = of("GLOBAL") + + @JvmStatic fun of(value: String) = Scope(JsonField.of(value)) + } + + /** An enum containing [Scope]'s known values. */ + enum class Known { + CARD, + ACCOUNT, + GLOBAL, + } + + /** + * An enum containing [Scope]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Scope] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + CARD, + ACCOUNT, + GLOBAL, + /** + * An enum member indicating that [Scope] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + CARD -> Value.CARD + ACCOUNT -> Value.ACCOUNT + GLOBAL -> Value.GLOBAL + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws LithicInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + CARD -> Known.CARD + ACCOUNT -> Known.ACCOUNT + GLOBAL -> Known.GLOBAL + else -> throw LithicInvalidDataException("Unknown Scope: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LithicInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match + * its expected type. + */ + fun validate(): Scope = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Scope && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Parameters && + filters == other.filters && + period == other.period && + scope == other.scope && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(filters, period, scope, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Parameters{filters=$filters, period=$period, scope=$scope, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Condition && + attribute == other.attribute && + operation == other.operation && + value == other.value && + parameters == other.parameters && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(attribute, operation, value, parameters, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Condition{attribute=$attribute, operation=$operation, value=$value, parameters=$parameters, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConditionalCardTransactionUpdateActionParameters && + action == other.action && + conditions == other.conditions && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(action, conditions, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConditionalCardTransactionUpdateActionParameters{action=$action, conditions=$conditions, additionalProperties=$additionalProperties}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventStream.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventStream.kt index 67244248e..4bc8b8938 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventStream.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventStream.kt @@ -31,6 +31,8 @@ class EventStream @JsonCreator private constructor(private val value: JsonField< @JvmField val ACH_DEBIT_RECEIPT = of("ACH_DEBIT_RECEIPT") + @JvmField val CARD_TRANSACTION_UPDATE = of("CARD_TRANSACTION_UPDATE") + @JvmStatic fun of(value: String) = EventStream(JsonField.of(value)) } @@ -41,6 +43,7 @@ class EventStream @JsonCreator private constructor(private val value: JsonField< TOKENIZATION, ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, + CARD_TRANSACTION_UPDATE, } /** @@ -58,6 +61,7 @@ class EventStream @JsonCreator private constructor(private val value: JsonField< TOKENIZATION, ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, + CARD_TRANSACTION_UPDATE, /** An enum member indicating that [EventStream] was instantiated with an unknown value. */ _UNKNOWN, } @@ -76,6 +80,7 @@ class EventStream @JsonCreator private constructor(private val value: JsonField< TOKENIZATION -> Value.TOKENIZATION ACH_CREDIT_RECEIPT -> Value.ACH_CREDIT_RECEIPT ACH_DEBIT_RECEIPT -> Value.ACH_DEBIT_RECEIPT + CARD_TRANSACTION_UPDATE -> Value.CARD_TRANSACTION_UPDATE else -> Value._UNKNOWN } @@ -94,6 +99,7 @@ class EventStream @JsonCreator private constructor(private val value: JsonField< TOKENIZATION -> Known.TOKENIZATION ACH_CREDIT_RECEIPT -> Known.ACH_CREDIT_RECEIPT ACH_DEBIT_RECEIPT -> Known.ACH_DEBIT_RECEIPT + CARD_TRANSACTION_UPDATE -> Known.CARD_TRANSACTION_UPDATE else -> throw LithicInvalidDataException("Unknown EventStream: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SpendVelocityFilters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SpendVelocityFilters.kt new file mode 100644 index 000000000..27f6c3561 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SpendVelocityFilters.kt @@ -0,0 +1,810 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonMissing +import com.lithic.api.core.JsonValue +import com.lithic.api.core.checkKnown +import com.lithic.api.core.toImmutable +import com.lithic.api.errors.LithicInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class SpendVelocityFilters +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val excludeCountries: JsonField>, + private val excludeMccs: JsonField>, + private val includeCountries: JsonField>, + private val includeMccs: JsonField>, + private val includePanEntryModes: JsonField>, + private val excludeTags: JsonField, + private val includeTags: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("exclude_countries") + @ExcludeMissing + excludeCountries: JsonField> = JsonMissing.of(), + @JsonProperty("exclude_mccs") + @ExcludeMissing + excludeMccs: JsonField> = JsonMissing.of(), + @JsonProperty("include_countries") + @ExcludeMissing + includeCountries: JsonField> = JsonMissing.of(), + @JsonProperty("include_mccs") + @ExcludeMissing + includeMccs: JsonField> = JsonMissing.of(), + @JsonProperty("include_pan_entry_modes") + @ExcludeMissing + includePanEntryModes: JsonField> = + JsonMissing.of(), + @JsonProperty("exclude_tags") + @ExcludeMissing + excludeTags: JsonField = JsonMissing.of(), + @JsonProperty("include_tags") + @ExcludeMissing + includeTags: JsonField = JsonMissing.of(), + ) : this( + excludeCountries, + excludeMccs, + includeCountries, + includeMccs, + includePanEntryModes, + excludeTags, + includeTags, + mutableMapOf(), + ) + + fun toVelocityLimitFilters(): VelocityLimitFilters = + VelocityLimitFilters.builder() + .excludeCountries(excludeCountries) + .excludeMccs(excludeMccs) + .includeCountries(includeCountries) + .includeMccs(includeMccs) + .includePanEntryModes(includePanEntryModes) + .build() + + /** + * ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. Transactions + * matching any of the provided will be excluded from the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun excludeCountries(): Optional> = + excludeCountries.getOptional("exclude_countries") + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions matching this + * MCC will be excluded from the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun excludeMccs(): Optional> = excludeMccs.getOptional("exclude_mccs") + + /** + * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transactions not + * matching any of the provided will not be included in the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun includeCountries(): Optional> = + includeCountries.getOptional("include_countries") + + /** + * Merchant Category Codes to include in the velocity calculation. Transactions not matching + * this MCC will not be included in the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun includeMccs(): Optional> = includeMccs.getOptional("include_mccs") + + /** + * PAN entry modes to include in the velocity calculation. Transactions not matching any of the + * provided will not be included in the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun includePanEntryModes(): Optional> = + includePanEntryModes.getOptional("include_pan_entry_modes") + + /** + * Tag key-value pairs to exclude from the velocity calculation. Transactions matching all + * specified tag key-value pairs will be excluded from the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun excludeTags(): Optional = excludeTags.getOptional("exclude_tags") + + /** + * Tag key-value pairs to include in the velocity calculation. Only transactions matching all + * specified tag key-value pairs will be included in the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun includeTags(): Optional = includeTags.getOptional("include_tags") + + /** + * Returns the raw JSON value of [excludeCountries]. + * + * Unlike [excludeCountries], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("exclude_countries") + @ExcludeMissing + fun _excludeCountries(): JsonField> = excludeCountries + + /** + * Returns the raw JSON value of [excludeMccs]. + * + * Unlike [excludeMccs], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("exclude_mccs") + @ExcludeMissing + fun _excludeMccs(): JsonField> = excludeMccs + + /** + * Returns the raw JSON value of [includeCountries]. + * + * Unlike [includeCountries], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("include_countries") + @ExcludeMissing + fun _includeCountries(): JsonField> = includeCountries + + /** + * Returns the raw JSON value of [includeMccs]. + * + * Unlike [includeMccs], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("include_mccs") + @ExcludeMissing + fun _includeMccs(): JsonField> = includeMccs + + /** + * Returns the raw JSON value of [includePanEntryModes]. + * + * Unlike [includePanEntryModes], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("include_pan_entry_modes") + @ExcludeMissing + fun _includePanEntryModes(): JsonField> = + includePanEntryModes + + /** + * Returns the raw JSON value of [excludeTags]. + * + * Unlike [excludeTags], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("exclude_tags") + @ExcludeMissing + fun _excludeTags(): JsonField = excludeTags + + /** + * Returns the raw JSON value of [includeTags]. + * + * Unlike [includeTags], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("include_tags") + @ExcludeMissing + fun _includeTags(): JsonField = includeTags + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [SpendVelocityFilters]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [SpendVelocityFilters]. */ + class Builder internal constructor() { + + private var excludeCountries: JsonField>? = null + private var excludeMccs: JsonField>? = null + private var includeCountries: JsonField>? = null + private var includeMccs: JsonField>? = null + private var includePanEntryModes: + JsonField>? = + null + private var excludeTags: JsonField = JsonMissing.of() + private var includeTags: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(spendVelocityFilters: SpendVelocityFilters) = apply { + excludeCountries = spendVelocityFilters.excludeCountries.map { it.toMutableList() } + excludeMccs = spendVelocityFilters.excludeMccs.map { it.toMutableList() } + includeCountries = spendVelocityFilters.includeCountries.map { it.toMutableList() } + includeMccs = spendVelocityFilters.includeMccs.map { it.toMutableList() } + includePanEntryModes = + spendVelocityFilters.includePanEntryModes.map { it.toMutableList() } + excludeTags = spendVelocityFilters.excludeTags + includeTags = spendVelocityFilters.includeTags + additionalProperties = spendVelocityFilters.additionalProperties.toMutableMap() + } + + /** + * ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. Transactions + * matching any of the provided will be excluded from the calculated velocity. + */ + fun excludeCountries(excludeCountries: List?) = + excludeCountries(JsonField.ofNullable(excludeCountries)) + + /** Alias for calling [Builder.excludeCountries] with `excludeCountries.orElse(null)`. */ + fun excludeCountries(excludeCountries: Optional>) = + excludeCountries(excludeCountries.getOrNull()) + + /** + * Sets [Builder.excludeCountries] to an arbitrary JSON value. + * + * You should usually call [Builder.excludeCountries] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun excludeCountries(excludeCountries: JsonField>) = apply { + this.excludeCountries = excludeCountries.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [excludeCountries]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addExcludeCountry(excludeCountry: String) = apply { + excludeCountries = + (excludeCountries ?: JsonField.of(mutableListOf())).also { + checkKnown("excludeCountries", it).add(excludeCountry) + } + } + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions matching + * this MCC will be excluded from the calculated velocity. + */ + fun excludeMccs(excludeMccs: List?) = excludeMccs(JsonField.ofNullable(excludeMccs)) + + /** Alias for calling [Builder.excludeMccs] with `excludeMccs.orElse(null)`. */ + fun excludeMccs(excludeMccs: Optional>) = excludeMccs(excludeMccs.getOrNull()) + + /** + * Sets [Builder.excludeMccs] to an arbitrary JSON value. + * + * You should usually call [Builder.excludeMccs] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun excludeMccs(excludeMccs: JsonField>) = apply { + this.excludeMccs = excludeMccs.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [excludeMccs]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addExcludeMcc(excludeMcc: String) = apply { + excludeMccs = + (excludeMccs ?: JsonField.of(mutableListOf())).also { + checkKnown("excludeMccs", it).add(excludeMcc) + } + } + + /** + * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transactions not + * matching any of the provided will not be included in the calculated velocity. + */ + fun includeCountries(includeCountries: List?) = + includeCountries(JsonField.ofNullable(includeCountries)) + + /** Alias for calling [Builder.includeCountries] with `includeCountries.orElse(null)`. */ + fun includeCountries(includeCountries: Optional>) = + includeCountries(includeCountries.getOrNull()) + + /** + * Sets [Builder.includeCountries] to an arbitrary JSON value. + * + * You should usually call [Builder.includeCountries] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun includeCountries(includeCountries: JsonField>) = apply { + this.includeCountries = includeCountries.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [includeCountries]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addIncludeCountry(includeCountry: String) = apply { + includeCountries = + (includeCountries ?: JsonField.of(mutableListOf())).also { + checkKnown("includeCountries", it).add(includeCountry) + } + } + + /** + * Merchant Category Codes to include in the velocity calculation. Transactions not matching + * this MCC will not be included in the calculated velocity. + */ + fun includeMccs(includeMccs: List?) = includeMccs(JsonField.ofNullable(includeMccs)) + + /** Alias for calling [Builder.includeMccs] with `includeMccs.orElse(null)`. */ + fun includeMccs(includeMccs: Optional>) = includeMccs(includeMccs.getOrNull()) + + /** + * Sets [Builder.includeMccs] to an arbitrary JSON value. + * + * You should usually call [Builder.includeMccs] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun includeMccs(includeMccs: JsonField>) = apply { + this.includeMccs = includeMccs.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [includeMccs]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addIncludeMcc(includeMcc: String) = apply { + includeMccs = + (includeMccs ?: JsonField.of(mutableListOf())).also { + checkKnown("includeMccs", it).add(includeMcc) + } + } + + /** + * PAN entry modes to include in the velocity calculation. Transactions not matching any of + * the provided will not be included in the calculated velocity. + */ + fun includePanEntryModes( + includePanEntryModes: List? + ) = includePanEntryModes(JsonField.ofNullable(includePanEntryModes)) + + /** + * Alias for calling [Builder.includePanEntryModes] with + * `includePanEntryModes.orElse(null)`. + */ + fun includePanEntryModes( + includePanEntryModes: Optional> + ) = includePanEntryModes(includePanEntryModes.getOrNull()) + + /** + * Sets [Builder.includePanEntryModes] to an arbitrary JSON value. + * + * You should usually call [Builder.includePanEntryModes] with a well-typed + * `List` value instead. This method is primarily + * for setting the field to an undocumented or not yet supported value. + */ + fun includePanEntryModes( + includePanEntryModes: JsonField> + ) = apply { this.includePanEntryModes = includePanEntryModes.map { it.toMutableList() } } + + /** + * Adds a single [VelocityLimitFilters.IncludePanEntryMode] to [includePanEntryModes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addIncludePanEntryMode(includePanEntryMode: VelocityLimitFilters.IncludePanEntryMode) = + apply { + includePanEntryModes = + (includePanEntryModes ?: JsonField.of(mutableListOf())).also { + checkKnown("includePanEntryModes", it).add(includePanEntryMode) + } + } + + /** + * Tag key-value pairs to exclude from the velocity calculation. Transactions matching all + * specified tag key-value pairs will be excluded from the calculated velocity. + */ + fun excludeTags(excludeTags: ExcludeTags?) = excludeTags(JsonField.ofNullable(excludeTags)) + + /** Alias for calling [Builder.excludeTags] with `excludeTags.orElse(null)`. */ + fun excludeTags(excludeTags: Optional) = excludeTags(excludeTags.getOrNull()) + + /** + * Sets [Builder.excludeTags] to an arbitrary JSON value. + * + * You should usually call [Builder.excludeTags] with a well-typed [ExcludeTags] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun excludeTags(excludeTags: JsonField) = apply { + this.excludeTags = excludeTags + } + + /** + * Tag key-value pairs to include in the velocity calculation. Only transactions matching + * all specified tag key-value pairs will be included in the calculated velocity. + */ + fun includeTags(includeTags: IncludeTags?) = includeTags(JsonField.ofNullable(includeTags)) + + /** Alias for calling [Builder.includeTags] with `includeTags.orElse(null)`. */ + fun includeTags(includeTags: Optional) = includeTags(includeTags.getOrNull()) + + /** + * Sets [Builder.includeTags] to an arbitrary JSON value. + * + * You should usually call [Builder.includeTags] with a well-typed [IncludeTags] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun includeTags(includeTags: JsonField) = apply { + this.includeTags = includeTags + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [SpendVelocityFilters]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): SpendVelocityFilters = + SpendVelocityFilters( + (excludeCountries ?: JsonMissing.of()).map { it.toImmutable() }, + (excludeMccs ?: JsonMissing.of()).map { it.toImmutable() }, + (includeCountries ?: JsonMissing.of()).map { it.toImmutable() }, + (includeMccs ?: JsonMissing.of()).map { it.toImmutable() }, + (includePanEntryModes ?: JsonMissing.of()).map { it.toImmutable() }, + excludeTags, + includeTags, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): SpendVelocityFilters = apply { + if (validated) { + return@apply + } + + excludeCountries() + excludeMccs() + includeCountries() + includeMccs() + includePanEntryModes().ifPresent { it.forEach { it.validate() } } + excludeTags().ifPresent { it.validate() } + includeTags().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (excludeCountries.asKnown().getOrNull()?.size ?: 0) + + (excludeMccs.asKnown().getOrNull()?.size ?: 0) + + (includeCountries.asKnown().getOrNull()?.size ?: 0) + + (includeMccs.asKnown().getOrNull()?.size ?: 0) + + (includePanEntryModes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (excludeTags.asKnown().getOrNull()?.validity() ?: 0) + + (includeTags.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Tag key-value pairs to exclude from the velocity calculation. Transactions matching all + * specified tag key-value pairs will be excluded from the calculated velocity. + */ + class ExcludeTags + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [ExcludeTags]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ExcludeTags]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(excludeTags: ExcludeTags) = apply { + additionalProperties = excludeTags.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ExcludeTags]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ExcludeTags = ExcludeTags(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): ExcludeTags = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ExcludeTags && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "ExcludeTags{additionalProperties=$additionalProperties}" + } + + /** + * Tag key-value pairs to include in the velocity calculation. Only transactions matching all + * specified tag key-value pairs will be included in the calculated velocity. + */ + class IncludeTags + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [IncludeTags]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [IncludeTags]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(includeTags: IncludeTags) = apply { + additionalProperties = includeTags.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [IncludeTags]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): IncludeTags = IncludeTags(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): IncludeTags = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is IncludeTags && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "IncludeTags{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is SpendVelocityFilters && + excludeCountries == other.excludeCountries && + excludeMccs == other.excludeMccs && + includeCountries == other.includeCountries && + includeMccs == other.includeMccs && + includePanEntryModes == other.includePanEntryModes && + excludeTags == other.excludeTags && + includeTags == other.includeTags && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + excludeCountries, + excludeMccs, + includeCountries, + includeMccs, + includePanEntryModes, + excludeTags, + includeTags, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "SpendVelocityFilters{excludeCountries=$excludeCountries, excludeMccs=$excludeMccs, includeCountries=$includeCountries, includeMccs=$includeMccs, includePanEntryModes=$includePanEntryModes, excludeTags=$excludeTags, includeTags=$includeTags, additionalProperties=$additionalProperties}" +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTransactionUpdateActionTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTransactionUpdateActionTest.kt new file mode 100644 index 000000000..0a2412cd3 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTransactionUpdateActionTest.kt @@ -0,0 +1,106 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.JsonValue +import com.lithic.api.core.jsonMapper +import com.lithic.api.errors.LithicInvalidDataException +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertThrows +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.EnumSource + +internal class CardTransactionUpdateActionTest { + + @Test + fun ofTag() { + val tag = + CardTransactionUpdateAction.TagAction.builder() + .key("key") + .type(CardTransactionUpdateAction.TagAction.Type.TAG) + .value("value") + .build() + + val cardTransactionUpdateAction = CardTransactionUpdateAction.ofTag(tag) + + assertThat(cardTransactionUpdateAction.tag()).contains(tag) + assertThat(cardTransactionUpdateAction.createCase()).isEmpty + } + + @Test + fun ofTagRoundtrip() { + val jsonMapper = jsonMapper() + val cardTransactionUpdateAction = + CardTransactionUpdateAction.ofTag( + CardTransactionUpdateAction.TagAction.builder() + .key("key") + .type(CardTransactionUpdateAction.TagAction.Type.TAG) + .value("value") + .build() + ) + + val roundtrippedCardTransactionUpdateAction = + jsonMapper.readValue( + jsonMapper.writeValueAsString(cardTransactionUpdateAction), + jacksonTypeRef(), + ) + + assertThat(roundtrippedCardTransactionUpdateAction).isEqualTo(cardTransactionUpdateAction) + } + + @Test + fun ofCreateCase() { + val createCase = + CardTransactionUpdateAction.CreateCaseAction.builder() + .queueToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .scope(CardTransactionUpdateAction.CreateCaseAction.Scope.CARD) + .type(CardTransactionUpdateAction.CreateCaseAction.Type.CREATE_CASE) + .build() + + val cardTransactionUpdateAction = CardTransactionUpdateAction.ofCreateCase(createCase) + + assertThat(cardTransactionUpdateAction.tag()).isEmpty + assertThat(cardTransactionUpdateAction.createCase()).contains(createCase) + } + + @Test + fun ofCreateCaseRoundtrip() { + val jsonMapper = jsonMapper() + val cardTransactionUpdateAction = + CardTransactionUpdateAction.ofCreateCase( + CardTransactionUpdateAction.CreateCaseAction.builder() + .queueToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .scope(CardTransactionUpdateAction.CreateCaseAction.Scope.CARD) + .type(CardTransactionUpdateAction.CreateCaseAction.Type.CREATE_CASE) + .build() + ) + + val roundtrippedCardTransactionUpdateAction = + jsonMapper.readValue( + jsonMapper.writeValueAsString(cardTransactionUpdateAction), + jacksonTypeRef(), + ) + + assertThat(roundtrippedCardTransactionUpdateAction).isEqualTo(cardTransactionUpdateAction) + } + + enum class IncompatibleJsonShapeTestCase(val value: JsonValue) { + BOOLEAN(JsonValue.from(false)), + STRING(JsonValue.from("invalid")), + INTEGER(JsonValue.from(-1)), + FLOAT(JsonValue.from(3.14)), + ARRAY(JsonValue.from(listOf("invalid", "array"))), + } + + @ParameterizedTest + @EnumSource + fun incompatibleJsonShapeDeserializesToUnknown(testCase: IncompatibleJsonShapeTestCase) { + val cardTransactionUpdateAction = + jsonMapper().convertValue(testCase.value, jacksonTypeRef()) + + val e = assertThrows { cardTransactionUpdateAction.validate() } + assertThat(e).hasMessageStartingWith("Unknown ") + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ConditionalCardTransactionUpdateActionParametersTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ConditionalCardTransactionUpdateActionParametersTest.kt new file mode 100644 index 000000000..4f27ca74b --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ConditionalCardTransactionUpdateActionParametersTest.kt @@ -0,0 +1,215 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.JsonValue +import com.lithic.api.core.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ConditionalCardTransactionUpdateActionParametersTest { + + @Test + fun create() { + val conditionalCardTransactionUpdateActionParameters = + ConditionalCardTransactionUpdateActionParameters.builder() + .action( + CardTransactionUpdateAction.TagAction.builder() + .key("key") + .type(CardTransactionUpdateAction.TagAction.Type.TAG) + .value("value") + .build() + ) + .addCondition( + ConditionalCardTransactionUpdateActionParameters.Condition.builder() + .attribute( + ConditionalCardTransactionUpdateActionParameters.Condition.Attribute.MCC + ) + .operation(ConditionalOperation.IS_ONE_OF) + .value("string") + .parameters( + ConditionalCardTransactionUpdateActionParameters.Condition.Parameters + .builder() + .filters( + SpendVelocityFilters.builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") + .addIncludeCountry("USD") + .addIncludeMcc("5542") + .addIncludePanEntryMode( + VelocityLimitFilters.IncludePanEntryMode.AUTO_ENTRY + ) + .excludeTags( + SpendVelocityFilters.ExcludeTags.builder() + .putAdditionalProperty( + "foo", + JsonValue.from("string"), + ) + .build() + ) + .includeTags( + SpendVelocityFilters.IncludeTags.builder() + .putAdditionalProperty( + "foo", + JsonValue.from("string"), + ) + .build() + ) + .build() + ) + .period( + VelocityLimitPeriod.TrailingWindowObject.builder() + .duration(10L) + .type(VelocityLimitPeriod.TrailingWindowObject.Type.CUSTOM) + .build() + ) + .scope( + ConditionalCardTransactionUpdateActionParameters.Condition + .Parameters + .Scope + .CARD + ) + .build() + ) + .build() + ) + .build() + + assertThat(conditionalCardTransactionUpdateActionParameters.action()) + .isEqualTo( + CardTransactionUpdateAction.ofTag( + CardTransactionUpdateAction.TagAction.builder() + .key("key") + .type(CardTransactionUpdateAction.TagAction.Type.TAG) + .value("value") + .build() + ) + ) + assertThat(conditionalCardTransactionUpdateActionParameters.conditions()) + .containsExactly( + ConditionalCardTransactionUpdateActionParameters.Condition.builder() + .attribute( + ConditionalCardTransactionUpdateActionParameters.Condition.Attribute.MCC + ) + .operation(ConditionalOperation.IS_ONE_OF) + .value("string") + .parameters( + ConditionalCardTransactionUpdateActionParameters.Condition.Parameters + .builder() + .filters( + SpendVelocityFilters.builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") + .addIncludeCountry("USD") + .addIncludeMcc("5542") + .addIncludePanEntryMode( + VelocityLimitFilters.IncludePanEntryMode.AUTO_ENTRY + ) + .excludeTags( + SpendVelocityFilters.ExcludeTags.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .includeTags( + SpendVelocityFilters.IncludeTags.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + ) + .period( + VelocityLimitPeriod.TrailingWindowObject.builder() + .duration(10L) + .type(VelocityLimitPeriod.TrailingWindowObject.Type.CUSTOM) + .build() + ) + .scope( + ConditionalCardTransactionUpdateActionParameters.Condition + .Parameters + .Scope + .CARD + ) + .build() + ) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val conditionalCardTransactionUpdateActionParameters = + ConditionalCardTransactionUpdateActionParameters.builder() + .action( + CardTransactionUpdateAction.TagAction.builder() + .key("key") + .type(CardTransactionUpdateAction.TagAction.Type.TAG) + .value("value") + .build() + ) + .addCondition( + ConditionalCardTransactionUpdateActionParameters.Condition.builder() + .attribute( + ConditionalCardTransactionUpdateActionParameters.Condition.Attribute.MCC + ) + .operation(ConditionalOperation.IS_ONE_OF) + .value("string") + .parameters( + ConditionalCardTransactionUpdateActionParameters.Condition.Parameters + .builder() + .filters( + SpendVelocityFilters.builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") + .addIncludeCountry("USD") + .addIncludeMcc("5542") + .addIncludePanEntryMode( + VelocityLimitFilters.IncludePanEntryMode.AUTO_ENTRY + ) + .excludeTags( + SpendVelocityFilters.ExcludeTags.builder() + .putAdditionalProperty( + "foo", + JsonValue.from("string"), + ) + .build() + ) + .includeTags( + SpendVelocityFilters.IncludeTags.builder() + .putAdditionalProperty( + "foo", + JsonValue.from("string"), + ) + .build() + ) + .build() + ) + .period( + VelocityLimitPeriod.TrailingWindowObject.builder() + .duration(10L) + .type(VelocityLimitPeriod.TrailingWindowObject.Type.CUSTOM) + .build() + ) + .scope( + ConditionalCardTransactionUpdateActionParameters.Condition + .Parameters + .Scope + .CARD + ) + .build() + ) + .build() + ) + .build() + + val roundtrippedConditionalCardTransactionUpdateActionParameters = + jsonMapper.readValue( + jsonMapper.writeValueAsString(conditionalCardTransactionUpdateActionParameters), + jacksonTypeRef(), + ) + + assertThat(roundtrippedConditionalCardTransactionUpdateActionParameters) + .isEqualTo(conditionalCardTransactionUpdateActionParameters) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/SpendVelocityFiltersTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/SpendVelocityFiltersTest.kt new file mode 100644 index 000000000..2fc5a0382 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/SpendVelocityFiltersTest.kt @@ -0,0 +1,85 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.JsonValue +import com.lithic.api.core.jsonMapper +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class SpendVelocityFiltersTest { + + @Test + fun create() { + val spendVelocityFilters = + SpendVelocityFilters.builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") + .addIncludeCountry("USD") + .addIncludeMcc("5542") + .addIncludePanEntryMode(VelocityLimitFilters.IncludePanEntryMode.AUTO_ENTRY) + .excludeTags( + SpendVelocityFilters.ExcludeTags.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .includeTags( + SpendVelocityFilters.IncludeTags.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + + assertThat(spendVelocityFilters.excludeCountries().getOrNull()).containsExactly("USD") + assertThat(spendVelocityFilters.excludeMccs().getOrNull()).containsExactly("5542") + assertThat(spendVelocityFilters.includeCountries().getOrNull()).containsExactly("USD") + assertThat(spendVelocityFilters.includeMccs().getOrNull()).containsExactly("5542") + assertThat(spendVelocityFilters.includePanEntryModes().getOrNull()) + .containsExactly(VelocityLimitFilters.IncludePanEntryMode.AUTO_ENTRY) + assertThat(spendVelocityFilters.excludeTags()) + .contains( + SpendVelocityFilters.ExcludeTags.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + assertThat(spendVelocityFilters.includeTags()) + .contains( + SpendVelocityFilters.IncludeTags.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val spendVelocityFilters = + SpendVelocityFilters.builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") + .addIncludeCountry("USD") + .addIncludeMcc("5542") + .addIncludePanEntryMode(VelocityLimitFilters.IncludePanEntryMode.AUTO_ENTRY) + .excludeTags( + SpendVelocityFilters.ExcludeTags.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .includeTags( + SpendVelocityFilters.IncludeTags.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + + val roundtrippedSpendVelocityFilters = + jsonMapper.readValue( + jsonMapper.writeValueAsString(spendVelocityFilters), + jacksonTypeRef(), + ) + + assertThat(roundtrippedSpendVelocityFilters).isEqualTo(spendVelocityFilters) + } +} From bb282c75d62080e57456309b7b0c510dab94f5ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 21:02:02 +0000 Subject: [PATCH 17/18] feat(client): improve logging Logging is now: 1. Streaming 4. Configurable in-memory 5. Generally more robust 6. Usable with any underlying http client --- README.md | 15 +- lithic-java-client-okhttp/build.gradle.kts | 1 - .../api/client/okhttp/LithicOkHttpClient.kt | 10 + .../client/okhttp/LithicOkHttpClientAsync.kt | 10 + .../lithic/api/client/okhttp/OkHttpClient.kt | 13 - .../com/lithic/api/core/ClientOptions.kt | 30 +- .../kotlin/com/lithic/api/core/LogLevel.kt | 33 + .../main/kotlin/com/lithic/api/core/Utils.kt | 6 + .../lithic/api/core/http/LoggingHttpClient.kt | 627 +++++++++++ .../api/core/http/LoggingHttpClientTest.kt | 999 ++++++++++++++++++ 10 files changed, 1727 insertions(+), 17 deletions(-) create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/core/LogLevel.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/core/http/LoggingHttpClient.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/core/http/LoggingHttpClientTest.kt diff --git a/README.md b/README.md index 80f40ba29..5ef2fd451 100644 --- a/README.md +++ b/README.md @@ -349,8 +349,6 @@ while (true) { ## Logging -The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor). - Enable logging by setting the `LITHIC_LOG` environment variable to `info`: ```sh @@ -363,6 +361,19 @@ Or to `debug` for more verbose logging: export LITHIC_LOG=debug ``` +Or configure the client manually using the `logLevel` method: + +```java +import com.lithic.api.client.LithicClient; +import com.lithic.api.client.okhttp.LithicOkHttpClient; +import com.lithic.api.core.LogLevel; + +LithicClient client = LithicOkHttpClient.builder() + .fromEnv() + .logLevel(LogLevel.INFO) + .build(); +``` + ## Webhooks Lithic uses webhooks to notify your application when events happen. The SDK provides methods for verifying webhook signatures and parsing event payloads. diff --git a/lithic-java-client-okhttp/build.gradle.kts b/lithic-java-client-okhttp/build.gradle.kts index 1227e2871..0a36f8b40 100644 --- a/lithic-java-client-okhttp/build.gradle.kts +++ b/lithic-java-client-okhttp/build.gradle.kts @@ -7,7 +7,6 @@ dependencies { api(project(":lithic-java-core")) implementation("com.squareup.okhttp3:okhttp:4.12.0") - implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") testImplementation(kotlin("test")) testImplementation("org.assertj:assertj-core:3.27.7") diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt index 39b27e2fd..4edcc3221 100644 --- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt +++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper import com.lithic.api.client.LithicClient import com.lithic.api.client.LithicClientImpl import com.lithic.api.core.ClientOptions +import com.lithic.api.core.LogLevel import com.lithic.api.core.Sleeper import com.lithic.api.core.Timeout import com.lithic.api.core.http.AsyncStreamResponse @@ -296,6 +297,15 @@ class LithicOkHttpClient private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } + /** + * The level at which to log request and response information. + * + * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv]. + * + * Defaults to [LogLevel.fromEnv]. + */ + fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) } + fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } fun webhookSecret(webhookSecret: String?) = apply { diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt index 026e630e2..d4b432cc6 100644 --- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt +++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper import com.lithic.api.client.LithicClientAsync import com.lithic.api.client.LithicClientAsyncImpl import com.lithic.api.core.ClientOptions +import com.lithic.api.core.LogLevel import com.lithic.api.core.Sleeper import com.lithic.api.core.Timeout import com.lithic.api.core.http.AsyncStreamResponse @@ -296,6 +297,15 @@ class LithicOkHttpClientAsync private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } + /** + * The level at which to log request and response information. + * + * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv]. + * + * Defaults to [LogLevel.fromEnv]. + */ + fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) } + fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } fun webhookSecret(webhookSecret: String?) = apply { diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt index e8f4cd8d1..71a2e2c98 100644 --- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt +++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt @@ -35,7 +35,6 @@ import okhttp3.Request import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.Response -import okhttp3.logging.HttpLoggingInterceptor import okio.BufferedSink import okio.buffer import okio.sink @@ -93,18 +92,6 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie private fun newCall(request: HttpRequest, requestOptions: RequestOptions): Call { val clientBuilder = okHttpClient.newBuilder() - val logLevel = - when (System.getenv("LITHIC_LOG")?.lowercase()) { - "info" -> HttpLoggingInterceptor.Level.BASIC - "debug" -> HttpLoggingInterceptor.Level.BODY - else -> null - } - if (logLevel != null) { - clientBuilder.addNetworkInterceptor( - HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") } - ) - } - requestOptions.timeout?.let { clientBuilder .connectTimeout(it.connect()) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt index 4a5bdd8c2..6e72f6e01 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper import com.lithic.api.core.http.AsyncStreamResponse import com.lithic.api.core.http.Headers import com.lithic.api.core.http.HttpClient +import com.lithic.api.core.http.LoggingHttpClient import com.lithic.api.core.http.PhantomReachableClosingHttpClient import com.lithic.api.core.http.QueryParams import com.lithic.api.core.http.RetryingHttpClient @@ -110,6 +111,14 @@ private constructor( * Defaults to 2. */ @get:JvmName("maxRetries") val maxRetries: Int, + /** + * The level at which to log request and response information. + * + * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv]. + * + * Defaults to [LogLevel.fromEnv]. + */ + @get:JvmName("logLevel") val logLevel: LogLevel, @get:JvmName("apiKey") val apiKey: String, private val webhookSecret: String?, ) { @@ -174,6 +183,7 @@ private constructor( private var responseValidation: Boolean = false private var timeout: Timeout = Timeout.default() private var maxRetries: Int = 2 + private var logLevel: LogLevel = LogLevel.fromEnv() private var apiKey: String? = null private var webhookSecret: String? = null @@ -191,6 +201,7 @@ private constructor( responseValidation = clientOptions.responseValidation timeout = clientOptions.timeout maxRetries = clientOptions.maxRetries + logLevel = clientOptions.logLevel apiKey = clientOptions.apiKey webhookSecret = clientOptions.webhookSecret } @@ -322,6 +333,15 @@ private constructor( */ fun maxRetries(maxRetries: Int) = apply { this.maxRetries = maxRetries } + /** + * The level at which to log request and response information. + * + * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv]. + * + * Defaults to [LogLevel.fromEnv]. + */ + fun logLevel(logLevel: LogLevel) = apply { this.logLevel = logLevel } + fun apiKey(apiKey: String) = apply { this.apiKey = apiKey } fun webhookSecret(webhookSecret: String?) = apply { this.webhookSecret = webhookSecret } @@ -426,6 +446,7 @@ private constructor( * System properties take precedence over environment variables. */ fun fromEnv() = apply { + logLevel(LogLevel.fromEnv()) (System.getProperty("lithic.baseUrl") ?: System.getenv("LITHIC_BASE_URL"))?.let { baseUrl(it) } @@ -502,7 +523,13 @@ private constructor( return ClientOptions( httpClient, RetryingHttpClient.builder() - .httpClient(httpClient) + .httpClient( + LoggingHttpClient.builder() + .httpClient(httpClient) + .clock(clock) + .level(logLevel) + .build() + ) .sleeper(sleeper) .clock(clock) .maxRetries(maxRetries) @@ -518,6 +545,7 @@ private constructor( responseValidation, timeout, maxRetries, + logLevel, apiKey, webhookSecret, ) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/LogLevel.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/LogLevel.kt new file mode 100644 index 000000000..b35f44038 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/LogLevel.kt @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.core + +/** The level at which to log request and response information. */ +enum class LogLevel { + /** No logging. */ + OFF, + /** Minimal request and response summary logs. No headers or bodies are logged. */ + INFO, + /** [INFO] logs plus details about request failures. */ + ERROR, + /** + * Full request and response logs. Sensitive headers are redacted, but sensitive data in request + * and response bodies may still be visible. + */ + DEBUG; + + /** Returns whether this level is at or higher than the given [level]. */ + fun shouldLog(level: LogLevel): Boolean = ordinal >= level.ordinal + + companion object { + + /** Returns a [LogLevel] based on the `LITHIC_LOG` environment variable. */ + fun fromEnv() = + when (System.getenv("LITHIC_LOG")?.lowercase()) { + "info" -> INFO + "error" -> ERROR + "debug" -> DEBUG + else -> OFF + } + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/Utils.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/Utils.kt index 5109aaf69..ef291e9d3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/Utils.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/Utils.kt @@ -6,6 +6,7 @@ import com.lithic.api.core.http.Headers import com.lithic.api.errors.LithicInvalidDataException import java.util.Collections import java.util.SortedMap +import java.util.SortedSet import java.util.concurrent.CompletableFuture import java.util.concurrent.locks.Lock @@ -17,6 +18,11 @@ internal fun T?.getOrThrow(name: String): T = internal fun List.toImmutable(): List = if (isEmpty()) Collections.emptyList() else Collections.unmodifiableList(toList()) +@JvmSynthetic +internal fun > SortedSet.toImmutable(): SortedSet = + if (isEmpty()) Collections.emptySortedSet() + else Collections.unmodifiableSortedSet(toSortedSet(comparator() ?: Comparator.naturalOrder())) + @JvmSynthetic internal fun Map.toImmutable(): Map = if (isEmpty()) immutableEmptyMap() else Collections.unmodifiableMap(toMap()) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/LoggingHttpClient.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/LoggingHttpClient.kt new file mode 100644 index 000000000..43cf6062e --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/LoggingHttpClient.kt @@ -0,0 +1,627 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.core.http + +import com.lithic.api.core.LogLevel +import com.lithic.api.core.RequestOptions +import com.lithic.api.core.checkRequired +import com.lithic.api.core.toImmutable +import java.io.ByteArrayOutputStream +import java.io.InputStream +import java.io.OutputStream +import java.nio.ByteBuffer +import java.nio.charset.CharacterCodingException +import java.nio.charset.Charset +import java.nio.charset.CharsetDecoder +import java.nio.charset.CodingErrorAction +import java.nio.charset.StandardCharsets +import java.time.Clock +import java.time.Duration +import java.time.OffsetDateTime +import java.util.SortedSet +import java.util.concurrent.CompletableFuture +import java.util.concurrent.CompletionException +import kotlin.time.toKotlinDuration + +/** A wrapper [HttpClient] around [httpClient] that logs request and response information. */ +class LoggingHttpClient +private constructor( + /** The underlying [HttpClient] for making requests. */ + @get:JvmName("httpClient") val httpClient: HttpClient, + /** + * Sensitive headers to redact from logs. + * + * Defaults to `Set.of("Authorization")`. + */ + @get:JvmName("redactedHeaders") val redactedHeaders: SortedSet, + /** + * The clock to use for measuring request and response durations. + * + * This is primarily useful for using a fake clock in tests. + * + * Defaults to [Clock.systemUTC]. + */ + @get:JvmName("clock") val clock: Clock, + /** + * The log level to use. + * + * Pass [LogLevel.fromEnv] to read from environment variables. + */ + @get:JvmName("level") val level: LogLevel, +) : HttpClient { + + override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse { + val loggingRequest = logRequest(request) + + val before = OffsetDateTime.now(clock) + val response = + try { + httpClient.execute(loggingRequest, requestOptions) + } catch (e: Throwable) { + logFailure(e, Duration.between(before, OffsetDateTime.now(clock))) + throw e + } + + val took = Duration.between(before, OffsetDateTime.now(clock)) + return logResponse(response, took) + } + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture { + val loggingRequest = logRequest(request) + + val before = OffsetDateTime.now(clock) + val future = + try { + httpClient.executeAsync(loggingRequest, requestOptions) + } catch (e: Throwable) { + logFailure(e, Duration.between(before, OffsetDateTime.now(clock))) + throw e + } + return future.handle { response, error -> + val took = Duration.between(before, OffsetDateTime.now(clock)) + if (error != null) { + logFailure(unwrapCompletionException(error), took) + throw error + } + logResponse(response, took) + } + } + + private fun logRequest(request: HttpRequest): HttpRequest { + if (!level.shouldLog(LogLevel.INFO)) { + return request + } + + System.err.println( + buildString { + append("--> ${request.method} ${request.url()}") + request.body?.let { + val length = it.contentLength() + append(if (length >= 0) " ($length-byte body)" else " (unknown-length body)") + } + } + ) + + if (!level.shouldLog(LogLevel.DEBUG)) { + return request + } + + logHeaders(request.headers) + + if (request.body == null) { + System.err.println("--> END ${request.method}") + System.err.println() + return request + } + + return request + .toBuilder() + .body(LoggingHttpRequestBody(request.method, request.body)) + .build() + } + + private fun logResponse(response: HttpResponse, took: Duration): HttpResponse { + if (!level.shouldLog(LogLevel.INFO)) { + return response + } + + val contentLength = response.headers().values("Content-Length").firstOrNull()?.toIntOrNull() + System.err.println( + "<-- ${response.statusCode()} (${ + buildString { + append(took.format()) + contentLength?.let { append(", $contentLength-byte body") } + } + })" + ) + + if (!level.shouldLog(LogLevel.DEBUG)) { + return response + } + + logHeaders(response.headers()) + return LoggingHttpResponse(response) + } + + private fun logFailure(error: Throwable, took: Duration) { + if (!level.shouldLog(LogLevel.ERROR)) { + return + } + + System.err.println( + buildString { + append("<-- !! ${error.javaClass.simpleName}") + error.message?.let { append(": $it") } + append(" (${took.format()})") + } + ) + } + + private fun unwrapCompletionException(error: Throwable): Throwable = + if (error is CompletionException && error.cause != null) error.cause!! else error + + private fun logHeaders(headers: Headers) = + headers.names().forEach { name -> + headers.values(name).forEach { value -> + System.err.println("$name: ${if (redactedHeaders.contains(name)) "██" else value}") + } + } + + override fun close() = httpClient.close() + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LoggingHttpClient]. + * + * The following fields are required: + * ```java + * .httpClient() + * .level() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LoggingHttpClient]. */ + class Builder internal constructor() { + + private var httpClient: HttpClient? = null + private var redactedHeaders: Set = setOf("Authorization") + private var clock: Clock = Clock.systemUTC() + private var level: LogLevel? = null + + @JvmSynthetic + internal fun from(loggingHttpClient: LoggingHttpClient) = apply { + httpClient = loggingHttpClient.httpClient + redactedHeaders = loggingHttpClient.redactedHeaders + clock = loggingHttpClient.clock + level = loggingHttpClient.level + } + + /** The underlying [HttpClient] for making requests. */ + fun httpClient(httpClient: HttpClient) = apply { this.httpClient = httpClient } + + /** + * Sensitive headers to redact from logs. + * + * Defaults to `Set.of("Authorization")`. + */ + fun redactedHeaders(redactedHeaders: Set) = apply { + this.redactedHeaders = redactedHeaders + } + + /** + * The clock to use for measuring request and response durations. + * + * This is primarily useful for using a fake clock in tests. + * + * Defaults to [Clock.systemUTC]. + */ + fun clock(clock: Clock) = apply { this.clock = clock } + + /** + * The log level to use. + * + * Pass [LogLevel.fromEnv] to read from environment variables. + */ + fun level(level: LogLevel) = apply { this.level = level } + + /** + * Returns an immutable instance of [LoggingHttpClient]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .httpClient() + * .level() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LoggingHttpClient = + LoggingHttpClient( + checkRequired("httpClient", httpClient), + redactedHeaders.toSortedSet(String.CASE_INSENSITIVE_ORDER).toImmutable(), + clock, + checkRequired("level", level), + ) + } +} + +/** + * An [HttpRequestBody] wrapper that delegates to [body] while also logging line by line as it's + * written. + * + * The logging occurs in a streaming manner with minimal buffering. + */ +private class LoggingHttpRequestBody( + private val method: HttpMethod, + private val body: HttpRequestBody, +) : HttpRequestBody { + + private val charset by lazy { parseCharset(body.contentType()) } + + override fun writeTo(outputStream: OutputStream) { + val loggingOutputStream = LoggingOutputStream(outputStream, charset) + body.writeTo(loggingOutputStream) + + loggingOutputStream.flush() + System.err.println("--> END $method (${loggingOutputStream.writeCount()}-byte body)") + System.err.println() + } + + override fun contentType(): String? = body.contentType() + + override fun contentLength(): Long = body.contentLength() + + override fun repeatable(): Boolean = body.repeatable() + + override fun close() = body.close() +} + +/** + * An [OutputStream] wrapper that delegates to [outputStream] while also logging bytes line by line + * as it's written to. + * + * The written content is assumed to be in the given [charset] and the logging occurs in a streaming + * manner with minimal buffering. + */ +private class LoggingOutputStream(private val outputStream: OutputStream, charset: Charset?) : + OutputStream() { + + private val buffer = LoggingBuffer(charset) + + fun writeCount() = buffer.writeCount() + + override fun write(b: Int) { + outputStream.write(b) + buffer.write(b) + } + + override fun write(b: ByteArray, off: Int, len: Int) { + outputStream.write(b, off, len) + for (i in off until off + len) { + buffer.write(b[i].toInt() and 0xFF) + } + } + + /** Prints any currently buffered content. */ + override fun flush() { + buffer.flush() + outputStream.flush() + } + + override fun close() = outputStream.close() +} + +/** + * An [HttpResponse] wrapper that delegates to [response] while also logging line-by-line as it's + * read. + * + * The logging occurs in a streaming manner with minimal buffering. + */ +private class LoggingHttpResponse(private val response: HttpResponse) : HttpResponse { + + private val loggingBody: Lazy = lazy { + LoggingInputStream( + response.body(), + parseCharset(response.headers().values("Content-Type").firstOrNull()), + ) + } + + override fun statusCode(): Int = response.statusCode() + + override fun headers(): Headers = response.headers() + + override fun body(): InputStream = loggingBody.value + + override fun close() { + if (loggingBody.isInitialized()) { + loggingBody.value.close() + } + response.close() + } +} + +/** + * An [InputStream] wrapper that delegates to [inputStream] while also logging bytes line by line as + * it's read. + * + * The contents of [inputStream] are assumed to be in the given [charset] and the logging occurs in + * a streaming manner with minimal buffering. + */ +private class LoggingInputStream(private val inputStream: InputStream, charset: Charset?) : + InputStream() { + + private var isDone = false + private val buffer = LoggingBuffer(charset) + + override fun read(): Int { + if (isDone) { + return -1 + } + + val b = inputStream.read() + + if (b == -1) { + markDone() + return b + } + + buffer.write(b) + return b + } + + override fun read(b: ByteArray, off: Int, len: Int): Int { + if (isDone) { + return -1 + } + + val bytesRead = inputStream.read(b, off, len) + + if (bytesRead == -1) { + markDone() + return bytesRead + } + + for (i in off until off + bytesRead) { + buffer.write(b[i].toInt() and 0xFF) + } + return bytesRead + } + + override fun close() { + if (!isDone) { + markDone(closedEarly = true) + } + inputStream.close() + } + + private fun markDone(closedEarly: Boolean = false) { + isDone = true + buffer.flush() + val suffix = if (closedEarly) ", closed early" else "" + System.err.println("<-- END HTTP (${buffer.writeCount()}-byte body$suffix)") + System.err.println() + } +} + +/** + * A byte buffer that prints line by line, using the given [charset], as bytes are written to it. + * + * When [charset] is `null`, the buffer performs an upfront check to detect binary content. If + * non-whitespace ISO control characters are found in the first [PROBABLY_UTF8_CODE_POINT_LIMIT] + * code points, body logging is suppressed entirely. + */ +private class LoggingBuffer(charset: Charset?) { + + private val charset = charset ?: StandardCharsets.UTF_8 + + private val decoder: CharsetDecoder = + this.charset + .newDecoder() + .onMalformedInput(CodingErrorAction.REPORT) + .onUnmappableCharacter(CodingErrorAction.REPORT) + private var writeCount = 0 + private val buffer = ByteArrayOutputStream(128) + + /** + * Whether logging has been suppressed because the content doesn't appear to be readable text. + * + * This is only set when [charset] is `null` and the content fails the [isProbablyUtf8] check. + */ + private var suppressed = false + + /** + * Bytes accumulated for the [isProbablyUtf8] check before any lines are printed. + * + * Once the check passes (or [charset] is non-null), this is set to `null` and bytes flow + * directly to [buffer]. + */ + private var prefetchBuffer: ByteArrayOutputStream? = + if (charset != null) null else ByteArrayOutputStream(128) + + fun writeCount() = writeCount + + fun write(b: Int) { + if (writeCount == 0) { + // Print a newline before we start printing anything to separate the printed content + // from previous content. + System.err.println() + } + + writeCount++ + + if (suppressed) { + return + } + + val prefetch = prefetchBuffer + if (prefetch != null) { + prefetch.write(b) + // Continue accumulating until we have enough bytes to decide. + if (prefetch.size() < PROBABLY_UTF8_BYTE_LIMIT && b != '\n'.code) { + return + } + // We have enough bytes. Check if the content is probably UTF-8. + prefetchBuffer = null + val bytes = prefetch.toByteArray() + if (!isProbablyUtf8(bytes)) { + suppressed = true + System.err.println("(binary body omitted)") + return + } + // Content looks like UTF-8. Feed the accumulated bytes into the normal buffer. + for (byte in bytes) { + writeToBuffer(byte.toInt() and 0xFF) + } + return + } + + writeToBuffer(b) + } + + private fun writeToBuffer(b: Int) { + if (b == '\n'.code) { + flush() + return + } + + buffer.write(b) + } + + /** Prints any currently buffered content. */ + fun flush() { + if (suppressed) { + return + } + + // If we still have a prefetch buffer when flush is called (body was shorter than the + // limit), run the check now. + val prefetch = prefetchBuffer + if (prefetch != null) { + prefetchBuffer = null + val bytes = prefetch.toByteArray() + if (bytes.isEmpty()) { + return + } + if (!isProbablyUtf8(bytes)) { + suppressed = true + System.err.println("(binary body omitted)") + return + } + for (byte in bytes) { + writeToBuffer(byte.toInt() and 0xFF) + } + } + + if (buffer.size() == 0) { + return + } + + val line = + try { + decoder.decode(ByteBuffer.wrap(buffer.toByteArray())) + } catch (e: CharacterCodingException) { + "(omitted line is not valid $charset)" + } + buffer.reset() + System.err.println(line) + } +} + +/** The maximum number of code points to sample when checking if content is probably UTF-8. */ +private const val PROBABLY_UTF8_CODE_POINT_LIMIT = 64 + +/** + * The maximum number of bytes to accumulate before running the [isProbablyUtf8] check. UTF-8 code + * points are at most 4 bytes, so this accommodates [PROBABLY_UTF8_CODE_POINT_LIMIT] code points. + */ +private const val PROBABLY_UTF8_BYTE_LIMIT = PROBABLY_UTF8_CODE_POINT_LIMIT * 4 + +/** + * Returns `true` if the given [bytes] probably contain human-readable UTF-8 text. + * + * Decodes up to [PROBABLY_UTF8_CODE_POINT_LIMIT] code points and returns `false` if any + * non-whitespace ISO control characters are found, or if the bytes are not valid UTF-8. + */ +private fun isProbablyUtf8(bytes: ByteArray): Boolean { + try { + val decoder = + StandardCharsets.UTF_8.newDecoder() + .onMalformedInput(CodingErrorAction.REPORT) + .onUnmappableCharacter(CodingErrorAction.REPORT) + val charBuffer = decoder.decode(ByteBuffer.wrap(bytes)) + var codePointCount = 0 + var i = 0 + while (i < charBuffer.length && codePointCount < PROBABLY_UTF8_CODE_POINT_LIMIT) { + val codePoint = Character.codePointAt(charBuffer, i) + if (Character.isISOControl(codePoint) && !Character.isWhitespace(codePoint)) { + return false + } + i += Character.charCount(codePoint) + codePointCount++ + } + return true + } catch (e: CharacterCodingException) { + return false + } +} + +/** Returns the [Charset] in the given [contentType] string, or `null` if unspecified. */ +private fun parseCharset(contentType: String?): Charset? = + contentType + ?.split(";") + ?.drop(1) + ?.map { it.trim() } + ?.firstOrNull { it.startsWith("charset=", ignoreCase = true) } + ?.substringAfter("=") + ?.trim() + ?.removeSurrounding("\"") + ?.let { runCatching { charset(it) }.getOrNull() } + +/** Formats the [Duration] into a string like "1m 40s 467ms". */ +private fun Duration.format(): String = + toKotlinDuration().toComponents { days, hours, minutes, seconds, nanoseconds -> + buildString { + val milliseconds = nanoseconds / 1_000_000 + if (days > 0) { + append("${days}d") + } + if (hours > 0) { + if (isNotEmpty()) { + append(" ") + } + append("${hours}h") + } + if (minutes > 0) { + if (isNotEmpty()) { + append(" ") + } + append("${minutes}m") + } + if (seconds > 0) { + if (isNotEmpty()) { + append(" ") + } + append("${seconds}s") + } + if (milliseconds > 0) { + if (isNotEmpty()) { + append(" ") + } + append("${milliseconds}ms") + } + + if (isEmpty()) { + append("0s") + } + } + } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/core/http/LoggingHttpClientTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/core/http/LoggingHttpClientTest.kt new file mode 100644 index 000000000..bb24d42f2 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/core/http/LoggingHttpClientTest.kt @@ -0,0 +1,999 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.core.http + +import com.lithic.api.core.LogLevel +import com.lithic.api.core.RequestOptions +import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream +import java.io.IOException +import java.io.InputStream +import java.io.OutputStream +import java.io.PrintStream +import java.nio.charset.StandardCharsets +import java.time.Clock +import java.time.Instant +import java.time.ZoneOffset +import java.util.concurrent.CompletableFuture +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.assertThatThrownBy +import org.junit.jupiter.api.AfterEach +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.parallel.ResourceLock +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.ValueSource + +@ResourceLock("stderr") +internal class LoggingHttpClientTest { + + private lateinit var originalErr: PrintStream + private lateinit var errContent: ByteArrayOutputStream + + @BeforeEach + fun beforeEach() { + originalErr = System.err + errContent = ByteArrayOutputStream() + System.setErr(PrintStream(errContent)) + } + + @AfterEach + fun afterEach() { + System.setErr(originalErr) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun offLevel_noOutput(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.OFF) + + val response = client.execute(simpleGetRequest(), async).apply { body().readBytes() } + + assertThat(response.statusCode()).isEqualTo(200) + assertThat(stderrOutput()).isEmpty() + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsGetRequest(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.INFO) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 200 (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsPostRequestWithBodySize(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.INFO) + + client.execute(postRequestWithBody("""{"key":"value"}"""), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> POST https://api.example.com/v1/resources (15-byte body) + |<-- 200 (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsRequestWithUnknownLengthBody(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.INFO) + + client + .execute(postRequestWithBody("""{"key":"value"}""", contentLength = -1L), async) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> POST https://api.example.com/v1/resources (unknown-length body) + |<-- 200 (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsResponseStatusAndDuration(async: Boolean) { + val clock = + clockFrom( + Instant.parse("1998-04-21T00:00:00Z"), + Instant.parse("1998-04-21T00:00:01.234Z"), + ) + val client = loggingClient(fakeHttpClient(statusCode = 201), LogLevel.INFO, clock) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 201 (1s 234ms) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsResponseContentLength(async: Boolean) { + val headers = + Headers.builder().put("Content-Length", "42").put("Content-Type", "text/plain").build() + val client = loggingClient(fakeHttpClient(responseHeaders = headers), LogLevel.INFO) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 200 (0s, 42-byte body) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_doesNotLogHeaders(async: Boolean) { + val headers = Headers.builder().put("X-Custom", "visible").build() + val client = loggingClient(fakeHttpClient(responseHeaders = headers), LogLevel.INFO) + + client + .execute( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("v1") + .putHeader("X-Request-Custom", "req-value") + .build(), + async, + ) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1 + |<-- 200 (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsGetWithEndMarker(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.DEBUG) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsRequestAndResponseHeaders(async: Boolean) { + val responseHeaders = + Headers.builder() + .put("X-Response-Id", "abc-123") + .put("Content-Type", "text/plain") + .build() + val client = + loggingClient(fakeHttpClient(responseHeaders = responseHeaders), LogLevel.DEBUG) + + client + .execute( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("test") + .putHeader("X-Custom", "my-value") + .build(), + async, + ) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/test + |X-Custom: my-value + |--> END GET + | + |<-- 200 (0s) + |Content-Type: text/plain + |X-Response-Id: abc-123 + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_redactsSensitiveHeaders(async: Boolean) { + val client = + loggingClient( + fakeHttpClient(), + LogLevel.DEBUG, + redactedHeaders = setOf("Authorization", "X-Secret"), + ) + + client + .execute( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("test") + .putHeader("Authorization", "Bearer token-123") + .putHeader("X-Secret", "secret-value") + .putHeader("X-Public", "public-value") + .build(), + async, + ) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/test + |Authorization: ██ + |X-Public: public-value + |X-Secret: ██ + |--> END GET + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_redactsHeadersCaseInsensitively(async: Boolean) { + val client = + loggingClient( + fakeHttpClient(), + LogLevel.DEBUG, + redactedHeaders = setOf("Authorization"), + ) + + client + .execute( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("test") + .putHeader("authorization", "Bearer secret") + .build(), + async, + ) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/test + |authorization: ██ + |--> END GET + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsRequestBody(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.DEBUG) + val body = """{"name":"test","value":42}""" + + client.execute(postRequestWithBody(body), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> POST https://api.example.com/v1/resources (26-byte body) + | + |{"name":"test","value":42} + |--> END POST (26-byte body) + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsResponseBody(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + val response = client.execute(simpleGetRequest(), async) + val body = response.body().readBytes().toString(StandardCharsets.UTF_8) + + assertThat(body).isEqualTo(responseBody) + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + | + |{"id":1,"status":"ok"} + |<-- END HTTP (22-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsBinaryResponseBodyAsOmitted(async: Boolean) { + val binaryBody = ByteArray(256) { it.toByte() } + val client = loggingClient(fakeHttpClient(responseBody = binaryBody), LogLevel.DEBUG) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + | + |(binary body omitted) + |<-- END HTTP (256-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsMultilineResponseBody(async: Boolean) { + val multilineBody = "line1\nline2\nline3" + val headers = Headers.builder().put("Content-Type", "text/plain; charset=utf-8").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = multilineBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: text/plain; charset=utf-8 + | + |line1 + |line2 + |line3 + |<-- END HTTP (17-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsResponseBodyWithExplicitCharset(async: Boolean) { + val responseBody = "héllo wörld" + val headers = Headers.builder().put("Content-Type", "text/plain; charset=utf-8").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: text/plain; charset=utf-8 + | + |héllo wörld + |<-- END HTTP (13-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsResponseBodyWithNoContentType(async: Boolean) { + val responseBody = "plain text body" + val client = + loggingClient( + fakeHttpClient(responseBody = responseBody.toByteArray(StandardCharsets.UTF_8)), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + | + |plain text body + |<-- END HTTP (15-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsEmptyResponseBody(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.DEBUG) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsEndHttpMarkerOnEarlyClose(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + val body = client.execute(simpleGetRequest(), async).body() + body.read(ByteArray(5)) + body.close() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + | + |{"id" + |<-- END HTTP (5-byte body, closed early) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsEndHttpMarkerOnCloseWithoutReading(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).body().close() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + |<-- END HTTP (0-byte body, closed early) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsEndHttpMarkerWhenResponseClosedAfterPartialRead(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + val response = client.execute(simpleGetRequest(), async) + response.body().read(ByteArray(5)) + response.close() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + | + |{"id" + |<-- END HTTP (5-byte body, closed early) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_doesNotLogEndHttpMarkerWhenResponseClosedWithoutBodyAccess(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).close() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun errorLevel_logsRequestFailure(async: Boolean) { + val clock = + clockFrom( + Instant.parse("1998-04-21T00:00:00Z"), + Instant.parse("1998-04-21T00:00:01.234Z"), + ) + val client = + loggingClient( + failingHttpClient(IOException("Connection refused")), + LogLevel.ERROR, + clock, + ) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- !! IOException: Connection refused (1s 234ms) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_doesNotLogRequestFailure(async: Boolean) { + val client = + loggingClient(failingHttpClient(IOException("Connection refused")), LogLevel.INFO) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsRequestFailureAfterHeaders(async: Boolean) { + val client = + loggingClient(failingHttpClient(IOException("Connection refused")), LogLevel.DEBUG) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- !! IOException: Connection refused (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun errorLevel_logsRequestFailureWithoutMessage(async: Boolean) { + val client = loggingClient(failingHttpClient(IOException()), LogLevel.ERROR) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- !! IOException (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun offLevel_doesNotLogRequestFailure(async: Boolean) { + val client = + loggingClient(failingHttpClient(IOException("Connection refused")), LogLevel.OFF) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()).isEmpty() + } + + @Test + fun errorLevel_logsExecuteAsyncSynchronousThrow() { + val error = IOException("Connection refused") + val client = + loggingClient( + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions, + ): HttpResponse = throw UnsupportedOperationException() + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture = throw error + + override fun close() {} + }, + LogLevel.ERROR, + ) + + assertThatThrownBy { client.execute(simpleGetRequest(), async = true) }.isSameAs(error) + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- !! IOException: Connection refused (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun durationFormat_seconds(async: Boolean) { + val clock = + clockFrom( + Instant.parse("1998-04-21T00:00:00Z"), + Instant.parse("1998-04-21T00:00:02.500Z"), + ) + val client = loggingClient(fakeHttpClient(), LogLevel.INFO, clock) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 200 (2s 500ms) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun durationFormat_minutesAndSeconds(async: Boolean) { + val clock = + clockFrom( + Instant.parse("1998-04-21T00:00:00Z"), + Instant.parse("1998-04-21T00:01:40.467Z"), + ) + val client = loggingClient(fakeHttpClient(), LogLevel.INFO, clock) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 200 (1m 40s 467ms) + |""" + .trimMargin() + ) + } + + @Test + fun builder_toBuilder_roundtrips() { + val delegate = fakeHttpClient() + val clock = Clock.fixed(Instant.parse("1998-04-21T00:00:00Z"), ZoneOffset.UTC) + val client = + LoggingHttpClient.builder() + .httpClient(delegate) + .level(LogLevel.DEBUG) + .redactedHeaders(setOf("X-Secret")) + .clock(clock) + .build() + + val rebuilt = client.toBuilder().build() + + assertThat(rebuilt.httpClient).isSameAs(delegate) + assertThat(rebuilt.level).isEqualTo(LogLevel.DEBUG) + assertThat(rebuilt.redactedHeaders).containsExactly("X-Secret") + assertThat(rebuilt.clock).isEqualTo(clock) + } + + @Test + fun close_delegatesToUnderlyingClient() { + var closed = false + val delegate = + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions, + ): HttpResponse = throw UnsupportedOperationException() + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture = throw UnsupportedOperationException() + + override fun close() { + closed = true + } + } + val client = loggingClient(delegate, LogLevel.OFF) + + client.close() + + assertThat(closed).isTrue() + } + + private fun stderrOutput(): String = errContent.toString("UTF-8") + + private fun loggingClient( + httpClient: HttpClient, + level: LogLevel, + clock: Clock = clockFrom(Instant.parse("1998-04-21T00:00:00Z")), + redactedHeaders: Set = setOf("Authorization"), + ): LoggingHttpClient = + LoggingHttpClient.builder() + .httpClient(httpClient) + .level(level) + .clock(clock) + .redactedHeaders(redactedHeaders) + .build() + + private fun simpleGetRequest(): HttpRequest = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("v1") + .addPathSegment("resources") + .build() + + private fun postRequestWithBody( + body: String, + contentType: String = "application/json", + contentLength: Long? = null, + ): HttpRequest = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl("https://api.example.com") + .addPathSegment("v1") + .addPathSegment("resources") + .body( + object : HttpRequestBody { + private val bytes = body.toByteArray(StandardCharsets.UTF_8) + + override fun writeTo(outputStream: OutputStream) { + outputStream.write(bytes) + } + + override fun contentType(): String = contentType + + override fun contentLength(): Long = contentLength ?: bytes.size.toLong() + + override fun repeatable(): Boolean = true + + override fun close() {} + } + ) + .build() + + private fun fakeHttpClient( + statusCode: Int = 200, + responseHeaders: Headers = Headers.builder().build(), + responseBody: ByteArray = ByteArray(0), + ): HttpClient = + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions, + ): HttpResponse { + // Consume the request body if present to trigger logging. + request.body?.let { + val out = ByteArrayOutputStream() + it.writeTo(out) + } + return fakeResponse(statusCode, responseHeaders, responseBody) + } + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture = + CompletableFuture.completedFuture(execute(request, requestOptions)) + + override fun close() {} + } + + private fun failingHttpClient(error: Throwable): HttpClient = + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions, + ): HttpResponse { + request.body?.let { + val out = ByteArrayOutputStream() + it.writeTo(out) + } + throw error + } + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture { + val future = CompletableFuture() + future.completeExceptionally(error) + return future + } + + override fun close() {} + } + + private fun fakeResponse(statusCode: Int, headers: Headers, body: ByteArray): HttpResponse = + object : HttpResponse { + override fun statusCode(): Int = statusCode + + override fun headers(): Headers = headers + + override fun body(): InputStream = ByteArrayInputStream(body) + + override fun close() {} + } + + private fun clockFrom(vararg instants: Instant): Clock = + object : Clock() { + private var index = 0 + + override fun getZone() = ZoneOffset.UTC + + override fun withZone(zone: java.time.ZoneId?) = this + + override fun instant(): Instant { + val instant = instants[index % instants.size] + index++ + return instant + } + } + + private fun HttpClient.execute(request: HttpRequest, async: Boolean): HttpResponse = + if (async) executeAsync(request).get() else execute(request) +} From 41eb208d807d6cfcd96337c4027d2d5b974d675e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 21:02:48 +0000 Subject: [PATCH 18/18] release: 0.125.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 36 +++++++++++++++++++++++++++++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cadbcc6fc..f3343e210 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.124.0" + ".": "0.125.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dbb06e50..273dd1b83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## 0.125.0 (2026-05-06) + +Full Changelog: [v0.124.0...v0.125.0](https://github.com/lithic-com/lithic-java/compare/v0.124.0...v0.125.0) + +### Features + +* **api:** add AMEX to Network enum in settlement params and models ([638084a](https://github.com/lithic-com/lithic-java/commit/638084a329e3e2da55a350e950f6752e185b5ae4)) +* **api:** add CARD_TRANSACTION_UPDATE event stream and conditional action to auth rules ([064ee52](https://github.com/lithic-com/lithic-java/commit/064ee523f9ced5648ad252fd7a625709b61ad1f4)) +* **api:** add IS_NEW_MERCHANT attribute to authorization action parameters ([6a44f6b](https://github.com/lithic-com/lithic-java/commit/6a44f6b77dc5749fe3e39e6deee4e0e2de316efe)) +* **client:** improve logging ([bb282c7](https://github.com/lithic-com/lithic-java/commit/bb282c75d62080e57456309b7b0c510dab94f5ca)) +* **client:** more robust error parsing ([af54a46](https://github.com/lithic-com/lithic-java/commit/af54a46bbbdbb176835e48074572df830dbc39c2)) +* **client:** support proxy authentication ([183501b](https://github.com/lithic-com/lithic-java/commit/183501b5aa6bde88a884b70a370f848b29cdcd8b)) +* support setting headers via env ([0493d0a](https://github.com/lithic-com/lithic-java/commit/0493d0ad4f3d8e45f35b652e670e505bcbfaf67a)) + + +### Bug Fixes + +* **types:** add EMPTY exemption type, make fields optional in Account/Card/NonPciCard ([2a2a00a](https://github.com/lithic-com/lithic-java/commit/2a2a00acc9cd3a92991a7ae50b6e02cdebaa930d)) + + +### Performance Improvements + +* **client:** create one json mapper ([1743358](https://github.com/lithic-com/lithic-java/commit/1743358e72d12f38c5012963276deef9f78831d9)) + + +### Chores + +* remove duplicated dokka setup ([1728d1a](https://github.com/lithic-com/lithic-java/commit/1728d1a87fbefc15fd86228d122d3a6e2ec53afb)) + + +### Documentation + +* **api:** improve event_tokens and transaction_token field docs in SettlementDetail ([1ccf96d](https://github.com/lithic-com/lithic-java/commit/1ccf96d80d888a5c0756ef5a115dd3e810f9f25b)) +* **api:** update exp_month/exp_year descriptions in card create/renew ([36c34a0](https://github.com/lithic-com/lithic-java/commit/36c34a04d23013e6504d322f84ed85506ab46220)) +* clarify forwards compat behavior ([746bf4a](https://github.com/lithic-com/lithic-java/commit/746bf4a1c7e5de2f4c498d411422827c2107ffc5)) + ## 0.124.0 (2026-04-20) Full Changelog: [v0.123.0...v0.124.0](https://github.com/lithic-com/lithic-java/compare/v0.123.0...v0.124.0) diff --git a/README.md b/README.md index 5ef2fd451..b323db83b 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.124.0) -[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.124.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.124.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.125.0) +[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.125.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.125.0) @@ -22,7 +22,7 @@ Use the Lithic MCP Server to enable AI assistants to interact with this API, all -The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.124.0). +The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.125.0). @@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic ### Gradle ```kotlin -implementation("com.lithic.api:lithic-java:0.124.0") +implementation("com.lithic.api:lithic-java:0.125.0") ``` ### Maven @@ -42,7 +42,7 @@ implementation("com.lithic.api:lithic-java:0.124.0") com.lithic.api lithic-java - 0.124.0 + 0.125.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index bf64b9ac9..9cf695abb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.lithic.api" - version = "0.124.0" // x-release-please-version + version = "0.125.0" // x-release-please-version } subprojects {