From 498c5fe9b52733f1723a1f5014b354c0b52a3d3b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:53:00 +0000 Subject: [PATCH 1/7] feat(types): add OTHER enum value to AuthRuleType --- .stats.yml | 4 +-- .../kotlin/com/lithic/api/models/AuthRule.kt | 12 +++++++ .../api/models/AuthRuleV2CreateParams.kt | 36 +++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 47c7d7549..9326df23d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 216 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-38a020a15ab14f79c7fea3290822406cf80a9d43d46ab3295632a9723f5e42cd.yml -openapi_spec_hash: 5a7357a17c5119bc91d8f5e42297fac3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-9a4064ca9be1efe3e33d922cae77a5d186b6a0119ef1d3601b5ded1447feb7f7.yml +openapi_spec_hash: bff457821129b2eb4fc5150e23efa197 config_hash: 27fa50e251754c8982e3dc615ef6da41 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 e3ae59125..b0bcd85b9 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 @@ -210,6 +210,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or ACH_PAYMENT_UPDATE event * stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are + * read-only; `OTHER` cannot be used when creating a rule. * * @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). @@ -662,6 +664,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or ACH_PAYMENT_UPDATE * event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are + * read-only; `OTHER` cannot be used when creating a rule. */ fun type(type: AuthRuleType) = type(JsonField.of(type)) @@ -3254,6 +3258,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or ACH_PAYMENT_UPDATE event * stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are + * read-only; `OTHER` cannot be used when creating a rule. */ class AuthRuleType @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -3280,6 +3286,8 @@ private constructor( @JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE") + @JvmField val OTHER = of("OTHER") + @JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value)) } @@ -3290,6 +3298,7 @@ private constructor( MERCHANT_LOCK, CONDITIONAL_ACTION, TYPESCRIPT_CODE, + OTHER, } /** @@ -3307,6 +3316,7 @@ private constructor( MERCHANT_LOCK, CONDITIONAL_ACTION, TYPESCRIPT_CODE, + OTHER, /** * An enum member indicating that [AuthRuleType] was instantiated with an unknown value. */ @@ -3327,6 +3337,7 @@ private constructor( MERCHANT_LOCK -> Value.MERCHANT_LOCK CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE + OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -3346,6 +3357,7 @@ private constructor( MERCHANT_LOCK -> Known.MERCHANT_LOCK CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE + OTHER -> Known.OTHER else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value") } 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 c0a400f36..f36432fcd 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 @@ -521,6 +521,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or * ACH_PAYMENT_UPDATE event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are + * read-only; `OTHER` cannot be used when creating a rule. * * @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 @@ -798,6 +800,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or * ACH_PAYMENT_UPDATE event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type + * are read-only; `OTHER` cannot be used when creating a rule. */ fun type(type: AuthRuleType) = type(JsonField.of(type)) @@ -1717,6 +1721,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or * ACH_PAYMENT_UPDATE event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are + * read-only; `OTHER` cannot be used when creating a rule. */ class AuthRuleType @JsonCreator @@ -1744,6 +1750,8 @@ private constructor( @JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE") + @JvmField val OTHER = of("OTHER") + @JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value)) } @@ -1754,6 +1762,7 @@ private constructor( MERCHANT_LOCK, CONDITIONAL_ACTION, TYPESCRIPT_CODE, + OTHER, } /** @@ -1772,6 +1781,7 @@ private constructor( MERCHANT_LOCK, CONDITIONAL_ACTION, TYPESCRIPT_CODE, + OTHER, /** * An enum member indicating that [AuthRuleType] was instantiated with an * unknown value. @@ -1793,6 +1803,7 @@ private constructor( MERCHANT_LOCK -> Value.MERCHANT_LOCK CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE + OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -1812,6 +1823,7 @@ private constructor( MERCHANT_LOCK -> Known.MERCHANT_LOCK CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE + OTHER -> Known.OTHER else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value") } @@ -1972,6 +1984,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or * ACH_PAYMENT_UPDATE event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are + * read-only; `OTHER` cannot be used when creating a rule. * * @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 @@ -2245,6 +2259,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or * ACH_PAYMENT_UPDATE event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type + * are read-only; `OTHER` cannot be used when creating a rule. */ fun type(type: AuthRuleType) = type(JsonField.of(type)) @@ -3108,6 +3124,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or * ACH_PAYMENT_UPDATE event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are + * read-only; `OTHER` cannot be used when creating a rule. */ class AuthRuleType @JsonCreator @@ -3135,6 +3153,8 @@ private constructor( @JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE") + @JvmField val OTHER = of("OTHER") + @JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value)) } @@ -3145,6 +3165,7 @@ private constructor( MERCHANT_LOCK, CONDITIONAL_ACTION, TYPESCRIPT_CODE, + OTHER, } /** @@ -3163,6 +3184,7 @@ private constructor( MERCHANT_LOCK, CONDITIONAL_ACTION, TYPESCRIPT_CODE, + OTHER, /** * An enum member indicating that [AuthRuleType] was instantiated with an * unknown value. @@ -3184,6 +3206,7 @@ private constructor( MERCHANT_LOCK -> Value.MERCHANT_LOCK CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE + OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -3203,6 +3226,7 @@ private constructor( MERCHANT_LOCK -> Known.MERCHANT_LOCK CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE + OTHER -> Known.OTHER else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value") } @@ -3376,6 +3400,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or * ACH_PAYMENT_UPDATE event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are + * read-only; `OTHER` cannot be used when creating a rule. * * @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 @@ -3704,6 +3730,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or * ACH_PAYMENT_UPDATE event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type + * are read-only; `OTHER` cannot be used when creating a rule. */ fun type(type: AuthRuleType) = type(JsonField.of(type)) @@ -4663,6 +4691,8 @@ private constructor( * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or * ACH_PAYMENT_UPDATE event stream. + * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are + * read-only; `OTHER` cannot be used when creating a rule. */ class AuthRuleType @JsonCreator @@ -4690,6 +4720,8 @@ private constructor( @JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE") + @JvmField val OTHER = of("OTHER") + @JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value)) } @@ -4700,6 +4732,7 @@ private constructor( MERCHANT_LOCK, CONDITIONAL_ACTION, TYPESCRIPT_CODE, + OTHER, } /** @@ -4718,6 +4751,7 @@ private constructor( MERCHANT_LOCK, CONDITIONAL_ACTION, TYPESCRIPT_CODE, + OTHER, /** * An enum member indicating that [AuthRuleType] was instantiated with an * unknown value. @@ -4739,6 +4773,7 @@ private constructor( MERCHANT_LOCK -> Value.MERCHANT_LOCK CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE + OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -4758,6 +4793,7 @@ private constructor( MERCHANT_LOCK -> Known.MERCHANT_LOCK CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE + OTHER -> Known.OTHER else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value") } From 71a8dc7df0db29dc489ba45c3c677e3d1dbeafa1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:13:03 +0000 Subject: [PATCH 2/7] feat(api): add EXTERNAL_STABLECOIN category/events to payments and account activity models --- .stats.yml | 4 +-- .../api/models/AccountActivityListParams.kt | 6 ++++ .../api/models/AccountActivityListResponse.kt | 6 ++++ ...ountActivityRetrieveTransactionResponse.kt | 6 ++++ .../com/lithic/api/models/ExternalPayment.kt | 36 +++++++++++++++++++ .../api/models/ExternalPaymentCreateParams.kt | 6 ++++ .../api/models/ExternalPaymentListParams.kt | 6 ++++ .../com/lithic/api/models/FinancialEvent.kt | 30 ++++++++++++++++ .../kotlin/com/lithic/api/models/Payment.kt | 6 ++++ .../lithic/api/models/StatementLineItems.kt | 36 +++++++++++++++++++ 10 files changed, 140 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9326df23d..36e76ee0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 216 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-9a4064ca9be1efe3e33d922cae77a5d186b6a0119ef1d3601b5ded1447feb7f7.yml -openapi_spec_hash: bff457821129b2eb4fc5150e23efa197 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-61d6a4ff8361065995b3a743d6034b7deb3d307e3f3d0c9ef24010dd1b71d692.yml +openapi_spec_hash: 736b5c82d6b4a14788140fe05e0fbc30 config_hash: 27fa50e251754c8982e3dc615ef6da41 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 0dec1db34..3a1db69cc 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 @@ -414,6 +414,8 @@ private constructor( @JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP") + @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN") + @JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER") @JvmField val EXTERNAL_WIRE = of("EXTERNAL_WIRE") @@ -453,6 +455,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -489,6 +492,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -529,6 +533,7 @@ private constructor( EXTERNAL_CHECK -> Value.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW EXTERNAL_RTP -> Value.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Value.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Value.MANAGEMENT_ADJUSTMENT @@ -567,6 +572,7 @@ private constructor( EXTERNAL_CHECK -> Known.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW EXTERNAL_RTP -> Known.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Known.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Known.MANAGEMENT_ADJUSTMENT 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 e5bff9e4c..972c5c9d8 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 @@ -1136,6 +1136,8 @@ private constructor( @JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP") + @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN") + @JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER") @JvmField val EXTERNAL_WIRE = of("EXTERNAL_WIRE") @@ -1175,6 +1177,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -1213,6 +1216,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -1253,6 +1257,7 @@ private constructor( EXTERNAL_CHECK -> Value.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW EXTERNAL_RTP -> Value.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Value.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Value.MANAGEMENT_ADJUSTMENT @@ -1291,6 +1296,7 @@ private constructor( EXTERNAL_CHECK -> Known.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW EXTERNAL_RTP -> Known.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Known.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Known.MANAGEMENT_ADJUSTMENT 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 7630a2e1e..52fa21012 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 @@ -1158,6 +1158,8 @@ private constructor( @JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP") + @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN") + @JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER") @JvmField val EXTERNAL_WIRE = of("EXTERNAL_WIRE") @@ -1197,6 +1199,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -1235,6 +1238,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -1275,6 +1279,7 @@ private constructor( EXTERNAL_CHECK -> Value.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW EXTERNAL_RTP -> Value.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Value.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Value.MANAGEMENT_ADJUSTMENT @@ -1313,6 +1318,7 @@ private constructor( EXTERNAL_CHECK -> Known.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW EXTERNAL_RTP -> Known.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Known.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Known.MANAGEMENT_ADJUSTMENT 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 7643d0349..f0a8f0132 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 @@ -866,6 +866,8 @@ private constructor( @JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP") + @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN") + @JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER") @JvmStatic fun of(value: String) = ExternalPaymentCategory(JsonField.of(value)) @@ -878,6 +880,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, } @@ -898,6 +901,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, /** * An enum member indicating that [ExternalPaymentCategory] was instantiated with an @@ -920,6 +924,7 @@ private constructor( EXTERNAL_CHECK -> Value.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW EXTERNAL_RTP -> Value.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER else -> Value._UNKNOWN } @@ -940,6 +945,7 @@ private constructor( EXTERNAL_CHECK -> Known.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW EXTERNAL_RTP -> Known.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER else -> throw LithicInvalidDataException("Unknown ExternalPaymentCategory: $value") } @@ -1792,6 +1798,16 @@ private constructor( @JvmField val EXTERNAL_RTP_RELEASED = of("EXTERNAL_RTP_RELEASED") + @JvmField val EXTERNAL_STABLECOIN_INITIATED = of("EXTERNAL_STABLECOIN_INITIATED") + + @JvmField val EXTERNAL_STABLECOIN_CANCELED = of("EXTERNAL_STABLECOIN_CANCELED") + + @JvmField val EXTERNAL_STABLECOIN_SETTLED = of("EXTERNAL_STABLECOIN_SETTLED") + + @JvmField val EXTERNAL_STABLECOIN_REVERSED = of("EXTERNAL_STABLECOIN_REVERSED") + + @JvmField val EXTERNAL_STABLECOIN_RELEASED = of("EXTERNAL_STABLECOIN_RELEASED") + @JvmStatic fun of(value: String) = ExternalPaymentEventType(JsonField.of(value)) } @@ -1827,6 +1843,11 @@ private constructor( EXTERNAL_RTP_SETTLED, EXTERNAL_RTP_REVERSED, EXTERNAL_RTP_RELEASED, + EXTERNAL_STABLECOIN_INITIATED, + EXTERNAL_STABLECOIN_CANCELED, + EXTERNAL_STABLECOIN_SETTLED, + EXTERNAL_STABLECOIN_REVERSED, + EXTERNAL_STABLECOIN_RELEASED, } /** @@ -1871,6 +1892,11 @@ private constructor( EXTERNAL_RTP_SETTLED, EXTERNAL_RTP_REVERSED, EXTERNAL_RTP_RELEASED, + EXTERNAL_STABLECOIN_INITIATED, + EXTERNAL_STABLECOIN_CANCELED, + EXTERNAL_STABLECOIN_SETTLED, + EXTERNAL_STABLECOIN_REVERSED, + EXTERNAL_STABLECOIN_RELEASED, /** * An enum member indicating that [ExternalPaymentEventType] was instantiated with * an unknown value. @@ -1917,6 +1943,11 @@ private constructor( EXTERNAL_RTP_SETTLED -> Value.EXTERNAL_RTP_SETTLED EXTERNAL_RTP_REVERSED -> Value.EXTERNAL_RTP_REVERSED EXTERNAL_RTP_RELEASED -> Value.EXTERNAL_RTP_RELEASED + EXTERNAL_STABLECOIN_INITIATED -> Value.EXTERNAL_STABLECOIN_INITIATED + EXTERNAL_STABLECOIN_CANCELED -> Value.EXTERNAL_STABLECOIN_CANCELED + EXTERNAL_STABLECOIN_SETTLED -> Value.EXTERNAL_STABLECOIN_SETTLED + EXTERNAL_STABLECOIN_REVERSED -> Value.EXTERNAL_STABLECOIN_REVERSED + EXTERNAL_STABLECOIN_RELEASED -> Value.EXTERNAL_STABLECOIN_RELEASED else -> Value._UNKNOWN } @@ -1961,6 +1992,11 @@ private constructor( EXTERNAL_RTP_SETTLED -> Known.EXTERNAL_RTP_SETTLED EXTERNAL_RTP_REVERSED -> Known.EXTERNAL_RTP_REVERSED EXTERNAL_RTP_RELEASED -> Known.EXTERNAL_RTP_RELEASED + EXTERNAL_STABLECOIN_INITIATED -> Known.EXTERNAL_STABLECOIN_INITIATED + EXTERNAL_STABLECOIN_CANCELED -> Known.EXTERNAL_STABLECOIN_CANCELED + EXTERNAL_STABLECOIN_SETTLED -> Known.EXTERNAL_STABLECOIN_SETTLED + EXTERNAL_STABLECOIN_REVERSED -> Known.EXTERNAL_STABLECOIN_REVERSED + EXTERNAL_STABLECOIN_RELEASED -> Known.EXTERNAL_STABLECOIN_RELEASED else -> throw LithicInvalidDataException("Unknown ExternalPaymentEventType: $value") } 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 201de3314..9eef74f3a 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 @@ -1006,6 +1006,8 @@ private constructor( @JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP") + @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN") + @JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER") @JvmStatic fun of(value: String) = ExternalPaymentCategory(JsonField.of(value)) @@ -1018,6 +1020,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, } @@ -1038,6 +1041,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, /** * An enum member indicating that [ExternalPaymentCategory] was instantiated with an @@ -1060,6 +1064,7 @@ private constructor( EXTERNAL_CHECK -> Value.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW EXTERNAL_RTP -> Value.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER else -> Value._UNKNOWN } @@ -1080,6 +1085,7 @@ private constructor( EXTERNAL_CHECK -> Known.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW EXTERNAL_RTP -> Known.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER else -> throw LithicInvalidDataException("Unknown ExternalPaymentCategory: $value") } 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 c4a356486..1969781a5 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 @@ -386,6 +386,8 @@ private constructor( @JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP") + @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN") + @JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER") @JvmStatic fun of(value: String) = ExternalPaymentCategory(JsonField.of(value)) @@ -398,6 +400,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, } @@ -418,6 +421,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, /** * An enum member indicating that [ExternalPaymentCategory] was instantiated with an @@ -440,6 +444,7 @@ private constructor( EXTERNAL_CHECK -> Value.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW EXTERNAL_RTP -> Value.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER else -> Value._UNKNOWN } @@ -460,6 +465,7 @@ private constructor( EXTERNAL_CHECK -> Known.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW EXTERNAL_RTP -> Known.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER else -> throw LithicInvalidDataException("Unknown ExternalPaymentCategory: $value") } 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 d7f28b871..b08c57268 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 @@ -555,6 +555,16 @@ private constructor( @JvmField val EXTERNAL_RTP_SETTLED = of("EXTERNAL_RTP_SETTLED") + @JvmField val EXTERNAL_STABLECOIN_CANCELED = of("EXTERNAL_STABLECOIN_CANCELED") + + @JvmField val EXTERNAL_STABLECOIN_INITIATED = of("EXTERNAL_STABLECOIN_INITIATED") + + @JvmField val EXTERNAL_STABLECOIN_RELEASED = of("EXTERNAL_STABLECOIN_RELEASED") + + @JvmField val EXTERNAL_STABLECOIN_REVERSED = of("EXTERNAL_STABLECOIN_REVERSED") + + @JvmField val EXTERNAL_STABLECOIN_SETTLED = of("EXTERNAL_STABLECOIN_SETTLED") + @JvmField val EXTERNAL_TRANSFER_CANCELED = of("EXTERNAL_TRANSFER_CANCELED") @JvmField val EXTERNAL_TRANSFER_INITIATED = of("EXTERNAL_TRANSFER_INITIATED") @@ -699,6 +709,11 @@ private constructor( EXTERNAL_RTP_RELEASED, EXTERNAL_RTP_REVERSED, EXTERNAL_RTP_SETTLED, + EXTERNAL_STABLECOIN_CANCELED, + EXTERNAL_STABLECOIN_INITIATED, + EXTERNAL_STABLECOIN_RELEASED, + EXTERNAL_STABLECOIN_REVERSED, + EXTERNAL_STABLECOIN_SETTLED, EXTERNAL_TRANSFER_CANCELED, EXTERNAL_TRANSFER_INITIATED, EXTERNAL_TRANSFER_RELEASED, @@ -807,6 +822,11 @@ private constructor( EXTERNAL_RTP_RELEASED, EXTERNAL_RTP_REVERSED, EXTERNAL_RTP_SETTLED, + EXTERNAL_STABLECOIN_CANCELED, + EXTERNAL_STABLECOIN_INITIATED, + EXTERNAL_STABLECOIN_RELEASED, + EXTERNAL_STABLECOIN_REVERSED, + EXTERNAL_STABLECOIN_SETTLED, EXTERNAL_TRANSFER_CANCELED, EXTERNAL_TRANSFER_INITIATED, EXTERNAL_TRANSFER_RELEASED, @@ -919,6 +939,11 @@ private constructor( EXTERNAL_RTP_RELEASED -> Value.EXTERNAL_RTP_RELEASED EXTERNAL_RTP_REVERSED -> Value.EXTERNAL_RTP_REVERSED EXTERNAL_RTP_SETTLED -> Value.EXTERNAL_RTP_SETTLED + EXTERNAL_STABLECOIN_CANCELED -> Value.EXTERNAL_STABLECOIN_CANCELED + EXTERNAL_STABLECOIN_INITIATED -> Value.EXTERNAL_STABLECOIN_INITIATED + EXTERNAL_STABLECOIN_RELEASED -> Value.EXTERNAL_STABLECOIN_RELEASED + EXTERNAL_STABLECOIN_REVERSED -> Value.EXTERNAL_STABLECOIN_REVERSED + EXTERNAL_STABLECOIN_SETTLED -> Value.EXTERNAL_STABLECOIN_SETTLED EXTERNAL_TRANSFER_CANCELED -> Value.EXTERNAL_TRANSFER_CANCELED EXTERNAL_TRANSFER_INITIATED -> Value.EXTERNAL_TRANSFER_INITIATED EXTERNAL_TRANSFER_RELEASED -> Value.EXTERNAL_TRANSFER_RELEASED @@ -1029,6 +1054,11 @@ private constructor( EXTERNAL_RTP_RELEASED -> Known.EXTERNAL_RTP_RELEASED EXTERNAL_RTP_REVERSED -> Known.EXTERNAL_RTP_REVERSED EXTERNAL_RTP_SETTLED -> Known.EXTERNAL_RTP_SETTLED + EXTERNAL_STABLECOIN_CANCELED -> Known.EXTERNAL_STABLECOIN_CANCELED + EXTERNAL_STABLECOIN_INITIATED -> Known.EXTERNAL_STABLECOIN_INITIATED + EXTERNAL_STABLECOIN_RELEASED -> Known.EXTERNAL_STABLECOIN_RELEASED + EXTERNAL_STABLECOIN_REVERSED -> Known.EXTERNAL_STABLECOIN_REVERSED + EXTERNAL_STABLECOIN_SETTLED -> Known.EXTERNAL_STABLECOIN_SETTLED EXTERNAL_TRANSFER_CANCELED -> Known.EXTERNAL_TRANSFER_CANCELED EXTERNAL_TRANSFER_INITIATED -> Known.EXTERNAL_TRANSFER_INITIATED EXTERNAL_TRANSFER_RELEASED -> Known.EXTERNAL_TRANSFER_RELEASED 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 9290be4aa..585984833 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 @@ -1213,6 +1213,8 @@ private constructor( @JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP") + @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN") + @JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER") @JvmField val EXTERNAL_WIRE = of("EXTERNAL_WIRE") @@ -1252,6 +1254,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -1288,6 +1291,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -1328,6 +1332,7 @@ private constructor( EXTERNAL_CHECK -> Value.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW EXTERNAL_RTP -> Value.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Value.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Value.MANAGEMENT_ADJUSTMENT @@ -1366,6 +1371,7 @@ private constructor( EXTERNAL_CHECK -> Known.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW EXTERNAL_RTP -> Known.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Known.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Known.MANAGEMENT_ADJUSTMENT 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 7fc41b0d8..e23f281a6 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 @@ -979,6 +979,8 @@ private constructor( @JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP") + @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN") + @JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER") @JvmField val EXTERNAL_WIRE = of("EXTERNAL_WIRE") @@ -1018,6 +1020,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -1056,6 +1059,7 @@ private constructor( EXTERNAL_CHECK, EXTERNAL_FEDNOW, EXTERNAL_RTP, + EXTERNAL_STABLECOIN, EXTERNAL_TRANSFER, EXTERNAL_WIRE, MANAGEMENT_ADJUSTMENT, @@ -1096,6 +1100,7 @@ private constructor( EXTERNAL_CHECK -> Value.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW EXTERNAL_RTP -> Value.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Value.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Value.MANAGEMENT_ADJUSTMENT @@ -1134,6 +1139,7 @@ private constructor( EXTERNAL_CHECK -> Known.EXTERNAL_CHECK EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW EXTERNAL_RTP -> Known.EXTERNAL_RTP + EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER EXTERNAL_WIRE -> Known.EXTERNAL_WIRE MANAGEMENT_ADJUSTMENT -> Known.MANAGEMENT_ADJUSTMENT @@ -1333,6 +1339,16 @@ private constructor( @JvmField val EXTERNAL_RTP_SETTLED = of("EXTERNAL_RTP_SETTLED") + @JvmField val EXTERNAL_STABLECOIN_CANCELED = of("EXTERNAL_STABLECOIN_CANCELED") + + @JvmField val EXTERNAL_STABLECOIN_INITIATED = of("EXTERNAL_STABLECOIN_INITIATED") + + @JvmField val EXTERNAL_STABLECOIN_RELEASED = of("EXTERNAL_STABLECOIN_RELEASED") + + @JvmField val EXTERNAL_STABLECOIN_REVERSED = of("EXTERNAL_STABLECOIN_REVERSED") + + @JvmField val EXTERNAL_STABLECOIN_SETTLED = of("EXTERNAL_STABLECOIN_SETTLED") + @JvmField val EXTERNAL_TRANSFER_CANCELED = of("EXTERNAL_TRANSFER_CANCELED") @JvmField val EXTERNAL_TRANSFER_INITIATED = of("EXTERNAL_TRANSFER_INITIATED") @@ -1477,6 +1493,11 @@ private constructor( EXTERNAL_RTP_RELEASED, EXTERNAL_RTP_REVERSED, EXTERNAL_RTP_SETTLED, + EXTERNAL_STABLECOIN_CANCELED, + EXTERNAL_STABLECOIN_INITIATED, + EXTERNAL_STABLECOIN_RELEASED, + EXTERNAL_STABLECOIN_REVERSED, + EXTERNAL_STABLECOIN_SETTLED, EXTERNAL_TRANSFER_CANCELED, EXTERNAL_TRANSFER_INITIATED, EXTERNAL_TRANSFER_RELEASED, @@ -1587,6 +1608,11 @@ private constructor( EXTERNAL_RTP_RELEASED, EXTERNAL_RTP_REVERSED, EXTERNAL_RTP_SETTLED, + EXTERNAL_STABLECOIN_CANCELED, + EXTERNAL_STABLECOIN_INITIATED, + EXTERNAL_STABLECOIN_RELEASED, + EXTERNAL_STABLECOIN_REVERSED, + EXTERNAL_STABLECOIN_SETTLED, EXTERNAL_TRANSFER_CANCELED, EXTERNAL_TRANSFER_INITIATED, EXTERNAL_TRANSFER_RELEASED, @@ -1699,6 +1725,11 @@ private constructor( EXTERNAL_RTP_RELEASED -> Value.EXTERNAL_RTP_RELEASED EXTERNAL_RTP_REVERSED -> Value.EXTERNAL_RTP_REVERSED EXTERNAL_RTP_SETTLED -> Value.EXTERNAL_RTP_SETTLED + EXTERNAL_STABLECOIN_CANCELED -> Value.EXTERNAL_STABLECOIN_CANCELED + EXTERNAL_STABLECOIN_INITIATED -> Value.EXTERNAL_STABLECOIN_INITIATED + EXTERNAL_STABLECOIN_RELEASED -> Value.EXTERNAL_STABLECOIN_RELEASED + EXTERNAL_STABLECOIN_REVERSED -> Value.EXTERNAL_STABLECOIN_REVERSED + EXTERNAL_STABLECOIN_SETTLED -> Value.EXTERNAL_STABLECOIN_SETTLED EXTERNAL_TRANSFER_CANCELED -> Value.EXTERNAL_TRANSFER_CANCELED EXTERNAL_TRANSFER_INITIATED -> Value.EXTERNAL_TRANSFER_INITIATED EXTERNAL_TRANSFER_RELEASED -> Value.EXTERNAL_TRANSFER_RELEASED @@ -1809,6 +1840,11 @@ private constructor( EXTERNAL_RTP_RELEASED -> Known.EXTERNAL_RTP_RELEASED EXTERNAL_RTP_REVERSED -> Known.EXTERNAL_RTP_REVERSED EXTERNAL_RTP_SETTLED -> Known.EXTERNAL_RTP_SETTLED + EXTERNAL_STABLECOIN_CANCELED -> Known.EXTERNAL_STABLECOIN_CANCELED + EXTERNAL_STABLECOIN_INITIATED -> Known.EXTERNAL_STABLECOIN_INITIATED + EXTERNAL_STABLECOIN_RELEASED -> Known.EXTERNAL_STABLECOIN_RELEASED + EXTERNAL_STABLECOIN_REVERSED -> Known.EXTERNAL_STABLECOIN_REVERSED + EXTERNAL_STABLECOIN_SETTLED -> Known.EXTERNAL_STABLECOIN_SETTLED EXTERNAL_TRANSFER_CANCELED -> Known.EXTERNAL_TRANSFER_CANCELED EXTERNAL_TRANSFER_INITIATED -> Known.EXTERNAL_TRANSFER_INITIATED EXTERNAL_TRANSFER_RELEASED -> Known.EXTERNAL_TRANSFER_RELEASED From 585fdd50392d686c01877f07189ed696345267c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Sep 2026 15:52:40 +0000 Subject: [PATCH 3/7] feat: TRE-14429: Document the stablecoin payments endpoint --- .stats.yml | 8 +- .../lithic/api/models/PaymentCreateParams.kt | 9 +- .../models/PaymentCreateStablecoinParams.kt | 1199 +++++++++++++++ .../models/PaymentCreateStablecoinResponse.kt | 1320 +++++++++++++++++ .../lithic/api/models/PaymentListParams.kt | 8 +- .../api/services/async/PaymentServiceAsync.kt | 54 +- .../services/async/PaymentServiceAsyncImpl.kt | 40 + .../api/services/blocking/PaymentService.kt | 54 +- .../services/blocking/PaymentServiceImpl.kt | 37 + .../PaymentCreateStablecoinParamsTest.kt | 79 + .../PaymentCreateStablecoinResponseTest.kt | 296 ++++ .../services/async/PaymentServiceAsyncTest.kt | 31 + .../services/blocking/PaymentServiceTest.kt | 30 + 13 files changed, 3157 insertions(+), 8 deletions(-) create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateStablecoinParams.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateStablecoinResponse.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateStablecoinParamsTest.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateStablecoinResponseTest.kt diff --git a/.stats.yml b/.stats.yml index 36e76ee0a..3bbc47373 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 216 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-61d6a4ff8361065995b3a743d6034b7deb3d307e3f3d0c9ef24010dd1b71d692.yml -openapi_spec_hash: 736b5c82d6b4a14788140fe05e0fbc30 -config_hash: 27fa50e251754c8982e3dc615ef6da41 +configured_endpoints: 217 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-70147140a7b2043acf622024eb3bde9b04264f8e9a695d4c79b5ee4db1534518.yml +openapi_spec_hash: 7a181cb1cfaaa201143bd9d04a841a2e +config_hash: e95c2dda5d175f9316457e0a84e35dce 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 823df27a3..caf00b1b3 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 @@ -21,7 +21,14 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** Initiates a payment between a financial account and an external bank account. */ +/** + * Initiates an ACH payment between a financial account and an external bank account. + * + * This endpoint originates on the ACH rail only. To send a stablecoin payout, use the + * [Create stablecoin payment](https://docs.lithic.com/reference/createstablecoinpayment) endpoint. + * Payments on every rail are read back through + * [List payments](https://docs.lithic.com/reference/searchpayments). + */ class PaymentCreateParams private constructor( private val body: CreatePaymentRequest, diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateStablecoinParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateStablecoinParams.kt new file mode 100644 index 000000000..6fcdc91d7 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateStablecoinParams.kt @@ -0,0 +1,1199 @@ +// 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.Params +import com.lithic.api.core.checkRequired +import com.lithic.api.core.http.Headers +import com.lithic.api.core.http.QueryParams +import com.lithic.api.errors.LithicInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Initiates a stablecoin payout from a financial account to a registered blockchain recipient. + * + * The recipient must have been registered with + * [Create blockchain recipient](https://docs.lithic.com/reference/createblockchainrecipient) and + * have completed address screening — only a recipient in the `ENABLED` verification state can + * receive a payout. The destination address and chain come from the recipient, so they are not + * supplied here. + * + * Only payouts are initiated through this endpoint. Stablecoin pay-ins are credited from on-chain + * deposits to a financial account's deposit address and are not created through the API. Funds are + * placed on hold when the payout is initiated, and a payout that fails on chain reverses that hold. + * A payout cannot be cancelled once it has been submitted on chain. + * + * This endpoint is only available to stablecoin-enabled programs. Contact your customer success + * manager to learn more. + */ +class PaymentCreateStablecoinParams +private constructor( + private val body: CreateStablecoinPaymentRequest, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * Payout amount in cents + * + * @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 amount(): Long = body.amount() + + /** + * Token of the blockchain recipient to send the payout to. The recipient must be in the + * `ENABLED` verification state + * + * @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 blockchainRecipientToken(): String = body.blockchainRecipientToken() + + /** + * Token of the financial account the payout is funded from + * + * @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 financialAccountToken(): String = body.financialAccountToken() + + /** + * Direction of the payment. Stablecoin supports payouts only + * + * @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 = body.type() + + /** + * Customer-provided token that will serve as an idempotency token. This token will become the + * transaction token + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun token(): Optional = body.token() + + /** + * Optional hold to settle when this payout is initiated + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun hold(): Optional = body.hold() + + /** + * Memo recorded on the payout. Defaults to `Stablecoin payout on ` when omitted + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun memo(): Optional = body.memo() + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _amount(): JsonField = body._amount() + + /** + * Returns the raw JSON value of [blockchainRecipientToken]. + * + * Unlike [blockchainRecipientToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _blockchainRecipientToken(): JsonField = body._blockchainRecipientToken() + + /** + * Returns the raw JSON value of [financialAccountToken]. + * + * Unlike [financialAccountToken], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _financialAccountToken(): JsonField = body._financialAccountToken() + + /** + * Returns the raw JSON value of [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _type(): JsonField = body._type() + + /** + * Returns the raw JSON value of [token]. + * + * Unlike [token], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _token(): JsonField = body._token() + + /** + * Returns the raw JSON value of [hold]. + * + * Unlike [hold], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _hold(): JsonField = body._hold() + + /** + * Returns the raw JSON value of [memo]. + * + * Unlike [memo], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _memo(): JsonField = body._memo() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [PaymentCreateStablecoinParams]. + * + * The following fields are required: + * ```java + * .amount() + * .blockchainRecipientToken() + * .financialAccountToken() + * .type() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PaymentCreateStablecoinParams]. */ + class Builder internal constructor() { + + private var body: CreateStablecoinPaymentRequest.Builder = + CreateStablecoinPaymentRequest.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(paymentCreateStablecoinParams: PaymentCreateStablecoinParams) = apply { + body = paymentCreateStablecoinParams.body.toBuilder() + additionalHeaders = paymentCreateStablecoinParams.additionalHeaders.toBuilder() + additionalQueryParams = paymentCreateStablecoinParams.additionalQueryParams.toBuilder() + } + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [amount] + * - [blockchainRecipientToken] + * - [financialAccountToken] + * - [type] + * - [token] + * - etc. + */ + fun body(body: CreateStablecoinPaymentRequest) = apply { this.body = body.toBuilder() } + + /** Payout amount in cents */ + fun amount(amount: Long) = apply { body.amount(amount) } + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { body.amount(amount) } + + /** + * Token of the blockchain recipient to send the payout to. The recipient must be in the + * `ENABLED` verification state + */ + fun blockchainRecipientToken(blockchainRecipientToken: String) = apply { + body.blockchainRecipientToken(blockchainRecipientToken) + } + + /** + * Sets [Builder.blockchainRecipientToken] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainRecipientToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun blockchainRecipientToken(blockchainRecipientToken: JsonField) = apply { + body.blockchainRecipientToken(blockchainRecipientToken) + } + + /** Token of the financial account the payout is funded from */ + fun financialAccountToken(financialAccountToken: String) = apply { + body.financialAccountToken(financialAccountToken) + } + + /** + * Sets [Builder.financialAccountToken] to an arbitrary JSON value. + * + * You should usually call [Builder.financialAccountToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + body.financialAccountToken(financialAccountToken) + } + + /** Direction of the payment. Stablecoin supports payouts only */ + fun type(type: Type) = apply { body.type(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 { body.type(type) } + + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token + */ + fun token(token: String) = apply { body.token(token) } + + /** + * Sets [Builder.token] to an arbitrary JSON value. + * + * You should usually call [Builder.token] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun token(token: JsonField) = apply { body.token(token) } + + /** Optional hold to settle when this payout is initiated */ + fun hold(hold: Hold) = apply { body.hold(hold) } + + /** + * Sets [Builder.hold] to an arbitrary JSON value. + * + * You should usually call [Builder.hold] with a well-typed [Hold] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun hold(hold: JsonField) = apply { body.hold(hold) } + + /** Memo recorded on the payout. Defaults to `Stablecoin payout on ` when omitted */ + fun memo(memo: String) = apply { body.memo(memo) } + + /** + * Sets [Builder.memo] to an arbitrary JSON value. + * + * You should usually call [Builder.memo] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun memo(memo: JsonField) = apply { body.memo(memo) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [PaymentCreateStablecoinParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .blockchainRecipientToken() + * .financialAccountToken() + * .type() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PaymentCreateStablecoinParams = + PaymentCreateStablecoinParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): CreateStablecoinPaymentRequest = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class CreateStablecoinPaymentRequest + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val blockchainRecipientToken: JsonField, + private val financialAccountToken: JsonField, + private val type: JsonField, + private val token: JsonField, + private val hold: JsonField, + private val memo: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + blockchainRecipientToken: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(), + @JsonProperty("hold") @ExcludeMissing hold: JsonField = JsonMissing.of(), + @JsonProperty("memo") @ExcludeMissing memo: JsonField = JsonMissing.of(), + ) : this( + amount, + blockchainRecipientToken, + financialAccountToken, + type, + token, + hold, + memo, + mutableMapOf(), + ) + + /** + * Payout amount in cents + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * Token of the blockchain recipient to send the payout to. The recipient must be in the + * `ENABLED` verification state + * + * @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 blockchainRecipientToken(): String = + blockchainRecipientToken.getRequired("blockchain_recipient_token") + + /** + * Token of the financial account the payout is funded from + * + * @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 financialAccountToken(): String = + financialAccountToken.getRequired("financial_account_token") + + /** + * Direction of the payment. Stablecoin supports payouts only + * + * @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") + + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun token(): Optional = token.getOptional("token") + + /** + * Optional hold to settle when this payout is initiated + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun hold(): Optional = hold.getOptional("hold") + + /** + * Memo recorded on the payout. Defaults to `Stablecoin payout on ` when omitted + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun memo(): Optional = memo.getOptional("memo") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [blockchainRecipientToken]. + * + * Unlike [blockchainRecipientToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + fun _blockchainRecipientToken(): JsonField = blockchainRecipientToken + + /** + * Returns the raw JSON value of [financialAccountToken]. + * + * Unlike [financialAccountToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken(): JsonField = financialAccountToken + + /** + * 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 [token]. + * + * Unlike [token], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("token") @ExcludeMissing fun _token(): JsonField = token + + /** + * Returns the raw JSON value of [hold]. + * + * Unlike [hold], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("hold") @ExcludeMissing fun _hold(): JsonField = hold + + /** + * Returns the raw JSON value of [memo]. + * + * Unlike [memo], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("memo") @ExcludeMissing fun _memo(): JsonField = memo + + @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 + * [CreateStablecoinPaymentRequest]. + * + * The following fields are required: + * ```java + * .amount() + * .blockchainRecipientToken() + * .financialAccountToken() + * .type() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreateStablecoinPaymentRequest]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var blockchainRecipientToken: JsonField? = null + private var financialAccountToken: JsonField? = null + private var type: JsonField? = null + private var token: JsonField = JsonMissing.of() + private var hold: JsonField = JsonMissing.of() + private var memo: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(createStablecoinPaymentRequest: CreateStablecoinPaymentRequest) = + apply { + amount = createStablecoinPaymentRequest.amount + blockchainRecipientToken = + createStablecoinPaymentRequest.blockchainRecipientToken + financialAccountToken = createStablecoinPaymentRequest.financialAccountToken + type = createStablecoinPaymentRequest.type + token = createStablecoinPaymentRequest.token + hold = createStablecoinPaymentRequest.hold + memo = createStablecoinPaymentRequest.memo + additionalProperties = + createStablecoinPaymentRequest.additionalProperties.toMutableMap() + } + + /** Payout amount in cents */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * Token of the blockchain recipient to send the payout to. The recipient must be in the + * `ENABLED` verification state + */ + fun blockchainRecipientToken(blockchainRecipientToken: String) = + blockchainRecipientToken(JsonField.of(blockchainRecipientToken)) + + /** + * Sets [Builder.blockchainRecipientToken] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainRecipientToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun blockchainRecipientToken(blockchainRecipientToken: JsonField) = apply { + this.blockchainRecipientToken = blockchainRecipientToken + } + + /** Token of the financial account the payout is funded from */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** + * Sets [Builder.financialAccountToken] to an arbitrary JSON value. + * + * You should usually call [Builder.financialAccountToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** Direction of the payment. Stablecoin supports payouts only */ + 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 } + + /** + * Customer-provided token that will serve as an idempotency token. This token will + * become the transaction token + */ + fun token(token: String) = token(JsonField.of(token)) + + /** + * Sets [Builder.token] to an arbitrary JSON value. + * + * You should usually call [Builder.token] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun token(token: JsonField) = apply { this.token = token } + + /** Optional hold to settle when this payout is initiated */ + fun hold(hold: Hold) = hold(JsonField.of(hold)) + + /** + * Sets [Builder.hold] to an arbitrary JSON value. + * + * You should usually call [Builder.hold] with a well-typed [Hold] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun hold(hold: JsonField) = apply { this.hold = hold } + + /** + * Memo recorded on the payout. Defaults to `Stablecoin payout on ` when omitted + */ + fun memo(memo: String) = memo(JsonField.of(memo)) + + /** + * Sets [Builder.memo] to an arbitrary JSON value. + * + * You should usually call [Builder.memo] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun memo(memo: JsonField) = apply { this.memo = memo } + + 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 [CreateStablecoinPaymentRequest]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .blockchainRecipientToken() + * .financialAccountToken() + * .type() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreateStablecoinPaymentRequest = + CreateStablecoinPaymentRequest( + checkRequired("amount", amount), + checkRequired("blockchainRecipientToken", blockchainRecipientToken), + checkRequired("financialAccountToken", financialAccountToken), + checkRequired("type", type), + token, + hold, + memo, + 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(): CreateStablecoinPaymentRequest = apply { + if (validated) { + return@apply + } + + amount() + blockchainRecipientToken() + financialAccountToken() + type().validate() + token() + hold().ifPresent { it.validate() } + memo() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (blockchainRecipientToken.asKnown().isPresent) 1 else 0) + + (if (financialAccountToken.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + (if (token.asKnown().isPresent) 1 else 0) + + (hold.asKnown().getOrNull()?.validity() ?: 0) + + (if (memo.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreateStablecoinPaymentRequest && + amount == other.amount && + blockchainRecipientToken == other.blockchainRecipientToken && + financialAccountToken == other.financialAccountToken && + type == other.type && + token == other.token && + hold == other.hold && + memo == other.memo && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + amount, + blockchainRecipientToken, + financialAccountToken, + type, + token, + hold, + memo, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreateStablecoinPaymentRequest{amount=$amount, blockchainRecipientToken=$blockchainRecipientToken, financialAccountToken=$financialAccountToken, type=$type, token=$token, hold=$hold, memo=$memo, additionalProperties=$additionalProperties}" + } + + /** Direction of the payment. Stablecoin supports payouts only */ + 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 PAYMENT = of("PAYMENT") + + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } + + /** An enum containing [Type]'s known values. */ + enum class Known { + PAYMENT + } + + /** + * 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 { + PAYMENT, + /** 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) { + PAYMENT -> Value.PAYMENT + 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) { + PAYMENT -> Known.PAYMENT + 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() + } + + /** Optional hold to settle when this payout is initiated */ + class Hold + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val token: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of() + ) : this(token, mutableMapOf()) + + /** + * Token of the hold to settle when this payout is initiated + * + * @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 token(): String = token.getRequired("token") + + /** + * Returns the raw JSON value of [token]. + * + * Unlike [token], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("token") @ExcludeMissing fun _token(): JsonField = token + + @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 [Hold]. + * + * The following fields are required: + * ```java + * .token() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Hold]. */ + class Builder internal constructor() { + + private var token: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(hold: Hold) = apply { + token = hold.token + additionalProperties = hold.additionalProperties.toMutableMap() + } + + /** Token of the hold to settle when this payout is initiated */ + fun token(token: String) = token(JsonField.of(token)) + + /** + * Sets [Builder.token] to an arbitrary JSON value. + * + * You should usually call [Builder.token] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun token(token: JsonField) = apply { this.token = token } + + 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 [Hold]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .token() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Hold = + Hold(checkRequired("token", token), 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(): Hold = apply { + if (validated) { + return@apply + } + + token() + 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 (token.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Hold && + token == other.token && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(token, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Hold{token=$token, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentCreateStablecoinParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "PaymentCreateStablecoinParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateStablecoinResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateStablecoinResponse.kt new file mode 100644 index 000000000..b9730eb14 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateStablecoinResponse.kt @@ -0,0 +1,1320 @@ +// 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.checkRequired +import com.lithic.api.core.toImmutable +import com.lithic.api.errors.LithicInvalidDataException +import java.time.LocalDate +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Payment transaction */ +class PaymentCreateStablecoinResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val token: JsonField, + private val category: JsonField, + private val created: JsonField, + private val descriptor: JsonField, + private val direction: JsonField, + private val events: JsonField>, + private val family: JsonField, + private val financialAccountToken: JsonField, + private val method: JsonField, + private val methodAttributes: JsonField, + private val pendingAmount: JsonField, + private val relatedAccountTokens: JsonField, + private val result: JsonField, + private val settledAmount: JsonField, + private val source: JsonField, + private val status: JsonField, + private val updated: JsonField, + private val blockchainRecipientToken: JsonField, + private val currency: JsonField, + private val expectedReleaseDate: JsonField, + private val externalBankAccountToken: JsonField, + private val tags: JsonField, + private val type: JsonField, + private val userDefinedId: JsonField, + private val balance: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(), + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + created: JsonField = JsonMissing.of(), + @JsonProperty("descriptor") + @ExcludeMissing + descriptor: JsonField = JsonMissing.of(), + @JsonProperty("direction") + @ExcludeMissing + direction: JsonField = JsonMissing.of(), + @JsonProperty("events") + @ExcludeMissing + events: JsonField> = JsonMissing.of(), + @JsonProperty("family") + @ExcludeMissing + family: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("method") + @ExcludeMissing + method: JsonField = JsonMissing.of(), + @JsonProperty("method_attributes") + @ExcludeMissing + methodAttributes: JsonField = JsonMissing.of(), + @JsonProperty("pending_amount") + @ExcludeMissing + pendingAmount: JsonField = JsonMissing.of(), + @JsonProperty("related_account_tokens") + @ExcludeMissing + relatedAccountTokens: JsonField = JsonMissing.of(), + @JsonProperty("result") + @ExcludeMissing + result: JsonField = JsonMissing.of(), + @JsonProperty("settled_amount") + @ExcludeMissing + settledAmount: JsonField = JsonMissing.of(), + @JsonProperty("source") + @ExcludeMissing + source: JsonField = JsonMissing.of(), + @JsonProperty("status") + @ExcludeMissing + status: JsonField = JsonMissing.of(), + @JsonProperty("updated") + @ExcludeMissing + updated: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + blockchainRecipientToken: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), + @JsonProperty("expected_release_date") + @ExcludeMissing + expectedReleaseDate: JsonField = JsonMissing.of(), + @JsonProperty("external_bank_account_token") + @ExcludeMissing + externalBankAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("tags") @ExcludeMissing tags: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + type: JsonField = JsonMissing.of(), + @JsonProperty("user_defined_id") + @ExcludeMissing + userDefinedId: JsonField = JsonMissing.of(), + @JsonProperty("balance") @ExcludeMissing balance: JsonField = JsonMissing.of(), + ) : this( + token, + category, + created, + descriptor, + direction, + events, + family, + financialAccountToken, + method, + methodAttributes, + pendingAmount, + relatedAccountTokens, + result, + settledAmount, + source, + status, + updated, + blockchainRecipientToken, + currency, + expectedReleaseDate, + externalBankAccountToken, + tags, + type, + userDefinedId, + balance, + mutableMapOf(), + ) + + fun toPayment(): Payment = + Payment.builder() + .token(token) + .category(category) + .created(created) + .descriptor(descriptor) + .direction(direction) + .events(events) + .family(family) + .financialAccountToken(financialAccountToken) + .method(method) + .methodAttributes(methodAttributes) + .pendingAmount(pendingAmount) + .relatedAccountTokens(relatedAccountTokens) + .result(result) + .settledAmount(settledAmount) + .source(source) + .status(status) + .updated(updated) + .blockchainRecipientToken(blockchainRecipientToken) + .currency(currency) + .expectedReleaseDate(expectedReleaseDate) + .externalBankAccountToken(externalBankAccountToken) + .tags(tags) + .type(type) + .userDefinedId(userDefinedId) + .build() + + /** + * Unique identifier 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 token(): String = token.getRequired("token") + + /** + * Transaction category + * + * @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 category(): Payment.TransactionCategory = category.getRequired("category") + + /** + * ISO 8601 timestamp of when the transaction was created + * + * @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 created(): OffsetDateTime = created.getRequired("created") + + /** + * Transaction descriptor + * + * @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 descriptor(): String = descriptor.getRequired("descriptor") + + /** + * Transfer direction + * + * @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 direction(): Payment.Direction = direction.getRequired("direction") + + /** + * List of transaction events + * + * @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 events(): List = events.getRequired("events") + + /** + * PAYMENT - Payment 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 family(): Payment.Family = family.getRequired("family") + + /** + * Financial account token + * + * @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 financialAccountToken(): String = + financialAccountToken.getRequired("financial_account_token") + + /** + * Transfer method + * + * @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 method(): Payment.Method = method.getRequired("method") + + /** + * Method-specific attributes + * + * @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 methodAttributes(): Payment.MethodAttributes = + methodAttributes.getRequired("method_attributes") + + /** + * Pending amount in cents + * + * @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 pendingAmount(): Long = pendingAmount.getRequired("pending_amount") + + /** + * Account tokens related to a payment transaction + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun relatedAccountTokens(): Optional = + relatedAccountTokens.getOptional("related_account_tokens") + + /** + * Transaction result + * + * @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 result(): Payment.TransactionResult = result.getRequired("result") + + /** + * Settled amount in cents + * + * @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 settledAmount(): Long = settledAmount.getRequired("settled_amount") + + /** + * Transaction source + * + * @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 source(): Payment.Source = source.getRequired("source") + + /** + * The status of 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 status(): Payment.TransactionStatus = status.getRequired("status") + + /** + * ISO 8601 timestamp of when the transaction was last updated + * + * @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 updated(): OffsetDateTime = updated.getRequired("updated") + + /** + * Token of the blockchain recipient the payout is sent to + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun blockchainRecipientToken(): Optional = + blockchainRecipientToken.getOptional("blockchain_recipient_token") + + /** + * Currency of the transaction in ISO 4217 format + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun currency(): Optional = currency.getOptional("currency") + + /** + * Expected release date for the transaction + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun expectedReleaseDate(): Optional = + expectedReleaseDate.getOptional("expected_release_date") + + /** + * External bank account token + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalBankAccountToken(): Optional = + externalBankAccountToken.getOptional("external_bank_account_token") + + /** + * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata with a + * resource for your own purposes. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun tags(): Optional = tags.getOptional("tags") + + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun type(): Optional = type.getOptional("type") + + /** + * User-defined identifier + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun userDefinedId(): Optional = userDefinedId.getOptional("user_defined_id") + + /** + * Balance + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun balance(): Optional = balance.getOptional("balance") + + /** + * Returns the raw JSON value of [token]. + * + * Unlike [token], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("token") @ExcludeMissing fun _token(): JsonField = token + + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("category") + @ExcludeMissing + fun _category(): JsonField = category + + /** + * Returns the raw JSON value of [created]. + * + * Unlike [created], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created") @ExcludeMissing fun _created(): JsonField = created + + /** + * Returns the raw JSON value of [descriptor]. + * + * Unlike [descriptor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("descriptor") @ExcludeMissing fun _descriptor(): JsonField = descriptor + + /** + * Returns the raw JSON value of [direction]. + * + * Unlike [direction], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("direction") + @ExcludeMissing + fun _direction(): JsonField = direction + + /** + * Returns the raw JSON value of [events]. + * + * Unlike [events], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("events") + @ExcludeMissing + fun _events(): JsonField> = events + + /** + * Returns the raw JSON value of [family]. + * + * Unlike [family], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("family") @ExcludeMissing fun _family(): JsonField = family + + /** + * Returns the raw JSON value of [financialAccountToken]. + * + * Unlike [financialAccountToken], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken(): JsonField = financialAccountToken + + /** + * Returns the raw JSON value of [method]. + * + * Unlike [method], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("method") @ExcludeMissing fun _method(): JsonField = method + + /** + * Returns the raw JSON value of [methodAttributes]. + * + * Unlike [methodAttributes], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("method_attributes") + @ExcludeMissing + fun _methodAttributes(): JsonField = methodAttributes + + /** + * Returns the raw JSON value of [pendingAmount]. + * + * Unlike [pendingAmount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("pending_amount") + @ExcludeMissing + fun _pendingAmount(): JsonField = pendingAmount + + /** + * Returns the raw JSON value of [relatedAccountTokens]. + * + * Unlike [relatedAccountTokens], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("related_account_tokens") + @ExcludeMissing + fun _relatedAccountTokens(): JsonField = relatedAccountTokens + + /** + * Returns the raw JSON value of [result]. + * + * Unlike [result], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("result") + @ExcludeMissing + fun _result(): JsonField = result + + /** + * Returns the raw JSON value of [settledAmount]. + * + * Unlike [settledAmount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("settled_amount") + @ExcludeMissing + fun _settledAmount(): JsonField = settledAmount + + /** + * Returns the raw JSON value of [source]. + * + * Unlike [source], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("source") @ExcludeMissing fun _source(): JsonField = source + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") + @ExcludeMissing + fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [updated]. + * + * Unlike [updated], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated + + /** + * Returns the raw JSON value of [blockchainRecipientToken]. + * + * Unlike [blockchainRecipientToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + fun _blockchainRecipientToken(): JsonField = blockchainRecipientToken + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + + /** + * Returns the raw JSON value of [expectedReleaseDate]. + * + * Unlike [expectedReleaseDate], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("expected_release_date") + @ExcludeMissing + fun _expectedReleaseDate(): JsonField = expectedReleaseDate + + /** + * Returns the raw JSON value of [externalBankAccountToken]. + * + * Unlike [externalBankAccountToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("external_bank_account_token") + @ExcludeMissing + fun _externalBankAccountToken(): JsonField = externalBankAccountToken + + /** + * Returns the raw JSON value of [tags]. + * + * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField = tags + + /** + * 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 [userDefinedId]. + * + * Unlike [userDefinedId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("user_defined_id") + @ExcludeMissing + fun _userDefinedId(): JsonField = userDefinedId + + /** + * Returns the raw JSON value of [balance]. + * + * Unlike [balance], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("balance") @ExcludeMissing fun _balance(): JsonField = balance + + @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 + * [PaymentCreateStablecoinResponse]. + * + * The following fields are required: + * ```java + * .token() + * .category() + * .created() + * .descriptor() + * .direction() + * .events() + * .family() + * .financialAccountToken() + * .method() + * .methodAttributes() + * .pendingAmount() + * .relatedAccountTokens() + * .result() + * .settledAmount() + * .source() + * .status() + * .updated() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PaymentCreateStablecoinResponse]. */ + class Builder internal constructor() { + + private var token: JsonField? = null + private var category: JsonField? = null + private var created: JsonField? = null + private var descriptor: JsonField? = null + private var direction: JsonField? = null + private var events: JsonField>? = null + private var family: JsonField? = null + private var financialAccountToken: JsonField? = null + private var method: JsonField? = null + private var methodAttributes: JsonField? = null + private var pendingAmount: JsonField? = null + private var relatedAccountTokens: JsonField? = null + private var result: JsonField? = null + private var settledAmount: JsonField? = null + private var source: JsonField? = null + private var status: JsonField? = null + private var updated: JsonField? = null + private var blockchainRecipientToken: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var expectedReleaseDate: JsonField = JsonMissing.of() + private var externalBankAccountToken: JsonField = JsonMissing.of() + private var tags: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var userDefinedId: JsonField = JsonMissing.of() + private var balance: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(paymentCreateStablecoinResponse: PaymentCreateStablecoinResponse) = + apply { + token = paymentCreateStablecoinResponse.token + category = paymentCreateStablecoinResponse.category + created = paymentCreateStablecoinResponse.created + descriptor = paymentCreateStablecoinResponse.descriptor + direction = paymentCreateStablecoinResponse.direction + events = paymentCreateStablecoinResponse.events.map { it.toMutableList() } + family = paymentCreateStablecoinResponse.family + financialAccountToken = paymentCreateStablecoinResponse.financialAccountToken + method = paymentCreateStablecoinResponse.method + methodAttributes = paymentCreateStablecoinResponse.methodAttributes + pendingAmount = paymentCreateStablecoinResponse.pendingAmount + relatedAccountTokens = paymentCreateStablecoinResponse.relatedAccountTokens + result = paymentCreateStablecoinResponse.result + settledAmount = paymentCreateStablecoinResponse.settledAmount + source = paymentCreateStablecoinResponse.source + status = paymentCreateStablecoinResponse.status + updated = paymentCreateStablecoinResponse.updated + blockchainRecipientToken = paymentCreateStablecoinResponse.blockchainRecipientToken + currency = paymentCreateStablecoinResponse.currency + expectedReleaseDate = paymentCreateStablecoinResponse.expectedReleaseDate + externalBankAccountToken = paymentCreateStablecoinResponse.externalBankAccountToken + tags = paymentCreateStablecoinResponse.tags + type = paymentCreateStablecoinResponse.type + userDefinedId = paymentCreateStablecoinResponse.userDefinedId + balance = paymentCreateStablecoinResponse.balance + additionalProperties = + paymentCreateStablecoinResponse.additionalProperties.toMutableMap() + } + + /** Unique identifier for the transaction */ + fun token(token: String) = token(JsonField.of(token)) + + /** + * Sets [Builder.token] to an arbitrary JSON value. + * + * You should usually call [Builder.token] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun token(token: JsonField) = apply { this.token = token } + + /** Transaction category */ + fun category(category: Payment.TransactionCategory) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed + * [Payment.TransactionCategory] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun category(category: JsonField) = apply { + this.category = category + } + + /** ISO 8601 timestamp of when the transaction was created */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** + * Sets [Builder.created] to an arbitrary JSON value. + * + * You should usually call [Builder.created] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun created(created: JsonField) = apply { this.created = created } + + /** Transaction descriptor */ + fun descriptor(descriptor: String) = descriptor(JsonField.of(descriptor)) + + /** + * Sets [Builder.descriptor] to an arbitrary JSON value. + * + * You should usually call [Builder.descriptor] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun descriptor(descriptor: JsonField) = apply { this.descriptor = descriptor } + + /** Transfer direction */ + fun direction(direction: Payment.Direction) = direction(JsonField.of(direction)) + + /** + * Sets [Builder.direction] to an arbitrary JSON value. + * + * You should usually call [Builder.direction] with a well-typed [Payment.Direction] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun direction(direction: JsonField) = apply { + this.direction = direction + } + + /** List of transaction events */ + fun events(events: List) = events(JsonField.of(events)) + + /** + * Sets [Builder.events] to an arbitrary JSON value. + * + * You should usually call [Builder.events] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun events(events: JsonField>) = apply { + this.events = events.map { it.toMutableList() } + } + + /** + * Adds a single [Payment.PaymentEvent] to [events]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addEvent(event: Payment.PaymentEvent) = apply { + events = + (events ?: JsonField.of(mutableListOf())).also { + checkKnown("events", it).add(event) + } + } + + /** PAYMENT - Payment Transaction */ + fun family(family: Payment.Family) = family(JsonField.of(family)) + + /** + * Sets [Builder.family] to an arbitrary JSON value. + * + * You should usually call [Builder.family] with a well-typed [Payment.Family] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun family(family: JsonField) = apply { this.family = family } + + /** Financial account token */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** + * Sets [Builder.financialAccountToken] to an arbitrary JSON value. + * + * You should usually call [Builder.financialAccountToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** Transfer method */ + fun method(method: Payment.Method) = method(JsonField.of(method)) + + /** + * Sets [Builder.method] to an arbitrary JSON value. + * + * You should usually call [Builder.method] with a well-typed [Payment.Method] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun method(method: JsonField) = apply { this.method = method } + + /** Method-specific attributes */ + fun methodAttributes(methodAttributes: Payment.MethodAttributes) = + methodAttributes(JsonField.of(methodAttributes)) + + /** + * Sets [Builder.methodAttributes] to an arbitrary JSON value. + * + * You should usually call [Builder.methodAttributes] with a well-typed + * [Payment.MethodAttributes] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun methodAttributes(methodAttributes: JsonField) = apply { + this.methodAttributes = methodAttributes + } + + /** Alias for calling [methodAttributes] with `Payment.MethodAttributes.ofAch(ach)`. */ + fun methodAttributes(ach: Payment.MethodAttributes.AchMethodAttributes) = + methodAttributes(Payment.MethodAttributes.ofAch(ach)) + + /** Alias for calling [methodAttributes] with `Payment.MethodAttributes.ofWire(wire)`. */ + fun methodAttributes(wire: Payment.MethodAttributes.WireMethodAttributes) = + methodAttributes(Payment.MethodAttributes.ofWire(wire)) + + /** + * Alias for calling [methodAttributes] with + * `Payment.MethodAttributes.ofStablecoin(stablecoin)`. + */ + fun methodAttributes(stablecoin: Payment.MethodAttributes.StablecoinMethodAttributes) = + methodAttributes(Payment.MethodAttributes.ofStablecoin(stablecoin)) + + /** Pending amount in cents */ + fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) + + /** + * Sets [Builder.pendingAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.pendingAmount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun pendingAmount(pendingAmount: JsonField) = apply { + this.pendingAmount = pendingAmount + } + + /** Account tokens related to a payment transaction */ + fun relatedAccountTokens(relatedAccountTokens: Payment.RelatedAccountTokens?) = + relatedAccountTokens(JsonField.ofNullable(relatedAccountTokens)) + + /** + * Alias for calling [Builder.relatedAccountTokens] with + * `relatedAccountTokens.orElse(null)`. + */ + fun relatedAccountTokens(relatedAccountTokens: Optional) = + relatedAccountTokens(relatedAccountTokens.getOrNull()) + + /** + * Sets [Builder.relatedAccountTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.relatedAccountTokens] with a well-typed + * [Payment.RelatedAccountTokens] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun relatedAccountTokens(relatedAccountTokens: JsonField) = + apply { + this.relatedAccountTokens = relatedAccountTokens + } + + /** Transaction result */ + fun result(result: Payment.TransactionResult) = result(JsonField.of(result)) + + /** + * Sets [Builder.result] to an arbitrary JSON value. + * + * You should usually call [Builder.result] with a well-typed [Payment.TransactionResult] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun result(result: JsonField) = apply { this.result = result } + + /** Settled amount in cents */ + fun settledAmount(settledAmount: Long) = settledAmount(JsonField.of(settledAmount)) + + /** + * Sets [Builder.settledAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.settledAmount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun settledAmount(settledAmount: JsonField) = apply { + this.settledAmount = settledAmount + } + + /** Transaction source */ + fun source(source: Payment.Source) = source(JsonField.of(source)) + + /** + * Sets [Builder.source] to an arbitrary JSON value. + * + * You should usually call [Builder.source] with a well-typed [Payment.Source] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun source(source: JsonField) = apply { this.source = source } + + /** The status of the transaction */ + fun status(status: Payment.TransactionStatus) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Payment.TransactionStatus] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + /** ISO 8601 timestamp of when the transaction was last updated */ + fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) + + /** + * Sets [Builder.updated] to an arbitrary JSON value. + * + * You should usually call [Builder.updated] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun updated(updated: JsonField) = apply { this.updated = updated } + + /** Token of the blockchain recipient the payout is sent to */ + fun blockchainRecipientToken(blockchainRecipientToken: String?) = + blockchainRecipientToken(JsonField.ofNullable(blockchainRecipientToken)) + + /** + * Alias for calling [Builder.blockchainRecipientToken] with + * `blockchainRecipientToken.orElse(null)`. + */ + fun blockchainRecipientToken(blockchainRecipientToken: Optional) = + blockchainRecipientToken(blockchainRecipientToken.getOrNull()) + + /** + * Sets [Builder.blockchainRecipientToken] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainRecipientToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun blockchainRecipientToken(blockchainRecipientToken: JsonField) = apply { + this.blockchainRecipientToken = blockchainRecipientToken + } + + /** Currency of the transaction in ISO 4217 format */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** Expected release date for the transaction */ + fun expectedReleaseDate(expectedReleaseDate: LocalDate?) = + expectedReleaseDate(JsonField.ofNullable(expectedReleaseDate)) + + /** + * Alias for calling [Builder.expectedReleaseDate] with `expectedReleaseDate.orElse(null)`. + */ + fun expectedReleaseDate(expectedReleaseDate: Optional) = + expectedReleaseDate(expectedReleaseDate.getOrNull()) + + /** + * Sets [Builder.expectedReleaseDate] to an arbitrary JSON value. + * + * You should usually call [Builder.expectedReleaseDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun expectedReleaseDate(expectedReleaseDate: JsonField) = apply { + this.expectedReleaseDate = expectedReleaseDate + } + + /** External bank account token */ + fun externalBankAccountToken(externalBankAccountToken: String?) = + externalBankAccountToken(JsonField.ofNullable(externalBankAccountToken)) + + /** + * Alias for calling [Builder.externalBankAccountToken] with + * `externalBankAccountToken.orElse(null)`. + */ + fun externalBankAccountToken(externalBankAccountToken: Optional) = + externalBankAccountToken(externalBankAccountToken.getOrNull()) + + /** + * Sets [Builder.externalBankAccountToken] to an arbitrary JSON value. + * + * You should usually call [Builder.externalBankAccountToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { + this.externalBankAccountToken = externalBankAccountToken + } + + /** + * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata + * with a resource for your own purposes. + */ + fun tags(tags: Payment.Tags) = tags(JsonField.of(tags)) + + /** + * Sets [Builder.tags] to an arbitrary JSON value. + * + * You should usually call [Builder.tags] with a well-typed [Payment.Tags] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tags(tags: JsonField) = apply { this.tags = tags } + + fun type(type: Payment.TransferType) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [Payment.TransferType] 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 } + + /** User-defined identifier */ + fun userDefinedId(userDefinedId: String?) = + userDefinedId(JsonField.ofNullable(userDefinedId)) + + /** Alias for calling [Builder.userDefinedId] with `userDefinedId.orElse(null)`. */ + fun userDefinedId(userDefinedId: Optional) = + userDefinedId(userDefinedId.getOrNull()) + + /** + * Sets [Builder.userDefinedId] to an arbitrary JSON value. + * + * You should usually call [Builder.userDefinedId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun userDefinedId(userDefinedId: JsonField) = apply { + this.userDefinedId = userDefinedId + } + + /** Balance */ + fun balance(balance: Balance) = balance(JsonField.of(balance)) + + /** + * Sets [Builder.balance] to an arbitrary JSON value. + * + * You should usually call [Builder.balance] with a well-typed [Balance] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun balance(balance: JsonField) = apply { this.balance = balance } + + 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 [PaymentCreateStablecoinResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .token() + * .category() + * .created() + * .descriptor() + * .direction() + * .events() + * .family() + * .financialAccountToken() + * .method() + * .methodAttributes() + * .pendingAmount() + * .relatedAccountTokens() + * .result() + * .settledAmount() + * .source() + * .status() + * .updated() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PaymentCreateStablecoinResponse = + PaymentCreateStablecoinResponse( + checkRequired("token", token), + checkRequired("category", category), + checkRequired("created", created), + checkRequired("descriptor", descriptor), + checkRequired("direction", direction), + checkRequired("events", events).map { it.toImmutable() }, + checkRequired("family", family), + checkRequired("financialAccountToken", financialAccountToken), + checkRequired("method", method), + checkRequired("methodAttributes", methodAttributes), + checkRequired("pendingAmount", pendingAmount), + checkRequired("relatedAccountTokens", relatedAccountTokens), + checkRequired("result", result), + checkRequired("settledAmount", settledAmount), + checkRequired("source", source), + checkRequired("status", status), + checkRequired("updated", updated), + blockchainRecipientToken, + currency, + expectedReleaseDate, + externalBankAccountToken, + tags, + type, + userDefinedId, + balance, + 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(): PaymentCreateStablecoinResponse = apply { + if (validated) { + return@apply + } + + token() + category().validate() + created() + descriptor() + direction().validate() + events().forEach { it.validate() } + family().validate() + financialAccountToken() + method().validate() + methodAttributes().validate() + pendingAmount() + relatedAccountTokens().ifPresent { it.validate() } + result().validate() + settledAmount() + source().validate() + status().validate() + updated() + blockchainRecipientToken() + currency() + expectedReleaseDate() + externalBankAccountToken() + tags().ifPresent { it.validate() } + type().ifPresent { it.validate() } + userDefinedId() + balance().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 = + (if (token.asKnown().isPresent) 1 else 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (if (created.asKnown().isPresent) 1 else 0) + + (if (descriptor.asKnown().isPresent) 1 else 0) + + (direction.asKnown().getOrNull()?.validity() ?: 0) + + (events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (family.asKnown().getOrNull()?.validity() ?: 0) + + (if (financialAccountToken.asKnown().isPresent) 1 else 0) + + (method.asKnown().getOrNull()?.validity() ?: 0) + + (methodAttributes.asKnown().getOrNull()?.validity() ?: 0) + + (if (pendingAmount.asKnown().isPresent) 1 else 0) + + (relatedAccountTokens.asKnown().getOrNull()?.validity() ?: 0) + + (result.asKnown().getOrNull()?.validity() ?: 0) + + (if (settledAmount.asKnown().isPresent) 1 else 0) + + (source.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (if (updated.asKnown().isPresent) 1 else 0) + + (if (blockchainRecipientToken.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + (if (expectedReleaseDate.asKnown().isPresent) 1 else 0) + + (if (externalBankAccountToken.asKnown().isPresent) 1 else 0) + + (tags.asKnown().getOrNull()?.validity() ?: 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + (if (userDefinedId.asKnown().isPresent) 1 else 0) + + (balance.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentCreateStablecoinResponse && + token == other.token && + category == other.category && + created == other.created && + descriptor == other.descriptor && + direction == other.direction && + events == other.events && + family == other.family && + financialAccountToken == other.financialAccountToken && + method == other.method && + methodAttributes == other.methodAttributes && + pendingAmount == other.pendingAmount && + relatedAccountTokens == other.relatedAccountTokens && + result == other.result && + settledAmount == other.settledAmount && + source == other.source && + status == other.status && + updated == other.updated && + blockchainRecipientToken == other.blockchainRecipientToken && + currency == other.currency && + expectedReleaseDate == other.expectedReleaseDate && + externalBankAccountToken == other.externalBankAccountToken && + tags == other.tags && + type == other.type && + userDefinedId == other.userDefinedId && + balance == other.balance && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + token, + category, + created, + descriptor, + direction, + events, + family, + financialAccountToken, + method, + methodAttributes, + pendingAmount, + relatedAccountTokens, + result, + settledAmount, + source, + status, + updated, + blockchainRecipientToken, + currency, + expectedReleaseDate, + externalBankAccountToken, + tags, + type, + userDefinedId, + balance, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PaymentCreateStablecoinResponse{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, blockchainRecipientToken=$blockchainRecipientToken, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" +} 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 46abda514..c70f2e30e 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 @@ -371,12 +371,15 @@ private constructor( @JvmField val ACH = of("ACH") + @JvmField val STABLECOIN = of("STABLECOIN") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { - ACH + ACH, + STABLECOIN, } /** @@ -390,6 +393,7 @@ private constructor( */ enum class Value { ACH, + STABLECOIN, /** An enum member indicating that [Category] was instantiated with an unknown value. */ _UNKNOWN, } @@ -404,6 +408,7 @@ private constructor( fun value(): Value = when (this) { ACH -> Value.ACH + STABLECOIN -> Value.STABLECOIN else -> Value._UNKNOWN } @@ -419,6 +424,7 @@ private constructor( fun known(): Known = when (this) { ACH -> Known.ACH + STABLECOIN -> Known.STABLECOIN else -> throw LithicInvalidDataException("Unknown Category: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsync.kt index 2e0dd10da..8dc99dabc 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsync.kt @@ -8,6 +8,8 @@ import com.lithic.api.core.http.HttpResponseFor import com.lithic.api.models.Payment import com.lithic.api.models.PaymentCreateParams import com.lithic.api.models.PaymentCreateResponse +import com.lithic.api.models.PaymentCreateStablecoinParams +import com.lithic.api.models.PaymentCreateStablecoinResponse import com.lithic.api.models.PaymentListPageAsync import com.lithic.api.models.PaymentListParams import com.lithic.api.models.PaymentRetrieveParams @@ -39,7 +41,14 @@ interface PaymentServiceAsync { */ fun withOptions(modifier: Consumer): PaymentServiceAsync - /** Initiates a payment between a financial account and an external bank account. */ + /** + * Initiates an ACH payment between a financial account and an external bank account. + * + * This endpoint originates on the ACH rail only. To send a stablecoin payout, use the + * [Create stablecoin payment](https://docs.lithic.com/reference/createstablecoinpayment) + * endpoint. Payments on every rail are read back through + * [List payments](https://docs.lithic.com/reference/searchpayments). + */ fun create(params: PaymentCreateParams): CompletableFuture = create(params, RequestOptions.none()) @@ -99,6 +108,34 @@ interface PaymentServiceAsync { fun list(requestOptions: RequestOptions): CompletableFuture = list(PaymentListParams.none(), requestOptions) + /** + * Initiates a stablecoin payout from a financial account to a registered blockchain recipient. + * + * The recipient must have been registered with + * [Create blockchain recipient](https://docs.lithic.com/reference/createblockchainrecipient) + * and have completed address screening — only a recipient in the `ENABLED` verification state + * can receive a payout. The destination address and chain come from the recipient, so they are + * not supplied here. + * + * Only payouts are initiated through this endpoint. Stablecoin pay-ins are credited from + * on-chain deposits to a financial account's deposit address and are not created through the + * API. Funds are placed on hold when the payout is initiated, and a payout that fails on chain + * reverses that hold. A payout cannot be cancelled once it has been submitted on chain. + * + * This endpoint is only available to stablecoin-enabled programs. Contact your customer success + * manager to learn more. + */ + fun createStablecoin( + params: PaymentCreateStablecoinParams + ): CompletableFuture = + createStablecoin(params, RequestOptions.none()) + + /** @see createStablecoin */ + fun createStablecoin( + params: PaymentCreateStablecoinParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + /** Retry an origination which has been returned. */ fun retry(paymentToken: String): CompletableFuture = retry(paymentToken, PaymentRetryParams.none()) @@ -326,6 +363,21 @@ interface PaymentServiceAsync { ): CompletableFuture> = list(PaymentListParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `post /v1/payments/stablecoin`, but is otherwise the same + * as [PaymentServiceAsync.createStablecoin]. + */ + fun createStablecoin( + params: PaymentCreateStablecoinParams + ): CompletableFuture> = + createStablecoin(params, RequestOptions.none()) + + /** @see createStablecoin */ + fun createStablecoin( + params: PaymentCreateStablecoinParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + /** * Returns a raw HTTP response for `post /v1/payments/{payment_token}/retry`, but is * otherwise the same as [PaymentServiceAsync.retry]. diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsyncImpl.kt index 5ccec83c1..992d731c1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsyncImpl.kt @@ -19,6 +19,8 @@ import com.lithic.api.core.prepareAsync import com.lithic.api.models.Payment import com.lithic.api.models.PaymentCreateParams import com.lithic.api.models.PaymentCreateResponse +import com.lithic.api.models.PaymentCreateStablecoinParams +import com.lithic.api.models.PaymentCreateStablecoinResponse import com.lithic.api.models.PaymentListPageAsync import com.lithic.api.models.PaymentListPageResponse import com.lithic.api.models.PaymentListParams @@ -71,6 +73,13 @@ class PaymentServiceAsyncImpl internal constructor(private val clientOptions: Cl // get /v1/payments withRawResponse().list(params, requestOptions).thenApply { it.parse() } + override fun createStablecoin( + params: PaymentCreateStablecoinParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /v1/payments/stablecoin + withRawResponse().createStablecoin(params, requestOptions).thenApply { it.parse() } + override fun retry( params: PaymentRetryParams, requestOptions: RequestOptions, @@ -228,6 +237,37 @@ class PaymentServiceAsyncImpl internal constructor(private val clientOptions: Cl } } + private val createStablecoinHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun createStablecoin( + params: PaymentCreateStablecoinParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "payments", "stablecoin") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createStablecoinHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val retryHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentService.kt index f9120c5e5..f9961d83e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentService.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentService.kt @@ -9,6 +9,8 @@ import com.lithic.api.core.http.HttpResponseFor import com.lithic.api.models.Payment import com.lithic.api.models.PaymentCreateParams import com.lithic.api.models.PaymentCreateResponse +import com.lithic.api.models.PaymentCreateStablecoinParams +import com.lithic.api.models.PaymentCreateStablecoinResponse import com.lithic.api.models.PaymentListPage import com.lithic.api.models.PaymentListParams import com.lithic.api.models.PaymentRetrieveParams @@ -39,7 +41,14 @@ interface PaymentService { */ fun withOptions(modifier: Consumer): PaymentService - /** Initiates a payment between a financial account and an external bank account. */ + /** + * Initiates an ACH payment between a financial account and an external bank account. + * + * This endpoint originates on the ACH rail only. To send a stablecoin payout, use the + * [Create stablecoin payment](https://docs.lithic.com/reference/createstablecoinpayment) + * endpoint. Payments on every rail are read back through + * [List payments](https://docs.lithic.com/reference/searchpayments). + */ fun create(params: PaymentCreateParams): PaymentCreateResponse = create(params, RequestOptions.none()) @@ -96,6 +105,32 @@ interface PaymentService { fun list(requestOptions: RequestOptions): PaymentListPage = list(PaymentListParams.none(), requestOptions) + /** + * Initiates a stablecoin payout from a financial account to a registered blockchain recipient. + * + * The recipient must have been registered with + * [Create blockchain recipient](https://docs.lithic.com/reference/createblockchainrecipient) + * and have completed address screening — only a recipient in the `ENABLED` verification state + * can receive a payout. The destination address and chain come from the recipient, so they are + * not supplied here. + * + * Only payouts are initiated through this endpoint. Stablecoin pay-ins are credited from + * on-chain deposits to a financial account's deposit address and are not created through the + * API. Funds are placed on hold when the payout is initiated, and a payout that fails on chain + * reverses that hold. A payout cannot be cancelled once it has been submitted on chain. + * + * This endpoint is only available to stablecoin-enabled programs. Contact your customer success + * manager to learn more. + */ + fun createStablecoin(params: PaymentCreateStablecoinParams): PaymentCreateStablecoinResponse = + createStablecoin(params, RequestOptions.none()) + + /** @see createStablecoin */ + fun createStablecoin( + params: PaymentCreateStablecoinParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PaymentCreateStablecoinResponse + /** Retry an origination which has been returned. */ fun retry(paymentToken: String): PaymentRetryResponse = retry(paymentToken, PaymentRetryParams.none()) @@ -309,6 +344,23 @@ interface PaymentService { fun list(requestOptions: RequestOptions): HttpResponseFor = list(PaymentListParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `post /v1/payments/stablecoin`, but is otherwise the same + * as [PaymentService.createStablecoin]. + */ + @MustBeClosed + fun createStablecoin( + params: PaymentCreateStablecoinParams + ): HttpResponseFor = + createStablecoin(params, RequestOptions.none()) + + /** @see createStablecoin */ + @MustBeClosed + fun createStablecoin( + params: PaymentCreateStablecoinParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + /** * Returns a raw HTTP response for `post /v1/payments/{payment_token}/retry`, but is * otherwise the same as [PaymentService.retry]. diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentServiceImpl.kt index 7ab67081a..318f47886 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentServiceImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentServiceImpl.kt @@ -19,6 +19,8 @@ import com.lithic.api.core.prepare import com.lithic.api.models.Payment import com.lithic.api.models.PaymentCreateParams import com.lithic.api.models.PaymentCreateResponse +import com.lithic.api.models.PaymentCreateStablecoinParams +import com.lithic.api.models.PaymentCreateStablecoinResponse import com.lithic.api.models.PaymentListPage import com.lithic.api.models.PaymentListPageResponse import com.lithic.api.models.PaymentListParams @@ -64,6 +66,13 @@ class PaymentServiceImpl internal constructor(private val clientOptions: ClientO // get /v1/payments withRawResponse().list(params, requestOptions).parse() + override fun createStablecoin( + params: PaymentCreateStablecoinParams, + requestOptions: RequestOptions, + ): PaymentCreateStablecoinResponse = + // post /v1/payments/stablecoin + withRawResponse().createStablecoin(params, requestOptions).parse() + override fun retry( params: PaymentRetryParams, requestOptions: RequestOptions, @@ -208,6 +217,34 @@ class PaymentServiceImpl internal constructor(private val clientOptions: ClientO } } + private val createStablecoinHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun createStablecoin( + params: PaymentCreateStablecoinParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "payments", "stablecoin") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createStablecoinHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val retryHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateStablecoinParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateStablecoinParamsTest.kt new file mode 100644 index 000000000..a9a26d3f1 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateStablecoinParamsTest.kt @@ -0,0 +1,79 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class PaymentCreateStablecoinParamsTest { + + @Test + fun create() { + PaymentCreateStablecoinParams.builder() + .amount(1588L) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + .financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d") + .type(PaymentCreateStablecoinParams.Type.PAYMENT) + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .hold( + PaymentCreateStablecoinParams.Hold.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + .memo("Vendor payout") + .build() + } + + @Test + fun body() { + val params = + PaymentCreateStablecoinParams.builder() + .amount(1588L) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + .financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d") + .type(PaymentCreateStablecoinParams.Type.PAYMENT) + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .hold( + PaymentCreateStablecoinParams.Hold.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + .memo("Vendor payout") + .build() + + val body = params._body() + + assertThat(body.amount()).isEqualTo(1588L) + assertThat(body.blockchainRecipientToken()) + .isEqualTo("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + assertThat(body.financialAccountToken()).isEqualTo("35b0c466-a3e3-519a-9549-ead6a6a2277d") + assertThat(body.type()).isEqualTo(PaymentCreateStablecoinParams.Type.PAYMENT) + assertThat(body.token()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(body.hold()) + .contains( + PaymentCreateStablecoinParams.Hold.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + assertThat(body.memo()).contains("Vendor payout") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + PaymentCreateStablecoinParams.builder() + .amount(1588L) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + .financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d") + .type(PaymentCreateStablecoinParams.Type.PAYMENT) + .build() + + val body = params._body() + + assertThat(body.amount()).isEqualTo(1588L) + assertThat(body.blockchainRecipientToken()) + .isEqualTo("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + assertThat(body.financialAccountToken()).isEqualTo("35b0c466-a3e3-519a-9549-ead6a6a2277d") + assertThat(body.type()).isEqualTo(PaymentCreateStablecoinParams.Type.PAYMENT) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateStablecoinResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateStablecoinResponseTest.kt new file mode 100644 index 000000000..c65c85a60 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateStablecoinResponseTest.kt @@ -0,0 +1,296 @@ +// 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 java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class PaymentCreateStablecoinResponseTest { + + @Test + fun create() { + val paymentCreateStablecoinResponse = + PaymentCreateStablecoinResponse.builder() + .token("bd4efddb-771b-49e3-9af9-49b077ab5eb8") + .category(Payment.TransactionCategory.ACH) + .created(OffsetDateTime.parse("2025-10-27T20:12:22Z")) + .descriptor("ach_origination_credit") + .direction(Payment.Direction.CREDIT) + .addEvent( + Payment.PaymentEvent.builder() + .token("327dccc3-fe42-54d2-962c-7f8135805464") + .amount(-1588L) + .created(OffsetDateTime.parse("2025-10-27T20:12:22Z")) + .result(Payment.PaymentEvent.Result.APPROVED) + .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) + .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") + .build() + ) + .addEvent( + Payment.PaymentEvent.builder() + .token("f9165477-7cfc-53c6-98f1-84e9ec856a60") + .amount(-1588L) + .created(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .result(Payment.PaymentEvent.Result.APPROVED) + .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) + .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") + .build() + ) + .family(Payment.Family.PAYMENT) + .financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d") + .method(Payment.Method.ACH_NEXT_DAY) + .methodAttributes( + Payment.MethodAttributes.AchMethodAttributes.builder() + .secCode(Payment.MethodAttributes.AchMethodAttributes.SecCode.CCD) + .achHoldPeriod(1L) + .addenda(null) + .companyId("1111111111") + .overrideCompanyName("override_company_name") + .receiptRoutingNumber(null) + .recipientName(null) + .retries(0L) + .returnReasonCode(null) + .addTraceNumber("string") + .build() + ) + .pendingAmount(-1588L) + .relatedAccountTokens( + Payment.RelatedAccountTokens.builder() + .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .businessAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + .result(Payment.TransactionResult.APPROVED) + .settledAmount(0L) + .source(Payment.Source.LITHIC) + .status(Payment.TransactionStatus.PENDING) + .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + .currency("USD") + .expectedReleaseDate(null) + .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") + .tags( + Payment.Tags.builder() + .putAdditionalProperty("risk-level", JsonValue.from("high")) + .build() + ) + .type(Payment.TransferType.ORIGINATION_CREDIT) + .userDefinedId(null) + .balance( + Balance.builder() + .availableAmount(0L) + .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .currency("currency") + .financialAccountToken("3fa85f64-5717-4562-b3fc-2c963f66afa6") + .financialAccountType(Balance.FinancialAccountType.CARD) + .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .pendingAmount(0L) + .totalAmount(0L) + .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .build() + + assertThat(paymentCreateStablecoinResponse.token()) + .isEqualTo("bd4efddb-771b-49e3-9af9-49b077ab5eb8") + assertThat(paymentCreateStablecoinResponse.category()) + .isEqualTo(Payment.TransactionCategory.ACH) + assertThat(paymentCreateStablecoinResponse.created()) + .isEqualTo(OffsetDateTime.parse("2025-10-27T20:12:22Z")) + assertThat(paymentCreateStablecoinResponse.descriptor()).isEqualTo("ach_origination_credit") + assertThat(paymentCreateStablecoinResponse.direction()).isEqualTo(Payment.Direction.CREDIT) + assertThat(paymentCreateStablecoinResponse.events()) + .containsExactly( + Payment.PaymentEvent.builder() + .token("327dccc3-fe42-54d2-962c-7f8135805464") + .amount(-1588L) + .created(OffsetDateTime.parse("2025-10-27T20:12:22Z")) + .result(Payment.PaymentEvent.Result.APPROVED) + .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) + .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") + .build(), + Payment.PaymentEvent.builder() + .token("f9165477-7cfc-53c6-98f1-84e9ec856a60") + .amount(-1588L) + .created(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .result(Payment.PaymentEvent.Result.APPROVED) + .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) + .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") + .build(), + ) + assertThat(paymentCreateStablecoinResponse.family()).isEqualTo(Payment.Family.PAYMENT) + assertThat(paymentCreateStablecoinResponse.financialAccountToken()) + .isEqualTo("35b0c466-a3e3-519a-9549-ead6a6a2277d") + assertThat(paymentCreateStablecoinResponse.method()).isEqualTo(Payment.Method.ACH_NEXT_DAY) + assertThat(paymentCreateStablecoinResponse.methodAttributes()) + .isEqualTo( + Payment.MethodAttributes.ofAch( + Payment.MethodAttributes.AchMethodAttributes.builder() + .secCode(Payment.MethodAttributes.AchMethodAttributes.SecCode.CCD) + .achHoldPeriod(1L) + .addenda(null) + .companyId("1111111111") + .overrideCompanyName("override_company_name") + .receiptRoutingNumber(null) + .recipientName(null) + .retries(0L) + .returnReasonCode(null) + .addTraceNumber("string") + .build() + ) + ) + assertThat(paymentCreateStablecoinResponse.pendingAmount()).isEqualTo(-1588L) + assertThat(paymentCreateStablecoinResponse.relatedAccountTokens()) + .contains( + Payment.RelatedAccountTokens.builder() + .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .businessAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + assertThat(paymentCreateStablecoinResponse.result()) + .isEqualTo(Payment.TransactionResult.APPROVED) + assertThat(paymentCreateStablecoinResponse.settledAmount()).isEqualTo(0L) + assertThat(paymentCreateStablecoinResponse.source()).isEqualTo(Payment.Source.LITHIC) + assertThat(paymentCreateStablecoinResponse.status()) + .isEqualTo(Payment.TransactionStatus.PENDING) + assertThat(paymentCreateStablecoinResponse.updated()) + .isEqualTo(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + assertThat(paymentCreateStablecoinResponse.blockchainRecipientToken()) + .contains("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + assertThat(paymentCreateStablecoinResponse.currency()).contains("USD") + assertThat(paymentCreateStablecoinResponse.expectedReleaseDate()).isEmpty + assertThat(paymentCreateStablecoinResponse.externalBankAccountToken()) + .contains("feb4fee1-2414-4c38-a5f6-9deac293c8f4") + assertThat(paymentCreateStablecoinResponse.tags()) + .contains( + Payment.Tags.builder() + .putAdditionalProperty("risk-level", JsonValue.from("high")) + .build() + ) + assertThat(paymentCreateStablecoinResponse.type()) + .contains(Payment.TransferType.ORIGINATION_CREDIT) + assertThat(paymentCreateStablecoinResponse.userDefinedId()).isEmpty + assertThat(paymentCreateStablecoinResponse.balance()) + .contains( + Balance.builder() + .availableAmount(0L) + .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .currency("currency") + .financialAccountToken("3fa85f64-5717-4562-b3fc-2c963f66afa6") + .financialAccountType(Balance.FinancialAccountType.CARD) + .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .pendingAmount(0L) + .totalAmount(0L) + .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val paymentCreateStablecoinResponse = + PaymentCreateStablecoinResponse.builder() + .token("bd4efddb-771b-49e3-9af9-49b077ab5eb8") + .category(Payment.TransactionCategory.ACH) + .created(OffsetDateTime.parse("2025-10-27T20:12:22Z")) + .descriptor("ach_origination_credit") + .direction(Payment.Direction.CREDIT) + .addEvent( + Payment.PaymentEvent.builder() + .token("327dccc3-fe42-54d2-962c-7f8135805464") + .amount(-1588L) + .created(OffsetDateTime.parse("2025-10-27T20:12:22Z")) + .result(Payment.PaymentEvent.Result.APPROVED) + .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) + .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") + .build() + ) + .addEvent( + Payment.PaymentEvent.builder() + .token("f9165477-7cfc-53c6-98f1-84e9ec856a60") + .amount(-1588L) + .created(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .result(Payment.PaymentEvent.Result.APPROVED) + .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) + .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") + .build() + ) + .family(Payment.Family.PAYMENT) + .financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d") + .method(Payment.Method.ACH_NEXT_DAY) + .methodAttributes( + Payment.MethodAttributes.AchMethodAttributes.builder() + .secCode(Payment.MethodAttributes.AchMethodAttributes.SecCode.CCD) + .achHoldPeriod(1L) + .addenda(null) + .companyId("1111111111") + .overrideCompanyName("override_company_name") + .receiptRoutingNumber(null) + .recipientName(null) + .retries(0L) + .returnReasonCode(null) + .addTraceNumber("string") + .build() + ) + .pendingAmount(-1588L) + .relatedAccountTokens( + Payment.RelatedAccountTokens.builder() + .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .businessAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + .result(Payment.TransactionResult.APPROVED) + .settledAmount(0L) + .source(Payment.Source.LITHIC) + .status(Payment.TransactionStatus.PENDING) + .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + .currency("USD") + .expectedReleaseDate(null) + .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") + .tags( + Payment.Tags.builder() + .putAdditionalProperty("risk-level", JsonValue.from("high")) + .build() + ) + .type(Payment.TransferType.ORIGINATION_CREDIT) + .userDefinedId(null) + .balance( + Balance.builder() + .availableAmount(0L) + .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .currency("currency") + .financialAccountToken("3fa85f64-5717-4562-b3fc-2c963f66afa6") + .financialAccountType(Balance.FinancialAccountType.CARD) + .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .pendingAmount(0L) + .totalAmount(0L) + .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .build() + + val roundtrippedPaymentCreateStablecoinResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(paymentCreateStablecoinResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedPaymentCreateStablecoinResponse) + .isEqualTo(paymentCreateStablecoinResponse) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/PaymentServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/PaymentServiceAsyncTest.kt index 45c7d5e53..db58bab23 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/PaymentServiceAsyncTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/PaymentServiceAsyncTest.kt @@ -5,6 +5,7 @@ package com.lithic.api.services.async import com.lithic.api.TestServerExtension import com.lithic.api.client.okhttp.LithicOkHttpClientAsync import com.lithic.api.models.PaymentCreateParams +import com.lithic.api.models.PaymentCreateStablecoinParams import com.lithic.api.models.PaymentReturnParams import com.lithic.api.models.PaymentSimulateActionParams import com.lithic.api.models.PaymentSimulateReceiptParams @@ -87,6 +88,36 @@ internal class PaymentServiceAsyncTest { page.response().validate() } + @Test + fun createStablecoin() { + val client = + LithicOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val paymentServiceAsync = client.payments() + + val responseFuture = + paymentServiceAsync.createStablecoin( + PaymentCreateStablecoinParams.builder() + .amount(1588L) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + .financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d") + .type(PaymentCreateStablecoinParams.Type.PAYMENT) + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .hold( + PaymentCreateStablecoinParams.Hold.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + .memo("Vendor payout") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Test fun retry() { val client = diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt index 06ff46221..94df014ab 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt @@ -5,6 +5,7 @@ package com.lithic.api.services.blocking import com.lithic.api.TestServerExtension import com.lithic.api.client.okhttp.LithicOkHttpClient import com.lithic.api.models.PaymentCreateParams +import com.lithic.api.models.PaymentCreateStablecoinParams import com.lithic.api.models.PaymentReturnParams import com.lithic.api.models.PaymentSimulateActionParams import com.lithic.api.models.PaymentSimulateReceiptParams @@ -84,6 +85,35 @@ internal class PaymentServiceTest { page.response().validate() } + @Test + fun createStablecoin() { + val client = + LithicOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val paymentService = client.payments() + + val response = + paymentService.createStablecoin( + PaymentCreateStablecoinParams.builder() + .amount(1588L) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") + .financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d") + .type(PaymentCreateStablecoinParams.Type.PAYMENT) + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .hold( + PaymentCreateStablecoinParams.Hold.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + .memo("Vendor payout") + .build() + ) + + response.validate() + } + @Test fun retry() { val client = From 97fabed2eefe8fe7c76fa4c45a66ed8495a28f9d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Sep 2026 17:04:28 +0000 Subject: [PATCH 4/7] feat: TRE-14349: add installment plan management operation event types --- .stats.yml | 4 ++-- .../kotlin/com/lithic/api/models/FinancialEvent.kt | 12 ++++++++++++ .../api/models/ManagementOperationCreateParams.kt | 12 ++++++++++++ .../api/models/ManagementOperationTransaction.kt | 12 ++++++++++++ .../com/lithic/api/models/StatementLineItems.kt | 12 ++++++++++++ 5 files changed, 50 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3bbc47373..d5cfb7940 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 217 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-70147140a7b2043acf622024eb3bde9b04264f8e9a695d4c79b5ee4db1534518.yml -openapi_spec_hash: 7a181cb1cfaaa201143bd9d04a841a2e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-17e70cd484ec2fc2aca1243462ac8849153dbbe9b9245959ff51681b14f74024.yml +openapi_spec_hash: cc75e169c1c5ddc9ed619de07ee94d70 config_hash: e95c2dda5d175f9316457e0a84e35dce 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 b08c57268..4b94db71d 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 @@ -589,6 +589,10 @@ private constructor( @JvmField val FINANCIAL_CREDIT_AUTHORIZATION = of("FINANCIAL_CREDIT_AUTHORIZATION") + @JvmField val INSTALLMENT_FEE = of("INSTALLMENT_FEE") + + @JvmField val INSTALLMENT_FEE_REVERSAL = of("INSTALLMENT_FEE_REVERSAL") + @JvmField val INTEREST = of("INTEREST") @JvmField val INTEREST_REVERSAL = of("INTEREST_REVERSAL") @@ -726,6 +730,8 @@ private constructor( EXTERNAL_WIRE_SETTLED, FINANCIAL_AUTHORIZATION, FINANCIAL_CREDIT_AUTHORIZATION, + INSTALLMENT_FEE, + INSTALLMENT_FEE_REVERSAL, INTEREST, INTEREST_REVERSAL, INTERNAL_ADJUSTMENT, @@ -839,6 +845,8 @@ private constructor( EXTERNAL_WIRE_SETTLED, FINANCIAL_AUTHORIZATION, FINANCIAL_CREDIT_AUTHORIZATION, + INSTALLMENT_FEE, + INSTALLMENT_FEE_REVERSAL, INTEREST, INTEREST_REVERSAL, INTERNAL_ADJUSTMENT, @@ -956,6 +964,8 @@ private constructor( EXTERNAL_WIRE_SETTLED -> Value.EXTERNAL_WIRE_SETTLED FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION FINANCIAL_CREDIT_AUTHORIZATION -> Value.FINANCIAL_CREDIT_AUTHORIZATION + INSTALLMENT_FEE -> Value.INSTALLMENT_FEE + INSTALLMENT_FEE_REVERSAL -> Value.INSTALLMENT_FEE_REVERSAL INTEREST -> Value.INTEREST INTEREST_REVERSAL -> Value.INTEREST_REVERSAL INTERNAL_ADJUSTMENT -> Value.INTERNAL_ADJUSTMENT @@ -1071,6 +1081,8 @@ private constructor( EXTERNAL_WIRE_SETTLED -> Known.EXTERNAL_WIRE_SETTLED FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION FINANCIAL_CREDIT_AUTHORIZATION -> Known.FINANCIAL_CREDIT_AUTHORIZATION + INSTALLMENT_FEE -> Known.INSTALLMENT_FEE + INSTALLMENT_FEE_REVERSAL -> Known.INSTALLMENT_FEE_REVERSAL INTEREST -> Known.INTEREST INTEREST_REVERSAL -> Known.INTEREST_REVERSAL INTERNAL_ADJUSTMENT -> Known.INTERNAL_ADJUSTMENT 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 f84492a1d..ba4e95fb7 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 @@ -1449,6 +1449,10 @@ private constructor( @JvmField val INTEREST_REVERSAL = of("INTEREST_REVERSAL") + @JvmField val INSTALLMENT_FEE = of("INSTALLMENT_FEE") + + @JvmField val INSTALLMENT_FEE_REVERSAL = of("INSTALLMENT_FEE_REVERSAL") + @JvmField val LATE_PAYMENT = of("LATE_PAYMENT") @JvmField val LATE_PAYMENT_REVERSAL = of("LATE_PAYMENT_REVERSAL") @@ -1497,6 +1501,8 @@ private constructor( CURRENCY_CONVERSION_REVERSAL, INTEREST, INTEREST_REVERSAL, + INSTALLMENT_FEE, + INSTALLMENT_FEE_REVERSAL, LATE_PAYMENT, LATE_PAYMENT_REVERSAL, BILLING_ERROR, @@ -1536,6 +1542,8 @@ private constructor( CURRENCY_CONVERSION_REVERSAL, INTEREST, INTEREST_REVERSAL, + INSTALLMENT_FEE, + INSTALLMENT_FEE_REVERSAL, LATE_PAYMENT, LATE_PAYMENT_REVERSAL, BILLING_ERROR, @@ -1577,6 +1585,8 @@ private constructor( CURRENCY_CONVERSION_REVERSAL -> Value.CURRENCY_CONVERSION_REVERSAL INTEREST -> Value.INTEREST INTEREST_REVERSAL -> Value.INTEREST_REVERSAL + INSTALLMENT_FEE -> Value.INSTALLMENT_FEE + INSTALLMENT_FEE_REVERSAL -> Value.INSTALLMENT_FEE_REVERSAL LATE_PAYMENT -> Value.LATE_PAYMENT LATE_PAYMENT_REVERSAL -> Value.LATE_PAYMENT_REVERSAL BILLING_ERROR -> Value.BILLING_ERROR @@ -1616,6 +1626,8 @@ private constructor( CURRENCY_CONVERSION_REVERSAL -> Known.CURRENCY_CONVERSION_REVERSAL INTEREST -> Known.INTEREST INTEREST_REVERSAL -> Known.INTEREST_REVERSAL + INSTALLMENT_FEE -> Known.INSTALLMENT_FEE + INSTALLMENT_FEE_REVERSAL -> Known.INSTALLMENT_FEE_REVERSAL LATE_PAYMENT -> Known.LATE_PAYMENT LATE_PAYMENT_REVERSAL -> Known.LATE_PAYMENT_REVERSAL BILLING_ERROR -> Known.BILLING_ERROR 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 744006b8a..aa9c2c882 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 @@ -2013,6 +2013,10 @@ private constructor( @JvmField val INTEREST_REVERSAL = of("INTEREST_REVERSAL") + @JvmField val INSTALLMENT_FEE = of("INSTALLMENT_FEE") + + @JvmField val INSTALLMENT_FEE_REVERSAL = of("INSTALLMENT_FEE_REVERSAL") + @JvmField val LATE_PAYMENT = of("LATE_PAYMENT") @JvmField val LATE_PAYMENT_REVERSAL = of("LATE_PAYMENT_REVERSAL") @@ -2061,6 +2065,8 @@ private constructor( CURRENCY_CONVERSION_REVERSAL, INTEREST, INTEREST_REVERSAL, + INSTALLMENT_FEE, + INSTALLMENT_FEE_REVERSAL, LATE_PAYMENT, LATE_PAYMENT_REVERSAL, BILLING_ERROR, @@ -2100,6 +2106,8 @@ private constructor( CURRENCY_CONVERSION_REVERSAL, INTEREST, INTEREST_REVERSAL, + INSTALLMENT_FEE, + INSTALLMENT_FEE_REVERSAL, LATE_PAYMENT, LATE_PAYMENT_REVERSAL, BILLING_ERROR, @@ -2141,6 +2149,8 @@ private constructor( CURRENCY_CONVERSION_REVERSAL -> Value.CURRENCY_CONVERSION_REVERSAL INTEREST -> Value.INTEREST INTEREST_REVERSAL -> Value.INTEREST_REVERSAL + INSTALLMENT_FEE -> Value.INSTALLMENT_FEE + INSTALLMENT_FEE_REVERSAL -> Value.INSTALLMENT_FEE_REVERSAL LATE_PAYMENT -> Value.LATE_PAYMENT LATE_PAYMENT_REVERSAL -> Value.LATE_PAYMENT_REVERSAL BILLING_ERROR -> Value.BILLING_ERROR @@ -2180,6 +2190,8 @@ private constructor( CURRENCY_CONVERSION_REVERSAL -> Known.CURRENCY_CONVERSION_REVERSAL INTEREST -> Known.INTEREST INTEREST_REVERSAL -> Known.INTEREST_REVERSAL + INSTALLMENT_FEE -> Known.INSTALLMENT_FEE + INSTALLMENT_FEE_REVERSAL -> Known.INSTALLMENT_FEE_REVERSAL LATE_PAYMENT -> Known.LATE_PAYMENT LATE_PAYMENT_REVERSAL -> Known.LATE_PAYMENT_REVERSAL BILLING_ERROR -> Known.BILLING_ERROR 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 e23f281a6..08d72aa9d 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 @@ -1373,6 +1373,10 @@ private constructor( @JvmField val FINANCIAL_CREDIT_AUTHORIZATION = of("FINANCIAL_CREDIT_AUTHORIZATION") + @JvmField val INSTALLMENT_FEE = of("INSTALLMENT_FEE") + + @JvmField val INSTALLMENT_FEE_REVERSAL = of("INSTALLMENT_FEE_REVERSAL") + @JvmField val INTEREST = of("INTEREST") @JvmField val INTEREST_REVERSAL = of("INTEREST_REVERSAL") @@ -1510,6 +1514,8 @@ private constructor( EXTERNAL_WIRE_SETTLED, FINANCIAL_AUTHORIZATION, FINANCIAL_CREDIT_AUTHORIZATION, + INSTALLMENT_FEE, + INSTALLMENT_FEE_REVERSAL, INTEREST, INTEREST_REVERSAL, INTERNAL_ADJUSTMENT, @@ -1625,6 +1631,8 @@ private constructor( EXTERNAL_WIRE_SETTLED, FINANCIAL_AUTHORIZATION, FINANCIAL_CREDIT_AUTHORIZATION, + INSTALLMENT_FEE, + INSTALLMENT_FEE_REVERSAL, INTEREST, INTEREST_REVERSAL, INTERNAL_ADJUSTMENT, @@ -1742,6 +1750,8 @@ private constructor( EXTERNAL_WIRE_SETTLED -> Value.EXTERNAL_WIRE_SETTLED FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION FINANCIAL_CREDIT_AUTHORIZATION -> Value.FINANCIAL_CREDIT_AUTHORIZATION + INSTALLMENT_FEE -> Value.INSTALLMENT_FEE + INSTALLMENT_FEE_REVERSAL -> Value.INSTALLMENT_FEE_REVERSAL INTEREST -> Value.INTEREST INTEREST_REVERSAL -> Value.INTEREST_REVERSAL INTERNAL_ADJUSTMENT -> Value.INTERNAL_ADJUSTMENT @@ -1857,6 +1867,8 @@ private constructor( EXTERNAL_WIRE_SETTLED -> Known.EXTERNAL_WIRE_SETTLED FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION FINANCIAL_CREDIT_AUTHORIZATION -> Known.FINANCIAL_CREDIT_AUTHORIZATION + INSTALLMENT_FEE -> Known.INSTALLMENT_FEE + INSTALLMENT_FEE_REVERSAL -> Known.INSTALLMENT_FEE_REVERSAL INTEREST -> Known.INTEREST INTEREST_REVERSAL -> Known.INTEREST_REVERSAL INTERNAL_ADJUSTMENT -> Known.INTERNAL_ADJUSTMENT From 5cdc715990d26e494c33d6dfd5bd6581ce21b6c7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Sep 2026 17:56:52 +0000 Subject: [PATCH 5/7] feat: Add missing blockchain/stablecoin endpoints to the spec --- .stats.yml | 8 +- .../BlockchainRecipientRetrieveParams.kt | 211 ++++++++++++++++++ .../async/BlockchainRecipientServiceAsync.kt | 97 ++++++++ .../BlockchainRecipientServiceAsyncImpl.kt | 43 ++++ .../blocking/BlockchainRecipientService.kt | 98 ++++++++ .../BlockchainRecipientServiceImpl.kt | 40 ++++ .../BlockchainRecipientRetrieveParamsTest.kt | 28 +++ .../BlockchainRecipientServiceAsyncTest.kt | 16 ++ .../BlockchainRecipientServiceTest.kt | 15 ++ 9 files changed, 552 insertions(+), 4 deletions(-) create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParams.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParamsTest.kt diff --git a/.stats.yml b/.stats.yml index d5cfb7940..a8ba03900 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 217 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-17e70cd484ec2fc2aca1243462ac8849153dbbe9b9245959ff51681b14f74024.yml -openapi_spec_hash: cc75e169c1c5ddc9ed619de07ee94d70 -config_hash: e95c2dda5d175f9316457e0a84e35dce +configured_endpoints: 218 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-c4c2ee9eddaa18ab29ef2d881e7c373d214d167b3eb7a74559f862ce36e95f74.yml +openapi_spec_hash: 3b1897cb075e1f19e2ce33e95781656a +config_hash: b314c3c5c82a483d1a7812b31b1d1fc4 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParams.kt new file mode 100644 index 000000000..cd0557c62 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParams.kt @@ -0,0 +1,211 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.lithic.api.core.Params +import com.lithic.api.core.http.Headers +import com.lithic.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Get a blockchain recipient by token + * + * Use this to poll the `verification_state` after registering an address: a recipient cannot + * receive a payout until screening completes and moves it out of `PENDING` + */ +class BlockchainRecipientRetrieveParams +private constructor( + private val blockchainRecipientToken: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun blockchainRecipientToken(): Optional = Optional.ofNullable(blockchainRecipientToken) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): BlockchainRecipientRetrieveParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [BlockchainRecipientRetrieveParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BlockchainRecipientRetrieveParams]. */ + class Builder internal constructor() { + + private var blockchainRecipientToken: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(blockchainRecipientRetrieveParams: BlockchainRecipientRetrieveParams) = + apply { + blockchainRecipientToken = + blockchainRecipientRetrieveParams.blockchainRecipientToken + additionalHeaders = blockchainRecipientRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = + blockchainRecipientRetrieveParams.additionalQueryParams.toBuilder() + } + + fun blockchainRecipientToken(blockchainRecipientToken: String?) = apply { + this.blockchainRecipientToken = blockchainRecipientToken + } + + /** + * Alias for calling [Builder.blockchainRecipientToken] with + * `blockchainRecipientToken.orElse(null)`. + */ + fun blockchainRecipientToken(blockchainRecipientToken: Optional) = + blockchainRecipientToken(blockchainRecipientToken.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [BlockchainRecipientRetrieveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): BlockchainRecipientRetrieveParams = + BlockchainRecipientRetrieveParams( + blockchainRecipientToken, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> blockchainRecipientToken ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BlockchainRecipientRetrieveParams && + blockchainRecipientToken == other.blockchainRecipientToken && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(blockchainRecipientToken, additionalHeaders, additionalQueryParams) + + override fun toString() = + "BlockchainRecipientRetrieveParams{blockchainRecipientToken=$blockchainRecipientToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsync.kt index 271e8b61c..a7add57ce 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsync.kt @@ -7,6 +7,7 @@ import com.lithic.api.core.RequestOptions import com.lithic.api.core.http.HttpResponseFor import com.lithic.api.models.BlockchainRecipient import com.lithic.api.models.BlockchainRecipientCreateParams +import com.lithic.api.models.BlockchainRecipientRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -41,6 +42,51 @@ interface BlockchainRecipientServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** + * Get a blockchain recipient by token + * + * Use this to poll the `verification_state` after registering an address: a recipient cannot + * receive a payout until screening completes and moves it out of `PENDING` + */ + fun retrieve(blockchainRecipientToken: String): CompletableFuture = + retrieve(blockchainRecipientToken, BlockchainRecipientRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + blockchainRecipientToken: String, + params: BlockchainRecipientRetrieveParams = BlockchainRecipientRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve( + params.toBuilder().blockchainRecipientToken(blockchainRecipientToken).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + blockchainRecipientToken: String, + params: BlockchainRecipientRetrieveParams = BlockchainRecipientRetrieveParams.none(), + ): CompletableFuture = + retrieve(blockchainRecipientToken, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: BlockchainRecipientRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieve */ + fun retrieve( + params: BlockchainRecipientRetrieveParams + ): CompletableFuture = retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + blockchainRecipientToken: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieve(blockchainRecipientToken, BlockchainRecipientRetrieveParams.none(), requestOptions) + /** * A view of [BlockchainRecipientServiceAsync] that provides access to raw HTTP responses for * each method. @@ -70,5 +116,56 @@ interface BlockchainRecipientServiceAsync { params: BlockchainRecipientCreateParams, requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> + + /** + * Returns a raw HTTP response for `get + * /v1/blockchain_recipients/{blockchain_recipient_token}`, but is otherwise the same as + * [BlockchainRecipientServiceAsync.retrieve]. + */ + fun retrieve( + blockchainRecipientToken: String + ): CompletableFuture> = + retrieve(blockchainRecipientToken, BlockchainRecipientRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + blockchainRecipientToken: String, + params: BlockchainRecipientRetrieveParams = BlockchainRecipientRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve( + params.toBuilder().blockchainRecipientToken(blockchainRecipientToken).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + blockchainRecipientToken: String, + params: BlockchainRecipientRetrieveParams = BlockchainRecipientRetrieveParams.none(), + ): CompletableFuture> = + retrieve(blockchainRecipientToken, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: BlockchainRecipientRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieve */ + fun retrieve( + params: BlockchainRecipientRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + blockchainRecipientToken: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieve( + blockchainRecipientToken, + BlockchainRecipientRetrieveParams.none(), + requestOptions, + ) } } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncImpl.kt index 6c47d1e09..83efe93e1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncImpl.kt @@ -4,6 +4,7 @@ package com.lithic.api.services.async import com.lithic.api.core.ClientOptions import com.lithic.api.core.RequestOptions +import com.lithic.api.core.checkRequired import com.lithic.api.core.handlers.errorBodyHandler import com.lithic.api.core.handlers.errorHandler import com.lithic.api.core.handlers.jsonHandler @@ -17,8 +18,10 @@ import com.lithic.api.core.http.parseable import com.lithic.api.core.prepareAsync import com.lithic.api.models.BlockchainRecipient import com.lithic.api.models.BlockchainRecipientCreateParams +import com.lithic.api.models.BlockchainRecipientRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull class BlockchainRecipientServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : BlockchainRecipientServiceAsync { @@ -44,6 +47,13 @@ internal constructor(private val clientOptions: ClientOptions) : BlockchainRecip // post /v1/blockchain_recipients withRawResponse().create(params, requestOptions).thenApply { it.parse() } + override fun retrieve( + params: BlockchainRecipientRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/blockchain_recipients/{blockchain_recipient_token} + withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : BlockchainRecipientServiceAsync.WithRawResponse { @@ -87,5 +97,38 @@ internal constructor(private val clientOptions: ClientOptions) : BlockchainRecip } } } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: BlockchainRecipientRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("blockchainRecipientToken", params.blockchainRecipientToken().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "blockchain_recipients", params._pathParam(0)) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } } } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientService.kt index 67020b171..e3dbcec86 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientService.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientService.kt @@ -8,6 +8,7 @@ import com.lithic.api.core.RequestOptions import com.lithic.api.core.http.HttpResponseFor import com.lithic.api.models.BlockchainRecipient import com.lithic.api.models.BlockchainRecipientCreateParams +import com.lithic.api.models.BlockchainRecipientRetrieveParams import java.util.function.Consumer interface BlockchainRecipientService { @@ -41,6 +42,49 @@ interface BlockchainRecipientService { requestOptions: RequestOptions = RequestOptions.none(), ): BlockchainRecipient + /** + * Get a blockchain recipient by token + * + * Use this to poll the `verification_state` after registering an address: a recipient cannot + * receive a payout until screening completes and moves it out of `PENDING` + */ + fun retrieve(blockchainRecipientToken: String): BlockchainRecipient = + retrieve(blockchainRecipientToken, BlockchainRecipientRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + blockchainRecipientToken: String, + params: BlockchainRecipientRetrieveParams = BlockchainRecipientRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): BlockchainRecipient = + retrieve( + params.toBuilder().blockchainRecipientToken(blockchainRecipientToken).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + blockchainRecipientToken: String, + params: BlockchainRecipientRetrieveParams = BlockchainRecipientRetrieveParams.none(), + ): BlockchainRecipient = retrieve(blockchainRecipientToken, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: BlockchainRecipientRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): BlockchainRecipient + + /** @see retrieve */ + fun retrieve(params: BlockchainRecipientRetrieveParams): BlockchainRecipient = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + blockchainRecipientToken: String, + requestOptions: RequestOptions, + ): BlockchainRecipient = + retrieve(blockchainRecipientToken, BlockchainRecipientRetrieveParams.none(), requestOptions) + /** * A view of [BlockchainRecipientService] that provides access to raw HTTP responses for each * method. @@ -70,5 +114,59 @@ interface BlockchainRecipientService { params: BlockchainRecipientCreateParams, requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + + /** + * Returns a raw HTTP response for `get + * /v1/blockchain_recipients/{blockchain_recipient_token}`, but is otherwise the same as + * [BlockchainRecipientService.retrieve]. + */ + @MustBeClosed + fun retrieve(blockchainRecipientToken: String): HttpResponseFor = + retrieve(blockchainRecipientToken, BlockchainRecipientRetrieveParams.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + blockchainRecipientToken: String, + params: BlockchainRecipientRetrieveParams = BlockchainRecipientRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve( + params.toBuilder().blockchainRecipientToken(blockchainRecipientToken).build(), + requestOptions, + ) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + blockchainRecipientToken: String, + params: BlockchainRecipientRetrieveParams = BlockchainRecipientRetrieveParams.none(), + ): HttpResponseFor = + retrieve(blockchainRecipientToken, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: BlockchainRecipientRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: BlockchainRecipientRetrieveParams + ): HttpResponseFor = retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + blockchainRecipientToken: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieve( + blockchainRecipientToken, + BlockchainRecipientRetrieveParams.none(), + requestOptions, + ) } } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceImpl.kt index 946e5a2dc..f49167ffd 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceImpl.kt @@ -4,6 +4,7 @@ package com.lithic.api.services.blocking import com.lithic.api.core.ClientOptions import com.lithic.api.core.RequestOptions +import com.lithic.api.core.checkRequired import com.lithic.api.core.handlers.errorBodyHandler import com.lithic.api.core.handlers.errorHandler import com.lithic.api.core.handlers.jsonHandler @@ -17,7 +18,9 @@ import com.lithic.api.core.http.parseable import com.lithic.api.core.prepare import com.lithic.api.models.BlockchainRecipient import com.lithic.api.models.BlockchainRecipientCreateParams +import com.lithic.api.models.BlockchainRecipientRetrieveParams import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull class BlockchainRecipientServiceImpl internal constructor(private val clientOptions: ClientOptions) : BlockchainRecipientService { @@ -40,6 +43,13 @@ internal constructor(private val clientOptions: ClientOptions) : BlockchainRecip // post /v1/blockchain_recipients withRawResponse().create(params, requestOptions).parse() + override fun retrieve( + params: BlockchainRecipientRetrieveParams, + requestOptions: RequestOptions, + ): BlockchainRecipient = + // get /v1/blockchain_recipients/{blockchain_recipient_token} + withRawResponse().retrieve(params, requestOptions).parse() + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : BlockchainRecipientService.WithRawResponse { @@ -80,5 +90,35 @@ internal constructor(private val clientOptions: ClientOptions) : BlockchainRecip } } } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: BlockchainRecipientRetrieveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("blockchainRecipientToken", params.blockchainRecipientToken().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "blockchain_recipients", params._pathParam(0)) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } } } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParamsTest.kt new file mode 100644 index 000000000..02821c5d8 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class BlockchainRecipientRetrieveParamsTest { + + @Test + fun create() { + BlockchainRecipientRetrieveParams.builder() + .blockchainRecipientToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + } + + @Test + fun pathParams() { + val params = + BlockchainRecipientRetrieveParams.builder() + .blockchainRecipientToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncTest.kt index 1e1b7077f..529e783ab 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncTest.kt @@ -37,4 +37,20 @@ internal class BlockchainRecipientServiceAsyncTest { val blockchainRecipient = blockchainRecipientFuture.get() blockchainRecipient.validate() } + + @Test + fun retrieve() { + val client = + LithicOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val blockchainRecipientServiceAsync = client.blockchainRecipients() + + val blockchainRecipientFuture = + blockchainRecipientServiceAsync.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + val blockchainRecipient = blockchainRecipientFuture.get() + blockchainRecipient.validate() + } } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceTest.kt index 9db896ff1..fdc8dab44 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceTest.kt @@ -36,4 +36,19 @@ internal class BlockchainRecipientServiceTest { blockchainRecipient.validate() } + + @Test + fun retrieve() { + val client = + LithicOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val blockchainRecipientService = client.blockchainRecipients() + + val blockchainRecipient = + blockchainRecipientService.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + blockchainRecipient.validate() + } } From 8ab17b8600e670de5baedfb831bf3aa327c3163a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 15:28:45 +0000 Subject: [PATCH 6/7] feat(api): add card.pin_updated webhook event --- .stats.yml | 4 +- .../api/models/CardPinUpdatedWebhookEvent.kt | 749 ++++++++++++++++++ .../kotlin/com/lithic/api/models/Event.kt | 12 + .../com/lithic/api/models/EventListParams.kt | 8 + .../lithic/api/models/EventSubscription.kt | 8 + .../models/EventSubscriptionCreateParams.kt | 8 + ...tSubscriptionSendSimulatedExampleParams.kt | 6 + .../models/EventSubscriptionUpdateParams.kt | 8 + .../lithic/api/models/ParsedWebhookEvent.kt | 28 + .../models/CardPinUpdatedWebhookEventTest.kt | 51 ++ .../api/models/ParsedWebhookEventTest.kt | 171 ++++ 11 files changed, 1051 insertions(+), 2 deletions(-) create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEvent.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEventTest.kt diff --git a/.stats.yml b/.stats.yml index a8ba03900..848bba662 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 218 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-c4c2ee9eddaa18ab29ef2d881e7c373d214d167b3eb7a74559f862ce36e95f74.yml -openapi_spec_hash: 3b1897cb075e1f19e2ce33e95781656a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-6acbf033ded2c03ed5d5c64b6bea9f3250323bf7879a11e9c545aa30e65b3cca.yml +openapi_spec_hash: c6007083223ccff12c5c15bc9e531b41 config_hash: b314c3c5c82a483d1a7812b31b1d1fc4 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEvent.kt new file mode 100644 index 000000000..d672179d4 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEvent.kt @@ -0,0 +1,749 @@ +// 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.checkRequired +import com.lithic.api.errors.LithicInvalidDataException +import java.util.Collections +import java.util.Objects +import kotlin.jvm.optionals.getOrNull + +class CardPinUpdatedWebhookEvent +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val cardToken: JsonField, + private val eventType: JsonField, + private val pinStatus: JsonField, + private val statusReason: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("card_token") @ExcludeMissing cardToken: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + eventType: JsonField = JsonMissing.of(), + @JsonProperty("pin_status") + @ExcludeMissing + pinStatus: JsonField = JsonMissing.of(), + @JsonProperty("status_reason") + @ExcludeMissing + statusReason: JsonField = JsonMissing.of(), + ) : this(cardToken, eventType, pinStatus, statusReason, mutableMapOf()) + + /** + * The token of the card whose PIN or PIN status was updated + * + * @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 cardToken(): String = cardToken.getRequired("card_token") + + /** + * The type of event that occurred. + * + * @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 eventType(): EventType = eventType.getRequired("event_type") + + /** + * The card's PIN status after the update + * + * @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 pinStatus(): PinStatus = pinStatus.getRequired("pin_status") + + /** + * The reason for the PIN update: + * * `PIN_SET` - The PIN was set for the first time; `pin_status` is `OK` + * * `PIN_CHANGED` - The PIN was changed, including when changing a blocked PIN; `pin_status` is + * `OK` + * * `PIN_UNBLOCKED` - The PIN was unblocked without changing it; `pin_status` is `OK` + * * `EXCESSIVE_PIN_ATTEMPTS` - The PIN was blocked due to excessive incorrect PIN attempts; + * `pin_status` is `BLOCKED` + * + * @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 statusReason(): StatusReason = statusReason.getRequired("status_reason") + + /** + * Returns the raw JSON value of [cardToken]. + * + * Unlike [cardToken], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("card_token") @ExcludeMissing fun _cardToken(): JsonField = cardToken + + /** + * Returns the raw JSON value of [eventType]. + * + * Unlike [eventType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("event_type") @ExcludeMissing fun _eventType(): JsonField = eventType + + /** + * Returns the raw JSON value of [pinStatus]. + * + * Unlike [pinStatus], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("pin_status") @ExcludeMissing fun _pinStatus(): JsonField = pinStatus + + /** + * Returns the raw JSON value of [statusReason]. + * + * Unlike [statusReason], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status_reason") + @ExcludeMissing + fun _statusReason(): JsonField = statusReason + + @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 [CardPinUpdatedWebhookEvent]. + * + * The following fields are required: + * ```java + * .cardToken() + * .eventType() + * .pinStatus() + * .statusReason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardPinUpdatedWebhookEvent]. */ + class Builder internal constructor() { + + private var cardToken: JsonField? = null + private var eventType: JsonField? = null + private var pinStatus: JsonField? = null + private var statusReason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(cardPinUpdatedWebhookEvent: CardPinUpdatedWebhookEvent) = apply { + cardToken = cardPinUpdatedWebhookEvent.cardToken + eventType = cardPinUpdatedWebhookEvent.eventType + pinStatus = cardPinUpdatedWebhookEvent.pinStatus + statusReason = cardPinUpdatedWebhookEvent.statusReason + additionalProperties = cardPinUpdatedWebhookEvent.additionalProperties.toMutableMap() + } + + /** The token of the card whose PIN or PIN status was updated */ + fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken)) + + /** + * Sets [Builder.cardToken] to an arbitrary JSON value. + * + * You should usually call [Builder.cardToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken } + + /** The type of event that occurred. */ + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + /** + * Sets [Builder.eventType] to an arbitrary JSON value. + * + * You should usually call [Builder.eventType] with a well-typed [EventType] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + + /** The card's PIN status after the update */ + fun pinStatus(pinStatus: PinStatus) = pinStatus(JsonField.of(pinStatus)) + + /** + * Sets [Builder.pinStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.pinStatus] with a well-typed [PinStatus] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun pinStatus(pinStatus: JsonField) = apply { this.pinStatus = pinStatus } + + /** + * The reason for the PIN update: + * * `PIN_SET` - The PIN was set for the first time; `pin_status` is `OK` + * * `PIN_CHANGED` - The PIN was changed, including when changing a blocked PIN; + * `pin_status` is `OK` + * * `PIN_UNBLOCKED` - The PIN was unblocked without changing it; `pin_status` is `OK` + * * `EXCESSIVE_PIN_ATTEMPTS` - The PIN was blocked due to excessive incorrect PIN attempts; + * `pin_status` is `BLOCKED` + */ + fun statusReason(statusReason: StatusReason) = statusReason(JsonField.of(statusReason)) + + /** + * Sets [Builder.statusReason] to an arbitrary JSON value. + * + * You should usually call [Builder.statusReason] with a well-typed [StatusReason] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun statusReason(statusReason: JsonField) = apply { + this.statusReason = statusReason + } + + 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 [CardPinUpdatedWebhookEvent]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .cardToken() + * .eventType() + * .pinStatus() + * .statusReason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardPinUpdatedWebhookEvent = + CardPinUpdatedWebhookEvent( + checkRequired("cardToken", cardToken), + checkRequired("eventType", eventType), + checkRequired("pinStatus", pinStatus), + checkRequired("statusReason", statusReason), + 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(): CardPinUpdatedWebhookEvent = apply { + if (validated) { + return@apply + } + + cardToken() + eventType().validate() + pinStatus().validate() + statusReason().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 (cardToken.asKnown().isPresent) 1 else 0) + + (eventType.asKnown().getOrNull()?.validity() ?: 0) + + (pinStatus.asKnown().getOrNull()?.validity() ?: 0) + + (statusReason.asKnown().getOrNull()?.validity() ?: 0) + + /** The type of event that occurred. */ + class EventType @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_PIN_UPDATED = of("card.pin_updated") + + @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) + } + + /** An enum containing [EventType]'s known values. */ + enum class Known { + CARD_PIN_UPDATED + } + + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] 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_PIN_UPDATED, + /** + * An enum member indicating that [EventType] 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_PIN_UPDATED -> Value.CARD_PIN_UPDATED + 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_PIN_UPDATED -> Known.CARD_PIN_UPDATED + else -> throw LithicInvalidDataException("Unknown EventType: $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(): EventType = 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 EventType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** The card's PIN status after the update */ + class PinStatus @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 OK = of("OK") + + @JvmField val BLOCKED = of("BLOCKED") + + @JvmStatic fun of(value: String) = PinStatus(JsonField.of(value)) + } + + /** An enum containing [PinStatus]'s known values. */ + enum class Known { + OK, + BLOCKED, + } + + /** + * An enum containing [PinStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PinStatus] 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 { + OK, + BLOCKED, + /** + * An enum member indicating that [PinStatus] 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) { + OK -> Value.OK + BLOCKED -> Value.BLOCKED + 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) { + OK -> Known.OK + BLOCKED -> Known.BLOCKED + else -> throw LithicInvalidDataException("Unknown PinStatus: $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(): PinStatus = 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 PinStatus && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * The reason for the PIN update: + * * `PIN_SET` - The PIN was set for the first time; `pin_status` is `OK` + * * `PIN_CHANGED` - The PIN was changed, including when changing a blocked PIN; `pin_status` is + * `OK` + * * `PIN_UNBLOCKED` - The PIN was unblocked without changing it; `pin_status` is `OK` + * * `EXCESSIVE_PIN_ATTEMPTS` - The PIN was blocked due to excessive incorrect PIN attempts; + * `pin_status` is `BLOCKED` + */ + class StatusReason @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 PIN_SET = of("PIN_SET") + + @JvmField val PIN_CHANGED = of("PIN_CHANGED") + + @JvmField val PIN_UNBLOCKED = of("PIN_UNBLOCKED") + + @JvmField val EXCESSIVE_PIN_ATTEMPTS = of("EXCESSIVE_PIN_ATTEMPTS") + + @JvmStatic fun of(value: String) = StatusReason(JsonField.of(value)) + } + + /** An enum containing [StatusReason]'s known values. */ + enum class Known { + PIN_SET, + PIN_CHANGED, + PIN_UNBLOCKED, + EXCESSIVE_PIN_ATTEMPTS, + } + + /** + * An enum containing [StatusReason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [StatusReason] 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 { + PIN_SET, + PIN_CHANGED, + PIN_UNBLOCKED, + EXCESSIVE_PIN_ATTEMPTS, + /** + * An enum member indicating that [StatusReason] 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) { + PIN_SET -> Value.PIN_SET + PIN_CHANGED -> Value.PIN_CHANGED + PIN_UNBLOCKED -> Value.PIN_UNBLOCKED + EXCESSIVE_PIN_ATTEMPTS -> Value.EXCESSIVE_PIN_ATTEMPTS + 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) { + PIN_SET -> Known.PIN_SET + PIN_CHANGED -> Known.PIN_CHANGED + PIN_UNBLOCKED -> Known.PIN_UNBLOCKED + EXCESSIVE_PIN_ATTEMPTS -> Known.EXCESSIVE_PIN_ATTEMPTS + else -> throw LithicInvalidDataException("Unknown StatusReason: $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(): StatusReason = 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 StatusReason && 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 CardPinUpdatedWebhookEvent && + cardToken == other.cardToken && + eventType == other.eventType && + pinStatus == other.pinStatus && + statusReason == other.statusReason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(cardToken, eventType, pinStatus, statusReason, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardPinUpdatedWebhookEvent{cardToken=$cardToken, eventType=$eventType, pinStatus=$pinStatus, statusReason=$statusReason, additionalProperties=$additionalProperties}" +} 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 fb5a6891b..9c2f276b1 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 @@ -85,6 +85,8 @@ private constructor( * - card_transaction.updated: Occurs when a card transaction happens. * - card.converted: Occurs when a card is converted from virtual to physical cards. * - card.created: Occurs when a new card is created. + * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to + * excessive incorrect PIN attempts. * - card.reissued: Occurs when a card is reissued. * - card.renewed: Occurs when a card is renewed. * - card.shipped: Occurs when a card is shipped. @@ -304,6 +306,8 @@ private constructor( * - card_transaction.updated: Occurs when a card transaction happens. * - card.converted: Occurs when a card is converted from virtual to physical cards. * - card.created: Occurs when a new card is created. + * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due + * to excessive incorrect PIN attempts. * - card.reissued: Occurs when a card is reissued. * - card.renewed: Occurs when a card is renewed. * - card.shipped: Occurs when a card is shipped. @@ -522,6 +526,8 @@ private constructor( * - card_transaction.updated: Occurs when a card transaction happens. * - card.converted: Occurs when a card is converted from virtual to physical cards. * - card.created: Occurs when a new card is created. + * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to + * excessive incorrect PIN attempts. * - card.reissued: Occurs when a card is reissued. * - card.renewed: Occurs when a card is renewed. * - card.shipped: Occurs when a card is shipped. @@ -656,6 +662,8 @@ private constructor( @JvmField val CARD_CREATED = of("card.created") + @JvmField val CARD_PIN_UPDATED = of("card.pin_updated") + @JvmField val CARD_REISSUED = of("card.reissued") @JvmField val CARD_RENEWED = of("card.renewed") @@ -779,6 +787,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -852,6 +861,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -930,6 +940,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Value.CARD_CONVERTED CARD_CREATED -> Value.CARD_CREATED + CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED CARD_REISSUED -> Value.CARD_REISSUED CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED @@ -1011,6 +1022,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Known.CARD_CONVERTED CARD_CREATED -> Known.CARD_CREATED + CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED CARD_REISSUED -> Known.CARD_REISSUED CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED 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 3b0ffb8cf..527d9d30e 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 @@ -343,6 +343,8 @@ private constructor( * - card_transaction.updated: Occurs when a card transaction happens. * - card.converted: Occurs when a card is converted from virtual to physical cards. * - card.created: Occurs when a new card is created. + * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to + * excessive incorrect PIN attempts. * - card.reissued: Occurs when a card is reissued. * - card.renewed: Occurs when a card is renewed. * - card.shipped: Occurs when a card is shipped. @@ -477,6 +479,8 @@ private constructor( @JvmField val CARD_CREATED = of("card.created") + @JvmField val CARD_PIN_UPDATED = of("card.pin_updated") + @JvmField val CARD_REISSUED = of("card.reissued") @JvmField val CARD_RENEWED = of("card.renewed") @@ -600,6 +604,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -673,6 +678,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -751,6 +757,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Value.CARD_CONVERTED CARD_CREATED -> Value.CARD_CREATED + CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED CARD_REISSUED -> Value.CARD_REISSUED CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED @@ -832,6 +839,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Known.CARD_CONVERTED CARD_CREATED -> Known.CARD_CREATED + CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED CARD_REISSUED -> Known.CARD_REISSUED CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED 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 1ac9217f3..39d0b0c10 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 @@ -353,6 +353,8 @@ private constructor( * - card_transaction.updated: Occurs when a card transaction happens. * - card.converted: Occurs when a card is converted from virtual to physical cards. * - card.created: Occurs when a new card is created. + * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to + * excessive incorrect PIN attempts. * - card.reissued: Occurs when a card is reissued. * - card.renewed: Occurs when a card is renewed. * - card.shipped: Occurs when a card is shipped. @@ -487,6 +489,8 @@ private constructor( @JvmField val CARD_CREATED = of("card.created") + @JvmField val CARD_PIN_UPDATED = of("card.pin_updated") + @JvmField val CARD_REISSUED = of("card.reissued") @JvmField val CARD_RENEWED = of("card.renewed") @@ -610,6 +614,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -683,6 +688,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -761,6 +767,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Value.CARD_CONVERTED CARD_CREATED -> Value.CARD_CREATED + CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED CARD_REISSUED -> Value.CARD_REISSUED CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED @@ -842,6 +849,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Known.CARD_CONVERTED CARD_CREATED -> Known.CARD_CREATED + CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED CARD_REISSUED -> Known.CARD_REISSUED CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED 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 120a4e9c0..729baa419 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 @@ -676,6 +676,8 @@ private constructor( * - card_transaction.updated: Occurs when a card transaction happens. * - card.converted: Occurs when a card is converted from virtual to physical cards. * - card.created: Occurs when a new card is created. + * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to + * excessive incorrect PIN attempts. * - card.reissued: Occurs when a card is reissued. * - card.renewed: Occurs when a card is renewed. * - card.shipped: Occurs when a card is shipped. @@ -810,6 +812,8 @@ private constructor( @JvmField val CARD_CREATED = of("card.created") + @JvmField val CARD_PIN_UPDATED = of("card.pin_updated") + @JvmField val CARD_REISSUED = of("card.reissued") @JvmField val CARD_RENEWED = of("card.renewed") @@ -933,6 +937,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -1006,6 +1011,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -1084,6 +1090,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Value.CARD_CONVERTED CARD_CREATED -> Value.CARD_CREATED + CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED CARD_REISSUED -> Value.CARD_REISSUED CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED @@ -1165,6 +1172,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Known.CARD_CONVERTED CARD_CREATED -> Known.CARD_CREATED + CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED CARD_REISSUED -> Known.CARD_REISSUED CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED 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 0bee59c6c..094ce1721 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 @@ -471,6 +471,8 @@ private constructor( @JvmField val CARD_CREATED = of("card.created") + @JvmField val CARD_PIN_UPDATED = of("card.pin_updated") + @JvmField val CARD_REISSUED = of("card.reissued") @JvmField val CARD_RENEWED = of("card.renewed") @@ -594,6 +596,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -667,6 +670,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -745,6 +749,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Value.CARD_CONVERTED CARD_CREATED -> Value.CARD_CREATED + CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED CARD_REISSUED -> Value.CARD_REISSUED CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED @@ -826,6 +831,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Known.CARD_CONVERTED CARD_CREATED -> Known.CARD_CREATED + CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED CARD_REISSUED -> Known.CARD_REISSUED CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED 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 91de84e1c..a75dc9eb5 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 @@ -699,6 +699,8 @@ private constructor( * - card_transaction.updated: Occurs when a card transaction happens. * - card.converted: Occurs when a card is converted from virtual to physical cards. * - card.created: Occurs when a new card is created. + * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to + * excessive incorrect PIN attempts. * - card.reissued: Occurs when a card is reissued. * - card.renewed: Occurs when a card is renewed. * - card.shipped: Occurs when a card is shipped. @@ -833,6 +835,8 @@ private constructor( @JvmField val CARD_CREATED = of("card.created") + @JvmField val CARD_PIN_UPDATED = of("card.pin_updated") + @JvmField val CARD_REISSUED = of("card.reissued") @JvmField val CARD_RENEWED = of("card.renewed") @@ -956,6 +960,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -1029,6 +1034,7 @@ private constructor( CARD_TRANSACTION_UPDATED, CARD_CONVERTED, CARD_CREATED, + CARD_PIN_UPDATED, CARD_REISSUED, CARD_RENEWED, CARD_SHIPPED, @@ -1107,6 +1113,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Value.CARD_CONVERTED CARD_CREATED -> Value.CARD_CREATED + CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED CARD_REISSUED -> Value.CARD_REISSUED CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED @@ -1188,6 +1195,7 @@ private constructor( CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED CARD_CONVERTED -> Known.CARD_CONVERTED CARD_CREATED -> Known.CARD_CREATED + CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED CARD_REISSUED -> Known.CARD_REISSUED CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt index 3bdbe366e..6521b09ce 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt @@ -55,6 +55,7 @@ private constructor( private val bookTransferTransactionUpdated: BookTransferTransactionUpdatedWebhookEvent? = null, private val cardCreated: CardCreatedWebhookEvent? = null, private val cardConverted: CardConvertedWebhookEvent? = null, + private val cardPinUpdated: CardPinUpdatedWebhookEvent? = null, private val cardRenewed: CardRenewedWebhookEvent? = null, private val cardReissued: CardReissuedWebhookEvent? = null, private val cardShipped: CardShippedWebhookEvent? = null, @@ -173,6 +174,8 @@ private constructor( fun cardConverted(): Optional = Optional.ofNullable(cardConverted) + fun cardPinUpdated(): Optional = Optional.ofNullable(cardPinUpdated) + fun cardRenewed(): Optional = Optional.ofNullable(cardRenewed) fun cardReissued(): Optional = Optional.ofNullable(cardReissued) @@ -372,6 +375,8 @@ private constructor( fun isCardConverted(): Boolean = cardConverted != null + fun isCardPinUpdated(): Boolean = cardPinUpdated != null + fun isCardRenewed(): Boolean = cardRenewed != null fun isCardReissued(): Boolean = cardReissued != null @@ -525,6 +530,8 @@ private constructor( fun asCardConverted(): CardConvertedWebhookEvent = cardConverted.getOrThrow("cardConverted") + fun asCardPinUpdated(): CardPinUpdatedWebhookEvent = cardPinUpdated.getOrThrow("cardPinUpdated") + fun asCardRenewed(): CardRenewedWebhookEvent = cardRenewed.getOrThrow("cardRenewed") fun asCardReissued(): CardReissuedWebhookEvent = cardReissued.getOrThrow("cardReissued") @@ -757,6 +764,7 @@ private constructor( visitor.visitBookTransferTransactionUpdated(bookTransferTransactionUpdated) cardCreated != null -> visitor.visitCardCreated(cardCreated) cardConverted != null -> visitor.visitCardConverted(cardConverted) + cardPinUpdated != null -> visitor.visitCardPinUpdated(cardPinUpdated) cardRenewed != null -> visitor.visitCardRenewed(cardRenewed) cardReissued != null -> visitor.visitCardReissued(cardReissued) cardShipped != null -> visitor.visitCardShipped(cardShipped) @@ -954,6 +962,10 @@ private constructor( cardConverted.validate() } + override fun visitCardPinUpdated(cardPinUpdated: CardPinUpdatedWebhookEvent) { + cardPinUpdated.validate() + } + override fun visitCardRenewed(cardRenewed: CardRenewedWebhookEvent) { cardRenewed.validate() } @@ -1322,6 +1334,9 @@ private constructor( override fun visitCardConverted(cardConverted: CardConvertedWebhookEvent) = cardConverted.validity() + override fun visitCardPinUpdated(cardPinUpdated: CardPinUpdatedWebhookEvent) = + cardPinUpdated.validity() + override fun visitCardRenewed(cardRenewed: CardRenewedWebhookEvent) = cardRenewed.validity() @@ -1549,6 +1564,7 @@ private constructor( bookTransferTransactionUpdated == other.bookTransferTransactionUpdated && cardCreated == other.cardCreated && cardConverted == other.cardConverted && + cardPinUpdated == other.cardPinUpdated && cardRenewed == other.cardRenewed && cardReissued == other.cardReissued && cardShipped == other.cardShipped && @@ -1624,6 +1640,7 @@ private constructor( bookTransferTransactionUpdated, cardCreated, cardConverted, + cardPinUpdated, cardRenewed, cardReissued, cardShipped, @@ -1703,6 +1720,7 @@ private constructor( "ParsedWebhookEvent{bookTransferTransactionUpdated=$bookTransferTransactionUpdated}" cardCreated != null -> "ParsedWebhookEvent{cardCreated=$cardCreated}" cardConverted != null -> "ParsedWebhookEvent{cardConverted=$cardConverted}" + cardPinUpdated != null -> "ParsedWebhookEvent{cardPinUpdated=$cardPinUpdated}" cardRenewed != null -> "ParsedWebhookEvent{cardRenewed=$cardRenewed}" cardReissued != null -> "ParsedWebhookEvent{cardReissued=$cardReissued}" cardShipped != null -> "ParsedWebhookEvent{cardShipped=$cardShipped}" @@ -1875,6 +1893,10 @@ private constructor( fun ofCardConverted(cardConverted: CardConvertedWebhookEvent) = ParsedWebhookEvent(cardConverted = cardConverted) + @JvmStatic + fun ofCardPinUpdated(cardPinUpdated: CardPinUpdatedWebhookEvent) = + ParsedWebhookEvent(cardPinUpdated = cardPinUpdated) + @JvmStatic fun ofCardRenewed(cardRenewed: CardRenewedWebhookEvent) = ParsedWebhookEvent(cardRenewed = cardRenewed) @@ -2215,6 +2237,8 @@ private constructor( fun visitCardConverted(cardConverted: CardConvertedWebhookEvent): T + fun visitCardPinUpdated(cardPinUpdated: CardPinUpdatedWebhookEvent): T + fun visitCardRenewed(cardRenewed: CardRenewedWebhookEvent): T fun visitCardReissued(cardReissued: CardReissuedWebhookEvent): T @@ -2514,6 +2538,9 @@ private constructor( tryDeserialize(node, jacksonTypeRef())?.let { ParsedWebhookEvent(cardConverted = it, _json = json) }, + tryDeserialize(node, jacksonTypeRef())?.let { + ParsedWebhookEvent(cardPinUpdated = it, _json = json) + }, tryDeserialize(node, jacksonTypeRef())?.let { ParsedWebhookEvent(cardRenewed = it, _json = json) }, @@ -2849,6 +2876,7 @@ private constructor( generator.writeObject(value.bookTransferTransactionUpdated) value.cardCreated != null -> generator.writeObject(value.cardCreated) value.cardConverted != null -> generator.writeObject(value.cardConverted) + value.cardPinUpdated != null -> generator.writeObject(value.cardPinUpdated) value.cardRenewed != null -> generator.writeObject(value.cardRenewed) value.cardReissued != null -> generator.writeObject(value.cardReissued) value.cardShipped != null -> generator.writeObject(value.cardShipped) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEventTest.kt new file mode 100644 index 000000000..347796677 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEventTest.kt @@ -0,0 +1,51 @@ +// 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.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class CardPinUpdatedWebhookEventTest { + + @Test + fun create() { + val cardPinUpdatedWebhookEvent = + CardPinUpdatedWebhookEvent.builder() + .cardToken("4df9a19c-9e1e-40d1-b27a-05e01152ee07") + .eventType(CardPinUpdatedWebhookEvent.EventType.CARD_PIN_UPDATED) + .pinStatus(CardPinUpdatedWebhookEvent.PinStatus.OK) + .statusReason(CardPinUpdatedWebhookEvent.StatusReason.PIN_SET) + .build() + + assertThat(cardPinUpdatedWebhookEvent.cardToken()) + .isEqualTo("4df9a19c-9e1e-40d1-b27a-05e01152ee07") + assertThat(cardPinUpdatedWebhookEvent.eventType()) + .isEqualTo(CardPinUpdatedWebhookEvent.EventType.CARD_PIN_UPDATED) + assertThat(cardPinUpdatedWebhookEvent.pinStatus()) + .isEqualTo(CardPinUpdatedWebhookEvent.PinStatus.OK) + assertThat(cardPinUpdatedWebhookEvent.statusReason()) + .isEqualTo(CardPinUpdatedWebhookEvent.StatusReason.PIN_SET) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val cardPinUpdatedWebhookEvent = + CardPinUpdatedWebhookEvent.builder() + .cardToken("4df9a19c-9e1e-40d1-b27a-05e01152ee07") + .eventType(CardPinUpdatedWebhookEvent.EventType.CARD_PIN_UPDATED) + .pinStatus(CardPinUpdatedWebhookEvent.PinStatus.OK) + .statusReason(CardPinUpdatedWebhookEvent.StatusReason.PIN_SET) + .build() + + val roundtrippedCardPinUpdatedWebhookEvent = + jsonMapper.readValue( + jsonMapper.writeValueAsString(cardPinUpdatedWebhookEvent), + jacksonTypeRef(), + ) + + assertThat(roundtrippedCardPinUpdatedWebhookEvent).isEqualTo(cardPinUpdatedWebhookEvent) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt index bd431f06e..227d2a165 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt @@ -52,6 +52,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -232,6 +233,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -431,6 +433,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -566,6 +569,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -682,6 +686,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -817,6 +822,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -1153,6 +1159,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -1704,6 +1711,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -2064,6 +2072,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -2222,6 +2231,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -2388,6 +2398,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -2550,6 +2561,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -2746,6 +2758,7 @@ internal class ParsedWebhookEventTest { .contains(bookTransferTransactionUpdated) assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -2894,6 +2907,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).contains(cardCreated) assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -2995,6 +3009,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).contains(cardConverted) + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -3070,6 +3085,111 @@ internal class ParsedWebhookEventTest { assertThat(roundtrippedParsedWebhookEvent).isEqualTo(parsedWebhookEvent) } + @Test + fun ofCardPinUpdated() { + val cardPinUpdated = + CardPinUpdatedWebhookEvent.builder() + .cardToken("4df9a19c-9e1e-40d1-b27a-05e01152ee07") + .eventType(CardPinUpdatedWebhookEvent.EventType.CARD_PIN_UPDATED) + .pinStatus(CardPinUpdatedWebhookEvent.PinStatus.OK) + .statusReason(CardPinUpdatedWebhookEvent.StatusReason.PIN_SET) + .build() + + val parsedWebhookEvent = ParsedWebhookEvent.ofCardPinUpdated(cardPinUpdated) + + assertThat(parsedWebhookEvent.accountHolderCreated()).isEmpty + assertThat(parsedWebhookEvent.kybPayload()).isEmpty + assertThat(parsedWebhookEvent.kycPayload()).isEmpty + assertThat(parsedWebhookEvent.legacyPayload()).isEmpty + assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty + assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationChallenge()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationChallengeResponse()).isEmpty + assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty + assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty + assertThat(parsedWebhookEvent.bookTransferTransactionCreated()).isEmpty + assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty + assertThat(parsedWebhookEvent.cardCreated()).isEmpty + assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).contains(cardPinUpdated) + assertThat(parsedWebhookEvent.cardRenewed()).isEmpty + assertThat(parsedWebhookEvent.cardReissued()).isEmpty + assertThat(parsedWebhookEvent.cardShipped()).isEmpty + assertThat(parsedWebhookEvent.cardUpdated()).isEmpty + assertThat(parsedWebhookEvent.cardTransactionUpdated()).isEmpty + assertThat(parsedWebhookEvent.cardTransactionEnhancedDataCreated()).isEmpty + assertThat(parsedWebhookEvent.cardTransactionEnhancedDataUpdated()).isEmpty + assertThat(parsedWebhookEvent.claimCreated()).isEmpty + assertThat(parsedWebhookEvent.claimUpdated()).isEmpty + assertThat(parsedWebhookEvent.claimDocumentUploaded()).isEmpty + assertThat(parsedWebhookEvent.claimDocumentAccepted()).isEmpty + assertThat(parsedWebhookEvent.claimDocumentRejected()).isEmpty + assertThat(parsedWebhookEvent.digitalWalletTokenizationApprovalRequest()).isEmpty + assertThat(parsedWebhookEvent.digitalWalletTokenizationResult()).isEmpty + assertThat(parsedWebhookEvent.digitalWalletTokenizationTwoFactorAuthenticationCode()) + .isEmpty + assertThat(parsedWebhookEvent.digitalWalletTokenizationTwoFactorAuthenticationCodeSent()) + .isEmpty + assertThat(parsedWebhookEvent.digitalWalletTokenizationUpdated()).isEmpty + assertThat(parsedWebhookEvent.disputeUpdated()).isEmpty + assertThat(parsedWebhookEvent.disputeEvidenceUploadFailed()).isEmpty + assertThat(parsedWebhookEvent.embedSessionGenerated()).isEmpty + assertThat(parsedWebhookEvent.embedViewed()).isEmpty + assertThat(parsedWebhookEvent.externalBankAccountCreated()).isEmpty + assertThat(parsedWebhookEvent.externalBankAccountUpdated()).isEmpty + assertThat(parsedWebhookEvent.externalPaymentCreated()).isEmpty + assertThat(parsedWebhookEvent.externalPaymentUpdated()).isEmpty + assertThat(parsedWebhookEvent.financialAccountCreated()).isEmpty + assertThat(parsedWebhookEvent.financialAccountUpdated()).isEmpty + assertThat(parsedWebhookEvent.fundingEventCreated()).isEmpty + assertThat(parsedWebhookEvent.loanTapeCreated()).isEmpty + assertThat(parsedWebhookEvent.loanTapeUpdated()).isEmpty + assertThat(parsedWebhookEvent.managementOperationCreated()).isEmpty + assertThat(parsedWebhookEvent.managementOperationUpdated()).isEmpty + assertThat(parsedWebhookEvent.internalTransactionCreated()).isEmpty + assertThat(parsedWebhookEvent.internalTransactionUpdated()).isEmpty + assertThat(parsedWebhookEvent.networkTotalCreated()).isEmpty + assertThat(parsedWebhookEvent.networkTotalUpdated()).isEmpty + assertThat(parsedWebhookEvent.paymentTransactionCreated()).isEmpty + assertThat(parsedWebhookEvent.paymentTransactionUpdated()).isEmpty + assertThat(parsedWebhookEvent.settlementReportUpdated()).isEmpty + assertThat(parsedWebhookEvent.statementsCreated()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationCreated()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationUpdated()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationChallenge()).isEmpty + assertThat(parsedWebhookEvent.tokenizationApprovalRequest()).isEmpty + assertThat(parsedWebhookEvent.tokenizationResult()).isEmpty + assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty + assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty + assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty + assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty + assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty + } + + @Test + fun ofCardPinUpdatedRoundtrip() { + val jsonMapper = jsonMapper() + val parsedWebhookEvent = + ParsedWebhookEvent.ofCardPinUpdated( + CardPinUpdatedWebhookEvent.builder() + .cardToken("4df9a19c-9e1e-40d1-b27a-05e01152ee07") + .eventType(CardPinUpdatedWebhookEvent.EventType.CARD_PIN_UPDATED) + .pinStatus(CardPinUpdatedWebhookEvent.PinStatus.OK) + .statusReason(CardPinUpdatedWebhookEvent.StatusReason.PIN_SET) + .build() + ) + + val roundtrippedParsedWebhookEvent = + jsonMapper.readValue( + jsonMapper.writeValueAsString(parsedWebhookEvent), + jacksonTypeRef(), + ) + + assertThat(roundtrippedParsedWebhookEvent).isEqualTo(parsedWebhookEvent) + } + @Test fun ofCardRenewed() { val cardRenewed = @@ -3099,6 +3219,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).contains(cardRenewed) assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -3203,6 +3324,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).contains(cardReissued) assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -3308,6 +3430,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).contains(cardShipped) @@ -3415,6 +3538,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -3744,6 +3868,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -4141,6 +4266,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -4354,6 +4480,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -4527,6 +4654,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -4661,6 +4789,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -4794,6 +4923,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -4928,6 +5058,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -5062,6 +5193,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -5262,6 +5394,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -5478,6 +5611,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -5638,6 +5772,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -5780,6 +5915,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -5947,6 +6083,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -6112,6 +6249,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -6238,6 +6376,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -6356,6 +6495,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -6472,6 +6612,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -6613,6 +6754,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -6780,6 +6922,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -6943,6 +7086,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -7103,6 +7247,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -7269,6 +7414,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -7440,6 +7586,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -7588,6 +7735,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -7862,6 +8010,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -8304,6 +8453,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -8637,6 +8787,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -8847,6 +8998,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -9027,6 +9179,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -9177,6 +9330,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -9322,6 +9476,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -9458,6 +9613,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -9645,6 +9801,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -9883,6 +10040,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -10074,6 +10232,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -10323,6 +10482,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -10686,6 +10846,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -11068,6 +11229,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -11479,6 +11641,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -11820,6 +11983,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -12022,6 +12186,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -12172,6 +12337,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -12311,6 +12477,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -12473,6 +12640,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -12756,6 +12924,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -13061,6 +13230,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty @@ -13285,6 +13455,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.bookTransferTransactionUpdated()).isEmpty assertThat(parsedWebhookEvent.cardCreated()).isEmpty assertThat(parsedWebhookEvent.cardConverted()).isEmpty + assertThat(parsedWebhookEvent.cardPinUpdated()).isEmpty assertThat(parsedWebhookEvent.cardRenewed()).isEmpty assertThat(parsedWebhookEvent.cardReissued()).isEmpty assertThat(parsedWebhookEvent.cardShipped()).isEmpty From 5b862041a8be447059faa1cdf44fabcc82ae5764 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 17:41:29 +0000 Subject: [PATCH 7/7] feat(api): add psd2Context field to ThreeDSAuthentication responses --- .stats.yml | 4 +- .../api/models/ThreeDSAuthentication.kt | 693 +++++++++++++++++- ...thenticationApprovalRequestWebhookEvent.kt | 57 +- ...hreeDSAuthenticationCreatedWebhookEvent.kt | 57 +- ...hreeDSAuthenticationUpdatedWebhookEvent.kt | 57 +- .../api/models/ParsedWebhookEventTest.kt | 76 ++ ...ticationApprovalRequestWebhookEventTest.kt | 25 + ...AuthenticationChallengeWebhookEventTest.kt | 32 + ...DSAuthenticationCreatedWebhookEventTest.kt | 25 + .../api/models/ThreeDSAuthenticationTest.kt | 25 + ...DSAuthenticationUpdatedWebhookEventTest.kt | 25 + 11 files changed, 1070 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 848bba662..36ae04943 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 218 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-6acbf033ded2c03ed5d5c64b6bea9f3250323bf7879a11e9c545aa30e65b3cca.yml -openapi_spec_hash: c6007083223ccff12c5c15bc9e531b41 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-e1085922e2d7ee4ce3122f1d9dfe675877f5551a591630592cfea38bd6fea9ed.yml +openapi_spec_hash: e9ca63bde70f9e3953e0a135e7daf185 config_hash: b314c3c5c82a483d1a7812b31b1d1fc4 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 7dcfe8843..fa7f6cf2a 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 @@ -41,6 +41,7 @@ private constructor( private val challengeMetadata: JsonField, private val challengeOrchestratedBy: JsonField, private val decisionMadeBy: JsonField, + private val psd2Context: JsonField, private val threeRiRequestType: JsonField, private val transaction: JsonField, private val additionalProperties: MutableMap, @@ -91,6 +92,9 @@ private constructor( @JsonProperty("decision_made_by") @ExcludeMissing decisionMadeBy: JsonField = JsonMissing.of(), + @JsonProperty("psd2_context") + @ExcludeMissing + psd2Context: JsonField = JsonMissing.of(), @JsonProperty("three_ri_request_type") @ExcludeMissing threeRiRequestType: JsonField = JsonMissing.of(), @@ -116,6 +120,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, mutableMapOf(), @@ -292,6 +297,15 @@ private constructor( */ fun decisionMadeBy(): Optional = decisionMadeBy.getOptional("decision_made_by") + /** + * PSD2/SCA context for EEA and UK transactions. Present when Lithic determines the transaction + * is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope transactions. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun psd2Context(): Optional = psd2Context.getOptional("psd2_context") + /** * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes place * at the initiation of the merchant rather than the cardholder. The most common example of this @@ -468,6 +482,15 @@ private constructor( @ExcludeMissing fun _decisionMadeBy(): JsonField = decisionMadeBy + /** + * Returns the raw JSON value of [psd2Context]. + * + * Unlike [psd2Context], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("psd2_context") + @ExcludeMissing + fun _psd2Context(): JsonField = psd2Context + /** * Returns the raw JSON value of [threeRiRequestType]. * @@ -546,6 +569,7 @@ private constructor( private var challengeMetadata: JsonField = JsonMissing.of() private var challengeOrchestratedBy: JsonField = JsonMissing.of() private var decisionMadeBy: JsonField = JsonMissing.of() + private var psd2Context: JsonField = JsonMissing.of() private var threeRiRequestType: JsonField = JsonMissing.of() private var transaction: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -571,6 +595,7 @@ private constructor( challengeMetadata = threeDSAuthentication.challengeMetadata challengeOrchestratedBy = threeDSAuthentication.challengeOrchestratedBy decisionMadeBy = threeDSAuthentication.decisionMadeBy + psd2Context = threeDSAuthentication.psd2Context threeRiRequestType = threeDSAuthentication.threeRiRequestType transaction = threeDSAuthentication.transaction additionalProperties = threeDSAuthentication.additionalProperties.toMutableMap() @@ -906,6 +931,27 @@ private constructor( this.decisionMadeBy = decisionMadeBy } + /** + * PSD2/SCA context for EEA and UK transactions. Present when Lithic determines the + * transaction is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope + * transactions. + */ + fun psd2Context(psd2Context: Psd2Context?) = psd2Context(JsonField.ofNullable(psd2Context)) + + /** Alias for calling [Builder.psd2Context] with `psd2Context.orElse(null)`. */ + fun psd2Context(psd2Context: Optional) = psd2Context(psd2Context.getOrNull()) + + /** + * Sets [Builder.psd2Context] to an arbitrary JSON value. + * + * You should usually call [Builder.psd2Context] with a well-typed [Psd2Context] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun psd2Context(psd2Context: JsonField) = apply { + this.psd2Context = psd2Context + } + /** * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes * place at the initiation of the merchant rather than the cardholder. The most common @@ -1017,6 +1063,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, additionalProperties.toMutableMap(), @@ -1056,6 +1103,7 @@ private constructor( challengeMetadata().ifPresent { it.validate() } challengeOrchestratedBy().ifPresent { it.validate() } decisionMadeBy().ifPresent { it.validate() } + psd2Context().ifPresent { it.validate() } threeRiRequestType().ifPresent { it.validate() } transaction().ifPresent { it.validate() } validated = true @@ -1094,6 +1142,7 @@ private constructor( (challengeMetadata.asKnown().getOrNull()?.validity() ?: 0) + (challengeOrchestratedBy.asKnown().getOrNull()?.validity() ?: 0) + (decisionMadeBy.asKnown().getOrNull()?.validity() ?: 0) + + (psd2Context.asKnown().getOrNull()?.validity() ?: 0) + (threeRiRequestType.asKnown().getOrNull()?.validity() ?: 0) + (transaction.asKnown().getOrNull()?.validity() ?: 0) @@ -7844,6 +7893,646 @@ private constructor( override fun toString() = value.toString() } + /** + * PSD2/SCA context for EEA and UK transactions. Present when Lithic determines the transaction + * is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope transactions. + */ + class Psd2Context + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val acquirerExemption: JsonField, + private val lithicExemptionValidation: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("acquirer_exemption") + @ExcludeMissing + acquirerExemption: JsonField = JsonMissing.of(), + @JsonProperty("lithic_exemption_validation") + @ExcludeMissing + lithicExemptionValidation: JsonField = JsonMissing.of(), + ) : this(acquirerExemption, lithicExemptionValidation, mutableMapOf()) + + /** + * SCA exemption declared by the acquirer in the 3DS authentication request. + * * `NONE` - No exemption claimed + * * `TRANSACTION_RISK_ANALYSIS` - Transaction Risk Analysis (TRA) exemption; acquirer + * asserts low fraud risk + * * `LOW_VALUE` - Low-value payment exemption; transaction is below the EUR 30 threshold + * * `RECURRING_PAYMENT` - Recurring payment with a fixed amount to the same payee + * * `MERCHANT_INITIATED_TRANSACTION` - Merchant-initiated transaction (MIT); cardholder not + * present + * * `TRUSTED_BENEFICIARY` - Trusted beneficiary; merchant is on cardholder's whitelist + * * `STRONG_CUSTOMER_AUTHENTICATION_DELEGATION` - SCA already performed by a delegated + * third-party authenticator + * * `SECURE_CORPORATE_PAYMENT` - Secure corporate payment using a dedicated corporate card + * or process + * * `AUTHENTICATION_OUTAGE_EXCEPTION` - Authentication outage exception; scheme-level + * fallback during ACS downtime + * * `BUNDLED` - Mastercard only; bundled exemption code where the exact exemption type + * cannot be distinguished + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun acquirerExemption(): Optional = + acquirerExemption.getOptional("acquirer_exemption") + + /** + * Lithic's validation of the acquirer-declared exemption. Absent when no acquirer exemption + * was declared. + * * `ACCEPTED` - Lithic signals support the acquirer's claim + * * `REJECTED` - Lithic signals contradict the claim, or a required signal is missing + * * `NOT_VALIDATED` - Exemption was declared but Lithic has no basis to evaluate it; + * treated as `REJECTED` for challenge purposes + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun lithicExemptionValidation(): Optional = + lithicExemptionValidation.getOptional("lithic_exemption_validation") + + /** + * Returns the raw JSON value of [acquirerExemption]. + * + * Unlike [acquirerExemption], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("acquirer_exemption") + @ExcludeMissing + fun _acquirerExemption(): JsonField = acquirerExemption + + /** + * Returns the raw JSON value of [lithicExemptionValidation]. + * + * Unlike [lithicExemptionValidation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("lithic_exemption_validation") + @ExcludeMissing + fun _lithicExemptionValidation(): JsonField = + lithicExemptionValidation + + @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 [Psd2Context]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Psd2Context]. */ + class Builder internal constructor() { + + private var acquirerExemption: JsonField = JsonMissing.of() + private var lithicExemptionValidation: JsonField = + JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(psd2Context: Psd2Context) = apply { + acquirerExemption = psd2Context.acquirerExemption + lithicExemptionValidation = psd2Context.lithicExemptionValidation + additionalProperties = psd2Context.additionalProperties.toMutableMap() + } + + /** + * SCA exemption declared by the acquirer in the 3DS authentication request. + * * `NONE` - No exemption claimed + * * `TRANSACTION_RISK_ANALYSIS` - Transaction Risk Analysis (TRA) exemption; acquirer + * asserts low fraud risk + * * `LOW_VALUE` - Low-value payment exemption; transaction is below the EUR 30 + * threshold + * * `RECURRING_PAYMENT` - Recurring payment with a fixed amount to the same payee + * * `MERCHANT_INITIATED_TRANSACTION` - Merchant-initiated transaction (MIT); cardholder + * not present + * * `TRUSTED_BENEFICIARY` - Trusted beneficiary; merchant is on cardholder's whitelist + * * `STRONG_CUSTOMER_AUTHENTICATION_DELEGATION` - SCA already performed by a delegated + * third-party authenticator + * * `SECURE_CORPORATE_PAYMENT` - Secure corporate payment using a dedicated corporate + * card or process + * * `AUTHENTICATION_OUTAGE_EXCEPTION` - Authentication outage exception; scheme-level + * fallback during ACS downtime + * * `BUNDLED` - Mastercard only; bundled exemption code where the exact exemption type + * cannot be distinguished + */ + fun acquirerExemption(acquirerExemption: AcquirerExemption) = + acquirerExemption(JsonField.of(acquirerExemption)) + + /** + * Sets [Builder.acquirerExemption] to an arbitrary JSON value. + * + * You should usually call [Builder.acquirerExemption] with a well-typed + * [AcquirerExemption] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun acquirerExemption(acquirerExemption: JsonField) = apply { + this.acquirerExemption = acquirerExemption + } + + /** + * Lithic's validation of the acquirer-declared exemption. Absent when no acquirer + * exemption was declared. + * * `ACCEPTED` - Lithic signals support the acquirer's claim + * * `REJECTED` - Lithic signals contradict the claim, or a required signal is missing + * * `NOT_VALIDATED` - Exemption was declared but Lithic has no basis to evaluate it; + * treated as `REJECTED` for challenge purposes + */ + fun lithicExemptionValidation(lithicExemptionValidation: LithicExemptionValidation) = + lithicExemptionValidation(JsonField.of(lithicExemptionValidation)) + + /** + * Sets [Builder.lithicExemptionValidation] to an arbitrary JSON value. + * + * You should usually call [Builder.lithicExemptionValidation] with a well-typed + * [LithicExemptionValidation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun lithicExemptionValidation( + lithicExemptionValidation: JsonField + ) = apply { this.lithicExemptionValidation = lithicExemptionValidation } + + 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 [Psd2Context]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Psd2Context = + Psd2Context( + acquirerExemption, + lithicExemptionValidation, + 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(): Psd2Context = apply { + if (validated) { + return@apply + } + + acquirerExemption().ifPresent { it.validate() } + lithicExemptionValidation().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 = + (acquirerExemption.asKnown().getOrNull()?.validity() ?: 0) + + (lithicExemptionValidation.asKnown().getOrNull()?.validity() ?: 0) + + /** + * SCA exemption declared by the acquirer in the 3DS authentication request. + * * `NONE` - No exemption claimed + * * `TRANSACTION_RISK_ANALYSIS` - Transaction Risk Analysis (TRA) exemption; acquirer + * asserts low fraud risk + * * `LOW_VALUE` - Low-value payment exemption; transaction is below the EUR 30 threshold + * * `RECURRING_PAYMENT` - Recurring payment with a fixed amount to the same payee + * * `MERCHANT_INITIATED_TRANSACTION` - Merchant-initiated transaction (MIT); cardholder not + * present + * * `TRUSTED_BENEFICIARY` - Trusted beneficiary; merchant is on cardholder's whitelist + * * `STRONG_CUSTOMER_AUTHENTICATION_DELEGATION` - SCA already performed by a delegated + * third-party authenticator + * * `SECURE_CORPORATE_PAYMENT` - Secure corporate payment using a dedicated corporate card + * or process + * * `AUTHENTICATION_OUTAGE_EXCEPTION` - Authentication outage exception; scheme-level + * fallback during ACS downtime + * * `BUNDLED` - Mastercard only; bundled exemption code where the exact exemption type + * cannot be distinguished + */ + class AcquirerExemption + @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 NONE = of("NONE") + + @JvmField val TRANSACTION_RISK_ANALYSIS = of("TRANSACTION_RISK_ANALYSIS") + + @JvmField val LOW_VALUE = of("LOW_VALUE") + + @JvmField val RECURRING_PAYMENT = of("RECURRING_PAYMENT") + + @JvmField val MERCHANT_INITIATED_TRANSACTION = of("MERCHANT_INITIATED_TRANSACTION") + + @JvmField val TRUSTED_BENEFICIARY = of("TRUSTED_BENEFICIARY") + + @JvmField + val STRONG_CUSTOMER_AUTHENTICATION_DELEGATION = + of("STRONG_CUSTOMER_AUTHENTICATION_DELEGATION") + + @JvmField val SECURE_CORPORATE_PAYMENT = of("SECURE_CORPORATE_PAYMENT") + + @JvmField + val AUTHENTICATION_OUTAGE_EXCEPTION = of("AUTHENTICATION_OUTAGE_EXCEPTION") + + @JvmField val BUNDLED = of("BUNDLED") + + @JvmStatic fun of(value: String) = AcquirerExemption(JsonField.of(value)) + } + + /** An enum containing [AcquirerExemption]'s known values. */ + enum class Known { + NONE, + TRANSACTION_RISK_ANALYSIS, + LOW_VALUE, + RECURRING_PAYMENT, + MERCHANT_INITIATED_TRANSACTION, + TRUSTED_BENEFICIARY, + STRONG_CUSTOMER_AUTHENTICATION_DELEGATION, + SECURE_CORPORATE_PAYMENT, + AUTHENTICATION_OUTAGE_EXCEPTION, + BUNDLED, + } + + /** + * An enum containing [AcquirerExemption]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AcquirerExemption] 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 { + NONE, + TRANSACTION_RISK_ANALYSIS, + LOW_VALUE, + RECURRING_PAYMENT, + MERCHANT_INITIATED_TRANSACTION, + TRUSTED_BENEFICIARY, + STRONG_CUSTOMER_AUTHENTICATION_DELEGATION, + SECURE_CORPORATE_PAYMENT, + AUTHENTICATION_OUTAGE_EXCEPTION, + BUNDLED, + /** + * An enum member indicating that [AcquirerExemption] 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) { + NONE -> Value.NONE + TRANSACTION_RISK_ANALYSIS -> Value.TRANSACTION_RISK_ANALYSIS + LOW_VALUE -> Value.LOW_VALUE + RECURRING_PAYMENT -> Value.RECURRING_PAYMENT + MERCHANT_INITIATED_TRANSACTION -> Value.MERCHANT_INITIATED_TRANSACTION + TRUSTED_BENEFICIARY -> Value.TRUSTED_BENEFICIARY + STRONG_CUSTOMER_AUTHENTICATION_DELEGATION -> + Value.STRONG_CUSTOMER_AUTHENTICATION_DELEGATION + SECURE_CORPORATE_PAYMENT -> Value.SECURE_CORPORATE_PAYMENT + AUTHENTICATION_OUTAGE_EXCEPTION -> Value.AUTHENTICATION_OUTAGE_EXCEPTION + BUNDLED -> Value.BUNDLED + 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) { + NONE -> Known.NONE + TRANSACTION_RISK_ANALYSIS -> Known.TRANSACTION_RISK_ANALYSIS + LOW_VALUE -> Known.LOW_VALUE + RECURRING_PAYMENT -> Known.RECURRING_PAYMENT + MERCHANT_INITIATED_TRANSACTION -> Known.MERCHANT_INITIATED_TRANSACTION + TRUSTED_BENEFICIARY -> Known.TRUSTED_BENEFICIARY + STRONG_CUSTOMER_AUTHENTICATION_DELEGATION -> + Known.STRONG_CUSTOMER_AUTHENTICATION_DELEGATION + SECURE_CORPORATE_PAYMENT -> Known.SECURE_CORPORATE_PAYMENT + AUTHENTICATION_OUTAGE_EXCEPTION -> Known.AUTHENTICATION_OUTAGE_EXCEPTION + BUNDLED -> Known.BUNDLED + else -> throw LithicInvalidDataException("Unknown AcquirerExemption: $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(): AcquirerExemption = 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 AcquirerExemption && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Lithic's validation of the acquirer-declared exemption. Absent when no acquirer exemption + * was declared. + * * `ACCEPTED` - Lithic signals support the acquirer's claim + * * `REJECTED` - Lithic signals contradict the claim, or a required signal is missing + * * `NOT_VALIDATED` - Exemption was declared but Lithic has no basis to evaluate it; + * treated as `REJECTED` for challenge purposes + */ + class LithicExemptionValidation + @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 ACCEPTED = of("ACCEPTED") + + @JvmField val REJECTED = of("REJECTED") + + @JvmField val NOT_VALIDATED = of("NOT_VALIDATED") + + @JvmStatic fun of(value: String) = LithicExemptionValidation(JsonField.of(value)) + } + + /** An enum containing [LithicExemptionValidation]'s known values. */ + enum class Known { + ACCEPTED, + REJECTED, + NOT_VALIDATED, + } + + /** + * An enum containing [LithicExemptionValidation]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [LithicExemptionValidation] 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 { + ACCEPTED, + REJECTED, + NOT_VALIDATED, + /** + * An enum member indicating that [LithicExemptionValidation] 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) { + ACCEPTED -> Value.ACCEPTED + REJECTED -> Value.REJECTED + NOT_VALIDATED -> Value.NOT_VALIDATED + 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) { + ACCEPTED -> Known.ACCEPTED + REJECTED -> Known.REJECTED + NOT_VALIDATED -> Known.NOT_VALIDATED + else -> + throw LithicInvalidDataException( + "Unknown LithicExemptionValidation: $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(): LithicExemptionValidation = 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 LithicExemptionValidation && 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 Psd2Context && + acquirerExemption == other.acquirerExemption && + lithicExemptionValidation == other.lithicExemptionValidation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(acquirerExemption, lithicExemptionValidation, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Psd2Context{acquirerExemption=$acquirerExemption, lithicExemptionValidation=$lithicExemptionValidation, additionalProperties=$additionalProperties}" + } + /** * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes place * at the initiation of the merchant rather than the cardholder. The most common example of this @@ -8698,6 +9387,7 @@ private constructor( challengeMetadata == other.challengeMetadata && challengeOrchestratedBy == other.challengeOrchestratedBy && decisionMadeBy == other.decisionMadeBy && + psd2Context == other.psd2Context && threeRiRequestType == other.threeRiRequestType && transaction == other.transaction && additionalProperties == other.additionalProperties @@ -8723,6 +9413,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, additionalProperties, @@ -8732,5 +9423,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ThreeDSAuthentication{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, merchant=$merchant, messageCategory=$messageCategory, threeDSRequestorChallengeIndicator=$threeDSRequestorChallengeIndicator, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, challengeMetadata=$challengeMetadata, challengeOrchestratedBy=$challengeOrchestratedBy, decisionMadeBy=$decisionMadeBy, threeRiRequestType=$threeRiRequestType, transaction=$transaction, additionalProperties=$additionalProperties}" + "ThreeDSAuthentication{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, merchant=$merchant, messageCategory=$messageCategory, threeDSRequestorChallengeIndicator=$threeDSRequestorChallengeIndicator, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, challengeMetadata=$challengeMetadata, challengeOrchestratedBy=$challengeOrchestratedBy, decisionMadeBy=$decisionMadeBy, psd2Context=$psd2Context, threeRiRequestType=$threeRiRequestType, transaction=$transaction, additionalProperties=$additionalProperties}" } 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 76db24e51..64845e290 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 @@ -43,6 +43,7 @@ private constructor( private val challengeMetadata: JsonField, private val challengeOrchestratedBy: JsonField, private val decisionMadeBy: JsonField, + private val psd2Context: JsonField, private val threeRiRequestType: JsonField, private val transaction: JsonField, private val eventType: JsonField, @@ -106,6 +107,9 @@ private constructor( @JsonProperty("decision_made_by") @ExcludeMissing decisionMadeBy: JsonField = JsonMissing.of(), + @JsonProperty("psd2_context") + @ExcludeMissing + psd2Context: JsonField = JsonMissing.of(), @JsonProperty("three_ri_request_type") @ExcludeMissing threeRiRequestType: JsonField = JsonMissing.of(), @@ -134,6 +138,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, eventType, @@ -160,6 +165,7 @@ private constructor( .challengeMetadata(challengeMetadata) .challengeOrchestratedBy(challengeOrchestratedBy) .decisionMadeBy(decisionMadeBy) + .psd2Context(psd2Context) .threeRiRequestType(threeRiRequestType) .transaction(transaction) .build() @@ -341,6 +347,16 @@ private constructor( fun decisionMadeBy(): Optional = decisionMadeBy.getOptional("decision_made_by") + /** + * PSD2/SCA context for EEA and UK transactions. Present when Lithic determines the transaction + * is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope transactions. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun psd2Context(): Optional = + psd2Context.getOptional("psd2_context") + /** * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes place * at the initiation of the merchant rather than the cardholder. The most common example of this @@ -533,6 +549,15 @@ private constructor( @ExcludeMissing fun _decisionMadeBy(): JsonField = decisionMadeBy + /** + * Returns the raw JSON value of [psd2Context]. + * + * Unlike [psd2Context], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("psd2_context") + @ExcludeMissing + fun _psd2Context(): JsonField = psd2Context + /** * Returns the raw JSON value of [threeRiRequestType]. * @@ -628,6 +653,7 @@ private constructor( JsonMissing.of() private var decisionMadeBy: JsonField = JsonMissing.of() + private var psd2Context: JsonField = JsonMissing.of() private var threeRiRequestType: JsonField = JsonMissing.of() private var transaction: JsonField = JsonMissing.of() @@ -661,6 +687,7 @@ private constructor( challengeOrchestratedBy = threeDSAuthenticationApprovalRequestWebhookEvent.challengeOrchestratedBy decisionMadeBy = threeDSAuthenticationApprovalRequestWebhookEvent.decisionMadeBy + psd2Context = threeDSAuthenticationApprovalRequestWebhookEvent.psd2Context threeRiRequestType = threeDSAuthenticationApprovalRequestWebhookEvent.threeRiRequestType transaction = threeDSAuthenticationApprovalRequestWebhookEvent.transaction eventType = threeDSAuthenticationApprovalRequestWebhookEvent.eventType @@ -1022,6 +1049,29 @@ private constructor( this.decisionMadeBy = decisionMadeBy } + /** + * PSD2/SCA context for EEA and UK transactions. Present when Lithic determines the + * transaction is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope + * transactions. + */ + fun psd2Context(psd2Context: ThreeDSAuthentication.Psd2Context?) = + psd2Context(JsonField.ofNullable(psd2Context)) + + /** Alias for calling [Builder.psd2Context] with `psd2Context.orElse(null)`. */ + fun psd2Context(psd2Context: Optional) = + psd2Context(psd2Context.getOrNull()) + + /** + * Sets [Builder.psd2Context] to an arbitrary JSON value. + * + * You should usually call [Builder.psd2Context] with a well-typed + * [ThreeDSAuthentication.Psd2Context] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun psd2Context(psd2Context: JsonField) = apply { + this.psd2Context = psd2Context + } + /** * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes * place at the initiation of the merchant rather than the cardholder. The most common @@ -1148,6 +1198,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, checkRequired("eventType", eventType), @@ -1188,6 +1239,7 @@ private constructor( challengeMetadata().ifPresent { it.validate() } challengeOrchestratedBy().ifPresent { it.validate() } decisionMadeBy().ifPresent { it.validate() } + psd2Context().ifPresent { it.validate() } threeRiRequestType().ifPresent { it.validate() } transaction().ifPresent { it.validate() } eventType().validate() @@ -1227,6 +1279,7 @@ private constructor( (challengeMetadata.asKnown().getOrNull()?.validity() ?: 0) + (challengeOrchestratedBy.asKnown().getOrNull()?.validity() ?: 0) + (decisionMadeBy.asKnown().getOrNull()?.validity() ?: 0) + + (psd2Context.asKnown().getOrNull()?.validity() ?: 0) + (threeRiRequestType.asKnown().getOrNull()?.validity() ?: 0) + (transaction.asKnown().getOrNull()?.validity() ?: 0) + (eventType.asKnown().getOrNull()?.validity() ?: 0) @@ -1389,6 +1442,7 @@ private constructor( challengeMetadata == other.challengeMetadata && challengeOrchestratedBy == other.challengeOrchestratedBy && decisionMadeBy == other.decisionMadeBy && + psd2Context == other.psd2Context && threeRiRequestType == other.threeRiRequestType && transaction == other.transaction && eventType == other.eventType && @@ -1415,6 +1469,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, eventType, @@ -1425,5 +1480,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ThreeDSAuthenticationApprovalRequestWebhookEvent{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, merchant=$merchant, messageCategory=$messageCategory, threeDSRequestorChallengeIndicator=$threeDSRequestorChallengeIndicator, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, challengeMetadata=$challengeMetadata, challengeOrchestratedBy=$challengeOrchestratedBy, decisionMadeBy=$decisionMadeBy, threeRiRequestType=$threeRiRequestType, transaction=$transaction, eventType=$eventType, additionalProperties=$additionalProperties}" + "ThreeDSAuthenticationApprovalRequestWebhookEvent{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, merchant=$merchant, messageCategory=$messageCategory, threeDSRequestorChallengeIndicator=$threeDSRequestorChallengeIndicator, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, challengeMetadata=$challengeMetadata, challengeOrchestratedBy=$challengeOrchestratedBy, decisionMadeBy=$decisionMadeBy, psd2Context=$psd2Context, threeRiRequestType=$threeRiRequestType, transaction=$transaction, eventType=$eventType, additionalProperties=$additionalProperties}" } 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 0417e3cd1..ed48dd89b 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 @@ -43,6 +43,7 @@ private constructor( private val challengeMetadata: JsonField, private val challengeOrchestratedBy: JsonField, private val decisionMadeBy: JsonField, + private val psd2Context: JsonField, private val threeRiRequestType: JsonField, private val transaction: JsonField, private val eventType: JsonField, @@ -106,6 +107,9 @@ private constructor( @JsonProperty("decision_made_by") @ExcludeMissing decisionMadeBy: JsonField = JsonMissing.of(), + @JsonProperty("psd2_context") + @ExcludeMissing + psd2Context: JsonField = JsonMissing.of(), @JsonProperty("three_ri_request_type") @ExcludeMissing threeRiRequestType: JsonField = JsonMissing.of(), @@ -134,6 +138,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, eventType, @@ -160,6 +165,7 @@ private constructor( .challengeMetadata(challengeMetadata) .challengeOrchestratedBy(challengeOrchestratedBy) .decisionMadeBy(decisionMadeBy) + .psd2Context(psd2Context) .threeRiRequestType(threeRiRequestType) .transaction(transaction) .build() @@ -341,6 +347,16 @@ private constructor( fun decisionMadeBy(): Optional = decisionMadeBy.getOptional("decision_made_by") + /** + * PSD2/SCA context for EEA and UK transactions. Present when Lithic determines the transaction + * is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope transactions. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun psd2Context(): Optional = + psd2Context.getOptional("psd2_context") + /** * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes place * at the initiation of the merchant rather than the cardholder. The most common example of this @@ -535,6 +551,15 @@ private constructor( @ExcludeMissing fun _decisionMadeBy(): JsonField = decisionMadeBy + /** + * Returns the raw JSON value of [psd2Context]. + * + * Unlike [psd2Context], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("psd2_context") + @ExcludeMissing + fun _psd2Context(): JsonField = psd2Context + /** * Returns the raw JSON value of [threeRiRequestType]. * @@ -630,6 +655,7 @@ private constructor( JsonMissing.of() private var decisionMadeBy: JsonField = JsonMissing.of() + private var psd2Context: JsonField = JsonMissing.of() private var threeRiRequestType: JsonField = JsonMissing.of() private var transaction: JsonField = JsonMissing.of() @@ -661,6 +687,7 @@ private constructor( challengeOrchestratedBy = threeDSAuthenticationCreatedWebhookEvent.challengeOrchestratedBy decisionMadeBy = threeDSAuthenticationCreatedWebhookEvent.decisionMadeBy + psd2Context = threeDSAuthenticationCreatedWebhookEvent.psd2Context threeRiRequestType = threeDSAuthenticationCreatedWebhookEvent.threeRiRequestType transaction = threeDSAuthenticationCreatedWebhookEvent.transaction eventType = threeDSAuthenticationCreatedWebhookEvent.eventType @@ -1022,6 +1049,29 @@ private constructor( this.decisionMadeBy = decisionMadeBy } + /** + * PSD2/SCA context for EEA and UK transactions. Present when Lithic determines the + * transaction is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope + * transactions. + */ + fun psd2Context(psd2Context: ThreeDSAuthentication.Psd2Context?) = + psd2Context(JsonField.ofNullable(psd2Context)) + + /** Alias for calling [Builder.psd2Context] with `psd2Context.orElse(null)`. */ + fun psd2Context(psd2Context: Optional) = + psd2Context(psd2Context.getOrNull()) + + /** + * Sets [Builder.psd2Context] to an arbitrary JSON value. + * + * You should usually call [Builder.psd2Context] with a well-typed + * [ThreeDSAuthentication.Psd2Context] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun psd2Context(psd2Context: JsonField) = apply { + this.psd2Context = psd2Context + } + /** * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes * place at the initiation of the merchant rather than the cardholder. The most common @@ -1149,6 +1199,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, checkRequired("eventType", eventType), @@ -1189,6 +1240,7 @@ private constructor( challengeMetadata().ifPresent { it.validate() } challengeOrchestratedBy().ifPresent { it.validate() } decisionMadeBy().ifPresent { it.validate() } + psd2Context().ifPresent { it.validate() } threeRiRequestType().ifPresent { it.validate() } transaction().ifPresent { it.validate() } eventType().validate() @@ -1228,6 +1280,7 @@ private constructor( (challengeMetadata.asKnown().getOrNull()?.validity() ?: 0) + (challengeOrchestratedBy.asKnown().getOrNull()?.validity() ?: 0) + (decisionMadeBy.asKnown().getOrNull()?.validity() ?: 0) + + (psd2Context.asKnown().getOrNull()?.validity() ?: 0) + (threeRiRequestType.asKnown().getOrNull()?.validity() ?: 0) + (transaction.asKnown().getOrNull()?.validity() ?: 0) + (eventType.asKnown().getOrNull()?.validity() ?: 0) @@ -1387,6 +1440,7 @@ private constructor( challengeMetadata == other.challengeMetadata && challengeOrchestratedBy == other.challengeOrchestratedBy && decisionMadeBy == other.decisionMadeBy && + psd2Context == other.psd2Context && threeRiRequestType == other.threeRiRequestType && transaction == other.transaction && eventType == other.eventType && @@ -1413,6 +1467,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, eventType, @@ -1423,5 +1478,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ThreeDSAuthenticationCreatedWebhookEvent{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, merchant=$merchant, messageCategory=$messageCategory, threeDSRequestorChallengeIndicator=$threeDSRequestorChallengeIndicator, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, challengeMetadata=$challengeMetadata, challengeOrchestratedBy=$challengeOrchestratedBy, decisionMadeBy=$decisionMadeBy, threeRiRequestType=$threeRiRequestType, transaction=$transaction, eventType=$eventType, additionalProperties=$additionalProperties}" + "ThreeDSAuthenticationCreatedWebhookEvent{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, merchant=$merchant, messageCategory=$messageCategory, threeDSRequestorChallengeIndicator=$threeDSRequestorChallengeIndicator, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, challengeMetadata=$challengeMetadata, challengeOrchestratedBy=$challengeOrchestratedBy, decisionMadeBy=$decisionMadeBy, psd2Context=$psd2Context, threeRiRequestType=$threeRiRequestType, transaction=$transaction, eventType=$eventType, additionalProperties=$additionalProperties}" } 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 b7e230718..38eb910ba 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 @@ -43,6 +43,7 @@ private constructor( private val challengeMetadata: JsonField, private val challengeOrchestratedBy: JsonField, private val decisionMadeBy: JsonField, + private val psd2Context: JsonField, private val threeRiRequestType: JsonField, private val transaction: JsonField, private val eventType: JsonField, @@ -106,6 +107,9 @@ private constructor( @JsonProperty("decision_made_by") @ExcludeMissing decisionMadeBy: JsonField = JsonMissing.of(), + @JsonProperty("psd2_context") + @ExcludeMissing + psd2Context: JsonField = JsonMissing.of(), @JsonProperty("three_ri_request_type") @ExcludeMissing threeRiRequestType: JsonField = JsonMissing.of(), @@ -134,6 +138,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, eventType, @@ -160,6 +165,7 @@ private constructor( .challengeMetadata(challengeMetadata) .challengeOrchestratedBy(challengeOrchestratedBy) .decisionMadeBy(decisionMadeBy) + .psd2Context(psd2Context) .threeRiRequestType(threeRiRequestType) .transaction(transaction) .build() @@ -341,6 +347,16 @@ private constructor( fun decisionMadeBy(): Optional = decisionMadeBy.getOptional("decision_made_by") + /** + * PSD2/SCA context for EEA and UK transactions. Present when Lithic determines the transaction + * is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope transactions. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun psd2Context(): Optional = + psd2Context.getOptional("psd2_context") + /** * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes place * at the initiation of the merchant rather than the cardholder. The most common example of this @@ -535,6 +551,15 @@ private constructor( @ExcludeMissing fun _decisionMadeBy(): JsonField = decisionMadeBy + /** + * Returns the raw JSON value of [psd2Context]. + * + * Unlike [psd2Context], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("psd2_context") + @ExcludeMissing + fun _psd2Context(): JsonField = psd2Context + /** * Returns the raw JSON value of [threeRiRequestType]. * @@ -630,6 +655,7 @@ private constructor( JsonMissing.of() private var decisionMadeBy: JsonField = JsonMissing.of() + private var psd2Context: JsonField = JsonMissing.of() private var threeRiRequestType: JsonField = JsonMissing.of() private var transaction: JsonField = JsonMissing.of() @@ -661,6 +687,7 @@ private constructor( challengeOrchestratedBy = threeDSAuthenticationUpdatedWebhookEvent.challengeOrchestratedBy decisionMadeBy = threeDSAuthenticationUpdatedWebhookEvent.decisionMadeBy + psd2Context = threeDSAuthenticationUpdatedWebhookEvent.psd2Context threeRiRequestType = threeDSAuthenticationUpdatedWebhookEvent.threeRiRequestType transaction = threeDSAuthenticationUpdatedWebhookEvent.transaction eventType = threeDSAuthenticationUpdatedWebhookEvent.eventType @@ -1022,6 +1049,29 @@ private constructor( this.decisionMadeBy = decisionMadeBy } + /** + * PSD2/SCA context for EEA and UK transactions. Present when Lithic determines the + * transaction is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope + * transactions. + */ + fun psd2Context(psd2Context: ThreeDSAuthentication.Psd2Context?) = + psd2Context(JsonField.ofNullable(psd2Context)) + + /** Alias for calling [Builder.psd2Context] with `psd2Context.orElse(null)`. */ + fun psd2Context(psd2Context: Optional) = + psd2Context(psd2Context.getOrNull()) + + /** + * Sets [Builder.psd2Context] to an arbitrary JSON value. + * + * You should usually call [Builder.psd2Context] with a well-typed + * [ThreeDSAuthentication.Psd2Context] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun psd2Context(psd2Context: JsonField) = apply { + this.psd2Context = psd2Context + } + /** * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes * place at the initiation of the merchant rather than the cardholder. The most common @@ -1149,6 +1199,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, checkRequired("eventType", eventType), @@ -1189,6 +1240,7 @@ private constructor( challengeMetadata().ifPresent { it.validate() } challengeOrchestratedBy().ifPresent { it.validate() } decisionMadeBy().ifPresent { it.validate() } + psd2Context().ifPresent { it.validate() } threeRiRequestType().ifPresent { it.validate() } transaction().ifPresent { it.validate() } eventType().validate() @@ -1228,6 +1280,7 @@ private constructor( (challengeMetadata.asKnown().getOrNull()?.validity() ?: 0) + (challengeOrchestratedBy.asKnown().getOrNull()?.validity() ?: 0) + (decisionMadeBy.asKnown().getOrNull()?.validity() ?: 0) + + (psd2Context.asKnown().getOrNull()?.validity() ?: 0) + (threeRiRequestType.asKnown().getOrNull()?.validity() ?: 0) + (transaction.asKnown().getOrNull()?.validity() ?: 0) + (eventType.asKnown().getOrNull()?.validity() ?: 0) @@ -1387,6 +1440,7 @@ private constructor( challengeMetadata == other.challengeMetadata && challengeOrchestratedBy == other.challengeOrchestratedBy && decisionMadeBy == other.decisionMadeBy && + psd2Context == other.psd2Context && threeRiRequestType == other.threeRiRequestType && transaction == other.transaction && eventType == other.eventType && @@ -1413,6 +1467,7 @@ private constructor( challengeMetadata, challengeOrchestratedBy, decisionMadeBy, + psd2Context, threeRiRequestType, transaction, eventType, @@ -1423,5 +1478,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ThreeDSAuthenticationUpdatedWebhookEvent{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, merchant=$merchant, messageCategory=$messageCategory, threeDSRequestorChallengeIndicator=$threeDSRequestorChallengeIndicator, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, challengeMetadata=$challengeMetadata, challengeOrchestratedBy=$challengeOrchestratedBy, decisionMadeBy=$decisionMadeBy, threeRiRequestType=$threeRiRequestType, transaction=$transaction, eventType=$eventType, additionalProperties=$additionalProperties}" + "ThreeDSAuthenticationUpdatedWebhookEvent{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, merchant=$merchant, messageCategory=$messageCategory, threeDSRequestorChallengeIndicator=$threeDSRequestorChallengeIndicator, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, challengeMetadata=$challengeMetadata, challengeOrchestratedBy=$challengeOrchestratedBy, decisionMadeBy=$decisionMadeBy, psd2Context=$psd2Context, threeRiRequestType=$threeRiRequestType, transaction=$transaction, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt index 227d2a165..880bd97c1 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt @@ -10811,6 +10811,14 @@ internal class ParsedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() @@ -11038,6 +11046,16 @@ internal class ParsedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption( + ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE + ) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType( ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION ) @@ -11194,6 +11212,14 @@ internal class ParsedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() @@ -11421,6 +11447,16 @@ internal class ParsedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption( + ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE + ) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType( ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION ) @@ -11591,6 +11627,17 @@ internal class ParsedWebhookEventTest { ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC ) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption( + ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE + ) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation + .ACCEPTED + ) + .build() + ) .threeRiRequestType( ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION ) @@ -11845,6 +11892,17 @@ internal class ParsedWebhookEventTest { ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC ) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption( + ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE + ) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation + .ACCEPTED + ) + .build() + ) .threeRiRequestType( ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION ) @@ -12887,6 +12945,14 @@ internal class ParsedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() @@ -13116,6 +13182,16 @@ internal class ParsedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption( + ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE + ) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType( ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEventTest.kt index 1fb4a8418..3c08c9126 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEventTest.kt @@ -137,6 +137,14 @@ internal class ThreeDSAuthenticationApprovalRequestWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() @@ -290,6 +298,15 @@ internal class ThreeDSAuthenticationApprovalRequestWebhookEventTest { .contains(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.decisionMadeBy()) .contains(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.psd2Context()) + .contains( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.threeRiRequestType()) .contains(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.transaction()) @@ -438,6 +455,14 @@ internal class ThreeDSAuthenticationApprovalRequestWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationChallengeWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationChallengeWebhookEventTest.kt index c67163292..3a2903d59 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationChallengeWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationChallengeWebhookEventTest.kt @@ -151,6 +151,17 @@ internal class ThreeDSAuthenticationChallengeWebhookEventTest { ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC ) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption( + ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE + ) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation + .ACCEPTED + ) + .build() + ) .threeRiRequestType( ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION ) @@ -315,6 +326,16 @@ internal class ThreeDSAuthenticationChallengeWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption( + ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE + ) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType( ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION ) @@ -491,6 +512,17 @@ internal class ThreeDSAuthenticationChallengeWebhookEventTest { ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC ) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption( + ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE + ) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation + .ACCEPTED + ) + .build() + ) .threeRiRequestType( ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationCreatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationCreatedWebhookEventTest.kt index fb4ae18d6..e8197330f 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationCreatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationCreatedWebhookEventTest.kt @@ -137,6 +137,14 @@ internal class ThreeDSAuthenticationCreatedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() @@ -287,6 +295,15 @@ internal class ThreeDSAuthenticationCreatedWebhookEventTest { .contains(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) assertThat(threeDSAuthenticationCreatedWebhookEvent.decisionMadeBy()) .contains(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + assertThat(threeDSAuthenticationCreatedWebhookEvent.psd2Context()) + .contains( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) assertThat(threeDSAuthenticationCreatedWebhookEvent.threeRiRequestType()) .contains(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) assertThat(threeDSAuthenticationCreatedWebhookEvent.transaction()) @@ -434,6 +451,14 @@ internal class ThreeDSAuthenticationCreatedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationTest.kt index e8028ae8a..48db52000 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationTest.kt @@ -137,6 +137,14 @@ internal class ThreeDSAuthenticationTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() @@ -282,6 +290,15 @@ internal class ThreeDSAuthenticationTest { .contains(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) assertThat(threeDSAuthentication.decisionMadeBy()) .contains(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + assertThat(threeDSAuthentication.psd2Context()) + .contains( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) assertThat(threeDSAuthentication.threeRiRequestType()) .contains(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) assertThat(threeDSAuthentication.transaction()) @@ -425,6 +442,14 @@ internal class ThreeDSAuthenticationTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationUpdatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationUpdatedWebhookEventTest.kt index 18b03f6ea..fe09621d7 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationUpdatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationUpdatedWebhookEventTest.kt @@ -137,6 +137,14 @@ internal class ThreeDSAuthenticationUpdatedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder() @@ -287,6 +295,15 @@ internal class ThreeDSAuthenticationUpdatedWebhookEventTest { .contains(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) assertThat(threeDSAuthenticationUpdatedWebhookEvent.decisionMadeBy()) .contains(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + assertThat(threeDSAuthenticationUpdatedWebhookEvent.psd2Context()) + .contains( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) assertThat(threeDSAuthenticationUpdatedWebhookEvent.threeRiRequestType()) .contains(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) assertThat(threeDSAuthenticationUpdatedWebhookEvent.transaction()) @@ -434,6 +451,14 @@ internal class ThreeDSAuthenticationUpdatedWebhookEventTest { ) .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .psd2Context( + ThreeDSAuthentication.Psd2Context.builder() + .acquirerExemption(ThreeDSAuthentication.Psd2Context.AcquirerExemption.NONE) + .lithicExemptionValidation( + ThreeDSAuthentication.Psd2Context.LithicExemptionValidation.ACCEPTED + ) + .build() + ) .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) .transaction( ThreeDSAuthentication.Transaction.builder()